-
Notifications
You must be signed in to change notification settings - Fork 3
refactor: Host provides editor settings #114
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
Conversation
To improve stability, the remote, site-specific editor un-registers block types that are not on the allow list.
This is largely in place for development experience purposes, not user facing. It allows the editor WebView to reload and retains its current GBKit global.
Avoid exceptions invoking array methods on `undefined`.
9092f64
to
cf5773f
Compare
This reverts commit 38fe2c7.
This reverts commit 2e1f1464ac65899dc3a5b23af12b59978a34dee9.
To allow the host app to manage editor start sequence, we do not start within `viewDidLoad`.
Hoist editor settings fetching and configuration to the host app to allow more control of the editor initialization flow.
Avoid difficulties typing complex JSON structures.
Remove unnecessary or unused code.
cf5773f
to
170d682
Compare
const observer = new IntersectionObserver( ( entries ) => { | ||
entries.forEach( ( entry ) => { | ||
if ( entry.isIntersecting ) { | ||
editorLoaded(); |
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.
The editor loaded event now await for the actual visibility of the editor. This ensures the UI is in-place before we visibly present the editor, avoiding UI layout jumps.
if isWarmupMode { | ||
setUpEditor() | ||
loadEditor() | ||
} |
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.
Loading the editor is postponed until the host app expressly invokes the methods, allowing the host app to fetch the editor settings.
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.
@dcalhoun I tested this with the Android PR and it all looks good. I'll approve, but perhaps you want to hold off merging until someone from the iOS side takes a look?
Related:
What?
Fetch and cache editor settings before providing them to the editor.
Why?
It allows improving offline support and performance. Ref CMM-200. Fix #105.
How?
Remove editor settings fetch, and replace it with an editor configuration option.
Testing Instructions
See testing instructions for sibling PRs:
Accessibility Testing Instructions
N/A, no user-facing changes.
Screenshots or screencast
N/A, no user-facing changes.