Skip to content

chore: update monaco editor to 0.57.0 - #5992

Merged
knolleary merged 3 commits into
mainfrom
chore/update-monaco-0.57.0
Oct 14, 2026
Merged

knolleary merged 3 commits into
mainfrom
chore/update-monaco-0.57.0

Conversation

@Steve-Mcl

@Steve-Mcl Steve-Mcl commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

Types of changes

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)

Proposed changes

Summary

Bumps the Monaco editor from 0.55.1 to 0.57.0, and the bundled Node.js API type declarations from v20.14.8 to v24.19.0. vendor/monaco/dist/** and src/types/** are the unmodified contents of nr-monaco-0.57.0.zip (monaco/dist and types) from the nr-monaco-build 0.57.0 release. Nothing in them was edited by hand.

What's included

  • packages/node_modules/@node-red/editor-client/src/vendor/monaco/dist/** - monaco 0.55.1 → 0.57.0
  • packages/node_modules/@node-red/editor-client/src/vendor/monaco/README.md - now describes updating from an nr-monaco-build release instead of building locally
  • packages/node_modules/@node-red/editor-client/src/types/node/** - @types/node 20.14.8 → 24.19.0, including new Node 22-24 modules (sqlite.d.ts, sea.d.ts) and the TypeScript-version compatibility files Node 24's types package now ships
  • monaco.js - the only hand-edited code file: the Buffer/TypedArray fix below
  • Two fixes found and verified while testing this bump end-to-end (see below). The Buffer one is in monaco.js here; the util.d.ts one is part of the vendored types/node-red, which comes from the release

New in the build: CSS and HTML workers

The 0.57.0 release exposes monaco.css.getWorker() and monaco.html.getWorker(), the same shape as Monaco's own monaco.json.getWorker(). Monaco only had public getters for its TypeScript and JSON workers, so editor code could not use the CSS or HTML language services for content embedded in another language. Nothing in the editor calls them yet; #5994 uses them for <style> blocks in HTML editors. This adds about 720 bytes to editor.js; the workers are unchanged.

Verifying the vendored files

Download nr-monaco-0.57.0.zip from the release, unzip it, and copy monaco/dist/. over src/vendor/monaco/dist/ and types/. over src/types/, as described in the updated vendor/monaco/README.md. git status should then show no changes. All 162 files in the zip are byte-identical to what this PR vendors.

Fixes bundled with the bump

Buffer/TypedArray types silently resolving to any. Node 24's @types/node split BufferConstructor's overloads (Buffer.from(), .alloc(), etc.) out of buffer.d.ts into a companion buffer.buffer.d.ts, and split NodeJS.TypedArray/ArrayBufferView out of globals.d.ts into globals.typedarray.d.ts. monaco.js only ever loaded one .d.ts file per module, so Buffer silently resolved to any in the Function node editor after the types bump. Added both companion files as their own tracked modules, loaded alongside buffer.d.ts and globals.d.ts respectively. Verified with a real Function node: Buffer.from(...) now shows the full overload signature and autocomplete instead of any.

Stale RED.util.linkcall type hint removed from util.d.ts. It never existed in the runtime - only node.linkcall() does, correctly documented in func.d.ts. Traced it to an early WIP commit (31f5a0542) that briefly exposed linkcall on the Function node sandbox's util object before the feature was finalized onto node.linkcall instead; the stale util.d.ts entry was never cleaned up.

Related

While testing this on Node 24, found and filed #5991 - node:-scoped core modules (node:sqlite, node:test, etc.) can't be used as a Function node module, the runtime treats them as an npm dependency and halts the flow. That's a separate, pre-existing bug unrelated to this bump (not something this PR introduces or fixes), tracked separately since it needs its own discussion on the right fix shape. The corresponding editor-side type support for those modules is parked pending that fix landing, to avoid shipping correct-looking types for something that still fails at runtime.

Testing

Built and tested in a browser after every change: monaco.version reports correctly, the editor loads and runs, intellisense for Node/node-red globals resolves correctly (including the Buffer fix above), and the editor's own dev build/watch pipeline (npm run dev) picks up all changes cleanly with no console errors

Checklist

  • I have read the contribution guidelines
  • For non-bugfix PRs, I have discussed this change on the forum/slack team.
  • I have run npm run test to verify the unit tests pass
  • I have added suitable unit tests to cover the new/changed functionality

Bumps the vendored Function node editor from monaco 0.55.1 to 0.57.0 and
updates the bundled Node.js API types to v24.19.0 (built via
node-red/nr-monaco-build).

Fixes a type-resolution regression this brought with it: Node 24's
@types/node split BufferConstructor's overloads (Buffer.from(), .alloc(),
etc.) out of buffer.d.ts into a companion buffer.buffer.d.ts file, and
split NodeJS.TypedArray/ArrayBufferView out of globals.d.ts into
globals.typedarray.d.ts. monaco.js only ever loaded one .d.ts file per
module, so Buffer was silently resolving to `any` in the Function node
editor. Added both companion files as their own tracked modules, loaded
alongside buffer.d.ts and globals.d.ts respectively.

Also removes a stale `RED.util.linkcall` type hint from util.d.ts. It
never existed in the runtime, only `node.linkcall()` does (documented
separately in func.d.ts) - it was left over from an early WIP draft of
the linkcall feature and got shipped accidentally in commit 31f5a05.
@Steve-Mcl

Steve-Mcl commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor Author

the artifacts in this PR were built from node-red/nr-monaco-build#16

the artifacts in this PR were built from https://github.com/node-red/nr-monaco-build artifacts in release tagged 0.57.0

Re-vendors Monaco and the Node.js/Node-RED types from the nr-monaco-build 0.57.0
release (https://github.com/node-red/nr-monaco-build/releases/tag/0.57.0) instead of
a local build. Only editor.js changes: the release also exposes
monaco.css.getWorker() and monaco.html.getWorker(), the same shape as
monaco.json.getWorker(), so editor code can use the CSS and HTML language services
for content embedded in another language. The workers and types are unchanged.

The vendor README now describes updating from a release rather than building.
@Steve-Mcl
Steve-Mcl added this pull request to stack #6001 October 13, 2026 10:21
@knolleary
knolleary merged commit 53e6683 into main Oct 14, 2026
3 checks passed
@knolleary
knolleary deleted the chore/update-monaco-0.57.0 branch October 14, 2026 09:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants