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

refactor some of the font code #69146

Open
wants to merge 2 commits into
base: arlyon/attempt-fix-too-long-file
Choose a base branch
from

Conversation

arlyon
Copy link
Contributor

@arlyon arlyon commented Aug 21, 2024

Some basic refactors that I made while browsing the fonts code. No behavioral differences should be observed so existing tests suffice.

@ijjk ijjk added created-by: Turbopack team PRs by the Turbopack team. Font (next/font) Related to Next.js Font Optimization. Turbopack Related to Turbopack with Next.js. labels Aug 21, 2024
Copy link
Contributor Author

arlyon commented Aug 21, 2024

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @arlyon and the rest of your teammates on Graphite Graphite

@arlyon arlyon changed the title simplify font finding logic refactor some of the font code Aug 21, 2024
@arlyon arlyon marked this pull request as ready for review August 21, 2024 14:21
@ijjk
Copy link
Member

ijjk commented Aug 21, 2024

Stats from current PR

Default Build (Increase detected ⚠️)
General
vercel/next.js canary vercel/next.js arlyon/font-code-refactor Change
buildDuration 23.5s 23s N/A
buildDurationCached 11.4s 10.1s N/A
nodeModulesSize 356 MB 356 MB N/A
nextStartRea..uration (ms) 514ms 511ms N/A
Client Bundles (main, webpack)
vercel/next.js canary vercel/next.js arlyon/font-code-refactor Change
5496-HASH.js gzip 37.9 kB 37.9 kB N/A
5885.HASH.js gzip 169 B 169 B
9560-HASH.js gzip 5.2 kB 5.19 kB N/A
b9a693a6-HASH.js gzip 51.9 kB 51.9 kB N/A
framework-HASH.js gzip 56.7 kB 56.7 kB
main-app-HASH.js gzip 223 B 227 B N/A
main-HASH.js gzip 32.5 kB 32.5 kB N/A
webpack-HASH.js gzip 1.71 kB 1.71 kB N/A
Overall change 56.9 kB 56.9 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary vercel/next.js arlyon/font-code-refactor Change
polyfills-HASH.js gzip 31 kB 31 kB
Overall change 31 kB 31 kB
Client Pages
vercel/next.js canary vercel/next.js arlyon/font-code-refactor Change
_app-HASH.js gzip 193 B 193 B
_error-HASH.js gzip 192 B 191 B N/A
amp-HASH.js gzip 511 B 512 B N/A
css-HASH.js gzip 343 B 343 B
dynamic-HASH.js gzip 1.84 kB 1.84 kB
edge-ssr-HASH.js gzip 266 B 265 B N/A
head-HASH.js gzip 362 B 365 B N/A
hooks-HASH.js gzip 391 B 392 B N/A
image-HASH.js gzip 4.4 kB 4.39 kB N/A
index-HASH.js gzip 268 B 268 B
link-HASH.js gzip 2.81 kB 2.81 kB
routerDirect..HASH.js gzip 327 B 328 B N/A
script-HASH.js gzip 397 B 397 B
withRouter-HASH.js gzip 323 B 324 B N/A
1afbb74e6ecf..834.css gzip 106 B 106 B
Overall change 5.96 kB 5.96 kB
Client Build Manifests
vercel/next.js canary vercel/next.js arlyon/font-code-refactor Change
_buildManifest.js gzip 751 B 744 B N/A
Overall change 0 B 0 B
Rendered Page Sizes
vercel/next.js canary vercel/next.js arlyon/font-code-refactor Change
index.html gzip 520 B 523 B N/A
link.html gzip 535 B 537 B N/A
withRouter.html gzip 517 B 518 B N/A
Overall change 0 B 0 B
Edge SSR bundle Size
vercel/next.js canary vercel/next.js arlyon/font-code-refactor Change
edge-ssr.js gzip 128 kB 127 kB N/A
page.js gzip 173 kB 173 kB N/A
Overall change 0 B 0 B
Middleware size
vercel/next.js canary vercel/next.js arlyon/font-code-refactor Change
middleware-b..fest.js gzip 669 B 666 B N/A
middleware-r..fest.js gzip 155 B 156 B N/A
middleware.js gzip 29.7 kB 29.7 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 arlyon/font-code-refactor Change
928-experime...dev.js gzip 322 B 322 B
928.runtime.dev.js gzip 314 B 314 B
app-page-exp...dev.js gzip 309 kB 308 kB N/A
app-page-exp..prod.js gzip 122 kB 121 kB N/A
app-page-tur..prod.js gzip 135 kB 133 kB N/A
app-page-tur..prod.js gzip 130 kB 129 kB N/A
app-page.run...dev.js gzip 298 kB 298 kB N/A
app-page.run..prod.js gzip 118 kB 118 kB N/A
app-route-ex...dev.js gzip 30.7 kB 30.7 kB N/A
app-route-ex..prod.js gzip 20.7 kB 20.7 kB N/A
app-route-tu..prod.js gzip 20.7 kB 20.7 kB N/A
app-route-tu..prod.js gzip 20.5 kB 20.5 kB N/A
app-route.ru...dev.js gzip 32.4 kB 32.3 kB N/A
app-route.ru..prod.js gzip 20.5 kB 20.5 kB N/A
pages-api-tu..prod.js gzip 9.62 kB 9.62 kB
pages-api.ru...dev.js gzip 11.5 kB 11.5 kB
pages-api.ru..prod.js gzip 9.61 kB 9.61 kB
pages-turbo...prod.js gzip 21.6 kB 21.6 kB
pages.runtim...dev.js gzip 27.5 kB 27.5 kB
pages.runtim..prod.js gzip 21.6 kB 21.6 kB
server.runti..prod.js gzip 57 kB 56.8 kB N/A
Overall change 102 kB 102 kB
build cache Overall increase ⚠️
vercel/next.js canary vercel/next.js arlyon/font-code-refactor Change
0.pack gzip 1.49 MB 1.5 MB ⚠️ +4.54 kB
index.pack gzip 127 kB 127 kB N/A
Overall change 1.49 MB 1.5 MB ⚠️ +4.54 kB
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([
   [8358],
   {
-    /***/ 3428: /***/ (
+    /***/ 6324: /***/ (
       __unused_webpack_module,
       __unused_webpack_exports,
       __webpack_require__
@@ -9,7 +9,7 @@
       (window.__NEXT_P = window.__NEXT_P || []).push([
         "/image",
         function () {
-          return __webpack_require__(9007);
+          return __webpack_require__(4483);
         },
       ]);
       if (false) {
@@ -18,7 +18,7 @@
       /***/
     },
 
-    /***/ 8578: /***/ (module, exports, __webpack_require__) => {
+    /***/ 3156: /***/ (module, exports, __webpack_require__) => {
       "use strict";
       /* __next_internal_client_entry_do_not_use__  cjs */
       Object.defineProperty(exports, "__esModule", {
@@ -40,17 +40,17 @@
         __webpack_require__(671)
       );
       const _head = /*#__PURE__*/ _interop_require_default._(
-        __webpack_require__(5208)
+        __webpack_require__(9939)
       );
-      const _getimgprops = __webpack_require__(8580);
-      const _imageconfig = __webpack_require__(4446);
-      const _imageconfigcontextsharedruntime = __webpack_require__(1864);
-      const _warnonce = __webpack_require__(3787);
-      const _routercontextsharedruntime = __webpack_require__(6758);
+      const _getimgprops = __webpack_require__(4422);
+      const _imageconfig = __webpack_require__(1573);
+      const _imageconfigcontextsharedruntime = __webpack_require__(5345);
+      const _warnonce = __webpack_require__(447);
+      const _routercontextsharedruntime = __webpack_require__(9420);
       const _imageloader = /*#__PURE__*/ _interop_require_default._(
-        __webpack_require__(842)
+        __webpack_require__(2949)
       );
-      const _usemergedref = __webpack_require__(3435);
+      const _usemergedref = __webpack_require__(8863);
       // This is replaced by webpack define plugin
       const configEnv = {
         deviceSizes: [640, 750, 828, 1080, 1200, 1920, 2048, 3840],
@@ -371,7 +371,7 @@
       /***/
     },
 
-    /***/ 3435: /***/ (module, exports, __webpack_require__) => {
+    /***/ 8863: /***/ (module, exports, __webpack_require__) => {
       "use strict";
 
       Object.defineProperty(exports, "__esModule", {
@@ -440,7 +440,7 @@
       /***/
     },
 
-    /***/ 8580: /***/ (
+    /***/ 4422: /***/ (
       __unused_webpack_module,
       exports,
       __webpack_require__
@@ -456,9 +456,9 @@
           return getImgProps;
         },
       });
-      const _warnonce = __webpack_require__(3787);
-      const _imageblursvg = __webpack_require__(5112);
-      const _imageconfig = __webpack_require__(4446);
+      const _warnonce = __webpack_require__(447);
+      const _imageblursvg = __webpack_require__(7821);
+      const _imageconfig = __webpack_require__(1573);
       const VALID_LOADING_VALUES =
         /* unused pure expression or super */ null && [
           "lazy",
@@ -830,7 +830,7 @@
       /***/
     },
 
-    /***/ 5112: /***/ (__unused_webpack_module, exports) => {
+    /***/ 7821: /***/ (__unused_webpack_module, exports) => {
       "use strict";
       /**
        * A shared function, used on both client and server, to generate a SVG blur placeholder.
@@ -885,7 +885,7 @@
       /***/
     },
 
-    /***/ 7735: /***/ (
+    /***/ 4563: /***/ (
       __unused_webpack_module,
       exports,
       __webpack_require__
@@ -912,10 +912,10 @@
         },
       });
       const _interop_require_default = __webpack_require__(4345);
-      const _getimgprops = __webpack_require__(8580);
-      const _imagecomponent = __webpack_require__(8578);
+      const _getimgprops = __webpack_require__(4422);
+      const _imagecomponent = __webpack_require__(3156);
       const _imageloader = /*#__PURE__*/ _interop_require_default._(
-        __webpack_require__(842)
+        __webpack_require__(2949)
       );
       function getImageProps(imgProps) {
         const { props } = (0, _getimgprops.getImgProps)(imgProps, {
@@ -947,7 +947,7 @@
       /***/
     },
 
-    /***/ 842: /***/ (__unused_webpack_module, exports) => {
+    /***/ 2949: /***/ (__unused_webpack_module, exports) => {
       "use strict";
 
       Object.defineProperty(exports, "__esModule", {
@@ -982,7 +982,7 @@
       /***/
     },
 
-    /***/ 9007: /***/ (
+    /***/ 4483: /***/ (
       __unused_webpack_module,
       __webpack_exports__,
       __webpack_require__
@@ -999,8 +999,8 @@
 
       // EXTERNAL MODULE: ./node_modules/.pnpm/react@19.0.0-rc-49496d49-20240814/node_modules/react/jsx-runtime.js
       var jsx_runtime = __webpack_require__(8436);
-      // EXTERNAL MODULE: ./node_modules/.pnpm/next@file+..+main-repo+packages+next+next-packed.tgz_react-dom@19.0.0-rc-49496d49-20240814_re_mwmfw6pwgc47m57syyu4ylsqkm/node_modules/next/image.js
-      var next_image = __webpack_require__(5519);
+      // EXTERNAL MODULE: ./node_modules/.pnpm/next@file+..+diff-repo+packages+next+next-packed.tgz_react-dom@19.0.0-rc-49496d49-20240814_re_q22c6uapaonmbfmq22amc326am/node_modules/next/image.js
+      var next_image = __webpack_require__(4);
       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",
@@ -1030,12 +1030,8 @@
       /***/
     },
 
-    /***/ 5519: /***/ (
-      module,
-      __unused_webpack_exports,
-      __webpack_require__
-    ) => {
-      module.exports = __webpack_require__(7735);
+    /***/ 4: /***/ (module, __unused_webpack_exports, __webpack_require__) => {
+      module.exports = __webpack_require__(4563);
 
       /***/
     },
@@ -1045,7 +1041,7 @@
     /******/ var __webpack_exec__ = (moduleId) =>
       __webpack_require__((__webpack_require__.s = moduleId));
     /******/ __webpack_require__.O(0, [2888, 9774, 179], () =>
-      __webpack_exec__(3428)
+      __webpack_exec__(6324)
     );
     /******/ var __webpack_exports__ = __webpack_require__.O();
     /******/ _N_E = __webpack_exports__;
Diff for 5496-HASH.js

Diff too large to display

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 server.runtime.prod.js

Diff too large to display

Commit: d4ce50f

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
created-by: Turbopack team PRs by the Turbopack team. Font (next/font) Related to Next.js Font Optimization. Turbopack Related to Turbopack with Next.js.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants