Repository navigation
Conversation
There was a problem hiding this comment.
Code Review
This pull request updates the documentation and release notes for Harper v5.4.0 to reflect changes in memory management and source map handling. Specifically, it documents that source maps are no longer enabled by default to reduce per-thread memory usage, and provides instructions on how to re-enable them using the NODE_OPTIONS=--enable-source-maps environment variable. It also highlights a 40% reduction in idle JavaScript heap usage due to optimized compiled code and lazy-loading of specific dependencies. No review comments were provided, so there is no additional feedback.
🚀 Preview DeploymentYour preview deployment is ready! 🔗 Preview URL: https://preview.harper-documentation.harperfabric.com/pr-714 This preview will update automatically when you push new commits. |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… maps, and add a 5.4 release note Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ebb3ed4 to
4939063
Compare
🚀 Preview DeploymentYour preview deployment is ready! 🔗 Preview URL: https://preview.harper-documentation.harperfabric.com/pr-714 This preview will update automatically when you push new commits. |
| To get stack traces that point at the original sources, set the Node.js `--enable-source-maps` flag through `NODE_OPTIONS`. Harper passes the setting on to every worker thread. It applies to modules Node.js loads itself: Harper's core, and application code loaded natively (for example with `applications.moduleLoader: native`). Modules run by Harper's VM-based loaders (`vm-current-context`, the default, as well as `vm` and `compartment`) are not mapped either way. | ||
|
|
||
| ```bash | ||
| NODE_OPTIONS=--enable-source-maps harper |
There was a problem hiding this comment.
If most people are running Harper on Fabric, how do they enable it? NODE_OPTIONS is not a great example for that use case.
There was a problem hiding this comment.
Good question. On Fabric clusters that Harper hosts there is no way to turn them on today:
NODE_OPTIONS: users don't control the process environment, and I found no Fabric control (central-manager, host-manager, studio) that sets it.threads.v8Flags:--enable-source-mapsis a Node.js flag, not a V8 flag, so it can't be passed this way.
What this costs a Fabric user is smaller than it looks. Application code on the default vm-current-context loader was never source-mapped. Harper strips TypeScript types there without moving code, so those stack traces are unchanged. What stays unmapped is frames from Harper's core and from npm packages Harper loads natively. The section now says this (debugging.md), and the release note limits NODE_OPTIONS to environments you control.
If we want Fabric users to have a way in, a small core change would do it: a Harper config key that makes the main thread call process.setSourceMapsEnabled(true) at startup. Workers already inherit that (manageThreads.js passes --enable-source-maps whenever process.sourceMapsEnabled is true). I left this thread open in case you'd like that before this merges, or know of a Fabric env-var control I missed.
— Claude Opus 5.5
…ric users see Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Dispatch-Task: fix-kriszyp_documentation_714-dcf91ad3
…-position promise, and carry the Fabric limit into the release note Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Dispatch-Task: fix-kriszyp_documentation_714-dcf91ad3
…hread promise from the release note Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Dispatch-Task: fix-kriszyp_documentation_714-dcf91ad3
🚀 Preview DeploymentYour preview deployment is ready! 🔗 Preview URL: https://preview.harper-documentation.harperfabric.com/pr-714 This preview will update automatically when you push new commits. |
Documents that Harper v5.4.0 no longer enables source maps by default, and how to turn them on. Companion to HarperFast/harper#3072, which turns them off to save several megabytes of heap per thread.
⊙ Problem
After HarperFast/harper#3072, stack traces from Harper's core point at the compiled
dist/*.jsfiles unless source maps are enabled. Nothing in the docs says source maps exist, so an operator who upgrades sees different stack traces with no explanation.🤔 Where operators look
The note sits on the debugging page next to the inspector settings. Should it also appear in the logging docs?
💡 Solution
A "Source Maps in Stack Traces" section tells operators how to turn source maps on (
NODE_OPTIONS=--enable-source-maps), what it costs, and which stack traces it changes. It also says what Fabric users get, and the 5.4 release note points to it.🤔 No opt-in on hosted Fabric
--enable-source-mapsis a Node.js flag, not a V8 flag, sothreads.v8Flagscannot carry it. A Harper config key (the main thread callingprocess.setSourceMapsEnabled(true), which workers already inherit) would give Fabric users a way in. That is a core change; this PR documents today's behavior.🔧 Changes
debugging.md: a "Source Maps in Stack Traces" section (changedin v5.4.0). It leads with how to turn them on (NODE_OPTIONS=--enable-source-maps), then the memory cost. It scopes the effect to modules Node.js loads itself: Harper's core, natively loaded application code, and natively loaded npm packages. Harper's VM-based loaders were never mapped.NODE_OPTIONScannot be set on Fabric clusters that Harper hosts. Application code on the default loader is unaffected; only core and natively loaded package frames stay unmapped. Look hardest here.overview.md: the See Also entry for Worker Thread Debugging mentions source maps.5.4.md: a "Smaller Per-Thread Baseline" note: idle heap drops from about 58 MB to 35 MB, some dependencies load on first use, and source maps are off by default.✅ Verification
Not observable end-to-end in this repository; prettier is clean on the changed files. The behavior described was checked against HarperFast/harper#3072 on a running server: source maps are off in the main thread and workers by default, and on in all of them with
NODE_OPTIONS=--enable-source-maps. Loader scoping was read from Harper'ssecurity/jsLoader.tsandserver/threads/manageThreads.js. That no Fabric control setsNODE_OPTIONSwas checked by searching the Fabric repos, not confirmed with the Fabric team.🤖 Generated by Claude Code (Claude Opus 5.5); posted via @kriszyp.
Related PRs: #671 independent, #709 overlaps (also adds a 5.4 release note), #712 overlaps (also adds a 5.4 release note), #710 overlaps (merged; also edits the 5.4 release notes, merges cleanly), #727 overlaps (also edits the 5.4 release notes; keep both sections on rebase), #720 overlaps (merged; its 5.4 agent section sits beside this one), #715 independent
Complexity: easy
Review-Coverage: authored=claude; ran=gemini,codex; adjudicated=domain; declined=cursor-grok,cursor-composer,cursor-kimi,cursor-muse,muse; rounds=4; full=1 @ 5d79e30
Review-Attention: skim ~2m (decisions: release-note-placement, opt-in-surface, no-production-recommendation) @ 5d79e30