-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Simplified the structure of a build's source files #46
Conversation
BTW, please note that I took the opportunity to better document what some of the things do in these files. Please read that too. cc @AnnaTomanek |
}, | ||
|
||
plugins: [ | ||
new CKEditorWebpackPlugin( { | ||
language: buildConfig.config.language, | ||
// UI language. Language codes follow the https://en.wikipedia.org/wiki/ISO_639-1 format. | ||
// When changing the builtin language, remember to also change it in the ditor's config (src/ckeditor.js). |
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 changing the built-in language, remember to also change it in the editor's configuration (src/ckeditor.js).
'@ckeditor/ckeditor5-paragraph/src/paragraph' | ||
], | ||
|
||
// Editor config. |
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.
// Editor configuration.
language: 'en' | ||
} | ||
// Plugins which will be automatically loaded when creating an instance of this editor build. | ||
// Note: New plugins should not be added to an existing editor build. They should be added at this stage. |
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.
New plugins -> Additional plugins
} | ||
// Plugins which will be automatically loaded when creating an instance of this editor build. | ||
// Note: New plugins should not be added to an existing editor build. They should be added at this stage. | ||
ClassicEditor.defaultPlugins = [ |
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 like the idea of calling it "buildInPlugins" because this is exactly what it is, and emphasize the fact that you can not change it in the runtime.
// | ||
// See all the configuration options: | ||
// https://docs.ckeditor.com/ckeditor5/latest/api/module_core_editor_editorconfig-EditorConfig.html | ||
ClassicEditor.defaultConfig = { |
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.
However, I would not use buildInConfig
. This it defaultConfig
, which can be easily overwritten.
// UI language. Language codes follow the https://en.wikipedia.org/wiki/ISO_639-1 format. | ||
// | ||
// See: https://docs.ckeditor.com/ckeditor5/latest/features/ui-language.html | ||
language: 'en' |
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.
If we want to deduplicate it, this variable could be also overwritten by CKEditorWebpackPlugin
since it already replaces some strings in the editor.
IDK what this PR is still doing here cause those changes were already merged in v11.0.0 |
Suggested merge commit message (convention)
Other: Simplified the structure of a build's source files. See ckeditor/ckeditor5#1038.
BREAKING CHANGES: TODO
Additional information
WIP. Will require changes in ckeditor5-core if we'll go this way with
Editor
's.defaultPlugins
and.defaultConfig
.BTW, I was also thinking about
Editor.builtinPlugins
andEditor.builtinConfig
which, at least for me, are more precise. I'm not sure, though, whether it isn't me only.