Skip to content

Use compilation.{emitAsset,updateAsset} api rather than mutating assets object - #75927

Merged
wbinnssmith merged 1 commit into
canaryfrom
wbinnssmith/build-manifest-webpack-api
Feb 12, 2025
Merged

Use compilation.{emitAsset,updateAsset} api rather than mutating assets object#75927
wbinnssmith merged 1 commit into
canaryfrom
wbinnssmith/build-manifest-webpack-api

Conversation

@wbinnssmith

@wbinnssmith wbinnssmith commented Feb 11, 2025

Copy link
Copy Markdown
Member

This uses the proper webpack apis for setting these assets instead of mutating the assets object. Rspack doesn’t seem to support the latter very well.

Closes PACK-3953

@ijjk ijjk added created-by: Turbopack team PRs by the Turbopack team. type: next labels Feb 11, 2025
@ijjk

ijjk commented Feb 11, 2025

Copy link
Copy Markdown
Member

Failing test suites

Commit: 1ea9d1d

pnpm test test/integration/amp-export-validation/test/index.test.js

  • AMP Validation on Export > production mode > should have shown errors during build
Expand output

● AMP Validation on Export › production mode › should have shown errors during build

expect(received).toMatch(expected)

Expected pattern: /error.*The mandatory attribute 'height' is missing in tag 'amp-video'\./
Received string:  "   Loading config from /root/actions-runner/_work/next.js/next.js/test/integration/amp-export-validation/next.config.js
   Loading config from /root/actions-runner/_work/next.js/next.js/test/integration/amp-export-validation/next.config.js
   ▲ Next.js 15.2.0-canary.53·
   Checking validity of types ...
   Creating an optimized production build ...
   Loading config from /root/actions-runner/_work/next.js/next.js/test/integration/amp-export-validation/next.config.js
   Loading config from /root/actions-runner/_work/next.js/next.js/test/integration/amp-export-validation/next.config.js
   Loading config from /root/actions-runner/_work/next.js/next.js/test/integration/amp-export-validation/next.config.js
 ✓ Compiled successfully
   Collecting page data ...
   Generating static pages (0/8) ...
   Generating static pages (2/8)··
 ⚠ Linting is disabled.
Error occurred prerendering page \"/dog-cat\". Read more: https://nextjs.org/docs/messages/prerender-error
AssertionError: Assertion failed: WebAssembly is uninitialized

  at new module$contents$goog$asserts_AssertionError (../evalmachine.<anonymous>:106:1695)
  at module$contents$goog$asserts_doAssertFailure (../evalmachine.<anonymous>:107:354)
  at goog.asserts.assertExists (../evalmachine.<anonymous>:109:142)
  at Object.module$contents$amp$validator_validateString [as validateString] (../evalmachine.<anonymous>:2663:108)
  at Validator.validateString (../packages/next/dist/compiled/amphtml-validator/index.js:1:20650)
  at validateAmp (../packages/next/dist/export/routes/pages.js:89:34)
  at async exportPagesPage (../packages/next/dist/export/routes/pages.js:106:13)
  at async Span.traceAsyncFn (../packages/next/dist/trace/trace.js:157:20)
  at async exportPage (../packages/next/dist/export/worker.js:358:18)
  Export encountered an error on /dog-cat, exiting the build.
   ⨯ Next.js build worker exited with code: 1 and signal: null
  "
  at Object.toMatch (integration/amp-export-validation/test/index.test.js:28:29)

Read more about building and testing Next.js in contributing.md.

pnpm test-dev-turbo test/development/acceptance/error-recovery.test.ts (turbopack)

  • ReactRefreshLogBox turbo > logbox: can recover from a syntax error without losing state
  • ReactRefreshLogBox turbo > logbox: can recover from a component error
  • ReactRefreshLogBox turbo > render error not shown right after syntax error
Expand output

● ReactRefreshLogBox turbo › logbox: can recover from a syntax error without losing state

TIMED OUT: /Count: 1/



