-
-
Notifications
You must be signed in to change notification settings - Fork 154
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Module Federation Documentation. #1253
base: 6.0
Are you sure you want to change the base?
Conversation
✅ Deploy Preview for 6-docs-plone-org ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
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"? |
Yes and no... Probably @thet can explain that better? |
Co-authored-by: Katja Süss <k.suess@rohberg.ch>
Co-authored-by: Steve Piercy <web@stevepiercy.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In this review, I cover the entire document to date.
It's looking good. Thank you!
Co-authored-by: Steve Piercy <web@stevepiercy.com>
Co-authored-by: Steve Piercy <web@stevepiercy.com>
Co-authored-by: Steve Piercy <web@stevepiercy.com>
Co-authored-by: Steve Piercy <web@stevepiercy.com>
Co-authored-by: Steve Piercy <web@stevepiercy.com>
Co-authored-by: Steve Piercy <web@stevepiercy.com>
Co-authored-by: Steve Piercy <web@stevepiercy.com>
Co-authored-by: Steve Piercy <web@stevepiercy.com>
Co-authored-by: Steve Piercy <web@stevepiercy.com>
Co-authored-by: Steve Piercy <web@stevepiercy.com>
Co-authored-by: Steve Piercy <web@stevepiercy.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One minor fix, and this is good to go.
If there are more things that need to be added, I would suggest adding an outline of those items at the least. Then we can fill in details.
Thank you!
docs/classic-ui/module-federation.md
Outdated
|
||
```{seealso} | ||
Webpack's documentation on [Module Federation](https://webpack.js.org/concepts/module-federation/). | ||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please move the above part after the content for this section, after "Add-ons can add bundles called "remotes" which are initialized for module federation by the host bundle." and before "## Using module federation". We need an introduction before showing a link to an external site.
Please include "classic-ui/module-federation" in naviagation. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have questions. This is how to get the custom pattern (js pattern code) of my add-on up and running. What about other js code. For example old jquery code. Would it maybe make sense to provide information about this traditional stuff also here, or would that go in another chapter?
@ksuess that doc here was not really meant to get you started from scratch. It's more about how to configure module federation. Btw. the https://github.com/Patternslib/pat-PATTERN_TEMPLATE is IMO a good patterns generator and a perfect starting point. @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.. :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A couple of English syntax improvements, using shorter sentences, and an optional suggestion for link syntax.
docs/classic-ui/module-federation.md
Outdated
@@ -44,28 +44,50 @@ Add the following line near the top of the file: | |||
const mf_config = require("@patternslib/dev/webpack/webpack.mf"); | |||
``` | |||
|
|||
Import all the dependencies you want to share. | |||
Potentially these are the ones from Patternslib, Mockup and your own dependencies. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When a term is first introduced on a page, we must either define it or provide a reference to its meaning, either with a Glossary entry or a link to an external website where it is defined. Please amend the link to whatever is preferred.
I also noticed that I overlooked that Mockup lacks a definition or reference when it is was first introduced, so that should be done above as well.
Potentially these are the ones from Patternslib, Mockup and your own dependencies. | |
Potentially these are the ones from [Patternslib](https://github.com/Patternslib/pat-PATTERN_TEMPLATE), Mockup, and your own dependencies. |
docs/classic-ui/module-federation.md
Outdated
and replace `myaddon.min` with the corresponding key in `config.entry` that points to your `index.js`. | ||
|
||
For a full but simple example, see the Patterns generator [pat-PATTERN-TEMPLATE][2] or any other Pattern addon in the patternslib GitHub organisation. | ||
For a complex example with Mockup integration see [plone.app.mosaic][3] and [Mockup][4] itself. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This suggestion is optional. In general, I prefer to keep the URL next to its label as in [label](https://url.com/path)
, instead of this reference style. They both render the same for readers. But for authors it has advantages:
- Simpler syntax.
- It associates the label with the link directly, instead of requiring the author to scroll down to reference it.
- When a link is broken,
linkcheck
andlinkcheckbroken
refer to the line of the label, not the URL, in the error, so you would see something likeclassic-ui/module-federation: line 31) broken https://pypi.org/project/plonecli-404/ - 404 Client Error: Not Found for url: https://pypi.org/project/plonecli-404/
- Preferred by most authors.
Perhaps that style was carried over from the dogma of keeping line lengths to 80 characters. In narrative documentation, line length does not matter. It is not code and most editors can soft wrap long lines of text these days.
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 read the instructions and I am a bit clueless. Could we have some very minimal but complete and working example? |
like in the training: Create a Theme from scratch vs Create a theme based on Diazo |
@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! |
Overall this looks good, what is missing? |
No description provided.