-
Notifications
You must be signed in to change notification settings - Fork 1k
add support for assets bindings to getPlatformProxy (take 2)
#7871
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
Conversation
🦋 Changeset detectedLatest commit: edc43d4 The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
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 |
getPlatformProxygetPlatformProxy (take 2)
|
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/13372236543/npm-package-wrangler-7871You can reference the automatically updated head of this PR with: npm install --save-dev https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/prs/7871/npm-package-wrangler-7871Or you can use npx https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13372236543/npm-package-wrangler-7871 dev path/to/script.jsAdditional artifacts:cloudflare-workers-bindings-extension: wget https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13372236543/npm-package-cloudflare-workers-bindings-extension-7871 -O ./cloudflare-workers-bindings-extension.0.0.0-vee9dc019c.vsix && code --install-extension ./cloudflare-workers-bindings-extension.0.0.0-vee9dc019c.vsixcreate-cloudflare: npx https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13372236543/npm-package-create-cloudflare-7871 --no-auto-update@cloudflare/kv-asset-handler: npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13372236543/npm-package-cloudflare-kv-asset-handler-7871miniflare: npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13372236543/npm-package-miniflare-7871@cloudflare/pages-shared: npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13372236543/npm-package-cloudflare-pages-shared-7871@cloudflare/unenv-preset: npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13372236543/npm-package-cloudflare-unenv-preset-7871@cloudflare/vite-plugin: npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13372236543/npm-package-cloudflare-vite-plugin-7871@cloudflare/vitest-pool-workers: npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13372236543/npm-package-cloudflare-vitest-pool-workers-7871@cloudflare/workers-editor-shared: npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13372236543/npm-package-cloudflare-workers-editor-shared-7871@cloudflare/workers-shared: npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13372236543/npm-package-cloudflare-workers-shared-7871@cloudflare/workflows-shared: npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13372236543/npm-package-cloudflare-workflows-shared-7871Note that these links will no longer work once the GitHub Actions artifact expires.
Please ensure constraints are pinned, and |
b613d89 to
6b93b08
Compare
vicb
left a comment
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.
Can you briefly explain in the description how this PR fixes the reason why the first iteration was reverted?
6befada to
4daa1ab
Compare
Done 👍 |
|
@dario-piotrowicz is this ready to pick up again? |
yes it is! it's been on the back of my mind for a bit but I've been busy with other stuff, I'll pick this back up tomorrow or in the next few days, sorry about it 🙇 |
85f3177 to
1de49e9
Compare
|
@penalosa should be good to review now 🙂👍 |
vicb
left a comment
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.
LGTM with a couple nits
fixtures/get-platform-proxy/tests/get-platform-proxy.env.test.ts
Outdated
Show resolved
Hide resolved
1de49e9 to
c5dbf1e
Compare
|
Failed to automatically backport this PR's changes to Wrangler v3. Please manually create a PR targeting the Depending on your changes, running Notes:
|
create-cloudflare
@cloudflare/kv-asset-handler
miniflare
@cloudflare/pages-shared
@cloudflare/unenv-preset
@cloudflare/vite-plugin
@cloudflare/vitest-pool-workers
@cloudflare/workers-editor-shared
wrangler
commit: |
c5dbf1e to
0deb955
Compare
Co-authored-by: Victor Berchet <[email protected]>
|
Note I've added the
skip-v3-pr
PS: I think that ideally the v3 backport check should be smart enough to understand when a manual backport PR has been created 🤔 |
…roxy` (#9694) * add support for assets bindings to `getPlatformProxy` * Apply suggestions from code review Co-authored-by: Victor Berchet <[email protected]> * fix formatting * fix CI * Update packages/wrangler/src/api/integrations/platform/index.ts --------- Co-authored-by: Victor Berchet <[email protected]> Co-authored-by: Carmen Popoviciu <[email protected]>
Fixes #7812
this change makes sure that that getPlatformProxy, when the input configuration
file contains an assets field, correctly returns the appropriate asset binding proxy
This is reintroducing the change introduced in #7816 and reverted in #7866
This was reverted because some projects might call
getPlatformProxybefore the assets directory exists (for example ifgetPlatformProxyis used in their vite config, an initialvite buildwill cause the utility not to find the directory and throw an error), my solution is to try catch the exception and ignore the non-existing dir for this utility (this seems reasonable enough to me, I need to see if the team agrees)getPlatformProxydocs by generalizing wrangler.toml references and adding assets bindings support cloudflare-docs#19300getPlatformProxy#9694