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

Turbopack: use file:// uris for server resources in development #71984

Merged
merged 1 commit into from
Nov 5, 2024

Conversation

wbinnssmith
Copy link
Member

@wbinnssmith wbinnssmith commented Oct 28, 2024

@ijjk ijjk added created-by: Turbopack team PRs by the Turbopack team. Turbopack Related to Turbopack with Next.js. labels Oct 28, 2024
@wbinnssmith wbinnssmith marked this pull request as draft October 28, 2024 17:34
@ijjk
Copy link
Member

ijjk commented Oct 28, 2024

Tests Passed

@ijjk
Copy link
Member

ijjk commented Oct 28, 2024

Stats from current PR

Default Build
General
vercel/next.js canary vercel/next.js wbinnssmith/server-file-urls Change
buildDuration 20.4s 20.8s ⚠️ +387ms
buildDurationCached 16.6s 14.5s N/A
nodeModulesSize 403 MB 403 MB N/A
nextStartRea..uration (ms) 473ms 466ms N/A
Client Bundles (main, webpack)
vercel/next.js canary vercel/next.js wbinnssmith/server-file-urls Change
3073-HASH.js gzip 45.4 kB 45.4 kB N/A
3898-HASH.js gzip 5.27 kB 5.27 kB N/A
7183.HASH.js gzip 169 B 169 B
b5cfd723-HASH.js gzip 52.5 kB 52.5 kB N/A
framework-HASH.js gzip 57.3 kB 57.3 kB N/A
main-app-HASH.js gzip 235 B 231 B N/A
main-HASH.js gzip 33.1 kB 33.1 kB N/A
webpack-HASH.js gzip 1.71 kB 1.71 kB N/A
Overall change 169 B 169 B
Legacy Client Bundles (polyfills)
vercel/next.js canary vercel/next.js wbinnssmith/server-file-urls 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 wbinnssmith/server-file-urls Change
_app-HASH.js gzip 193 B 193 B
_error-HASH.js gzip 192 B 192 B
amp-HASH.js gzip 513 B 508 B N/A
css-HASH.js gzip 343 B 343 B
dynamic-HASH.js gzip 1.85 kB 1.84 kB N/A
edge-ssr-HASH.js gzip 265 B 264 B N/A
head-HASH.js gzip 363 B 365 B N/A
hooks-HASH.js gzip 392 B 391 B N/A
image-HASH.js gzip 4.41 kB 4.41 kB
index-HASH.js gzip 268 B 268 B
link-HASH.js gzip 2.77 kB 2.77 kB N/A
routerDirect..HASH.js gzip 327 B 327 B
script-HASH.js gzip 396 B 394 B N/A
withRouter-HASH.js gzip 324 B 322 B N/A
1afbb74e6ecf..834.css gzip 106 B 106 B
Overall change 5.84 kB 5.84 kB
Client Build Manifests
vercel/next.js canary vercel/next.js wbinnssmith/server-file-urls Change
_buildManifest.js gzip 748 B 750 B N/A
Overall change 0 B 0 B
Rendered Page Sizes
vercel/next.js canary vercel/next.js wbinnssmith/server-file-urls Change
index.html gzip 524 B 524 B
link.html gzip 539 B 539 B
withRouter.html gzip 519 B 519 B
Overall change 1.58 kB 1.58 kB
Edge SSR bundle Size
vercel/next.js canary vercel/next.js wbinnssmith/server-file-urls Change
edge-ssr.js gzip 128 kB 128 kB N/A
page.js gzip 198 kB 189 kB N/A
Overall change 0 B 0 B
Middleware size
vercel/next.js canary vercel/next.js wbinnssmith/server-file-urls Change
middleware-b..fest.js gzip 668 B 667 B N/A
middleware-r..fest.js gzip 156 B 155 B N/A
middleware.js gzip 31 kB 31 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 wbinnssmith/server-file-urls Change
10-experimen...dev.js gzip 319 B N/A N/A
10.runtime.dev.js gzip 311 B N/A N/A
app-page-exp...dev.js gzip 318 kB 318 kB N/A
app-page-exp..prod.js gzip 123 kB 122 kB N/A
app-page-tur..prod.js gzip 136 kB 135 kB N/A
app-page-tur..prod.js gzip 131 kB 130 kB N/A
app-page.run...dev.js gzip 309 kB 309 kB N/A
app-page.run..prod.js gzip 119 kB 118 kB N/A
app-route-ex...dev.js gzip 35.9 kB 35.9 kB N/A
app-route-ex..prod.js gzip 24.4 kB 24.3 kB N/A
app-route-tu..prod.js gzip 24.4 kB 24.4 kB N/A
app-route-tu..prod.js gzip 24.2 kB 24.1 kB N/A
app-route.ru...dev.js gzip 37.5 kB 37.5 kB N/A
app-route.ru..prod.js gzip 24.2 kB 24.1 kB N/A
pages-api-tu..prod.js gzip 9.59 kB 9.59 kB
pages-api.ru...dev.js gzip 11.4 kB 11.4 kB
pages-api.ru..prod.js gzip 9.58 kB 9.58 kB
pages-turbo...prod.js gzip 20.9 kB 20.9 kB N/A
pages.runtim...dev.js gzip 26.5 kB 26.5 kB N/A
pages.runtim..prod.js gzip 20.9 kB 20.9 kB N/A
server.runti..prod.js gzip 915 kB 914 kB N/A
973-experime...dev.js gzip N/A 322 B N/A
973.runtime.dev.js gzip N/A 314 B N/A
Overall change 30.6 kB 30.6 kB
build cache
vercel/next.js canary vercel/next.js wbinnssmith/server-file-urls Change
0.pack gzip 2 MB 1.85 MB N/A
index.pack gzip 145 kB 144 kB N/A
Overall change 0 B 0 B
Diff details
Diff for page.js

Diff too large to display

Diff for middleware.js

Diff too large to display

Diff for edge-ssr.js

Diff too large to display

Diff for image-HASH.js
@@ -1,7 +1,7 @@
 (self["webpackChunk_N_E"] = self["webpackChunk_N_E"] || []).push([
-  [2983],
+  [8358],
   {
-    /***/ 8916: /***/ (
+    /***/ 8942: /***/ (
       __unused_webpack_module,
       __unused_webpack_exports,
       __webpack_require__
@@ -9,7 +9,7 @@
       (window.__NEXT_P = window.__NEXT_P || []).push([
         "/image",
         function () {
-          return __webpack_require__(4209);
+          return __webpack_require__(2864);
         },
       ]);
       if (false) {
@@ -18,7 +18,7 @@
       /***/
     },
 
-    /***/ 9265: /***/ (module, exports, __webpack_require__) => {
+    /***/ 1673: /***/ (module, exports, __webpack_require__) => {
       "use strict";
       /* __next_internal_client_entry_do_not_use__  cjs */
       Object.defineProperty(exports, "__esModule", {
@@ -30,27 +30,27 @@
           return Image;
         },
       });
-      const _interop_require_default = __webpack_require__(1739);
-      const _interop_require_wildcard = __webpack_require__(1474);
-      const _jsxruntime = __webpack_require__(7515);
+      const _interop_require_default = __webpack_require__(9608);
+      const _interop_require_wildcard = __webpack_require__(4856);
+      const _jsxruntime = __webpack_require__(2073);
       const _react = /*#__PURE__*/ _interop_require_wildcard._(
-        __webpack_require__(7611)
+        __webpack_require__(102)
       );
       const _reactdom = /*#__PURE__*/ _interop_require_default._(
-        __webpack_require__(9577)
+        __webpack_require__(8693)
       );
       const _head = /*#__PURE__*/ _interop_require_default._(
-        __webpack_require__(1436)
+        __webpack_require__(5838)
       );
-      const _getimgprops = __webpack_require__(8517);
-      const _imageconfig = __webpack_require__(2168);
-      const _imageconfigcontextsharedruntime = __webpack_require__(9202);
-      const _warnonce = __webpack_require__(6992);
-      const _routercontextsharedruntime = __webpack_require__(8155);
+      const _getimgprops = __webpack_require__(5726);
+      const _imageconfig = __webpack_require__(187);
+      const _imageconfigcontextsharedruntime = __webpack_require__(5786);
+      const _warnonce = __webpack_require__(3673);
+      const _routercontextsharedruntime = __webpack_require__(759);
       const _imageloader = /*#__PURE__*/ _interop_require_default._(
-        __webpack_require__(345)
+        __webpack_require__(2182)
       );
-      const _usemergedref = __webpack_require__(2806);
+      const _usemergedref = __webpack_require__(9363);
       // This is replaced by webpack define plugin
       const configEnv = {
         deviceSizes: [640, 750, 828, 1080, 1200, 1920, 2048, 3840],
@@ -371,7 +371,7 @@
       /***/
     },
 
-    /***/ 2806: /***/ (module, exports, __webpack_require__) => {
+    /***/ 9363: /***/ (module, exports, __webpack_require__) => {
       "use strict";
 
       Object.defineProperty(exports, "__esModule", {
@@ -383,7 +383,7 @@
           return useMergedRef;
         },
       });
-      const _react = __webpack_require__(7611);
+      const _react = __webpack_require__(102);
       function useMergedRef(refA, refB) {
         const cleanupA = (0, _react.useRef)(() => {});
         const cleanupB = (0, _react.useRef)(() => {});
@@ -432,7 +432,7 @@
       /***/
     },
 
-    /***/ 8517: /***/ (
+    /***/ 5726: /***/ (
       __unused_webpack_module,
       exports,
       __webpack_require__
@@ -448,9 +448,9 @@
           return getImgProps;
         },
       });
-      const _warnonce = __webpack_require__(6992);
-      const _imageblursvg = __webpack_require__(1692);
-      const _imageconfig = __webpack_require__(2168);
+      const _warnonce = __webpack_require__(3673);
+      const _imageblursvg = __webpack_require__(5499);
+      const _imageconfig = __webpack_require__(187);
       const VALID_LOADING_VALUES =
         /* unused pure expression or super */ null && [
           "lazy",
@@ -824,7 +824,7 @@
       /***/
     },
 
-    /***/ 1692: /***/ (__unused_webpack_module, exports) => {
+    /***/ 5499: /***/ (__unused_webpack_module, exports) => {
       "use strict";
       /**
        * A shared function, used on both client and server, to generate a SVG blur placeholder.
@@ -879,7 +879,7 @@
       /***/
     },
 
-    /***/ 4673: /***/ (
+    /***/ 6157: /***/ (
       __unused_webpack_module,
       exports,
       __webpack_require__
@@ -905,11 +905,11 @@
           return getImageProps;
         },
       });
-      const _interop_require_default = __webpack_require__(1739);
-      const _getimgprops = __webpack_require__(8517);
-      const _imagecomponent = __webpack_require__(9265);
+      const _interop_require_default = __webpack_require__(9608);
+      const _getimgprops = __webpack_require__(5726);
+      const _imagecomponent = __webpack_require__(1673);
       const _imageloader = /*#__PURE__*/ _interop_require_default._(
-        __webpack_require__(345)
+        __webpack_require__(2182)
       );
       function getImageProps(imgProps) {
         const { props } = (0, _getimgprops.getImgProps)(imgProps, {
@@ -941,7 +941,7 @@
       /***/
     },
 
-    /***/ 345: /***/ (__unused_webpack_module, exports) => {
+    /***/ 2182: /***/ (__unused_webpack_module, exports) => {
       "use strict";
 
       Object.defineProperty(exports, "__esModule", {
@@ -976,7 +976,7 @@
       /***/
     },
 
-    /***/ 4209: /***/ (
+    /***/ 2864: /***/ (
       __unused_webpack_module,
       __webpack_exports__,
       __webpack_require__
@@ -992,10 +992,10 @@
       });
 
       // EXTERNAL MODULE: ./node_modules/.pnpm/react@19.0.0-rc-7c8e5e7a-20241101/node_modules/react/jsx-runtime.js
-      var jsx_runtime = __webpack_require__(7515);
-      // EXTERNAL MODULE: ./node_modules/.pnpm/next@file+..+main-repo+packages+next+next-packed.tgz_react-dom@19.0.0-rc-7c8e5e7a-20241101_re_ngsqfltlxii45umrwe6rktuauy/node_modules/next/image.js
-      var next_image = __webpack_require__(7265);
-      var image_default = /*#__PURE__*/ __webpack_require__.n(next_image); // ./pages/nextjs.png
+      var jsx_runtime = __webpack_require__(2073);
+      // EXTERNAL MODULE: ./node_modules/.pnpm/next@file+..+diff-repo+packages+next+next-packed.tgz_react-dom@19.0.0-rc-7c8e5e7a-20241101_re_ay5jspqvpcpk5357qiimbatlya/node_modules/next/image.js
+      var next_image = __webpack_require__(9915);
+      var image_default = /*#__PURE__*/ __webpack_require__.n(next_image); // CONCATENATED MODULE: ./pages/nextjs.png
       /* harmony default export */ const nextjs = {
         src: "/_next/static/media/nextjs.cae0b805.png",
         height: 1347,
@@ -1004,7 +1004,7 @@
           "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAHCAMAAAACh/xsAAAAD1BMVEX////x8fH6+vrb29vo6Oh8o70bAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAH0lEQVR4nGNgwARMjIyMjCAGCzMzMwsTRISJCcRABwAEcAAkLCQfgAAAAABJRU5ErkJggg==",
         blurWidth: 8,
         blurHeight: 7,
-      }; // ./pages/image.js
+      }; // CONCATENATED MODULE: ./pages/image.js
       function ImagePage(props) {
         return /*#__PURE__*/ (0, jsx_runtime.jsxs)(jsx_runtime.Fragment, {
           children: [
@@ -1024,12 +1024,12 @@
       /***/
     },
 
-    /***/ 7265: /***/ (
+    /***/ 9915: /***/ (
       module,
       __unused_webpack_exports,
       __webpack_require__
     ) => {
-      module.exports = __webpack_require__(4673);
+      module.exports = __webpack_require__(6157);
 
       /***/
     },
@@ -1038,8 +1038,8 @@
     // webpackRuntimeModules
     /******/ var __webpack_exec__ = (moduleId) =>
       __webpack_require__((__webpack_require__.s = moduleId));
-    /******/ __webpack_require__.O(0, [636, 6593, 8792], () =>
-      __webpack_exec__(8916)
+    /******/ __webpack_require__.O(0, [2888, 9774, 179], () =>
+      __webpack_exec__(8942)
     );
     /******/ var __webpack_exports__ = __webpack_require__.O();
     /******/ _N_E = __webpack_exports__;
Diff for 3073-HASH.js

Diff too large to display

Diff for main-HASH.js

Diff too large to display

Diff for 10-experimen..ntime.dev.js
deleted
Diff for 10.runtime.dev.js
deleted
Diff for 973-experime..ntime.dev.js
@@ -0,0 +1,2 @@
+"use strict";exports.id=973,exports.ids=[973],exports.modules={"./dist/client/dev/noop-turbopack-hmr.js":(module,exports1)=>{function connect(){}Object.defineProperty(exports1,"__esModule",{value:!0}),Object.defineProperty(exports1,"connect",{enumerable:!0,get:function(){return connect}}),("function"==typeof exports1.default||"object"==typeof exports1.default&&null!==exports1.default)&&void 0===exports1.default.__esModule&&(Object.defineProperty(exports1.default,"__esModule",{value:!0}),Object.assign(exports1.default,exports1),module.exports=exports1.default)}};
+//# sourceMappingURL=973-experimental.runtime.dev.js.map
\ No newline at end of file
Diff for 973.runtime.dev.js
@@ -0,0 +1,2 @@
+"use strict";exports.id=973,exports.ids=[973],exports.modules={"./dist/client/dev/noop-turbopack-hmr.js":(module,exports1)=>{function connect(){}Object.defineProperty(exports1,"__esModule",{value:!0}),Object.defineProperty(exports1,"connect",{enumerable:!0,get:function(){return connect}}),("function"==typeof exports1.default||"object"==typeof exports1.default&&null!==exports1.default)&&void 0===exports1.default.__esModule&&(Object.defineProperty(exports1.default,"__esModule",{value:!0}),Object.assign(exports1.default,exports1),module.exports=exports1.default)}};
+//# sourceMappingURL=973.runtime.dev.js.map
\ No newline at end of file
Diff for app-page-exp..ntime.dev.js
failed to diff
Diff for app-page-exp..time.prod.js

Diff too large to display

Diff for app-page-tur..time.prod.js

Diff too large to display

Diff for app-page-tur..time.prod.js

Diff too large to display

Diff for app-page.runtime.dev.js
failed to diff
Diff for app-page.runtime.prod.js

Diff too large to display

Diff for app-route-ex..ntime.dev.js

Diff too large to display

Diff for app-route-ex..time.prod.js

Diff too large to display

Diff for app-route-tu..time.prod.js

Diff too large to display

Diff for app-route-tu..time.prod.js

Diff too large to display

Diff for app-route.runtime.dev.js

Diff too large to display

Diff for app-route.ru..time.prod.js

Diff too large to display

Diff for pages-turbo...time.prod.js

Diff too large to display

Diff for pages.runtime.dev.js

Diff too large to display

Diff for pages.runtime.prod.js

Diff too large to display

Diff for server.runtime.prod.js
failed to diff
Commit: cf20441

@wbinnssmith wbinnssmith force-pushed the wbinnssmith/server-file-urls branch from ea95183 to 5f665ed Compare October 28, 2024 18:32
@ijjk ijjk added the tests label Oct 28, 2024
@eps1lon
Copy link
Member

eps1lon commented Oct 28, 2024

If you stack it on top of #71940, you should have an easier time asserting in the correct stacks since it'll no longer show the full, absolute path.

@eps1lon
Copy link
Member

eps1lon commented Oct 28, 2024

or normalizing works as well for now.

@eps1lon
Copy link
Member

eps1lon commented Oct 28, 2024

Do all generated source maps now include the absolute paths or just the ones for dev?

@wbinnssmith wbinnssmith marked this pull request as ready for review October 28, 2024 19:51
@wbinnssmith wbinnssmith requested review from bgw, sokra and eps1lon and removed request for eps1lon October 28, 2024 19:51
@wbinnssmith
Copy link
Member Author

cc @sebmarkbage @eps1lon

@wbinnssmith
Copy link
Member Author

Do all generated source maps now include the absolute paths or just the ones for dev?

Just dev.

@wbinnssmith wbinnssmith force-pushed the wbinnssmith/server-file-urls branch from 5f665ed to e5da935 Compare October 28, 2024 23:28
@wbinnssmith wbinnssmith changed the base branch from canary to sebbie/10-27-clickable_stack_trace_links_in_logged_terminal_errors October 28, 2024 23:28
Comment on lines +34 to +46
'\nError: Boom' +
'\n at logError (app/rsc-error-log/page.js:2:16)' +
(isTurbopack
? '\n at Page (app/rsc-error-log/page.js:7:2)'
: // FIXME: Method name should be "Page"
'\n at logError (app/rsc-error-log/page.js:7:2)') +
'\n 1 | function logError() {' +
"\n> 2 | const error = new Error('Boom')" +
'\n | ^' +
'\n 3 | console.error(error)' +
'\n 4 | }' +
'\n 5 |' +
'\n'
Copy link
Member

Choose a reason for hiding this comment

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

So good

@eps1lon eps1lon force-pushed the sebbie/10-27-clickable_stack_trace_links_in_logged_terminal_errors branch from 9ccdf4b to e9e1eff Compare October 28, 2024 23:57
@wbinnssmith wbinnssmith force-pushed the wbinnssmith/server-file-urls branch 2 times, most recently from 902e496 to 0990dfe Compare October 29, 2024 00:07
@eps1lon eps1lon force-pushed the sebbie/10-27-clickable_stack_trace_links_in_logged_terminal_errors branch 2 times, most recently from 0737f9d to c8f7831 Compare October 29, 2024 09:58
@wbinnssmith wbinnssmith force-pushed the wbinnssmith/server-file-urls branch 2 times, most recently from 62665f3 to 19d9976 Compare October 29, 2024 17:25
@eps1lon eps1lon force-pushed the sebbie/10-27-clickable_stack_trace_links_in_logged_terminal_errors branch 2 times, most recently from c6bd19e to 9430f84 Compare November 1, 2024 10:03
@eps1lon eps1lon force-pushed the sebbie/10-27-clickable_stack_trace_links_in_logged_terminal_errors branch from 9430f84 to 679929a Compare November 1, 2024 14:57
Base automatically changed from sebbie/10-27-clickable_stack_trace_links_in_logged_terminal_errors to canary November 1, 2024 15:12
@eps1lon
Copy link
Member

eps1lon commented Nov 1, 2024

@wbinnssmith Landed the base now. Once you rebase, we should be able to land this.

@eps1lon eps1lon force-pushed the wbinnssmith/server-file-urls branch from 19d9976 to cf20441 Compare November 5, 2024 10:00
@wbinnssmith wbinnssmith merged commit 4746716 into canary Nov 5, 2024
107 checks passed
@wbinnssmith wbinnssmith deleted the wbinnssmith/server-file-urls branch November 5, 2024 17:31
stipsan pushed a commit to sanity-io/next.js that referenced this pull request Nov 6, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 20, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
created-by: Turbopack team PRs by the Turbopack team. locked tests Turbopack Related to Turbopack with Next.js. type: next
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants