remove monaco in favor of codemirror#2920
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
|
||
| const createEditorView = () => { | ||
| return new EditorView({ | ||
| parent: editorElement, |
There was a problem hiding this comment.
You could make this function pure if you passed editorElement in instead of depending on the state being declared already.
| return new EditorView({ | ||
| parent: editorElement, | ||
| state: EditorState.create({ | ||
| doc: content, |
There was a problem hiding this comment.
Same here but unsure if EditorState updates content, but you could purify the func by passing this in as well, the rest seem to be options
| if (transaction.docChanged) { | ||
| content = editorView.state.doc.toString(); | ||
| } | ||
| }, |
There was a problem hiding this comment.
Lol I got to here and it seems less feasible but I'm curious when this function ends up getting called in the lifecycle of codemirror.
Probably ignore the comments above.
| await tick(); | ||
| editorView = createEditorView(); | ||
| } | ||
| }; |
There was a problem hiding this comment.
If you made an editor component and used it in the if statement wouldn't this happen automagically without you having to manage and use await tick? Also the onMount would naturally move to the new editor component.
| <section class={twMerge('h-full w-full', className)}> | ||
| <iframe | ||
| bind:this={iframe} | ||
| onload={resizeIframe} |
There was a problem hiding this comment.
Do we care if the window size is changed and need to update this? Should we use a resizeObserver (or whatever the window version is) on this to keep things properly laid out?
There was a problem hiding this comment.
Good question, this was existing code I copied over from src/lib/holocene/monaco/markdown.svelte, so I didn't want to touch it.
There was a problem hiding this comment.
It seems to work fine
Screen.Recording.2025-09-18.at.1.04.08.PM.mov
Auto-generated version bump from 2.40.1 to 2.41.0 Bump type: minor Changes included: - [`904ca347`](904ca34) fix(workflows): add GitHub App token to version bump PR creation (#2910) - [`bd50889e`](bd50889) fix(workflows): fix changelog generation and PR body formatting in version bump (#2912) - [`ce91ecf6`](ce91ecf) style: fix formatting in version-bump workflow (#2914) - [`352e9f66`](352e9f6) ci(workflows): add path filter to trigger-downstream-updates (#2916) - [`9e39fa81`](9e39fa8) Add test sentence in README. - [`68f75a20`](68f75a2) Remove test sentence - [`73c83894`](73c8389) Start Delay UI improvements (#2907) - [`f7924cd0`](f7924cd) Fix issue with localActivity decoding with Java sdk (#2921) - [`474091aa`](474091a) add switch icon (#2895) - [`a6ec2611`](a6ec261) remove monaco in favor of codemirror (#2920) - [`b0042390`](b004239) Add quotes around allowOrigins (#2923) - [`b809fb51`](b809fb5) feat(holocene): add VerticalNav component (#2924) - [`e72ca8ac`](e72ca8a) Try adding overflow css to codemirror (#2929) - [`9c472385`](9c47238) add change event to dark mode in top nav (#2930) - [`bb750c9c`](bb750c9) fix(security): remediate command injection vulnerabilities in GitHub Actions (#2932) - [`e54f3dc9`](e54f3dc) Add try catch around decodeForSvelte on bad params (#2934) - [`cfc4998c`](cfc4998) replace v5 with crypto.randomuuid (#2927) - [`a47970e9`](a47970e) Fix NaN in Batch Operations results (#2938) - [`6cb24dec`](6cb24de) Migrate layout files to Svelte 5 (#2937) - [`f424f03d`](f424f03) Bump tar-fs from 3.0.9 to 3.1.1 (#2926) - [`3255f31d`](3255f31) Saved Workflow Query Views (#2931)
Auto-generated version bump from 2.40.1 to 2.41.0 Bump type: minor Changes included: - [`904ca347`](904ca34) fix(workflows): add GitHub App token to version bump PR creation (#2910) - [`bd50889e`](bd50889) fix(workflows): fix changelog generation and PR body formatting in version bump (#2912) - [`ce91ecf6`](ce91ecf) style: fix formatting in version-bump workflow (#2914) - [`352e9f66`](352e9f6) ci(workflows): add path filter to trigger-downstream-updates (#2916) - [`9e39fa81`](9e39fa8) Add test sentence in README. - [`68f75a20`](68f75a2) Remove test sentence - [`73c83894`](73c8389) Start Delay UI improvements (#2907) - [`f7924cd0`](f7924cd) Fix issue with localActivity decoding with Java sdk (#2921) - [`474091aa`](474091a) add switch icon (#2895) - [`a6ec2611`](a6ec261) remove monaco in favor of codemirror (#2920) - [`b0042390`](b004239) Add quotes around allowOrigins (#2923) - [`b809fb51`](b809fb5) feat(holocene): add VerticalNav component (#2924) - [`e72ca8ac`](e72ca8a) Try adding overflow css to codemirror (#2929) - [`9c472385`](9c47238) add change event to dark mode in top nav (#2930) - [`bb750c9c`](bb750c9) fix(security): remediate command injection vulnerabilities in GitHub Actions (#2932) - [`e54f3dc9`](e54f3dc) Add try catch around decodeForSvelte on bad params (#2934) - [`cfc4998c`](cfc4998) replace v5 with crypto.randomuuid (#2927) - [`a47970e9`](a47970e) Fix NaN in Batch Operations results (#2938) - [`6cb24dec`](6cb24de) Migrate layout files to Svelte 5 (#2937) - [`f424f03d`](f424f03) Bump tar-fs from 3.0.9 to 3.1.1 (#2926) - [`3255f31d`](3255f31) Saved Workflow Query Views (#2931) Co-authored-by: Alex-Tideman <[email protected]>
Description & motivation 💭
Remove monaco-editor and use codemirror instead for nexus desccription
Screenshots (if applicable) 📸
Screen.Recording.2025-09-18.at.11.22.30.AM.mov
Design Considerations 🎨
Testing 🧪
How was this tested 👻
Steps for others to test: 🚶🏽♂️🚶🏽♀️
Checklists
Draft Checklist
Merge Checklist
Issue(s) closed
Docs
Any docs updates needed?