Skip to content

Commit

Permalink
Merge pull request #8614 from ckeditor/dll-integration
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Reinmar committed Feb 1, 2021
2 parents 9ed6d4a + 661d50e commit b278fde
Show file tree
Hide file tree
Showing 492 changed files with 5,169 additions and 1,300 deletions.
28 changes: 27 additions & 1 deletion .eslintrc.js
Expand Up @@ -7,6 +7,32 @@

'use strict';

const fs = require( 'fs' );
const path = require( 'path' );

const dllPackages = fs.readdirSync( path.join( __dirname, 'src' ) ).map( directory => directory.replace( /\.js$/, '' ) );

module.exports = {
extends: 'ckeditor5'
extends: 'ckeditor5',
settings: {
dllPackages
},
rules: {
'ckeditor5-rules/ckeditor-imports': 'error'
},
overrides: [
{
files: [ '**/tests/**/*.js' ],
rules: {
'no-unused-expressions': 'off',
'ckeditor5-rules/ckeditor-imports': 'off'
}
},
{
files: [ '**/docs/**/*.js' ],
rules: {
'ckeditor5-rules/ckeditor-imports': 'off'
}
}
]
};
8 changes: 7 additions & 1 deletion docs/_snippets/examples/custom-build.js
Expand Up @@ -15,6 +15,9 @@ import Strikethrough from '@ckeditor/ckeditor5-basic-styles/src/strikethrough';
import Code from '@ckeditor/ckeditor5-basic-styles/src/code';
import Highlight from '@ckeditor/ckeditor5-highlight/src/highlight';
import EasyImage from '@ckeditor/ckeditor5-easy-image/src/easyimage';
import Image from '@ckeditor/ckeditor5-image/src/image';
import ImageUpload from '@ckeditor/ckeditor5-image/src/imageupload';
import CloudServices from '@ckeditor/ckeditor5-cloud-services/src/cloudservices';

import { CS_CONFIG } from '@ckeditor/ckeditor5-cloud-services/tests/_utils/cloud-services-config';

Expand All @@ -29,7 +32,10 @@ ClassicEditor
Strikethrough,
Code,
Highlight,
EasyImage
EasyImage,
Image,
ImageUpload,
CloudServices
],
toolbar: {
items: [ 'bold', 'italic', 'underline', 'strikethrough', 'code', '|', 'highlight', '|', 'undo', 'redo' ],
Expand Down
3 changes: 2 additions & 1 deletion docs/_snippets/examples/multi-root-editor.js
Expand Up @@ -37,6 +37,7 @@ import Table from '@ckeditor/ckeditor5-table/src/table';
import TableToolbar from '@ckeditor/ckeditor5-table/src/tabletoolbar';
import MediaEmbed from '@ckeditor/ckeditor5-media-embed/src/mediaembed';
import EasyImage from '@ckeditor/ckeditor5-easy-image/src/easyimage';
import CloudServices from '@ckeditor/ckeditor5-cloud-services/src/cloudservices';
import { CS_CONFIG } from '@ckeditor/ckeditor5-cloud-services/tests/_utils/cloud-services-config';

/**
Expand Down Expand Up @@ -388,7 +389,7 @@ MultirootEditor
footerright: document.querySelector( '#footer-right' )
}, {
plugins: [ Essentials, Paragraph, Heading, Bold, Italic, List, Link, BlockQuote, Image, ImageCaption,
ImageStyle, ImageToolbar, ImageUpload, Table, TableToolbar, MediaEmbed, EasyImage ],
ImageStyle, ImageToolbar, ImageUpload, Table, TableToolbar, MediaEmbed, EasyImage, CloudServices ],
toolbar: [ 'heading', '|', 'bold', 'italic', 'link', 'bulletedList', 'numberedList', 'imageUpload', 'blockQuote',
'insertTable', 'mediaEmbed', 'undo', 'redo' ],
image: {
Expand Down
4 changes: 4 additions & 0 deletions docs/_snippets/features/mathtype.js
Expand Up @@ -8,6 +8,8 @@
import ClassicEditor from '@ckeditor/ckeditor5-editor-classic/src/classiceditor';
import ArticlePluginSet from '@ckeditor/ckeditor5-core/tests/_utils/articlepluginset';
import EasyImage from '@ckeditor/ckeditor5-easy-image/src/easyimage';
import ImageUpload from '@ckeditor/ckeditor5-image/src/imageupload';
import CloudServices from '@ckeditor/ckeditor5-cloud-services/src/cloudservices';
import MathType from '@wiris/mathtype-ckeditor5';
import { CS_CONFIG } from '@ckeditor/ckeditor5-cloud-services/tests/_utils/cloud-services-config';

Expand All @@ -16,6 +18,8 @@ ClassicEditor
plugins: [
ArticlePluginSet,
EasyImage,
ImageUpload,
CloudServices,
MathType
],
toolbar: {
Expand Down
4 changes: 3 additions & 1 deletion docs/_snippets/features/wproofreader.js
Expand Up @@ -8,13 +8,15 @@
import ClassicEditor from '@ckeditor/ckeditor5-editor-classic/src/classiceditor';
import ArticlePluginSet from '@ckeditor/ckeditor5-core/tests/_utils/articlepluginset';
import EasyImage from '@ckeditor/ckeditor5-easy-image/src/easyimage';
import ImageUpload from '@ckeditor/ckeditor5-image/src/imageupload';
import CloudServices from '@ckeditor/ckeditor5-cloud-services/src/cloudservices';
import WProofreader from '@webspellchecker/wproofreader-ckeditor5/src/wproofreader';

import { CS_CONFIG } from '@ckeditor/ckeditor5-cloud-services/tests/_utils/cloud-services-config';

ClassicEditor
.create( document.querySelector( '#snippet-wproofreader' ), {
plugins: [ ArticlePluginSet, EasyImage, WProofreader ],
plugins: [ ArticlePluginSet, EasyImage, ImageUpload, CloudServices, WProofreader ],
wproofreader: {
serviceId: '1:Eebp63-lWHbt2-ASpHy4-AYUpy2-fo3mk4-sKrza1-NsuXy4-I1XZC2-0u2F54-aqYWd1-l3Qf14-umd',
lang: 'en_AI',
Expand Down

0 comments on commit b278fde

Please sign in to comment.