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

Add **/*.wasm?module as a default module rule #2783

Merged
merged 2 commits into from
Apr 11, 2023
Merged

Conversation

GregBrimble
Copy link
Member

@GregBrimble GregBrimble commented Feb 23, 2023

What this PR solves / how to test:

Associated docs issues/PR:

Author has included the following, where applicable:

  • Tests
  • Changeset

Reviewer has performed the following, where applicable:

  • Checked for inclusion of relevant tests
  • Checked for inclusion of a relevant changeset
  • Checked for creation of associated docs updates
  • Manually pulled down the changes and spot-tested

Fixes # [insert issue number].

@GregBrimble GregBrimble requested a review from a team as a code owner February 23, 2023 12:46
@changeset-bot
Copy link

changeset-bot bot commented Feb 23, 2023

🦋 Changeset detected

Latest commit: 34802e5

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

This PR includes changesets to release 1 package
Name Type
wrangler 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
Copy link
Contributor

github-actions bot commented Feb 23, 2023

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/4252812557/npm-package-wrangler-2783

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

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

Or you can use npx with this latest build directly:

npx https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/4252812557/npm-package-wrangler-2783 dev path/to/script.js
Additional artifacts:
npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/4252812557/npm-package-cloudflare-pages-shared-2783

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

@petebacondarwin
Copy link
Contributor

As discussed offline, we feel comfortable that adding this feature will not unduly constrain Wrangler in the future:

  • it only adds an import that currently would cause a deployment to crash
  • the semantic of this import is unlikely to change in the future
  • if it does the user will be able to override it, initially, via a custom rule in the Worker config - and by this time, hopefully, Pages projects will also support being configured in the same way
  • if the general meaning of this import changes in a way that we would want to change the default, we could do this using the standard deprecation and major version bump breaking change process that Wrangler already uses.

@codecov
Copy link

codecov bot commented Feb 23, 2023

Codecov Report

Merging #2783 (34802e5) into main (26d8066) will increase coverage by 0.02%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #2783      +/-   ##
==========================================
+ Coverage   73.97%   74.00%   +0.02%     
==========================================
  Files         166      166              
  Lines       10163    10163              
  Branches     2705     2705              
==========================================
+ Hits         7518     7521       +3     
+ Misses       2645     2642       -3     
Impacted Files Coverage Δ
packages/wrangler/src/module-collection.ts 97.36% <ø> (ø)
packages/wrangler/src/git-client.ts 43.75% <0.00%> (+4.16%) ⬆️
...ackages/wrangler/src/__tests__/helpers/mock-bin.ts 100.00% <0.00%> (+5.26%) ⬆️

@dario-piotrowicz
Copy link
Member

I can see we have tests/fixtures for *.wasm, should we also add some for *.wasm?module?

(maybe not, just asking 🙂)

Copy link
Member

@dario-piotrowicz dario-piotrowicz left a comment

Choose a reason for hiding this comment

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

Looks good to me 😄 (based on my very limited knowledge of this code)

@GregBrimble GregBrimble merged commit 4c55baf into main Apr 11, 2023
@GregBrimble GregBrimble deleted the add-wasm-module-alias branch April 11, 2023 16:06
@github-actions github-actions bot mentioned this pull request Apr 11, 2023
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.

None yet

4 participants