-
Notifications
You must be signed in to change notification settings - Fork 27.5k
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
test, fix and document all possible import types for URL imports #30165
Conversation
This comment has been minimized.
This comment has been minimized.
21feb9b
to
f61c574
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
f61c574
to
184e2c9
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
184e2c9
to
0099dab
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
9d4df05
to
257e43f
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
resolve absolute URLs in CSS when using urlImports remove `[path]` from static static image output path replace file-loader with asset module, remove file-loader
257e43f
to
f82a740
Compare
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.
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.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
loader: require.resolve('next/dist/compiled/file-loader'), | ||
options: { | ||
// Hash the file for immutable cacheability | ||
name: 'static/media/[name].[hash].[ext]', |
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.
Will the asset/resource
follow the same pattern as next-image-loader
is using?
'/static/media/[name].[hash:8].[ext]', |
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.
yep
@@ -1510,6 +1510,7 @@ export default async function getBaseWebpackConfig( | |||
sassOptions: config.sassOptions, | |||
productionBrowserSourceMaps: config.productionBrowserSourceMaps, | |||
future: config.future, | |||
experimental: config.experimental, | |||
isCraCompat: config.experimental.craCompat, |
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.
Seems like experimental.isCraCompat
is no longe needed since you're passing the entire experimental
object
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.
done
Stats from current PRDefault Build (Decrease detected ✓)General Overall decrease ✓
Page Load Tests Overall decrease
|
vercel/next.js canary | vercel/next.js url-imports/css-url | Change | |
---|---|---|---|
/ failed reqs | 0 | 0 | ✓ |
/ total time (seconds) | 3.653 | 3.719 | |
/ avg req/sec | 684.28 | 672.24 | |
/error-in-render failed reqs | 0 | 0 | ✓ |
/error-in-render total time (seconds) | 1.931 | 1.975 | |
/error-in-render avg req/sec | 1294.75 | 1265.92 |
Client Bundles (main, webpack, commons) Overall increase ⚠️
vercel/next.js canary | vercel/next.js url-imports/css-url | Change | |
---|---|---|---|
450.HASH.js gzip | 179 B | 179 B | ✓ |
framework-HASH.js gzip | 42.2 kB | 42.2 kB | ✓ |
main-HASH.js gzip | 27.7 kB | 27.7 kB | ✓ |
webpack-HASH.js gzip | 1.45 kB | 1.45 kB | |
Overall change | 71.5 kB | 71.5 kB |
Legacy Client Bundles (polyfills)
vercel/next.js canary | vercel/next.js url-imports/css-url | Change | |
---|---|---|---|
polyfills-a4..dd70.js gzip | 31 kB | 31 kB | ✓ |
Overall change | 31 kB | 31 kB | ✓ |
Client Pages Overall decrease ✓
vercel/next.js canary | vercel/next.js url-imports/css-url | Change | |
---|---|---|---|
_app-HASH.js gzip | 1.23 kB | 1.23 kB | ✓ |
_error-HASH.js gzip | 194 B | 194 B | ✓ |
amp-HASH.js gzip | 312 B | 312 B | ✓ |
css-HASH.js gzip | 327 B | 327 B | ✓ |
dynamic-HASH.js gzip | 2.38 kB | 2.38 kB | ✓ |
head-HASH.js gzip | 350 B | 350 B | ✓ |
hooks-HASH.js gzip | 635 B | 635 B | ✓ |
image-HASH.js gzip | 4.44 kB | 4.44 kB | ✓ |
index-HASH.js gzip | 263 B | 263 B | ✓ |
link-HASH.js gzip | 1.87 kB | 1.87 kB | ✓ |
routerDirect..HASH.js gzip | 321 B | 321 B | ✓ |
script-HASH.js gzip | 383 B | 383 B | ✓ |
withRouter-HASH.js gzip | 318 B | 318 B | ✓ |
9a34b27eb3f9..27d.css gzip | 125 B | N/A | N/A |
334f979574ae..6f4.css gzip | N/A | 106 B | N/A |
Overall change | 13.2 kB | 13.1 kB | -19 B |
Client Build Manifests
vercel/next.js canary | vercel/next.js url-imports/css-url | Change | |
---|---|---|---|
_buildManifest.js gzip | 459 B | 459 B | ✓ |
Overall change | 459 B | 459 B | ✓ |
Rendered Page Sizes Overall decrease ✓
vercel/next.js canary | vercel/next.js url-imports/css-url | Change | |
---|---|---|---|
index.html gzip | 535 B | 534 B | -1 B |
link.html gzip | 547 B | 546 B | -1 B |
withRouter.html gzip | 528 B | 527 B | -1 B |
Overall change | 1.61 kB | 1.61 kB | -3 B |
Diffs
Diff for _buildManifest.js
@@ -4,7 +4,7 @@ self.__BUILD_MANIFEST = {
"/_error": ["static\u002Fchunks\u002Fpages\u002F_error-97db2c91e74bb63f.js"],
"/amp": ["static\u002Fchunks\u002Fpages\u002Famp-8c7b17a56b7abb6e.js"],
"/css": [
- "static\u002Fcss\u002Fb05d9375ec06fe1b.css",
+ "static\u002Fcss\u002F7edf9ee7c3885268.css",
"static\u002Fchunks\u002Fpages\u002Fcss-99ad492aad2c14e4.js"
],
"/dynamic": [
Diff for webpack-HASH.js
@@ -171,7 +171,7 @@
/******/ // This function allow to reference all chunks
/******/ __webpack_require__.miniCssF = function(chunkId) {
/******/ // return url for filenames based on template
- /******/ return "static/css/" + "b05d9375ec06fe1b" + ".css";
+ /******/ return "static/css/" + "7edf9ee7c3885268" + ".css";
/******/
};
/******/
Diff for 7edf9ee7c3885268.css
@@ -0,0 +1,4 @@
+.css_helloWorld__2Fhmt {
+ color: green;
+ background: url(/_next/static/media/nextjs.cae0b805.png);
+}
Diff for b05d9375ec06fe1b.css
deleted
Diff for index.html
@@ -11,7 +11,7 @@
src="/_next/static/chunks/polyfills-a40ef1678bae11e696dba45124eadd70.js"
></script>
<script
- src="/_next/static/chunks/webpack-020dd12211ca2daa.js"
+ src="/_next/static/chunks/webpack-43980cc4f59eb55b.js"
defer=""
></script>
<script
Diff for link.html
@@ -11,7 +11,7 @@
src="/_next/static/chunks/polyfills-a40ef1678bae11e696dba45124eadd70.js"
></script>
<script
- src="/_next/static/chunks/webpack-020dd12211ca2daa.js"
+ src="/_next/static/chunks/webpack-43980cc4f59eb55b.js"
defer=""
></script>
<script
Diff for withRouter.html
@@ -11,7 +11,7 @@
src="/_next/static/chunks/polyfills-a40ef1678bae11e696dba45124eadd70.js"
></script>
<script
- src="/_next/static/chunks/webpack-020dd12211ca2daa.js"
+ src="/_next/static/chunks/webpack-43980cc4f59eb55b.js"
defer=""
></script>
<script
Default Build with SWC (Increase detected ⚠️ )
General Overall decrease ✓
vercel/next.js canary | vercel/next.js url-imports/css-url | Change | |
---|---|---|---|
buildDuration | 18.4s | 17.9s | -437ms |
buildDurationCached | 4.2s | 4.3s | |
nodeModulesSize | 196 MB | 196 MB | -4.04 kB |
Page Load Tests Overall increase ✓
vercel/next.js canary | vercel/next.js url-imports/css-url | Change | |
---|---|---|---|
/ failed reqs | 0 | 0 | ✓ |
/ total time (seconds) | 3.775 | 3.796 | |
/ avg req/sec | 662.19 | 658.62 | |
/error-in-render failed reqs | 0 | 0 | ✓ |
/error-in-render total time (seconds) | 1.979 | 1.898 | -0.08 |
/error-in-render avg req/sec | 1263.19 | 1317.25 | +54.06 |
Client Bundles (main, webpack, commons) Overall increase ⚠️
vercel/next.js canary | vercel/next.js url-imports/css-url | Change | |
---|---|---|---|
450.HASH.js gzip | 179 B | 179 B | ✓ |
framework-HASH.js gzip | 42.2 kB | 42.2 kB | ✓ |
main-HASH.js gzip | 27.8 kB | 27.8 kB | ✓ |
webpack-HASH.js gzip | 1.43 kB | 1.43 kB | |
Overall change | 71.6 kB | 71.6 kB |
Legacy Client Bundles (polyfills)
vercel/next.js canary | vercel/next.js url-imports/css-url | Change | |
---|---|---|---|
polyfills-a4..dd70.js gzip | 31 kB | 31 kB | ✓ |
Overall change | 31 kB | 31 kB | ✓ |
Client Pages Overall decrease ✓
vercel/next.js canary | vercel/next.js url-imports/css-url | Change | |
---|---|---|---|
_app-HASH.js gzip | 1.22 kB | 1.22 kB | ✓ |
_error-HASH.js gzip | 180 B | 180 B | ✓ |
amp-HASH.js gzip | 305 B | 305 B | ✓ |
css-HASH.js gzip | 321 B | 321 B | ✓ |
dynamic-HASH.js gzip | 2.38 kB | 2.38 kB | ✓ |
head-HASH.js gzip | 342 B | 342 B | ✓ |
hooks-HASH.js gzip | 621 B | 621 B | ✓ |
image-HASH.js gzip | 4.46 kB | 4.46 kB | ✓ |
index-HASH.js gzip | 256 B | 256 B | ✓ |
link-HASH.js gzip | 1.9 kB | 1.9 kB | ✓ |
routerDirect..HASH.js gzip | 314 B | 314 B | ✓ |
script-HASH.js gzip | 375 B | 375 B | ✓ |
withRouter-HASH.js gzip | 309 B | 309 B | ✓ |
9a34b27eb3f9..27d.css gzip | 125 B | N/A | N/A |
334f979574ae..6f4.css gzip | N/A | 106 B | N/A |
Overall change | 13.1 kB | 13.1 kB | -19 B |
Client Build Manifests
vercel/next.js canary | vercel/next.js url-imports/css-url | Change | |
---|---|---|---|
_buildManifest.js gzip | 459 B | 459 B | ✓ |
Overall change | 459 B | 459 B | ✓ |
Rendered Page Sizes Overall increase ⚠️
vercel/next.js canary | vercel/next.js url-imports/css-url | Change | |
---|---|---|---|
index.html gzip | 533 B | 533 B | ✓ |
link.html gzip | 546 B | 547 B | |
withRouter.html gzip | 527 B | 527 B | ✓ |
Overall change | 1.61 kB | 1.61 kB |
Diffs
Diff for _buildManifest.js
@@ -4,7 +4,7 @@ self.__BUILD_MANIFEST = {
"/_error": ["static\u002Fchunks\u002Fpages\u002F_error-97db2c91e74bb63f.js"],
"/amp": ["static\u002Fchunks\u002Fpages\u002Famp-8c7b17a56b7abb6e.js"],
"/css": [
- "static\u002Fcss\u002Fb05d9375ec06fe1b.css",
+ "static\u002Fcss\u002F7edf9ee7c3885268.css",
"static\u002Fchunks\u002Fpages\u002Fcss-99ad492aad2c14e4.js"
],
"/dynamic": [
Diff for webpack-HASH.js
@@ -171,7 +171,7 @@
/******/ // This function allow to reference all chunks
/******/ __webpack_require__.miniCssF = function(chunkId) {
/******/ // return url for filenames based on template
- /******/ return "static/css/" + "b05d9375ec06fe1b" + ".css";
+ /******/ return "static/css/" + "7edf9ee7c3885268" + ".css";
/******/
};
/******/
Diff for 7edf9ee7c3885268.css
@@ -0,0 +1,4 @@
+.css_helloWorld__2Fhmt {
+ color: green;
+ background: url(/_next/static/media/nextjs.cae0b805.png);
+}
Diff for b05d9375ec06fe1b.css
deleted
Diff for index.html
@@ -11,7 +11,7 @@
src="/_next/static/chunks/polyfills-a40ef1678bae11e696dba45124eadd70.js"
></script>
<script
- src="/_next/static/chunks/webpack-020dd12211ca2daa.js"
+ src="/_next/static/chunks/webpack-43980cc4f59eb55b.js"
defer=""
></script>
<script
Diff for link.html
@@ -11,7 +11,7 @@
src="/_next/static/chunks/polyfills-a40ef1678bae11e696dba45124eadd70.js"
></script>
<script
- src="/_next/static/chunks/webpack-020dd12211ca2daa.js"
+ src="/_next/static/chunks/webpack-43980cc4f59eb55b.js"
defer=""
></script>
<script
Diff for withRouter.html
@@ -11,7 +11,7 @@
src="/_next/static/chunks/polyfills-a40ef1678bae11e696dba45124eadd70.js"
></script>
<script
- src="/_next/static/chunks/webpack-020dd12211ca2daa.js"
+ src="/_next/static/chunks/webpack-43980cc4f59eb55b.js"
defer=""
></script>
<script
Failing test suitesCommit: 50e26f3 test/development/basic/hmr.test.ts
Expand output● basic HMR › Error Recovery › should recover from errors in the render function
● basic HMR › Error Recovery › should recover after a bad return from the render function
|
resolve absolute URLs in CSS when using urlImports
remove
[path]
from static static image output pathreplace file-loader with asset module, remove file-loader
Bug
fixes #number
contributing.md
Feature
fixes #number
contributing.md
Documentation / Examples
yarn lint