Skip to content
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

Confusing API of useCKEditorCloud() #52

Open
Reinmar opened this issue Jan 10, 2025 · 0 comments · May be fixed by #53 or ckeditor/ckeditor5-react#569
Open

Confusing API of useCKEditorCloud() #52

Reinmar opened this issue Jan 10, 2025 · 0 comments · May be fixed by #53 or ckeditor/ckeditor5-react#569
Assignees

Comments

@Reinmar
Copy link
Member

Reinmar commented Jan 10, 2025

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment