Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[vitest-pool-workers] fix: use builtin node:process module over polyfill #5101

Merged
merged 1 commit into from
Feb 26, 2024

Conversation

mrbbot
Copy link
Contributor

@mrbbot mrbbot commented Feb 26, 2024

Ref: #5081 (review)

What this PR solves / how to test:

This PR fixes an issue when upgrading the workerd version used by @cloudflare/vitest-pool-workers. Specifically, newer versions of workerd will always load the built-in version of node:process, which doesn't support all the required functionality. Previously, our polyfill was loaded instead. This change brings the required parts of the polyfill over to the built-in version, then removes the polyfill.

Author has addressed the following:

  • Tests
    • Included
    • Not necessary because: passing existing
  • Changeset (Changeset guidelines)
    • Included
    • Not necessary because: @cloudflare/vitest-pool-workers isn't published yet
  • Associated docs
    • Issue(s)/PR(s):
    • Not necessary because: fixing an internal regression

Note for PR author:

We want to celebrate and highlight awesome PR review! If you think this PR received a particularly high-caliber review, please assign it the label highlight pr review so future reviewers can take inspiration and learn from it.

Copy link

changeset-bot bot commented Feb 26, 2024

⚠️ No Changeset found

Latest commit: ab23ee2

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@mrbbot mrbbot marked this pull request as ready for review February 26, 2024 16:13
@mrbbot mrbbot requested a review from a team as a code owner February 26, 2024 16:13
@mrbbot mrbbot changed the title fix: use builtin node:process module over polyfill for Vitest pool [vitest-pool-workers] fix: use builtin node:process module over polyfill Feb 26, 2024
@mrbbot mrbbot mentioned this pull request Feb 26, 2024
6 tasks
Copy link
Contributor

A wrangler prerelease is available for testing. You can install this latest build in your project with:

npm install --save-dev https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/8052038672/npm-package-wrangler-5101

You can reference the automatically updated head of this PR with:

npm install --save-dev https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/prs/5101/npm-package-wrangler-5101

Or you can use npx with this latest build directly:

npx https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/8052038672/npm-package-wrangler-5101 dev path/to/script.js
Additional artifacts:
npx https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/8052038672/npm-package-create-cloudflare-5101 --no-auto-update
npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/8052038672/npm-package-cloudflare-kv-asset-handler-5101
npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/8052038672/npm-package-miniflare-5101
npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/8052038672/npm-package-cloudflare-pages-shared-5101
npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/8052038672/npm-package-cloudflare-vitest-pool-workers-5101

Note that these links will no longer work once the GitHub Actions artifact expires.


wrangler@3.29.0 includes the following runtime dependencies:

Package Constraint Resolved
miniflare workspace:* 3.20240208.0
workerd 1.20240208.0 1.20240208.0
workerd --version 1.20240208.0 2024-02-08

Please ensure constraints are pinned, and miniflare/workerd minor versions match.

Copy link

codecov bot commented Feb 26, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 70.35%. Comparing base (2aa7913) to head (ab23ee2).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #5101      +/-   ##
==========================================
+ Coverage   70.33%   70.35%   +0.01%     
==========================================
  Files         298      298              
  Lines       15515    15515              
  Branches     3987     3987              
==========================================
+ Hits        10913    10916       +3     
+ Misses       4602     4599       -3     

see 5 files with indirect coverage changes

@mrbbot mrbbot merged commit d4b4c3a into main Feb 26, 2024
17 checks passed
@mrbbot mrbbot deleted the bcoll/vitest-pool-workers-use-builtin-node-process branch February 26, 2024 16:26
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