Skip to content

Conversation

@franknoirot
Copy link
Contributor

Built on #9058, more towards #8880. After consolidating KclManager, we need to do a number of things:

  1. Convert as much of the managed state within KclManager that is updated in the execution loop into CodeMirror extensions that register StateFields and EditorView.updateListener.of's to push and pull from CodeMirror state as we can
  2. Eventually, extend KclManager to be able to spin up multiple CodeMirror buffers and manage them independently.
  3. Eventually, remove codemirror-react and instead just mount CodeMirror "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 Extension and adding a method to KclManager to 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.

@vercel
Copy link

vercel bot commented Nov 26, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
modeling-app Ready Ready Preview Comment Nov 26, 2025 8:06pm

@franknoirot franknoirot changed the base branch from main to franknoirot/8880/kill-a-provider November 26, 2025 17:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants