Create valid URLs in source map sources with Turbopack#75719
Create valid URLs in source map sources with Turbopack#75719
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. |
8749b6d to
a2fc316
Compare
f8960c2 to
b883440
Compare
sourcesa2fc316 to
918eb1a
Compare
5ec9f44 to
fe356cf
Compare
918eb1a to
8000180
Compare
Stats from current PRDefault Build (Increase detected
|
| vercel/next.js canary | vercel/next.js sebbie/02-05-valid_url_host_turbopack | Change | |
|---|---|---|---|
| buildDuration | 20.9s | 18.3s | N/A |
| buildDurationCached | 17.5s | 14.6s | N/A |
| nodeModulesSize | 393 MB | 393 MB | N/A |
| nextStartRea..uration (ms) | 450ms | 457ms | N/A |
Client Bundles (main, webpack)
| vercel/next.js canary | vercel/next.js sebbie/02-05-valid_url_host_turbopack | Change | |
|---|---|---|---|
| 5271-HASH.js gzip | 55.4 kB | 55.4 kB | N/A |
| 6228c9d4-HASH.js gzip | 56.9 kB | 56.9 kB | N/A |
| 7048.HASH.js gzip | 168 B | 168 B | ✓ |
| 8377-HASH.js gzip | 5.46 kB | 5.46 kB | N/A |
| framework-HASH.js gzip | 57.5 kB | 57.5 kB | N/A |
| main-app-HASH.js gzip | 245 B | 246 B | N/A |
| main-HASH.js gzip | 34.9 kB | 34.9 kB | N/A |
| webpack-HASH.js gzip | 1.71 kB | 1.71 kB | ✓ |
| Overall change | 1.88 kB | 1.88 kB | ✓ |
Legacy Client Bundles (polyfills)
| vercel/next.js canary | vercel/next.js sebbie/02-05-valid_url_host_turbopack | Change | |
|---|---|---|---|
| polyfills-HASH.js gzip | 39.4 kB | 39.4 kB | ✓ |
| Overall change | 39.4 kB | 39.4 kB | ✓ |
Client Pages
| vercel/next.js canary | vercel/next.js sebbie/02-05-valid_url_host_turbopack | Change | |
|---|---|---|---|
| _app-HASH.js gzip | 194 B | 194 B | ✓ |
| _error-HASH.js gzip | 193 B | 192 B | N/A |
| amp-HASH.js gzip | 513 B | 511 B | N/A |
| css-HASH.js gzip | 342 B | 342 B | ✓ |
| dynamic-HASH.js gzip | 1.84 kB | 1.84 kB | N/A |
| edge-ssr-HASH.js gzip | 265 B | 264 B | N/A |
| head-HASH.js gzip | 363 B | 360 B | N/A |
| hooks-HASH.js gzip | 393 B | 390 B | N/A |
| image-HASH.js gzip | 4.59 kB | 4.59 kB | N/A |
| index-HASH.js gzip | 268 B | 266 B | N/A |
| link-HASH.js gzip | 2.35 kB | 2.35 kB | ✓ |
| routerDirect..HASH.js gzip | 328 B | 326 B | N/A |
| script-HASH.js gzip | 397 B | 397 B | ✓ |
| withRouter-HASH.js gzip | 325 B | 325 B | ✓ |
| 1afbb74e6ecf..834.css gzip | 106 B | 106 B | ✓ |
| Overall change | 3.72 kB | 3.72 kB | ✓ |
Client Build Manifests
| vercel/next.js canary | vercel/next.js sebbie/02-05-valid_url_host_turbopack | Change | |
|---|---|---|---|
| _buildManifest.js gzip | 749 B | 747 B | N/A |
| Overall change | 0 B | 0 B | ✓ |
Rendered Page Sizes
| vercel/next.js canary | vercel/next.js sebbie/02-05-valid_url_host_turbopack | Change | |
|---|---|---|---|
| index.html gzip | 523 B | 523 B | ✓ |
| link.html gzip | 538 B | 537 B | N/A |
| withRouter.html gzip | 519 B | 518 B | N/A |
| Overall change | 523 B | 523 B | ✓ |
Edge SSR bundle Size
| vercel/next.js canary | vercel/next.js sebbie/02-05-valid_url_host_turbopack | Change | |
|---|---|---|---|
| edge-ssr.js gzip | 130 kB | 130 kB | N/A |
| page.js gzip | 214 kB | 214 kB | N/A |
| Overall change | 0 B | 0 B | ✓ |
Middleware size
| vercel/next.js canary | vercel/next.js sebbie/02-05-valid_url_host_turbopack | Change | |
|---|---|---|---|
| middleware-b..fest.js gzip | 677 B | 674 B | N/A |
| middleware-r..fest.js gzip | 155 B | 156 B | N/A |
| middleware.js gzip | 31.6 kB | 31.6 kB | N/A |
| edge-runtime..pack.js gzip | 844 B | 844 B | ✓ |
| Overall change | 844 B | 844 B | ✓ |
Next Runtimes
| vercel/next.js canary | vercel/next.js sebbie/02-05-valid_url_host_turbopack | Change | |
|---|---|---|---|
| app-page-exp...dev.js gzip | 395 kB | 395 kB | ✓ |
| app-page-exp..prod.js gzip | 133 kB | 133 kB | ✓ |
| app-page-tur..prod.js gzip | 145 kB | 145 kB | ✓ |
| app-page-tur..prod.js gzip | 141 kB | 141 kB | ✓ |
| app-page.run...dev.js gzip | 382 kB | 382 kB | ✓ |
| app-page.run..prod.js gzip | 129 kB | 129 kB | ✓ |
| app-route-ex...dev.js gzip | 39.4 kB | 39.4 kB | ✓ |
| app-route-ex..prod.js gzip | 25.7 kB | 25.7 kB | ✓ |
| app-route-tu..prod.js gzip | 25.7 kB | 25.7 kB | ✓ |
| app-route-tu..prod.js gzip | 25.5 kB | 25.5 kB | ✓ |
| app-route.ru...dev.js gzip | 41 kB | 41 kB | ✓ |
| app-route.ru..prod.js gzip | 25.5 kB | 25.5 kB | ✓ |
| dist_client_...dev.js gzip | 356 B | 356 B | ✓ |
| dist_client_...dev.js gzip | 349 B | 349 B | ✓ |
| pages-api-tu..prod.js gzip | 9.72 kB | 9.72 kB | ✓ |
| pages-api.ru...dev.js gzip | 11.8 kB | 11.8 kB | ✓ |
| pages-api.ru..prod.js gzip | 9.72 kB | 9.72 kB | ✓ |
| pages-turbo...prod.js gzip | 22 kB | 22 kB | ✓ |
| pages.runtim...dev.js gzip | 31.6 kB | 31.6 kB | ✓ |
| pages.runtim..prod.js gzip | 22 kB | 22 kB | ✓ |
| server.runti..prod.js gzip | 61.2 kB | 61.2 kB | ✓ |
| Overall change | 1.68 MB | 1.68 MB | ✓ |
build cache Overall increase ⚠️
| vercel/next.js canary | vercel/next.js sebbie/02-05-valid_url_host_turbopack | Change | |
|---|---|---|---|
| 0.pack gzip | 2.12 MB | 2.12 MB | |
| index.pack gzip | 77.5 kB | 75.8 kB | N/A |
| Overall change | 2.12 MB | 2.12 MB |
Diff details
Diff for 5271-HASH.js
Diff too large to display
Diff for main-HASH.js
Diff too large to display
8000180 to
5cdd87a
Compare
fe356cf to
36685d8
Compare
e0938af to
d34bdc0
Compare
36685d8 to
c003181
Compare
d34bdc0 to
221167b
Compare
Failing test suitesCommit: 176169f
Expand output● css-minify › production mode › should minify correctly by removing whitespace Read more about building and testing Next.js in contributing.md.
Expand output● app-dir - metadata-img-too-large twitter-image › should throw when twitter-image file size exceeds 5MB Read more about building and testing Next.js in contributing.md.
Expand output● Next.js Script - Primary Strategies - Strict Mode › priority beforeInteractive ● Next.js Script - Primary Strategies - Strict Mode › priority beforeInteractive - older version Read more about building and testing Next.js in contributing.md.
Expand output● SCSS Support ({"sass": "1.54.0"}) › Production only › CSS Compilation and Prefixing › should've compiled and prefixed ● SCSS Support ({"sass-embedded": "1.75.0"}) › Production only › CSS Compilation and Prefixing › should've compiled and prefixed Read more about building and testing Next.js in contributing.md.
Expand output● next/dynamic › Dynamic import › default behavior › should render dynamic import components ● next/dynamic › Dynamic import › default behavior › should render dynamic import components using a function as first parameter Read more about building and testing Next.js in contributing.md.
Expand output● app dir - css › sass support › error handling › should use original source points for sass errors Read more about building and testing Next.js in contributing.md.
Expand output● next/dynamic › Dynamic import › default behavior › should render dynamic import components ● next/dynamic › Dynamic import › default behavior › should render dynamic import components using a function as first parameter Read more about building and testing Next.js in contributing.md.
Expand output● app-dir - metadata-img-too-large opengraph-image › should throw when opengraph-image file size exceeds 8MB Read more about building and testing Next.js in contributing.md.
Expand output● use-cache-standalone-search-params › when searchParams are used inside of "use cache" › should show an error ● use-cache-standalone-search-params › when searchParams are used inside of "use cache" › should show an error Read more about building and testing Next.js in contributing.md. |
c3f6098 to
009bcaa
Compare
635be51 to
1aea268
Compare
|
Need to try |
1aea268 to
bcc6fcf
Compare
Tilde needs no escaping at all. `+` behaves differently between `encodeURI` and `encodeURIComponent` so we hit some (test) faults. Might really be just test issue but it indicates that using `+` would've caused breakage.
fdcbe5b to
1051a0e
Compare
1051a0e to
db00a83
Compare
|
Replacing with #76075 |

turbopack://[project]/->turbopack:///[project]/turbopack://[turbopack]->turbopack:///[turbopack]/turbopack://[next]->turbopack:///[next]/(don't actually know where this is coming from).Entries in
sourcesof a sourcemaps need to be valid relative or absolute URLs. The part after the protocol is considered the "host". If a host is encapsulated by square brackets, it is treated as an IPv6. That means that URLs liketurbopack://[project]are not valid sinceprojectis not a valid IPv6.Source map consumers are free to ignore invalid source URLs. However, it's also valid by spec for them to throw. Both Node.js and
source-mapchoose to throw while Chrome simply ignores the URL.So we need to make an effort to create valid URLs. Sourcemaps from 3rd party libraries can still be invalid which we handle since #75713.
I originally used
[project]->PROJECTbut then some places used the lowercase variant. This also meant we producedTURBOPACK_runtime.js. This seems sketchy to debug between case-sensitive (e.g. Ubuntu) and case-insensitive file systems (e.g. MacOS).<project>and|project|don't produce valid URLs either.%project%could work but I don't really trust this on Windows which could interpret it as a placeholder. No round brackets because(project)ends up in function names which Chrome has problems parsing in stackframes.{project}could work but curly braces are also unsafe characters and may need to be escaped.$is a safe character but breaks resolution of Client references in React (don't know if intentional).~doesn't require any encoding.Just using
projectseems like a nightmare to grep in the future.I mainly did pattern matching. I probably need some guidance for places I missed.
Closes https://linear.app/vercel/issue/NDX-795/