-
Notifications
You must be signed in to change notification settings - Fork 93
Convert CodeMirror theme toggling behavior to Extension #9063
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
Draft
franknoirot
wants to merge
24
commits into
franknoirot/8880/kill-a-provider
Choose a base branch
from
franknoirot/8880/editor-theme-extension
base: franknoirot/8880/kill-a-provider
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Convert CodeMirror theme toggling behavior to Extension #9063
franknoirot
wants to merge
24
commits into
franknoirot/8880/kill-a-provider
from
franknoirot/8880/editor-theme-extension
Conversation
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
authored with codex, using previous two commits as examples.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
We need it to wait until <App/> mounts to fire
… true Which broke the web app
dfccc37 to
fa421d3
Compare
b4be5ad to
a6ed618
Compare
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.
Built on #9058, more towards #8880. After consolidating
KclManager, we need to do a number of things:StateFieldsandEditorView.updateListener.of's to push and pull from CodeMirror state as we canKclManagerto be able to spin up multiple CodeMirror buffers and manage them independently.codemirror-reactand instead just mountCodeMirror"statically" as far as React is concerned, because all the state concerning it is completely out of React.This PR is a small proof-of-concept to show how an aspect of CodeMirror that's bound in React—the theme toggling—can be decoupled from React by converting it to a CodeMirror
Extensionand adding a method toKclManagerto dispatch an effect for it CodeMirror instead. I suspect there might be an even more encapsulated way to define this without a method, which just automatically listens to the reactive value of the setting within the extension definition, but this gets it out of React without losing reactivity for now.Users should experience no change in behavior after this PR.