Skip to content

Conversation

outslept
Copy link

Resolves #177

@voxpelli voxpelli requested a review from Copilot September 12, 2025 18:10
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR enables Node.js compile cache functionality to improve module instantiation performance. The changes add compile cache support in both CommonJS and ESM entry points while disabling it during testing to ensure test environment consistency.

  • Adds enableCompileCache calls to both ESM and CommonJS entry points for performance optimization
  • Configures test environment to disable compile cache for consistent test results

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
lib/esm.mjs Imports and enables Node.js compile cache with optional chaining
lib/cjs.cjs Enables compile cache using require() approach for CommonJS compatibility
.github/workflows/test.yml Disables compile cache in CI environment for consistent testing

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Copy link

codecov bot commented Sep 12, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.24%. Comparing base (60634b7) to head (f53c3a9).
⚠️ Report is 5 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #193      +/-   ##
==========================================
+ Coverage   96.03%   96.24%   +0.20%     
==========================================
  Files          36       36              
  Lines        2143     2155      +12     
  Branches       84       86       +2     
==========================================
+ Hits         2058     2074      +16     
+ Misses         83       81       -2     
+ Partials        2        0       -2     
Flag Coverage Δ
macos-latest-20 95.77% <83.33%> (-0.17%) ⬇️
macos-latest-22 95.86% <100.00%> (+0.02%) ⬆️
macos-latest-24 95.86% <100.00%> (+0.02%) ⬆️
ubuntu-latest-20 95.39% <83.33%> (-0.07%) ⬇️
ubuntu-latest-22 95.48% <100.00%> (+0.02%) ⬆️
ubuntu-latest-24 95.48% <100.00%> (+0.02%) ⬆️
windows-latest-20 95.41% <83.33%> (-0.07%) ⬇️
windows-latest-22 95.50% <100.00%> (+0.02%) ⬆️
windows-latest-24 95.50% <100.00%> (+0.02%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 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.

@outslept
Copy link
Author

Ooh. I didn't account for the engines. Give me a minute

@outslept outslept marked this pull request as draft September 12, 2025 18:25
@outslept
Copy link
Author

This works, but it might not be the cleanest approach. Open to better ideas if anyone has suggestions

@outslept outslept marked this pull request as ready for review September 12, 2025 18:40
Copy link
Collaborator

@voxpelli voxpelli left a comment

Choose a reason for hiding this comment

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

Since at least I personally often nest calls to npm-run-all2 we maybe need / should do a module.flushCompileCache() before spawning child processes?

@bcomnes
Copy link
Owner

bcomnes commented Sep 12, 2025

Any noticeable differences in performance? Refreshing my familiarity with the implications of doing this.

@bcomnes
Copy link
Owner

bcomnes commented Oct 4, 2025

Sorry I didn't get to this this week, but its still on my todo.

@outslept
Copy link
Author

outslept commented Oct 4, 2025

I was really busy as well. I'll upload before/after on the weekend

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.

Enable module cache
3 participants