-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
feat: improve rolldown compatibility #13519
Conversation
🦋 Changeset detectedLatest commit: 5bf450a The changes in this PR will be included in the next version bump. 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 |
CodSpeed Performance ReportMerging #13519 will not alter performanceComparing Summary
|
Can you please breakdown the changes for us reviewers? I don't know what the changes are for, and what I'm reviewing |
@@ -151,7 +154,7 @@ export default function assets({ settings }: { settings: AstroSettings }): vite. | |||
}, | |||
// In build, rewrite paths to ESM imported images in code to their final location | |||
async renderChunk(code) { | |||
const assetUrlRE = /__ASTRO_ASSET_IMAGE__([\w$]{8})__(?:_(.*?)__)?/g; | |||
const assetUrlRE = /__ASTRO_ASSET_IMAGE__([\w$]+)__(?:_(.*?)__)?/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.
In rolldown hashes are not exactly 8 long
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 recommend you read the patch file linked in the PR desc. I ported the changes that seemed non breaking to Astro directly. The fact that tests still pass is reassuring imo
@@ -57,6 +57,9 @@ function getNonPrerenderOnlyChunks(bundle: Rollup.OutputBundle, internals: Build | |||
|
|||
nonPrerenderOnlyEntryChunks.add(chunk); | |||
} | |||
if (chunk.type === 'chunk' && chunk.isDynamicEntry) { |
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 would be a bug in Astro according to the patch file
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.
Thank you @florian-lefebvre. I would add a changelog so we can track the changes, in case there's some unexpected regression to our users.
Also, I would appreciate if we left comments in the places where we now return objects. We return strings on most of our plugins, however only the asset ones require an object. We should keep track of the change with a comment, so maintainers aren't going to refactor it.
Changes
load
to return an object instead of a string so it's easier to adopt Rolldown module typesTesting
Should pass
Docs
N/A. No changeset since it's a refactor