-
-
Notifications
You must be signed in to change notification settings - Fork 52
chore: improve support for Workers Assets beta #406
Conversation
🦋 Changeset detectedLatest commit: 7d5d92a The changes in this PR will be included in the next version bump. This PR includes changesets to release 10 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 |
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.
This PR seems to add a new option for the user. This means that this isn't a refactor, but a real minor
that requires a changeset and new tests.
I agree with the changeset, however I'm not sure about the test, because this is still |
Can you explain why our tests would fail? I don't see any new dependency added, so I probably miss some context. Nonetheless, I trust your judgment. If these workers assets are beta, I suppose that even out option should be experimental. |
Fail is the wrong term here, sorry. I meant the tests would not represent the But I agree the flag should be experimental. I'll change the code. |
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.
Left a couple of suggestions (nitpicks). We have some docs before shipping this, I suppose.
.filter(Boolean) | ||
.map((s: string) => { | ||
const syntax = s | ||
.replace(/\/:.*?(?=\/|$)/g, '/*') |
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.
nit: Regex created in a for loop are wasteful. They can be created in a top-level function and re-used
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.
Good point, I'll address it in a follow up PR, since it was like this before.
const syntax = s | ||
.replace(/\/:.*?(?=\/|$)/g, '/*') | ||
// remove query params as they are not supported by cloudflare | ||
.replace(/\?.*$/, ''); |
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.
Same here
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.
Good point, I'll address it in a follow up PR, since it was like this before.
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.
Going to add some docs PR and going to address the nitpicks.
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.
Going to add some docs PR and going to address the nitpicks.
Actually I think it is just easier for users to add a ignore file, so we don't need to support two different build outputs.. closing, still going to write docs PR to explain this to users. https://developers.cloudflare.com/workers/static-assets/binding/#ignoring-assets |
Changes
/_worker.js/index.js
url.wrangler.toml
(not sure how we can provide that to the user)Testing
Docs
cc @dario-piotrowicz @petebacondarwin