-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
Adding plugins to builds (DLLs) #8395
Comments
Research summary:
|
#667 takeouts: We should not rely on Some ideas from the original issue, namely exposing editor The idea to avoid importing from Making CKEditor 5 as a peer dependency of all other packages - might be useful for exposing CKE5 global object (#1061, comments below: #667 (comment)). CKEditor 5 global object (#667 (comment), #667 (comment), #667 (comment)) Duplicated CSS might be a bigger problem (#667 (comment) ) Previous proposal (#667 (comment))
CSS de-duplication ideas: #667 (comment). |
#8402: Review cross-packages imports
|
#8397: It looks like we've missed the biggest premise of the Module Federation - to load code from external entry points at run time. This is a killer feature for micro-frontends but it uses an asynchronous-first approach. AFAICS this might not be feasible to use for sharing a code synchronously. Especially if we want to make it easier to use than we do currently. |
#8398: The DLL is very promising and we will go further on this path. The main task for this will #8517 in which we will provide a bunch of DLLs and a way to use them together in a single HTML file as separate ckeditor5/dll/dll-plugin/index.html Lines 126 to 149 in 582fbe1
The |
After adding more packages to the base DLL and by providing the first DLL consumer plugins ( There are a few open questions, however, we don't see any clear blocker that would prevent us from delivering the whole thing using DLLs. |
Due to the fact that we're in the middle of release and that the work on DLLs might take a bit of time I've introduced the |
The base DLL work is done. We've created a ATM you can checkout it and play with it:
This is an early build however and still many aspects of this must be polished. |
We're implementing some improvements to the DLL build process. This, unfortunately, means that the
|
Other: Enabled creating builds that can be extended (with more plugins) without the need to being recompiled. This required splitting the project into the, so-called, DLL part and consumers of this DLL. Under the hood, the mechanism is based on [webpack DLLs](https://webpack.js.org/plugins/dll-plugin/). This is the first part of the required changes and it contains the necessary breaking changes (see the "MAJOR BREAKING CHANGES" section above). For more information see the ["DLL builds"](https://ckeditor.com/docs/ckeditor5/latest/builds/guides/development/dll-builds.html) guide. Closes [#8395](#8395). Other: Introduced `Image.isImageWidget()` utility method. Feature (core): Plugin collection will allow to require plugin by name when it is provided in `config.plugins` or if it was already loaded. Closes [#2907](#2907). MAJOR BREAKING CHANGE: Several plugins are not anymore loaded automatically as dependencies of other plugins. From now on, they need to be provided to the editor creator manually (via `config.plugins`). This list includes: - The `CloudServicesUploadAdapter` plugin no longer loads `CloudServices`. Make sure to add `CloudServices` to the editor plugins when using the `CloudServicesUploadAdapter` or `EasyImage` features. - The `EasyImage` plugin no longer loads `Image` and `ImageUpload`. Make sure to add `Image` and `ImageUpload` to the editor plugins when using the `EasyImage` feature. - The `CKFinder` plugin no longer loads `CKFinderUploadAdapter`. The `CKFinderEditing` plugin no longer loads `ImageEditing` and `LinkEditing` features. Make sure to add `CKFinderUploadAdapter`, `Image`, and `Link` features to the editor plugins when using the `CKFinder` feature. - The `Title` plugin no longer loads `Paragraph`. Make sure to add `Paragraph` to the editor plugins when using the `Title` feature. - The `ListEditing` plugin no longer loads `Paragraph`. Make sure to add `Paragraph` to the editor plugins when using the `List` feature. - The `LinkImageEditing` plugin no longer loads `ImageEditing`. Make sure to add `Image` to the editor plugins when using the `LinkImage` feature. - The `LinkImageUI` plugin no longer loads `Image`. Make sure to add `Image` to the editor plugins when using the `LinkImage` feature. - The `ExportPdf` plugin no longer loads `CloudServices`. Make sure to add `CloudServices` to the editor plugins when using the `ExportPdf` feature. - The `ExportWord` plugin no longer loads `CloudServices`. Make sure to add `CloudServices` to the editor plugins when using the `ExportWord` feature.
Feature (utils): Added a module (`builds.getDllPluginWebpackConfig()`) that produces the webpack configuration for DLL. See ckeditor/ckeditor5#8395.
There's still a long tail of followups, but we can consider DLLs ready to use. Docs will follow soon. |
The original story behind this issue can be read in #667. However, some things we discussed in the past may be obsolete today. Hence a new issue that will focus on research & implementation of allowing adding plugins to a compiled builds.
Key drivers to have this implemented:
<script>
tags of our special build and a bundled (or not) external feature.We have talked about:
window
) and dot access to classes (base editor API).main.js
file - this should work well with tree shaking.js
andcss
file.EmitterMixin
)EmitterMixing
dependency in the utils. ChangingPlugin
API might a bit might solve that. Check what we import from other features in the first place.ckeditor5
package could be potentially used to expose the global API.Related issues:
If you'd like to see this improvement implemented, add a 👍 reaction to this post.
The text was updated successfully, but these errors were encountered: