refactor: Host provides editor settings#114
Merged
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.
This was referenced Apr 9, 2025
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
dcalhoun
commented
Apr 11, 2025
| const observer = new IntersectionObserver( ( entries ) => { | ||
| entries.forEach( ( entry ) => { | ||
| if ( entry.isIntersecting ) { | ||
| editorLoaded(); |
Member
Author
There was a problem hiding this comment.
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.
Comment on lines
+73
to
+76
| if isWarmupMode { | ||
| setUpEditor() | ||
| loadEditor() | ||
| } |
Member
Author
There was a problem hiding this comment.
Loading the editor is postponed until the host app expressly invokes the methods, allowing the host app to fetch the editor settings.
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.