The day has come! We merged DLLs into master in all 3 repos.

The changes are vast – 500 files in CKE5 itse. They touched some of the basics of how our plugin system works and how the core packages are exposed so read on to learn more.

First of all: The project has been split into two parts – the DLL and the rest (consumers of the DLL).

DLL

The DLL === the ckeditor5 package.

So far this package was empty. Right now, it contains reexport of modules from: clipboard, enter, ui, widget, cloud-services-core, paragraph, undo, core, select-all, upload, engine, typing, utils.

Whenever you need to import something from one of these packages in an src/* of a non-DLL package, you need to go through ckeditor5 like this:

import { Plugin } from 'ckeditor5/src/core';
import { Widget } from 'ckeditor5/src/widget';

What else can you find in ckeditor5/src/core? It's a re-export from [ckeditor5-core/src/index.js](<https://github.com/ckeditor/ckeditor5/blob/b278fde/packages/ckeditor5-core/src/index.js#L1>) – an index file of that package. Whenever something from one of the DLL packages has to be used in a non-DLL package, you need to make sure it's in the index.js of that package.

Content of the DLL

Why these packages became part of the DLL? The tl;dr is – these are the most common cross-package dependencies. This is – other (non-DLL) packages import modules mostly from this set of packages.

The problem is that you must not have imports between non-DLL packages. This is very limiting, but we figured out that with relatively few changes, we can make this true.

Turns out there are 3 categories of packages:

We had to remove that last 1% from our code. The packages listed in the points 1+2+3 are now part of the DLL so other packages can import from them without limitations (assuming that the thing they need is exposed in the index file of these packages). There are no dependencies between non-DLL packages at all.

To make that possible we had to implement soft-requirements (dynamic requirements) between plugins. These are requirements that are not specified by a specific class, but by a string. Check out e.g. https://github.com/ckeditor/ckeditor5/blob/b278fde/packages/ckeditor5-easy-image/src/easyimage.js#L45. This means that when you load EasyImage, it will load CloudServicesUploadAdapter just like it did in the past. However, it will require, but not load Image and ImageUpload. The reason for that is that the latter 2 plugins are in a different package so we cannot import them. However, we can tell that we need them and if you forget to pass them to config.plugins when starting the editor, you'll get nice info about this.

Dependencies