Skip to content

Confusing API of useCKEditorCloud() #52

@Reinmar

Description

@Reinmar

I tried to load additional plugin by useCKEditorCloud().

Something in the line of:

useCKEditorCloud( {
    version: '44.1.0'
    plugins: {
        ThirdPartyPlugin: [
            'https://cdn.example.com/plugin.umd.js'
        ]
} )

There was no clear error that I used it incorrectly (about that in a sec) but it crashed sort of silently. Since this is a very sugar-like tool and a big black box, I believe that it must be very clear on how and when it fails. Otherwise, figuring out what's the issue is painful.

And there are multiple things that can go wrong here because there are hidden assumptions. One being that the key of plugins must be the registered global (it's documented, but not apparent when reading the code). It's easy to miss this.

But why did it fail, actually? What did I do incorrectly?

Turns out that the second item in the array is necessary:

useCKEditorCloud( {
    version: '44.1.0'
    plugins: {
        ThirdPartyPlugin: [
            'https://cdn.example.com/plugin.umd.js',
            'https://cdn.example.com/plugin.css'
        ]
} )

Which I think shouldn't be necessary.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions