Page MenuHomePhabricator

Introduce PHUIRemarkupView, a sane way to work with Remarkup
ClosedPublic

Authored by epriestley on Oct 15 2015, 5:09 PM.
Tags
None
Referenced Files
F13086572: D14289.diff
Thu, Apr 25, 12:36 AM
Unknown Object (File)
Tue, Apr 16, 2:17 PM
Unknown Object (File)
Thu, Apr 11, 8:30 AM
Unknown Object (File)
Mon, Apr 8, 1:45 AM
Unknown Object (File)
Fri, Mar 29, 7:28 PM
Unknown Object (File)
Mar 3 2024, 3:48 AM
Unknown Object (File)
Feb 11 2024, 2:16 PM
Unknown Object (File)
Jan 23 2024, 3:48 PM
Subscribers
None

Details

Summary

Fixes T9273. Remarkup has reasonably good fundamentals but the API is a giant pain to work with.

Provide a PHUIRemarkupView to make it easier. This object is way simpler to use by default.

It's not currently as powerful, but we can expand the power level later by adding more setters.

Eventually I'd expect to replace PhabricatorRemarkupInterface and PhabricatorMarkupOneOff with this, but no rush on those.

I converted a few callsites as a sanity check that it works OK.

Test Plan
  • Viewed remarkup in Passphrase.
  • Viewed remarkup in Badges.
  • Viewed a Conduit method.

Diff Detail

Repository
rP Phabricator
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

epriestley retitled this revision from to Introduce PHUIRemarkupView, a sane way to work with Remarkup.
epriestley updated this object.
epriestley edited the test plan for this revision. (Show Details)
epriestley added a reviewer: chad.
This revision is now accepted and ready to land.Oct 15 2015, 5:12 PM

Yeahh, I thought this was going to be like an hour of work to get a v1 but I think we're totally fine like this for now.

The downside to this approach is that we aren't sharing the engine between views, but that's fine (we weren't with MarkupOneOff anyway, so we can replace all of those at no cost). Once we start replacing PhabricatorMarkupInterface this class will have to get a bit smarter to avoid creating a performance cost, and I think it will eventually be ~10-20x more complex than this (with a mixture of options, engine management, and render pipelining) but we can fix like 90% of the "this is horrible to work with because you have to type 50 lines of garbage" stuff really easily right now and worry about the perf stuff later.

In the longer run, the views can pool themselves on the $viewer (like Handles do) and coordinate access to a smaller number of engines that way, and we can pass engines in to support pipelining too.

Basically, this is way better for working with Remarkup, and has plenty of flexibility for improving the backend later.

This revision was automatically updated to reflect the committed changes.