Skip to content

enable node compile cache - #2171

Merged
beeequeue merged 1 commit into
mainfrom
compile-cache
Jul 19, 2026
Merged

beeequeue merged 1 commit into
mainfrom
compile-cache

Conversation

@beeequeue

@beeequeue beeequeue commented Jul 19, 2026 •

Copy link
Copy Markdown
Member

@changeset-bot

changeset-bot Bot commented Jul 19, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 4c73d8f

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@changesets/cli Patch

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

@codecov

codecov Bot commented Jul 19, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 83.02%. Comparing base (180833e) to head (4c73d8f).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2171   +/-   ##
=======================================
  Coverage   83.02%   83.02%           
=======================================
  Files          76       76           
  Lines        2981     2981           
  Branches      815      815           
=======================================
  Hits         2475     2475           
  Misses        459      459           
  Partials       47       47           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Comment thread packages/cli/bin.js
if (globalThis.process?.getBuiltinModule) {
const { enableCompileCache } =
globalThis.process.getBuiltinModule("node:module");
enableCompileCache();

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

q: could this be enabled in ./index.ts? or does this have to be enabled before loading the code? I just wonder cause it feels that perhaps at some point we should get rid of ./bin.js but maybe this compilation makes it necessary?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it has to be enabled before importing the code that should be cached, it won't be cached if it's already loaded.

you can see this in typescript as well

you can also enable it permanently for everything with NODE_COMPILE_CACHE=/some/path/to/cache and NODE_COMPILE_CACHE_PORTABLE=1

@Andarist Andarist Jul 19, 2026 •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, cool - then I feel less bad now about the ./bin.js+./index.js split :p there is an actual reason for it now 👍

@beeequeue
beeequeue added this pull request to the merge queue Jul 19, 2026
Merged via the queue into main with commit 3257f57 Jul 19, 2026
12 checks passed
@beeequeue
beeequeue deleted the compile-cache branch July 19, 2026 14:30
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