documentation icon indicating copy to clipboard operation
documentation copied to clipboard

Module Federation Documentation.

Open thet opened this issue 3 years ago • 12 comments

thet avatar May 16 '22 09:05 thet

Deploy Preview for 6-docs-plone-org ready!

Name Link
Latest commit cfe78b0efa41fafa122f0abe038456043aa96a13
Latest deploy log https://app.netlify.com/sites/6-docs-plone-org/deploys/662f5108579a32000792d0c9
Deploy Preview https://deploy-preview-1253--6-docs-plone-org.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

netlify[bot] avatar May 16 '22 09:05 netlify[bot]

See also https://github.com/Patternslib/Patterns/blob/master/docs/developer/module-federation.md

reinhardt avatar May 17 '22 17:05 reinhardt

Thanks for the suggestion! I'm actually starting to doubt whether it makes sense to have a separate chapter on module federation. With https://github.com/plone/bobtemplates.plone/pull/507 you will get it for free in the future when creating a pattern with plonecli/bobtemplates. There should probably be documentation how to customize a pattern, including a sentence that mentions module federation, but maybe not a full explanation.

reinhardt avatar Jun 01 '22 08:06 reinhardt

Thanks for the suggestion! I'm actually starting to doubt whether it makes sense to have a separate chapter on module federation. With plone/bobtemplates.plone#507 you will get it for free in the future when creating a pattern with plonecli/bobtemplates. There should probably be documentation how to customize a pattern, including a sentence that mentions module federation, but maybe not a full explanation.

Module federation is independent of Mockup patterns, but is the way JS bundles are composed the Plone 6 way, am I correct?

So, will this draft also be an instruction for "I have a Plone 5 add-on with some arbitrary Javascript code, not necessary a Mockup pattern, and I want to know, how I to lift this Plone 5 add-on to Plone 6"?

ksuess avatar Jun 01 '22 08:06 ksuess

Yes and no... Probably @thet can explain that better?

reinhardt avatar Jun 01 '22 11:06 reinhardt

Please include "classic-ui/module-federation" in naviagation.

ksuess avatar Jul 21 '22 06:07 ksuess

@ksuess that doc here was not really meant to get you started from scratch. It's more about how to configure module federation. But I agree - we need a how to start document, also a bobtemplates integration (started but here: https://github.com/plone/bobtemplates.plone/pull/507 but not finished yet). Not sure if these docs should be extended for a full start-from-scratch, or should it?

Btw. the https://github.com/Patternslib/pat-PATTERN_TEMPLATE is IMO a good patterns generator and a perfect starting point. However, it does not provide a plone integration (registering of resources, etc) - this is what the bobtemplates PR‌ is about.

@petschki I added some fixes for the recent webpack.mf.js changes plus some references to full, working examples.

Btw. I'm on vacation the next two weeks, so don't expect any updates from me.. :)

thet avatar Jul 21 '22 21:07 thet

@ksuess that doc here was not really meant to get you started from scratch. It's more about how to configure module federation. But I agree - we need a how to start document, also a bobtemplates integration (started but here: plone/bobtemplates.plone#507 but not finished yet). Not sure if these docs should be extended for a full start-from-scratch, or should it?

Btw. the https://github.com/Patternslib/pat-PATTERN_TEMPLATE is IMO a good patterns generator and a perfect starting point. However, it does not provide a plone integration (registering of resources, etc) - this is what the bobtemplates PR‌ is about.

@petschki I added some fixes for the recent webpack.mf.js changes plus some references to full, working examples.

Btw. I'm on vacation the next two weeks, so don't expect any updates from me.. :)

Ah, OK, then this is chapter is focused on Module Federation. And it assumes knowledge on how to work with static resources in general, how to add static resources (js, css) to a custom theme (based on Barceloneta or not).

Then the questions of a theme / add-on creator should be answered in a general chapter on static resources, which indeed already exists! After your comment, I found it: https://6.dev-docs.plone.org/classic-ui/theming/from-scratch.html#theme . The chapter title "Plone Classic UI Theming based on Barceloneta" should probable read something like "Plone Classic UI Theming independent of Barceloneta". I'll mark my former imaginary theme creator questions as resolved and find a way to add them to https://6.dev-docs.plone.org/classic-ui/theming/from-scratch.html#theme if appropriate.

ksuess avatar Jul 22 '22 08:07 ksuess

I read the instructions and I am a bit clueless. Could we have some very minimal but complete and working example?

jensens avatar Jul 22 '22 11:07 jensens

Then the questions of a theme / add-on creator should be answered in a general chapter on static resources, which indeed already exists! After your comment, I found it: https://6.dev-docs.plone.org/classic-ui/theming/from-scratch.html#theme . The chapter title "Plone Classic UI Theming based on Barceloneta" should probable read something like "Plone Classic UI Theming independent of Barceloneta".

from-scratch here stays for no Diazo, only templates overrides vs diazo. In the docs there is not much for theming sofar, but the training has already quite some infos, but they need an update before the conference.

like in the training: Create a Theme from scratch vs Create a theme based on Diazo

MrTango avatar Aug 03 '22 15:08 MrTango

@thet @reinhardt @ksuess @jensens @MrTango I updated the base branch and tidied up the MyST and English grammar and syntax. I'd appreciate your collaboration to get this PR finished and deployed to the documentation. Thank you!

stevepiercy avatar Apr 28 '24 23:04 stevepiercy

Overall this looks good, what is missing?

jensens avatar Apr 29 '24 07:04 jensens

@stevepiercy regarding casing: on the webpack docs its called "Module Federation" everywhere ... https://webpack.js.org/concepts/module-federation/ ...

petschki avatar Jul 01 '24 09:07 petschki

@petschki reverted in 9a80b1b. Why, webpack, why? Especially when you don't even use title case for your own name! 🙄

@ksuess you still have requested changes in your review, but I think all your questions were answered, so I'm going to merge this. If not, then would you please open a new issue? Thank you!

stevepiercy avatar Jul 01 '24 10:07 stevepiercy