-
Notifications
You must be signed in to change notification settings - Fork 27k
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
(next/image): Merge query string params in imgix loader #26719
(next/image): Merge query string params in imgix loader #26719
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
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.
Great work, thanks! 🎉
This comment has been minimized.
This comment has been minimized.
Failing test suitesCommit: 4cde0c2 test/integration/create-next-app/index.test.js
Expand output● create next app › empty directory
● create next app › valid example
● create next app › should support typescript flag
● create next app › should allow example with GitHub URL
● create next app › should allow example with GitHub URL and example-path
● create next app › should use --example-path over the file path in the GitHub URL
● create next app › should fall back to default template
● create next app › should allow an example named default
● create next app › should create a project in the current directory
● create next app › should ask the user for a name for the project if none supplied
● create next app › should use npm as the package manager on supplying --use-npm
● create next app › should use npm as the package manager on supplying --use-npm with example
|
Stats from current PRDefault Build (Increase detected
|
vercel/next.js canary | theostrahlen/next.js fix/imgix-no-double-querystrings | Change | |
---|---|---|---|
buildDuration | 11.2s | 11.2s | |
buildDurationCached | 2.7s | 2.6s | -100ms |
nodeModulesSize | 49.3 MB | 49.3 MB |
Page Load Tests Overall increase ✓
vercel/next.js canary | theostrahlen/next.js fix/imgix-no-double-querystrings | Change | |
---|---|---|---|
/ failed reqs | 0 | 0 | ✓ |
/ total time (seconds) | 1.951 | 1.95 | 0 |
/ avg req/sec | 1281.29 | 1282.26 | +0.97 |
/error-in-render failed reqs | 0 | 0 | ✓ |
/error-in-render total time (seconds) | 1.174 | 1.139 | -0.03 |
/error-in-render avg req/sec | 2130.34 | 2193.95 | +63.61 |
Client Bundles (main, webpack, commons)
vercel/next.js canary | theostrahlen/next.js fix/imgix-no-double-querystrings | Change | |
---|---|---|---|
359.HASH.js gzip | 3.09 kB | 3.09 kB | ✓ |
framework-HASH.js gzip | 42 kB | 42 kB | ✓ |
main-HASH.js gzip | 20.6 kB | 20.6 kB | ✓ |
webpack-HASH.js gzip | 1.49 kB | 1.49 kB | ✓ |
Overall change | 67.2 kB | 67.2 kB | ✓ |
Legacy Client Bundles (polyfills)
vercel/next.js canary | theostrahlen/next.js fix/imgix-no-double-querystrings | Change | |
---|---|---|---|
polyfills-HASH.js gzip | 31.1 kB | 31.1 kB | ✓ |
Overall change | 31.1 kB | 31.1 kB | ✓ |
Client Pages
vercel/next.js canary | theostrahlen/next.js fix/imgix-no-double-querystrings | Change | |
---|---|---|---|
_app-HASH.js gzip | 803 B | 803 B | ✓ |
_error-HASH.js gzip | 3.18 kB | 3.18 kB | ✓ |
amp-HASH.js gzip | 526 B | 526 B | ✓ |
css-HASH.js gzip | 329 B | 329 B | ✓ |
hooks-HASH.js gzip | 903 B | 903 B | ✓ |
index-HASH.js gzip | 263 B | 263 B | ✓ |
link-HASH.js gzip | 1.65 kB | 1.65 kB | ✓ |
routerDirect..HASH.js gzip | 322 B | 322 B | ✓ |
withRouter-HASH.js gzip | 320 B | 320 B | ✓ |
bb14e60e810b..30f.css gzip | 125 B | 125 B | ✓ |
Overall change | 8.42 kB | 8.42 kB | ✓ |
Client Build Manifests
vercel/next.js canary | theostrahlen/next.js fix/imgix-no-double-querystrings | Change | |
---|---|---|---|
_buildManifest.js gzip | 390 B | 390 B | ✓ |
Overall change | 390 B | 390 B | ✓ |
Rendered Page Sizes
vercel/next.js canary | theostrahlen/next.js fix/imgix-no-double-querystrings | Change | |
---|---|---|---|
index.html gzip | 523 B | 523 B | ✓ |
link.html gzip | 537 B | 537 B | ✓ |
withRouter.html gzip | 515 B | 515 B | ✓ |
Overall change | 1.57 kB | 1.57 kB | ✓ |
Webpack 4 Mode (Increase detected ⚠️ )
General Overall increase ⚠️
vercel/next.js canary | theostrahlen/next.js fix/imgix-no-double-querystrings | Change | |
---|---|---|---|
buildDuration | 9.7s | 9.8s | |
buildDurationCached | 4.1s | 3.9s | -176ms |
nodeModulesSize | 49.3 MB | 49.3 MB |
Page Load Tests Overall increase ✓
vercel/next.js canary | theostrahlen/next.js fix/imgix-no-double-querystrings | Change | |
---|---|---|---|
/ failed reqs | 0 | 0 | ✓ |
/ total time (seconds) | 2.054 | 2.032 | -0.02 |
/ avg req/sec | 1217.21 | 1230.51 | +13.3 |
/error-in-render failed reqs | 0 | 0 | ✓ |
/error-in-render total time (seconds) | 1.24 | 1.101 | -0.14 |
/error-in-render avg req/sec | 2015.54 | 2271.69 | +256.15 |
Client Bundles (main, webpack, commons)
vercel/next.js canary | theostrahlen/next.js fix/imgix-no-double-querystrings | Change | |
---|---|---|---|
14.HASH.js gzip | 3.11 kB | 3.11 kB | ✓ |
677f882d2ed8..HASH.js gzip | 13.9 kB | 13.9 kB | ✓ |
framework.HASH.js gzip | 41.8 kB | 41.8 kB | ✓ |
main-HASH.js gzip | 7.81 kB | 7.81 kB | ✓ |
webpack-HASH.js gzip | 1.19 kB | 1.19 kB | ✓ |
Overall change | 67.8 kB | 67.8 kB | ✓ |
Legacy Client Bundles (polyfills)
vercel/next.js canary | theostrahlen/next.js fix/imgix-no-double-querystrings | Change | |
---|---|---|---|
polyfills-HASH.js gzip | 31.3 kB | 31.3 kB | ✓ |
Overall change | 31.3 kB | 31.3 kB | ✓ |
Client Pages
vercel/next.js canary | theostrahlen/next.js fix/imgix-no-double-querystrings | Change | |
---|---|---|---|
_app-HASH.js gzip | 791 B | 791 B | ✓ |
_error-HASH.js gzip | 3.83 kB | 3.83 kB | ✓ |
amp-HASH.js gzip | 531 B | 531 B | ✓ |
css-HASH.js gzip | 333 B | 333 B | ✓ |
hooks-HASH.js gzip | 910 B | 910 B | ✓ |
index-HASH.js gzip | 227 B | 227 B | ✓ |
link-HASH.js gzip | 1.64 kB | 1.64 kB | ✓ |
routerDirect..HASH.js gzip | 295 B | 295 B | ✓ |
withRouter-HASH.js gzip | 292 B | 292 B | ✓ |
e025d2764813..52f.css gzip | 125 B | 125 B | ✓ |
Overall change | 8.98 kB | 8.98 kB | ✓ |
Client Build Manifests
vercel/next.js canary | theostrahlen/next.js fix/imgix-no-double-querystrings | Change | |
---|---|---|---|
_buildManifest.js gzip | 418 B | 418 B | ✓ |
Overall change | 418 B | 418 B | ✓ |
Rendered Page Sizes
vercel/next.js canary | theostrahlen/next.js fix/imgix-no-double-querystrings | Change | |
---|---|---|---|
index.html gzip | 569 B | 569 B | ✓ |
link.html gzip | 581 B | 581 B | ✓ |
withRouter.html gzip | 561 B | 561 B | ✓ |
Overall change | 1.71 kB | 1.71 kB | ✓ |
If the `Image` src url had existing query params, the imgix loader would simply append another query string with `?` causing both query strings to break. This PR adds a way to safely merge query strings if needed using [URLSearchParams](https://developer.mozilla.org/en-US/docs/Web/API/URLSearchParams). ## Bug - [X] fixes vercel#26288 - [X] Integration tests added
If the
Image
src url had existing query params, the imgix loader would simply append another query string with?
causing both query strings to break.This PR adds a way to safely merge query strings if needed using URLSearchParams.
Bug