Page MenuHomePhabricator

Modularize application extensions to EditEngine
ClosedPublic

Authored by epriestley on Nov 29 2015, 6:14 PM.

Details

Summary

Ref T9132. Currently, EditEngine had some branchy-instanceof code like this:

if ($object instanceof Whatever) {
  do_magic();
}

if ($object instanceof SomethingElse) {
  do_other_magic();
}

...where Whatever and SomethingElse are first-party applications like ProjectsInterface and SubscribersInterface.

This kind of code is generally bad because third-parties can't add new stuff, and it suggest something is kind of hacky in its architecture. Ideally, we would eventually get rid of almost all of this.

T9789 is a similar discussion of this for the next layer down (TransactionEditor) and plans to get rid of branchy-instanceofs there too.

Since I'm about to add more stuff here (for Custom Fields), split it out first so I'm not digging us any deeper than I already dug us.

Broadly, this allows third-party extensions to add fields to every EditEngine UI if they want, like we do for Policies, Subscribers, Projects and Comments today (and CustomFields soon).

Test Plan

  • Observed that all fields still appear on the form and seem to work correctly.

Diff Detail

Repository
rP Phabricator
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

epriestley updated this revision to Diff 35310.Nov 29 2015, 6:14 PM
epriestley retitled this revision from to Modularize application extensions to EditEngine.
epriestley updated this object.
epriestley edited the test plan for this revision. (Show Details)
epriestley added a reviewer: chad.
chad accepted this revision.Nov 30 2015, 3:15 PM
chad edited edge metadata.
This revision is now accepted and ready to land.Nov 30 2015, 3:15 PM
epriestley updated this revision to Diff 35335.Nov 30 2015, 4:57 PM
epriestley edited edge metadata.
  • Move the Owners changes out from under this, since they weren't quite ready to land.
This revision was automatically updated to reflect the committed changes.