undefined

  731 |
  732 |   if (hardError) {
> 733 |     throw new Error('TIMED OUT: ' + regex + '\n\n' + content + '\n\n' + lastErr)
      |           ^
  734 |   }
  735 |   return false
  736 | }

  at check (lib/next-test-utils.ts:733:11)
  at Object.<anonymous> (development/acceptance/error-recovery.test.ts:66:5)

● ReactRefreshLogBox turbo › logbox: can recover from a component error

expect(received).toBe(expected) // Object.is equality

Expected: true
Received: false

  218 |     )
  219 |
> 220 |     expect(didNotReload).toBe(true)
      |                          ^
  221 |     await session.assertNoRedbox()
  222 |     expect(
  223 |       await session.evaluate(() => document.querySelector('p').textContent)

  at Object.toBe (development/acceptance/error-recovery.test.ts:220:26)

● ReactRefreshLogBox turbo › render error not shown right after syntax error

Application is in inconsistent state: timeout.

  92 |             }
  93 |             if (status !== 'pending') {
> 94 |               throw new Error(
     |                     ^
  95 |                 `Application is in inconsistent state: ${status}.`
  96 |               )
  97 |             }

  at Object.patch (lib/development-sandbox.ts:94:21)
  at Object.<anonymous> (development/acceptance/error-recovery.test.ts:252:5)

Read more about building and testing Next.js in contributing.md.

__NEXT_EXPERIMENTAL_PPR=true pnpm test-dev test/e2e/app-dir/actions/app-action.test.ts (PPR)

  • app-dir action handling > should forward action request to a worker that contains the action handler (edge)
Expand output

● app-dir action handling › should forward action request to a worker that contains the action handler (edge)

page.waitForSelector: Timeout 60000ms exceeded.
Call log:
  - waiting for locator('#other-page')

  430 |     return this.chain(() => {
  431 |       return page
> 432 |         .waitForSelector(selector, { timeout, state: 'attached' })
      |          ^
  433 |         .then(async (el) => {
  434 |           // it seems selenium waits longer and tests rely on this behavior
  435 |           // so we wait for the load event fire before returning

  at waitForSelector (lib/browsers/playwright.ts:432:10)
  at e2e/app-dir/actions/app-action.test.ts:862:7
  at Proxy.chain (lib/browsers/base.ts:17:23)
  at Proxy.chain (lib/browsers/playwright.ts:430:17)
  at waitForElementByCss (e2e/app-dir/actions/app-action.test.ts:865:10)

Read more about building and testing Next.js in contributing.md.

@ijjk

ijjk commented Feb 11, 2025

Copy link
Copy Markdown
Member

Stats from current PR

Default Build (Increase detected ⚠️)
General Overall increase ⚠️
vercel/next.js canary vercel/next.js wbinnssmith/build-manifest-webpack-api Change
buildDuration 22.9s 20.6s N/A
buildDurationCached 19.7s 17.2s N/A
nodeModulesSize 393 MB 393 MB ⚠️ +5.81 kB
nextStartRea..uration (ms) 505ms 489ms N/A
Client Bundles (main, webpack)
vercel/next.js canary vercel/next.js wbinnssmith/build-manifest-webpack-api Change
5306-HASH.js gzip 55 kB 55 kB N/A
8276.HASH.js gzip 169 B 168 B N/A
8377-HASH.js gzip 5.46 kB 5.47 kB N/A
bccd1874-HASH.js gzip 53 kB 53 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.7 kB 34.7 kB N/A
webpack-HASH.js gzip 1.71 kB 1.71 kB N/A
Overall change 0 B 0 B
Legacy Client Bundles (polyfills)
vercel/next.js canary vercel/next.js wbinnssmith/build-manifest-webpack-api 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/build-manifest-webpack-api Change
_app-HASH.js gzip 193 B 193 B
_error-HASH.js gzip 193 B 193 B
amp-HASH.js gzip 512 B 510 B N/A
css-HASH.js gzip 343 B 342 B N/A
dynamic-HASH.js gzip 1.84 kB 1.84 kB
edge-ssr-HASH.js gzip 265 B 265 B
head-HASH.js gzip 363 B 362 B N/A
hooks-HASH.js gzip 393 B 392 B N/A
image-HASH.js gzip 4.59 kB 4.59 kB N/A
index-HASH.js gzip 268 B 268 B
link-HASH.js gzip 2.35 kB 2.35 kB N/A
routerDirect..HASH.js gzip 328 B 328 B
script-HASH.js gzip 397 B 397 B
withRouter-HASH.js gzip 323 B 326 B N/A
1afbb74e6ecf..834.css gzip 106 B 106 B
Overall change 3.59 kB 3.59 kB
Client Build Manifests
vercel/next.js canary vercel/next.js wbinnssmith/build-manifest-webpack-api Change
_buildManifest.js gzip 748 B 748 B
Overall change 748 B 748 B
Rendered Page Sizes
vercel/next.js canary vercel/next.js wbinnssmith/build-manifest-webpack-api Change
index.html gzip 523 B 523 B
link.html gzip 538 B 538 B
withRouter.html gzip 520 B 520 B
Overall change 1.58 kB 1.58 kB
Edge SSR bundle Size
vercel/next.js canary vercel/next.js wbinnssmith/build-manifest-webpack-api Change
edge-ssr.js gzip 130 kB 130 kB N/A
page.js gzip 211 kB 211 kB N/A
Overall change 0 B 0 B
Middleware size
vercel/next.js canary vercel/next.js wbinnssmith/build-manifest-webpack-api Change
middleware-b..fest.js gzip 676 B 670 B N/A
middleware-r..fest.js gzip 155 B 156 B N/A
middleware.js gzip 31.3 kB 31.3 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/build-manifest-webpack-api Change
app-page-exp...dev.js gzip 394 kB 394 kB
app-page-exp..prod.js gzip 132 kB 132 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.3 kB 39.3 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.4 kB 25.4 kB
app-route.ru...dev.js gzip 40.9 kB 40.9 kB
app-route.ru..prod.js gzip 25.4 kB 25.4 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.69 kB 9.69 kB
pages-api.ru...dev.js gzip 11.8 kB 11.8 kB
pages-api.ru..prod.js gzip 9.69 kB 9.69 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.1 kB 61.1 kB
Overall change 1.67 MB 1.67 MB
build cache Overall increase ⚠️
vercel/next.js canary vercel/next.js wbinnssmith/build-manifest-webpack-api Change
0.pack gzip 2.11 MB 2.11 MB ⚠️ +659 B
index.pack gzip 75 kB 75.4 kB ⚠️ +336 B
Overall change 2.19 MB 2.19 MB ⚠️ +995 B
Diff details
Diff for main-HASH.js

Diff too large to display

Commit: 1ea9d1d

@ijjk ijjk added the Font (next/font) Related to Next.js Font Optimization. label Feb 11, 2025
@wbinnssmith
wbinnssmith force-pushed the wbinnssmith/build-manifest-webpack-api branch 2 times, most recently from 1c347ea to 20c60dc Compare February 12, 2025 00:46
@wbinnssmith
wbinnssmith marked this pull request as ready for review February 12, 2025 00:53
…ssets` object

This uses the proper webpack apis for setting these assets instead of mutating the `assets` object. Rspack doesn’t seem to support the latter very well.
@wbinnssmith
wbinnssmith force-pushed the wbinnssmith/build-manifest-webpack-api branch from 20c60dc to 1ea9d1d Compare February 12, 2025 02:27
@wbinnssmith
wbinnssmith enabled auto-merge (squash) February 12, 2025 03:14
@wbinnssmith
wbinnssmith merged commit a90f0c9 into canary Feb 12, 2025
@wbinnssmith
wbinnssmith deleted the wbinnssmith/build-manifest-webpack-api branch February 12, 2025 17:32
@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Feb 27, 2025
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. Font (next/font) Related to Next.js Font Optimization. locked type: next

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants