feat: add worker factory option for Monaco Editor >= 0.55#282
Open
ttys026 wants to merge 2 commits intoremcohaszing:mainfrom
Open
feat: add worker factory option for Monaco Editor >= 0.55#282ttys026 wants to merge 2 commits intoremcohaszing:mainfrom
ttys026 wants to merge 2 commits intoremcohaszing:mainfrom
Conversation
Monaco Editor 0.55 changed the createWebWorker API to require a Worker instance via opts.worker. Additionally, createData is no longer sent through the worker message protocol. This adds a `worker` option to `configureMonacoYaml()` that allows consumers to provide their own Worker factory function. When provided, the worker manager intercepts the postMessage sequence to inject createData before the RPC INITIALIZE message, preserving compatibility with the existing yaml worker protocol. For Monaco < 0.55, omit the worker option and use MonacoEnvironment as before. Updated README with usage examples for both Vite and Webpack. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
✅ Deploy Preview for monaco-yaml ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify project configuration. |
Update all three examples (demo, vite-example, monaco-editor-webpack-plugin) to use monaco-editor 0.55.1 and the new `worker` option in configureMonacoYaml. The yaml worker case is removed from MonacoEnvironment.getWorker since it's now handled directly by the worker option. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Author
|
Mostly done by AI, but it did fix my issue. |
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.
Monaco Editor 0.55 changed the createWebWorker API to require a Worker instance via opts.worker. Additionally, createData is no longer sent through the worker message protocol.
This adds a
workeroption toconfigureMonacoYaml()that allows consumers to provide their own Worker factory function. When provided, the worker manager intercepts the postMessage sequence to inject createData before the RPC INITIALIZE message, preserving compatibility with the existing yaml worker protocol.For Monaco < 0.55, omit the worker option and use MonacoEnvironment as before. Updated README with usage examples for both Vite and Webpack.