Page MenuHomePhorge

Update the documentation for "Adding New CSS and JS" to not exclude extensions
Open, Needs TriagePublic

Description

In my experience, this works just fine, despite the glaring disclaimer (which doesn't stop me, because I have elected to ignore it).
Extensions just need to do the following:

  • Create a directory to store CSS and JS in. Phorge uses rsrc/ within webroot/, which is misleading, because it does not have to be a web-accessible directory.
  • Create a directory where Celerity should store its map. If you already have a resources/ directory, you can create a celerity directory here.
  • Create a new class extending CelerityResourcesOnDisk and link these paths. CelerityPhabricatorResources is a good example.
    • If you do not have a need for packages, you can just create a packages.php file that returns an empty array.
  • Create some resources, following the documentation on how to do so.
  • Run bin/celerity map, which will rebuild for all Celerity resources.
  • Access the new resource by using require_celerity_resource('NAME_OF_RESOURCE', 'EXTENSION_NAME').