Plan: Node runtime to replace Deno runtime for apps-engine subprocess#40005
Draft
Plan: Node runtime to replace Deno runtime for apps-engine subprocess#40005
Conversation
Contributor
|
Looks like this PR is not ready to merge, because of the following issues:
Please fix the issues and try again If you have any trouble, please check the PR guidelines |
|
Detailed analysis of deno-runtime code, Deno-specific API inventory, Node.js permission model mapping, TypeScript support evaluation, IPC performance analysis, and step-by-step implementation plan. Agent-Logs-Url: https://github.com/RocketChat/Rocket.Chat/sessions/8488baa5-c13b-4d61-bde6-ebff44fb58d6 Co-authored-by: d-gubert <1810309+d-gubert@users.noreply.github.com>
Agent-Logs-Url: https://github.com/RocketChat/Rocket.Chat/sessions/8488baa5-c13b-4d61-bde6-ebff44fb58d6 Co-authored-by: d-gubert <1810309+d-gubert@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Plan for implementing node-runtime equivalent of Deno
Plan: Node runtime to replace Deno runtime for apps-engine subprocess
Mar 31, 2026
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.
Comprehensive analysis of
deno-runtime/and migration plan to anode-runtimethat preserves identical behavior without Deno-specific APIs.Deno API inventory
Cataloged all Deno-specific surface area across ~25 files:
Deno.stdin.readable,Deno.stdout,Deno.stderr,Deno.args,Deno.pid,Deno.exit(),Deno.open()@std/io(writeAll),@std/cli(parseArgs),@std/streams(toArrayBuffer)ErrorEvent(needs polyfill), globaladdEventListener('unhandledrejection')→process.on('unhandledRejection')deno.jsoncimport maps power@rocket.chat/apps-engine/resolution andimport.meta.resolve()— no Node equivalent~10 of ~25 files need changes; the rest are already Node-compatible.
Node permission model mapping
--permission)--allow-read=<dirs>--allow-fs-read=<dirs>--allow-env=VAR1,VAR2spawnProcess()only passesPATH--allow-netTypeScript support
Node 22.7+
--experimental-transform-typeshandles all syntax in the codebase. The singleenuminlib/logger.tsrequires transform (not just strip)..tsimport extensions work natively.AppRuntimeManager
Already supports runtime selection via factory injection:
Only need a new
NodeRuntimeSubprocessControllerimplementingIRuntimeController+ update the default factory (env var or config).IPC performance (Node IPC vs stdio+msgpack)
Key risks
ErrorEventmissing in Node — needs polyfill or different event patternimport.meta.resolve()with Deno import maps —lib/require.tscritically depends on this--experimental-transform-typesis experimental — pin Node 22.7+ minimum--deny-netFull plan at
packages/apps-engine/node-runtime/MIGRATION_PLAN.md. Awaiting approval on decision points before implementation.Original prompt