Skip to content

worker: strip types in Web Worker module entries - #66085

Open
osztenkurden wants to merge 1 commit into
nodejs:mainfrom
osztenkurden:fix/webworker-typescript-entry
Open

osztenkurden wants to merge 1 commit into
nodejs:mainfrom
osztenkurden:fix/webworker-typescript-entry

Conversation

@osztenkurden

Copy link
Copy Markdown

The experimental Web Worker module entries don't perform TypeScript stripping: type annotations in the entry file cause a SyntaxError, even though a JavaScript-compatible entry importing files with TypeScript annotations succeeds.

The proposed solution is to strip types from file-backed .ts, .mts, and .cts module-worker entries before evaluation, preserving existing fetching and worker-type semantics.

Strip TypeScript from file-backed module worker entries before
evaluating the fetched source.

Add regression coverage and document the supported entry types.

Assisted-by: Codex
Signed-off-by: Hubert Walczak <hubertwalczak8@gmail.com>
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/typescript

@nodejs-github-bot nodejs-github-bot added the needs-ci PRs that need a full CI run. label Sep 17, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Welcome to Node.js, and thank you for your first contribution!

Before review, please take a moment to read:

Please make sure every commit is signed off. For a first pull request, GitHub Actions require collaborator approval and Jenkins CI must be started by a collaborator or triager, so an initial wait is normal.

@codecov

codecov Bot commented Sep 17, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.28%. Comparing base (fa95cd5) to head (fec74c9).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #66085      +/-   ##
==========================================
+ Coverage   90.27%   90.28%   +0.01%     
==========================================
  Files         789      789              
  Lines      271623   271642      +19     
  Branches    51847    51860      +13     
==========================================
+ Hits       245196   245250      +54     
+ Misses      16910    16861      -49     
- Partials     9517     9531      +14     
Files with missing lines Coverage Δ
lib/internal/webworker.js 93.23% <100.00%> (+0.13%) ⬆️

... and 31 files with indirect coverage changes

🚀 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-ci PRs that need a full CI run.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants