-
Notifications
You must be signed in to change notification settings - Fork 99
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
Add support for the Context and Watchdog features #178
Conversation
Pull Request Test Coverage Report for Build 309
💛 - Coveralls |
I see there're some uncovered lines touching the error handling mechanisms. I'll cover them later today. |
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.
First-round. Mostly I am missing tests.
…changes. Improved tests.
…ed communication between these components via React's Context.
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.
We need to decide about the AIP in the onReady
/onError
callbacks.
Also, minor refactoring would be nice.
Missing tests (and dropped coverage) could be fixed in a separate issue.
…watchdog in the editor component. Changed API for `onReady()` and onError() functions.
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.
LGTM.
Suggested merge commit message (convention)
Feature: The
<CKEditor>
component contains the built-in watchdog feature. Closes #118.Feature: Introduced the
<CKEditorContext>
component that supports the context feature.Feature: Added the
id
property which is used to distinguish different documents. When this property changes, the component restarts the underlying editor instead of setting data on it, which allows e.g. for switching between collaboration documents and fixes a couple of issues (e.g. theonChange
event no longer fires during changing the document). Closes #168. Closes #169.Feature: The
onError()
callback will be called with two arguments. The first one will be an error object (as it was before the release 3+). A second argument is an object that contains two properties:{String} phase
:'initialization'|'runtime'
- Informs when the error has occurred (during the editor/context initialization or after the initialization).{Boolean} willEditorRestart
- Whentrue
, it means that the editor component will restart itself.{Boolean} willContextRestart
- Whentrue
, it means that the context component will restart itself.The
willEditorRestart
property will not appear when the error has occurred in the context feature.The
willContextRestart
property will not appear when the error has occurred in the editor.Add to the release summary: Both components (
<CKEditor>
and<CKEditorContext>
) will internally use theWatchdog
class that restarts the editor or context when an error occurs.Add to the release summary: The API of the entry point of the package has changed.
The previous way how the package was imported:
will not work with the release (3+). Use:
BREAKING CHANGE: The entry point of the package has changed. The default import was removed since the package provides more than a single component now. Use
import { CKEditor } from '@ckeditor/ckeditor5-react'
instead ofimport CKEditor from '@ckeditor/ckeditor5-react';
.BREAKING CHANGE: The
onInit
property was renamed toonReady
and can be called multiple times (after the initialization and after the component is ready when an error occurred).Additional information
[TODO]: Add a link to PR in ckeditor5.