DOC-3367: Add new bundling guide overview page.#3983
DOC-3367: Add new bundling guide overview page.#3983kemister85 wants to merge 1 commit intotinymce/8from
Conversation
|
|
||
| == Plugin gotchas | ||
|
|
||
| Some plugins require additional resource files (JS, CSS, or language files) to function properly. These must be explicitly imported when bundling: |
There was a problem hiding this comment.
| Some plugins require additional resource files (JS, CSS, or language files) to function properly. These must be explicitly imported when bundling: | |
| Some plugins require additional resource files (JS, CSS, or language files) to function properly. These must be explicitly imported when bundling. |
?
|
|
||
| * Core plugin resources typically use relative paths without file extensions | ||
| * Premium plugin resources (from `+tinymce-premium+`) MUST include the `.js` or `.css` file extension in the import path | ||
| * Plugins lazy-load additional resources at runtime, so these files must be included in the bundle or accessible as static assets |
There was a problem hiding this comment.
"Some plugins" or "plugins may" - to not cause panic that every plugin pulls in more resources?
| Key points about plugin resources: | ||
|
|
||
| * Core plugin resources typically use relative paths without file extensions | ||
| * Premium plugin resources (from `+tinymce-premium+`) MUST include the `.js` or `.css` file extension in the import path |
There was a problem hiding this comment.
I can't see this noted in Sorita's notes and wasn't aware it was a thing - sanity checking where this comes from?
There was a problem hiding this comment.
Oh, was this from her examples for the lang files?
There was a problem hiding this comment.
I think we may not need to include this. An integrator could follow their own import styles, so long as their bundler is configured properly to resolve the file extensions. The choices in the example code were mainly to ensure it would work for the majority out of the box.
|
|
||
| == CSS files | ||
|
|
||
| Plugin CSS files are typically included automatically when importing plugins. However, some plugins may require explicit CSS imports for proper styling. |
There was a problem hiding this comment.
| Plugin CSS files are typically included automatically when importing plugins. However, some plugins may require explicit CSS imports for proper styling. | |
| Some plugins require additional CSS files. Plugin CSS files are included automatically when importing plugins via their JS file. |
or something? from what Sorita said, should never need to pull in a CSS file manually
There was a problem hiding this comment.
Currently, there aren't any plugins that require a CSS import, and if it does, then it would likely require a fix - as in the case for Uploadcare.
| Language files are optional and used for localizing the {productname} UI and plugin interfaces. | ||
|
|
||
| === Core UI language files | ||
|
|
There was a problem hiding this comment.
| For community packages: | |
| [NOTE] | ||
| ==== | ||
| * English is the default language, so `+en.js+` language files don't exist | ||
| * For premium plugins, the language file path must include the `.js` extension |
There was a problem hiding this comment.
From the examples here, it looks like the .js is always required, whether premium or community? @soritaheng any thoughts?
There was a problem hiding this comment.
Most bundlers support resolving file extensions, so they are not necessarily required. For example, in Vite. Since the order of the resolution could be configured, I went with the extensions in the examples for clarity's sake. But let me know if that should be reconsidered.
Ticket: DOC-3367
Site: New: Bundling guide (page)
Summary
Adds a new bundling overview guide and improves bundling documentation consistency across the codebase.
Changes
New Files
modules/ROOT/pages/bundling-guide.adoc- New bundling overview page providing:include::partial$misc/bundling-guide-link.adoc[]to all core and premium plugins.Pre-checks:
feature/<version>/,hotfix/<version>/,staging/<version>/, orrelease/<version>/.modules/ROOT/nav.adochas been updated(if applicable).Review: