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

fix(plugin-assets-retry): support output.assetPrefix with absolute url #4129

Merged
merged 5 commits into from
Dec 7, 2024

Conversation

SoonIter
Copy link
Member

@SoonIter SoonIter commented Dec 5, 2024

Summary

let async-retry url calculating aligned with initial-retry

Before

only support

domain: ['https://a.com', 'https://b.com']

// or

domain: ['https://a.com/path-foo', 'https://b.com/path-foo']

if you uses below

domain: ['https://a.com/path-foo', 'https://b.com'],
max: 3

output: {
	assetPrefix: 'https://a.com/path-foo'
}

the retry contexts:

0. https://a.com/path-foo/static/js/main.js

1. https://a.com/path-foo/static/js/main.js

2. https://b.com/path-foo/static/js/main.js

3. https://a.com/path-foo/static/js/main.js

after

domains: ['https://a.com/path-foo', 'https://b.com'],
max: 3

output: {
	assetPrefix: 'https://a.com/path-foo'
}
0. https://a.com/path-foo/static/js/main.js

1. https://a.com/path-foo/static/js/main.js

2. https://b.com/static/js/main.js

3. https://a.com/path-foo/static/js/main.js

Copy link

netlify bot commented Dec 5, 2024

Deploy Preview for rsbuild ready!

Name Link
🔨 Latest commit 65edab6
🔍 Latest deploy log https://app.netlify.com/sites/rsbuild/deploys/67542466f00c8300086af5d6
😎 Deploy Preview https://deploy-preview-4129--rsbuild.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 74 (🟢 up 3 from production)
Accessibility: 97 (no change from production)
Best Practices: 100 (no change from production)
SEO: 100 (no change from production)
PWA: 60 (no change from production)
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify site configuration.

@SoonIter SoonIter marked this pull request as ready for review December 5, 2024 12:14
@SoonIter SoonIter changed the title fix(plugin-assets-retry): different domains config fix(plugin-assets-retry): support output.assetPrefix with absolute url Dec 5, 2024
// this function is same with async chunk retry
function getUrlRetryQuery(
existRetryTimes: number,
originalQuery: string,
Copy link
Member

Choose a reason for hiding this comment

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

Is this originalQuery param the same as const originalQuery in L247?

Copy link
Member Author

Choose a reason for hiding this comment

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

yes, these two functions are exactly the same now

Copy link
Member

Choose a reason for hiding this comment

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

But the originalQuery param seems to be unnecessary in this file

@chenjiahan chenjiahan merged commit 762c3b4 into main Dec 7, 2024
9 checks passed
@chenjiahan chenjiahan deleted the fix-assets-retry-different-domain branch December 7, 2024 11:47
@chenjiahan chenjiahan mentioned this pull request Dec 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants