feat: implements helper classes for configuring frontend plugin slots - #281
feat: implements helper classes for configuring frontend plugin slots#281tecoholic wants to merge 3 commits into
Conversation
83f1604 to
68eac9d
Compare
|
@arbrandes After spending an unfair amount of time trying out different ideas, I think I finally have a working solution. It's rough around the edges code quality and testing wise (I have only tested one MFE and plugin combo). I have tried my best to not touch the existing functionality to keep everything backward compatible. It would be great to get some feedback before I spent anytime polishing this. P.S: |
|
@tecoholic, this is in my queue to review. I hope to get to it in the beginning of next week. If it looks good, I'll check with the other maintainers as well. |
|
@arbrandes Hi, it's been a while. Checking to see if you had chance to go through this PR. |
|
@tecoholic, haven't forgotten about you. As a matter of fact, we're just now considering whether/how to follow this approach in frontend-base land. I'll come back here once we can think of a way that works for both types of MFEs. |
|
Now that frontend-base support has landed in main, I think we should focus our attention on it. It's where the frontend is going - we shouldn't add new features to the legacy, at this point. So... let's discuss this. This is what adding a frontend app (which is what a plugin is called in frontend-base land) looks like now. From the README: That's it. No slots to configure: that logic is now part of the app itself. (You can still configure slots individually if you want to a single-py-file plugin, but I would not recommend duplicating the upstream slot configuration logic because of that simple use-case.) The question is whether it's worth the trouble of adding to the API surface area to go from the above to this: What do you think? |
|
@arbrandes Hi, this is great. The I didn't read through the full diff, but things like the following really stood out as good improvements in both architecture and DevX
With that I agree that this PR is no longer relevant for the future of Thank you for keeping this in mind and coming back to it. Cheers. |
Description
This PR implements a set of helpful classes that make adding frontend plugins to MFEs easier and more declerative.
The main goal is to reduce the work for developers. The
FrontendPluginclass rolls multiple patches into a simple declaration and removes the need to createenv.config.jsxandmodule.config.jsfiles in your MFE folder and having to run the dev server separately outside Tutor.Compare the examples below:
Native patches
Helper class
The helper classes remove a lot of boiler plate.
Development Workflow
tutor mounts add authoring:/path/to/my-plugin:/plugins/my-plugin.FrontendPluginclass as shown above. Make sure to include thelocal_pathfor development.tutor plugins enable <tutor-plugin>,tutor dev start authoring.With this you should see the plugin loaded into the MFE and changes reflects in a hot-reload.
Related information