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.
|
|
||
| * **Emoticons**: Requires an emoji database file (`+js/emojis+`) | ||
| * **Help**: Requires a keyboard navigation language file (`+js/i18n/keynav/<lang>+`) | ||
| * **Page Embed**: Requires a CSS file (`+css/empa30.css+`) |
There was a problem hiding this comment.
From my testing, this import is not necessary. Was there an issue reported on page embed that required this import?
|
|
||
| === Plugins requiring additional resources | ||
|
|
||
| * **Emoticons**: Requires an emoji database file (`+js/emojis+`) |
There was a problem hiding this comment.
| * **Emoticons**: Requires an emoji database file (`+js/emojis+`) | |
| * **Emoticons**: Requires an emoji database file (`+js/emojis.js+`) |
| === Plugins requiring additional resources | ||
|
|
||
| * **Emoticons**: Requires an emoji database file (`+js/emojis+`) | ||
| * **Help**: Requires a keyboard navigation language file (`+js/i18n/keynav/<lang>+`) |
There was a problem hiding this comment.
| * **Help**: Requires a keyboard navigation language file (`+js/i18n/keynav/<lang>+`) | |
| * **Help**: Requires a keyboard navigation language file (`+js/i18n/keynav/<lang>.js+`) |
| // Community plugin language file | ||
| import 'tinymce/plugins/<plugincode>/langs/<language>.js'; | ||
|
|
||
| // Premium plugin language file (note: .js extension required) |
There was a problem hiding this comment.
| // Premium plugin language file (note: .js extension required) | |
| // Premium plugin language file |
We can remove this
|
|
||
| === Plugin language files | ||
|
|
||
| Plugin language files are separate from the main UI language files: |
There was a problem hiding this comment.
I think we should also note that the editor's language option must first be set to the desired language for the plugin's language file to take effect.
|
|
||
| [NOTE] | ||
| ==== | ||
| * English is the default language, so `+en.js+` language files don't exist |
There was a problem hiding this comment.
Maybe worth specifying it's US English? https://www.tiny.cloud/docs/tinymce/latest/ui-localization/#language. Perhaps also mentioning language packs for extra clarity, as help and autocorrect plugins have an en.js file.
| * English is the default language, so `+en.js+` language files don't exist | |
| * US English is the default language, so the language packs do not include `+en.js+` language files |
| * Icons, see xref:bundling-icons.adoc[Bundling icons] | ||
| * Themes, see xref:bundling-themes.adoc[Bundling themes] | ||
| * Models, see xref:bundling-models.adoc[Bundling models] | ||
| * Skins, see xref:bundling-skins.adoc[Bundling skins] |
There was a problem hiding this comment.
The page for Bundling skin mainly references CSS files. @metricjs I think for guides like Webpack and Browserify that already have ways to import CSS files, it may be worth keeping those examples around. We could consider adding a note that importing the js file is another way to get the CSS, but it seems safest not to remove those CSS examples when we start tackling those specific pages.
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: