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
Unknown Object (File)
Fri, Dec 20, 6:56 PM
Unknown Object (File)
Fri, Dec 13, 12:33 AM
Unknown Object (File)
Wed, Dec 11, 5:58 AM
Unknown Object (File)
Tue, Dec 10, 2:49 AM
Unknown Object (File)
Wed, Dec 4, 2:51 PM
Unknown Object (File)
Nov 22 2024, 5:08 PM
Unknown Object (File)
Nov 10 2024, 12:40 AM
Unknown Object (File)
Nov 10 2024, 12:40 AM
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.