cloudflare / workers-sdk

⛅️ Home to Wrangler, the CLI for Cloudflare Workers®
https://developers.cloudflare.com/workers/
Apache License 2.0
2.6k stars 675 forks source link

fix(wrangler): avoid path collisions between performance and Performance polyfills #6025

Closed IgorMinar closed 3 months ago

IgorMinar commented 3 months ago

It turns out that ESBuild paths are case insensitive, which can result in path collisions between polyfills for globalThis.performance and globalThis.Performance.

This change ensures that we encode all global names to lowercase and decode them appropriately.

The version of unenv used at HEAD currently doesn't suffer from this path collision, but if not fixed the change introduced in https://github.com/unjs/unenv/pull/257/files would result in Node.js API coverage regressions. This change prevents those regressions from happening.

What this PR solves / how to test

Fixes #[insert GH or internal issue number(s)].

Author has addressed the following

changeset-bot[bot] commented 3 months ago

🦋 Changeset detected

Latest commit: 6effdbaea31bbc9a86da18774f28be7e83ce3bff

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

This PR includes changesets to release 2 packages | Name | Type | | ------------------------------- | ----- | | wrangler | Patch | | @cloudflare/vitest-pool-workers | 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

github-actions[bot] commented 3 months ago

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/9498249323/npm-package-wrangler-6025

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

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

Or you can use npx with this latest build directly:

npx https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/9498249323/npm-package-wrangler-6025 dev path/to/script.js
Additional artifacts: ```sh npx https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/9498249323/npm-package-create-cloudflare-6025 --no-auto-update ``` ```sh npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/9498249323/npm-package-cloudflare-kv-asset-handler-6025 ``` ```sh npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/9498249323/npm-package-miniflare-6025 ``` ```sh npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/9498249323/npm-package-cloudflare-pages-shared-6025 ``` ```sh npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/9498249323/npm-package-cloudflare-vitest-pool-workers-6025 ``` Note that these links will no longer work once [the GitHub Actions artifact expires](https://docs.github.com/en/organizations/managing-organization-settings/configuring-the-retention-period-for-github-actions-artifacts-and-logs-in-your-organization).

wrangler@3.60.2 includes the following runtime dependencies:

Package Constraint Resolved
miniflare workspace:* 3.20240605.0
workerd 1.20240605.0 1.20240605.0
workerd --version 1.20240605.0 2024-06-05

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

petebacondarwin commented 3 months ago

It needs a changeset before I merge...

holopin-bot[bot] commented 3 months ago

Congratulations @IgorMinar, you just earned a holobyte! Here it is: https://holopin.io/holobyte/clxd6dfbz31420cmgnkzuoc3x

This badge can only be claimed by you, so make sure that your GitHub account is linked to your Holopin account. You can manage those preferences here: https://holopin.io/account. Or if you're new to Holopin, you can simply sign up with GitHub, which will do the trick!