Repository navigation
fix #493 - Expose Monaco Editor Worker from Text Editor - #504
Conversation
Signed-off-by: Fabrizio Antonangeli <fabrizio.antonangeli@gmail.com>
Signed-off-by: Fabrizio Antonangeli <fabrizio.antonangeli@gmail.com>
…llisions and use relative base in vanilla example Signed-off-by: Fabrizio Antonangeli <fabrizio.antonangeli@gmail.com>
…ate-Text-Editor-and-Language-Service-in-vanilla-Web-Component Signed-off-by: Fabrizio Antonangeli <fabrizio.antonangeli@gmail.com>
Signed-off-by: Fabrizio Antonangeli <fabrizio.antonangeli@gmail.com>
…ate-Text-Editor-and-Language-Service-in-vanilla-Web-Component Signed-off-by: Fabrizio Antonangeli <fabrizio.antonangeli@gmail.com>
Signed-off-by: Fabrizio Antonangeli <fabrizio.antonangeli@gmail.com>
🦋 Changeset detectedLatest commit: 9213e2b The changes in this PR will be included in the next version bump. This PR includes changesets to release 0 packagesWhen changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
✅ Deploy Preview for openworkflow-editor canceled.Built without sensitive environment variables
|
There was a problem hiding this comment.
🟡 Changes recommended
The component replacement leaves outdated tests failing and removes build verification steps, while stale React content props can cause the displayed editor value to diverge from the content getter.
2 open issues
1 file not reviewed
pnpm-lock.yaml: Generated file
What changed in this PR
This proof of concept exposes the Text Editor’s bundled Monaco worker to address worker-resolution errors in Web Component integrations (#493). It remains marked DO NOT MERGE, pending the Dual Editor integration in #369.
Changes:
- Add a dedicated Monaco editor-worker entry point and export the Text Editor stylesheet.
- Replace the vanilla example’s diagram wrapper with a text-editor wrapper and configure both workers.
- Update the sample, deployment base path, dependencies, and build scripts.
| File | Description |
|---|---|
pnpm-lock.yaml |
Switch the example dependency and refresh transitive resolutions. |
packages/text-editor/vite.config.ts |
Build the dedicated editor-worker entry point. |
packages/text-editor/src/worker/editor.worker.ts |
Import Monaco’s editor worker. |
packages/text-editor/package.json |
Export the editor worker and stylesheet. |
examples/vanilla-web-component/vite.config.ts |
Use relative asset paths for deployment. |
examples/vanilla-web-component/src/text-editor-element.ts |
Add the Text Editor custom-element wrapper. |
examples/vanilla-web-component/src/sample-workflow.ts |
Replace the YAML sample with a smaller JSON workflow. |
examples/vanilla-web-component/src/index.ts |
Register the text-editor element and load its styles. |
examples/vanilla-web-component/src/diagram-editor-element.ts |
Remove the diagram-editor wrapper. |
examples/vanilla-web-component/package.json |
Switch editor dependencies and remove build-time test checks. |
examples/vanilla-web-component/index.html |
Display the Text Editor and configure worker factories. |
Review effort: Balanced
Following: open-workflow-specification/editor#504 Signed-off-by: Fabrizio Antonangeli <fabrizio.antonangeli@gmail.com>
Signed-off-by: Fabrizio Antonangeli <fabrizio.antonangeli@gmail.com>
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues are reported for the editor-worker exports and vanilla Web Component example changes.
No open issues 🎉
2 resolved since last review
1 file not reviewed
pnpm-lock.yaml: Generated file
Review effort: Balanced
…o-Editor-logs-worker-errors-in-Web-Component-integrations Signed-off-by: Fabrizio Antonangeli <fabrizio.antonangeli@gmail.com>
Signed-off-by: Fabrizio Antonangeli <fabrizio.antonangeli@gmail.com>
Signed-off-by: Fabrizio Antonangeli <fabrizio.antonangeli@gmail.com>
Signed-off-by: Fabrizio Antonangeli <fabrizio.antonangeli@gmail.com>
|
@lornakelly @handreyrc @kumaradityaraj This PR is now ready for review and I have updated the description, the prevew link and the video |
| <script type="module"> | ||
| import "./src/index.ts"; | ||
| import { sampleWorkflow } from "./src/sample-workflow.ts"; | ||
| <script type="module"> |
There was a problem hiding this comment.
Looks like this is just formatting but also looks like the changes are actually breaking indentation?
| }); | ||
| ``` | ||
|
|
||
| The `?worker` suffix is specific to Vite. Other bundlers must configure equivalent worker loading for `@openworkflowspec/text-editor/editor-worker`. This configuration belongs to the host application, not to the Text Editor or Dual Editor props. |
There was a problem hiding this comment.
Should we add this to the dual-editor readme as well? and maybe remove teh mention of dual editor here since its not part of this package?
| @@ -2874,9 +2874,6 @@ packages: | |||
| resolution: {integrity: sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==} | |||
There was a problem hiding this comment.
Wondering why there are changes to lockfile but not to package.json file?

Closes #493
Requires:
Description
Monaco Editor logs
editorWorkerServiceerrors when the Text Editor is embedded in a Web Component because the default Monaco worker is not correctly resolved by the consuming application.Changes
@openworkflowspec/text-editor.@openworkflowspec/text-editor/editor-worker.MonacoEnvironment.getWorker()using the new entry point.monaco-editordependency from the Vanilla Example.This allows consumers to use the Monaco Editor Worker bundled with the Text Editor, avoiding direct dependencies on Monaco and potential version mismatches on the consumer side.
How to test
Build and run the Vanilla Web Component Example:
Open the application and check the browser Console.
Verify that no
editorWorkerServiceorwebWorkerBootstrap.jserrors are reported.Verify that YAML Schema diagnostics, completions, and CodeLens still work.
Quarkus Flow validation
The same worker entry point has also been successfully tested in the Quarkus Flow Dev UI using Maven/mvnpm and esbuild.
Preview
https://fantonangeli.github.io/open-workflow-specification-editor/issue-493/
issue-493-bug-Monaco-Editor-logs-worker-errors-in-Web-Component-integrations-v2.mp4
The preview uses the Vanilla Web Component PoC with the new Monaco Editor Worker configuration.