Overview
It will need to be possible for contrib modules to extend Experience Builder without requiring a build step after the module is installed.
It would also be helpful to have some examples of setting up semi-coupled templates that are not buried in the complexity of the full XB app. This is difficult to learn with just Readmes.
Proposed resolution
Create a test module that can extend XB without needing a build step after install (having an existing built file used by a #libraries would be fine). The module can be used to confirm functionality and be built / documented in a way that benefits contributors who want to contribute to XB or extend it with their own modules.
User interface changes
Issue fork experience_builder-3485692
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
bnjmnmComment #5
lauriiiComment #6
bnjmnmFeedback addressed/responded
Comment #7
lauriiiJust so that I can find this issue more easily in future 😅
Comment #8
effulgentsia commentedComment #10
wim leersReviews from @larowlan, @jessebaker and @larowlan are on the MR, reflecting that here 😊
Comment #11
balintbrewsAfter resolving some conflicts that were introduced by #3504517: Libraries needed only inside the preview iframe are loaded for the entire UI, I also reviewed the solution, but not leaving specific feedback, there are enough great comments already on the code changes. 😊
I think as a technical concept and achievement, the solution is beautiful. 👏🏻 I also think that as our long-term solution for extensibility, we shouldn't expose such a low-level API as the app's Redux store. Instead, we should define what tasks we would like extensions to do, and with what high-level UX, then design more abstract APIs for those tasks, including purpose-built UI.
I would look at e.g. Shopify apps and Monday.com apps for inspiration. See the pages I linked — these platforms allow apps to specifically define where on the UI their functionality will show up, and what they can do. Some of those can't even specify anything for their appearance, but e.g. add a menu item in a dropdown list that does a specific action. Others are more flexible and allow adding to the UI from an available suite of components. (Also see my comment on providing UI elements.) This isn't very different from Drupal's APIs where you can e.g. add local tasks, menu items etc. using high-level abstractions, without having to worry about where those will show up, or how they will look.
None of this needs to block this issue, I just wanted to voice some thoughts, so we may start thinking about where to take our extensions. The current implementation is as good as it gets with the information we have today, and can serve as a the basis of whatever we end up doing.
Comment #12
effulgentsia commentedI think this is all that's left, so setting to NR and assigning to @longwave. FWIW, I think it's okay to merge this with that bypass, and open a follow up to improve that if we don't think that that bypass is a good long term solution.
Comment #13
effulgentsia commentedBy the way, the whole dance of finding all the libraries that are XB extensions seems conceptually very similar to service tags and Symfony's new
!tagged_iterator. I realize thatlibraries.ymlisn't the same asservices.yml, but I wonder if we want to open a core issue to port over a similar capability/syntax tolibraries.yml.Comment #14
jessebaker commented@wim leers - @longwave has given a +1 in response to your question here https://git.drupalcode.org/project/experience_builder/-/merge_requests/3...
This just needs a final review I think and can be merged.
Comment #15
wim leersOn it!
I had 2 remarks: docs (Jesse added those 👍) and a @longwave review of some clever bypassing of a core API. @longwave +1'd it for here, but did confirm the need for a follow-up, which he created: #3506442: Refactor library discovery for XB Extensions and (field widget) client-side transforms. And seems like @effulgentsia implicitly agreed with that too in #13 :)
Comment #19
wim leersNow all this needs is a nice screencast or GIF 🙏😇
Comment #20
jessebaker commentedGIF to follow in #3506195: Render the extensions P.o.C into the Extensions dialog once it's all looking a bit nicer!
Comment #21
effulgentsia commentedMarking Fixed per #20.
Comment #22
wim leers