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

Allow --experimental-local to be used with module workers #1934

Merged
merged 1 commit into from Sep 27, 2022

Conversation

mrbbot
Copy link
Contributor

@mrbbot mrbbot commented Sep 27, 2022

Previously, Miniflare 3 was automatically collecting modules. These collected modules were given names relative to the current working directory. Because Wrangler puts scripts in a temporary directory, these names started with .., which workerd was not happy with.

This change avoids the redundant automatic collection in Miniflare, and ensures module names are resolved relative to the temporary directory.

Previously, Miniflare 3 was automatically collecting modules.
These collected modules were given names relative to the current
working directory. Because Wrangler puts scripts in a temporary
directory, these names started with `..`, which `workerd` was not
happy with.

This change avoids the redundant automatic collection in Miniflare,
and ensures module names are resolved relative to the temporary
directory.
@changeset-bot
Copy link

changeset-bot bot commented Sep 27, 2022

🦋 Changeset detected

Latest commit: 9119b27

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

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

npm install --save-dev https://prerelease-registry.developers.workers.dev/runs/3136749169/npm-package-wrangler-1934

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

npm install --save-dev https://prerelease-registry.developers.workers.dev/prs/1934/npm-package-wrangler-1934

Or you can use npx with this latest build directly:

npx https://prerelease-registry.developers.workers.dev/runs/3136749169/npm-package-wrangler-1934 dev path/to/script.js
Additional artifacts:
npm install https://prerelease-registry.developers.workers.dev/runs/3136749169/npm-package-cloudflare-pages-shared-1934

@codecov
Copy link

codecov bot commented Sep 27, 2022

Codecov Report

Merging #1934 (9119b27) into main (452b84b) will decrease coverage by 0.02%.
The diff coverage is 53.84%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1934      +/-   ##
==========================================
- Coverage   75.26%   75.23%   -0.03%     
==========================================
  Files         116      116              
  Lines        7896     7907      +11     
  Branches     2055     2057       +2     
==========================================
+ Hits         5943     5949       +6     
- Misses       1953     1958       +5     
Impacted Files Coverage Δ
packages/wrangler/src/dev/local.tsx 27.31% <33.33%> (-0.49%) ⬇️
packages/wrangler/src/module-collection.ts 97.36% <100.00%> (+0.14%) ⬆️
...ackages/wrangler/src/__tests__/helpers/mock-bin.ts 100.00% <0.00%> (+5.26%) ⬆️

Copy link
Contributor

@cameron-robey cameron-robey left a comment

Choose a reason for hiding this comment

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

All looks good to me

Copy link
Contributor

@JacobMGEvans JacobMGEvans left a comment

Choose a reason for hiding this comment

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

Is there any way to test this?

@rozenmd
Copy link
Contributor

rozenmd commented Sep 27, 2022

Do we have plans to add --experimental-local to unstable_dev too? 🥺

@mrbbot
Copy link
Contributor Author

mrbbot commented Sep 27, 2022

Do we have plans to add --experimental-local to unstable_dev too? 🥺

Definitely! I'm hoping this won't be too complicated. 👍
I'd like to land this ASAP though as module workers are used quite a lot. 😅

Is there any way to test this?

We can add tests using unstable_dev once we've added experimentalLocal support to that. 👍

@mrbbot mrbbot merged commit 7ebaec1 into main Sep 27, 2022
@mrbbot mrbbot deleted the bcoll/experimental-local-modules branch September 27, 2022 16:46
@github-actions github-actions bot mentioned this pull request Sep 27, 2022
@mrbbot
Copy link
Contributor Author

mrbbot commented Sep 28, 2022

Do we have plans to add --experimental-local to unstable_dev too? 🥺

#1940 🙂

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