-
Notifications
You must be signed in to change notification settings - Fork 778
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
vite-plugin: update to use the new @cloudflare/unenv-preset
#7830
vite-plugin: update to use the new @cloudflare/unenv-preset
#7830
Conversation
🦋 Changeset detectedLatest commit: 6299a92 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
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/13264468734/npm-package-wrangler-7830 You can reference the automatically updated head of this PR with: npm install --save-dev https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/prs/7830/npm-package-wrangler-7830 Or you can use npx https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13264468734/npm-package-wrangler-7830 dev path/to/script.js Additional artifacts:cloudflare-workers-bindings-extension: wget https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13264468734/npm-package-cloudflare-workers-bindings-extension-7830 -O ./cloudflare-workers-bindings-extension.0.0.0-vc4fc52576.vsix && code --install-extension ./cloudflare-workers-bindings-extension.0.0.0-vc4fc52576.vsix create-cloudflare: npx https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13264468734/npm-package-create-cloudflare-7830 --no-auto-update @cloudflare/kv-asset-handler: npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13264468734/npm-package-cloudflare-kv-asset-handler-7830 miniflare: npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13264468734/npm-package-miniflare-7830 @cloudflare/pages-shared: npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13264468734/npm-package-cloudflare-pages-shared-7830 @cloudflare/unenv-preset: npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13264468734/npm-package-cloudflare-unenv-preset-7830 @cloudflare/vite-plugin: npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13264468734/npm-package-cloudflare-vite-plugin-7830 @cloudflare/vitest-pool-workers: npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13264468734/npm-package-cloudflare-vitest-pool-workers-7830 @cloudflare/workers-editor-shared: npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13264468734/npm-package-cloudflare-workers-editor-shared-7830 @cloudflare/workers-shared: npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13264468734/npm-package-cloudflare-workers-shared-7830 @cloudflare/workflows-shared: npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13264468734/npm-package-cloudflare-workflows-shared-7830 Note that these links will no longer work once the GitHub Actions artifact expires.
Please ensure constraints are pinned, and |
169c800
to
a2cd688
Compare
@@ -40,9 +40,10 @@ | |||
"test:ci": "vitest run" | |||
}, | |||
"dependencies": { | |||
"@cloudflare/unenv-preset": "~1.1.1", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Not sure if this should be "1.1.1" (no
~
)? We can relax the range once 2.0 is released - Is it expected that the plugin has no (peer) dep on
workerd
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wrangler is in both devDep and peerDep, as is Vite
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wrangler is there twice because the devDep
is only for testing (and we use the workspace version); while the peerDep is a range ("wrangler": "^3.101.0") which constrains the minimum version.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Happy to pin this dep to 1.1.1 if that helps.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the cf unenv preset has its own peer dependency on workerd.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Happy to pin this dep to 1.1.1 if that helps
It's more that we do not expect any 1.1.2...
the cf unenv preset has its own peer dependency on workerd.
it's a peer dep so it should be installed somewhere...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It'll be installed as part of Wrangler
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I only took a quick look.
How urgent is this? If this can be put on hold until we release the v2 of the preset, that would be ideal
The Vite plugin is currently broken with Vite 6.1 and this solves that. If we want to hold off on landing this then I would have to put up a fix for the old unenv usage. Is there a reason to hold this back? This Vite plugin is, itself, in beta, so it feels like a good place to try out new stuff like the Cloudflare unenv update. |
85717f6
to
5e2abeb
Compare
I'm asking mostly because I don't have time to do a deep review. There might be changes to do after #7915 is merged / 2.0 is released |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No time for a deep review right now.
But @petebacondarwin mentioned it fixes issues and the plugin is still in beta.
I can look at it more closely after v2.0 of the preset is released
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, as far as I understand the new preset. I would prefer the plugins to be defined in the same file though so that they have access to the cloudflare
function scope.
5e2abeb
to
9291388
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! I think there's still a bit of an open question about what's correct for preview mode but happy for you to make the decision on this.
e931930
to
6299a92
Compare
…de.js compat module
6299a92
to
b46a906
Compare
Fixes #8054