Skip to content

[dynamicIO] track import() outside of render#78512

Closed
lubieowoce wants to merge 5 commits into
graphite-base/78512from
lubieowoce/top-level-dynamic-import-cache-tracking
Closed

[dynamicIO] track import() outside of render#78512
lubieowoce wants to merge 5 commits into
graphite-base/78512from
lubieowoce/top-level-dynamic-import-cache-tracking

Conversation

@lubieowoce
Copy link
Copy Markdown
Member

@lubieowoce lubieowoce commented Apr 24, 2025

No description provided.

Copy link
Copy Markdown
Member Author

lubieowoce commented Apr 24, 2025

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.

@lubieowoce lubieowoce changed the title move shared types out of next-app-loader/index [dynamicIO] track import() outside of components Apr 24, 2025
@lubieowoce lubieowoce added the CI Bypass Graphite Optimization Ignore Graphite CI optimizations, run the full CI suite. https://graphite.dev/docs/stacking-and-ci label Apr 24, 2025
@lubieowoce lubieowoce force-pushed the lubieowoce/top-level-dynamic-import-cache-tracking branch from 766f45a to d2aff4b Compare April 24, 2025 15:57
@lubieowoce lubieowoce force-pushed the lubieowoce/dynamic-import-cache-tracking branch from 02aadc1 to 380082e Compare April 24, 2025 15:57
@ijjk
Copy link
Copy Markdown
Member

ijjk commented Apr 24, 2025

Failing test suites

Commit: 7879090

pnpm test-start-turbo test/e2e/app-dir/dynamic-io-dynamic-imports/dynamic-io-dynamic-imports.test.ts (turbopack)

  • async imports in dynamicIO > does not cause any routes to become (partially) dynamic
Expand output

● async imports in dynamicIO › does not cause any routes to become (partially) dynamic

expect(received).toMatchInlineSnapshot(snapshot)

Snapshot name: `async imports in dynamicIO does not cause any routes to become (partially) dynamic 1`

- Snapshot  - 0
+ Received  + 1

@@ -10,8 +10,9 @@
    "/inside-render/server/sync-module",
    "/outside-of-render/client/async-module",
    "/outside-of-render/client/sync-module",
    "/outside-of-render/server/async-module",
    "/outside-of-render/server/sync-module",
+   "/top-level-await-in-segment",
    "/top-level-await-in-segment/client",
    "/top-level-await-in-segment/server",
  ]

  39 |       }
  40 |
> 41 |       expect(prerenderedRoutes).toMatchInlineSnapshot(`
     |                                 ^
  42 |        [
  43 |          "/inside-render/client/async-module",
  44 |          "/inside-render/client/sync-module",

  at Object.toMatchInlineSnapshot (e2e/app-dir/dynamic-io-dynamic-imports/dynamic-io-dynamic-imports.test.ts:41:33)

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

pnpm test-start test/e2e/app-dir/segment-cache/basic/segment-cache-basic.test.ts

  • segment cache (basic tests) > navigate to page with lazily-generated (not at build time) static param
Expand output

● segment cache (basic tests) › navigate to page with lazily-generated (not at build time) static param

Expected a response containing the given string:

target-page-with-lazily-generated-param

  104 |     // Reveal the link to trigger a prefetch.
  105 |     const reveal = await browser.elementByCss('input[type="checkbox"]')
> 106 |     const link = await act(
      |                        ^
  107 |       async () => {
  108 |         await reveal.click()
  109 |         return await browser.elementByCss('a')

  at Object.act (e2e/app-dir/segment-cache/basic/segment-cache-basic.test.ts:106:24)

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

pnpm test-dev test/e2e/app-dir/back-forward-cache/back-forward-cache.test.ts

  • back/forward cache > bfcache only preserves up to N entries
Expand output

● back/forward cache › bfcache only preserves up to N entries

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

Expected: "Count: 0"
Received: "Count: 2"

  158 |     const counterDisplay1AfterNav =
  159 |       await browser.elementById('counter-display-1')
> 160 |     expect(await counterDisplay1AfterNav.text()).toBe('Count: 0')
      |                                                  ^
  161 |   })
  162 |
  163 |   it('navigate back and forth repeatedly between the same pages without evicting', async () => {

  at Object.toBe (e2e/app-dir/back-forward-cache/back-forward-cache.test.ts:160:50)

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

pnpm test-start test/e2e/app-dir/segment-cache/revalidation/segment-cache-revalidation.test.ts

  • segment cache (revalidation) > evict client cache when Server Action calls revalidatePath
  • segment cache (revalidation) > refetch visible Form components after cache is revalidated
  • segment cache (revalidation) > call router.prefetch(..., {onInvalidate}) after cache is revalidated
  • segment cache (revalidation) > evict client cache when Server Action calls revalidateTag
Expand output

● segment cache (revalidation) › evict client cache when Server Action calls revalidatePath

Expected a response containing the given string:

random-greeting [1]

  75 |     // corresponding entry to be evicted from the client cache, and a new
  76 |     // prefetch to be requested.
> 77 |     await act(
     |           ^
  78 |       async () => {
  79 |         const revalidateByPath = await browser.elementById('revalidate-by-path')
  80 |         await revalidateByPath.click()

  at Object.act (e2e/app-dir/segment-cache/revalidation/segment-cache-revalidation.test.ts:77:11)

● segment cache (revalidation) › refetch visible Form components after cache is revalidated

Expected a response containing the given string:

random-greeting

  114 |
  115 |     // Reveal the form that points to the target page to trigger a prefetch
> 116 |     await act(
      |           ^
  117 |       async () => {
  118 |         await formVisibilityToggle.click()
  119 |       },

  at Object.act (e2e/app-dir/segment-cache/revalidation/segment-cache-revalidation.test.ts:116:11)

● segment cache (revalidation) › call router.prefetch(..., {onInvalidate}) after cache is revalidated

Expected a response containing the given string:

random-greeting

  167 |
  168 |     // Reveal the link that points to the target page to trigger a prefetch
> 169 |     await act(
      |           ^
  170 |       async () => {
  171 |         await linkVisibilityToggle.click()
  172 |       },

  at Object.act (e2e/app-dir/segment-cache/revalidation/segment-cache-revalidation.test.ts:169:11)

● segment cache (revalidation) › evict client cache when Server Action calls revalidateTag

Expected a response containing the given string:

random-greeting

  214 |
  215 |     // Reveal the link the target page to trigger a prefetch.
> 216 |     await act(
      |           ^
  217 |       async () => {
  218 |         await linkVisibilityToggle.click()
  219 |       },

  at Object.act (e2e/app-dir/segment-cache/revalidation/segment-cache-revalidation.test.ts:216:11)

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

@lubieowoce lubieowoce changed the base branch from lubieowoce/dynamic-import-cache-tracking to graphite-base/78512 April 25, 2025 01:55
@lubieowoce lubieowoce force-pushed the lubieowoce/top-level-dynamic-import-cache-tracking branch from d2aff4b to d753caa Compare April 25, 2025 03:24
@lubieowoce lubieowoce changed the base branch from graphite-base/78512 to lubieowoce/dynamic-import-cache-tracking April 25, 2025 03:24
@lubieowoce lubieowoce force-pushed the lubieowoce/dynamic-import-cache-tracking branch from 07925ec to b1aab47 Compare April 25, 2025 03:29
@lubieowoce lubieowoce force-pushed the lubieowoce/top-level-dynamic-import-cache-tracking branch 2 times, most recently from 0531ed9 to 66d8cea Compare April 25, 2025 12:57
@lubieowoce lubieowoce force-pushed the lubieowoce/dynamic-import-cache-tracking branch 2 times, most recently from 2c9a07f to 9a6d379 Compare April 25, 2025 14:04
@lubieowoce lubieowoce force-pushed the lubieowoce/top-level-dynamic-import-cache-tracking branch from 66d8cea to 2dd25f7 Compare April 25, 2025 14:04
@lubieowoce lubieowoce force-pushed the lubieowoce/dynamic-import-cache-tracking branch from 9a6d379 to 6103cbd Compare April 25, 2025 18:22
@lubieowoce lubieowoce force-pushed the lubieowoce/top-level-dynamic-import-cache-tracking branch 2 times, most recently from 921b310 to d406e1f Compare April 25, 2025 19:00
@lubieowoce lubieowoce force-pushed the lubieowoce/dynamic-import-cache-tracking branch 2 times, most recently from 81d2008 to 3d99624 Compare April 25, 2025 19:53
@lubieowoce lubieowoce force-pushed the lubieowoce/top-level-dynamic-import-cache-tracking branch 2 times, most recently from 0e24118 to 95dbdb0 Compare April 25, 2025 20:10
@lubieowoce lubieowoce force-pushed the lubieowoce/dynamic-import-cache-tracking branch from 3d99624 to 1cd26f8 Compare April 28, 2025 17:49
@lubieowoce lubieowoce force-pushed the lubieowoce/top-level-dynamic-import-cache-tracking branch from 95dbdb0 to 033c65b Compare April 28, 2025 17:49
@lubieowoce lubieowoce force-pushed the lubieowoce/dynamic-import-cache-tracking branch from 1cd26f8 to b5c55e7 Compare April 29, 2025 00:10
@lubieowoce lubieowoce force-pushed the lubieowoce/top-level-dynamic-import-cache-tracking branch 2 times, most recently from 93a61e7 to c77cfb1 Compare April 29, 2025 01:10
@lubieowoce lubieowoce force-pushed the lubieowoce/dynamic-import-cache-tracking branch from b5c55e7 to b190620 Compare April 29, 2025 01:10
@lubieowoce lubieowoce changed the title [dynamicIO] track import() outside of components [dynamicIO] track import() outside of render Apr 29, 2025
@lubieowoce lubieowoce force-pushed the lubieowoce/dynamic-import-cache-tracking branch from b190620 to 9caa528 Compare April 29, 2025 02:17
@lubieowoce lubieowoce force-pushed the lubieowoce/top-level-dynamic-import-cache-tracking branch from c77cfb1 to 8bf749a Compare April 29, 2025 02:17
@lubieowoce lubieowoce force-pushed the lubieowoce/top-level-dynamic-import-cache-tracking branch 4 times, most recently from 28f6648 to 029e54c Compare April 29, 2025 05:54
@lubieowoce lubieowoce force-pushed the lubieowoce/top-level-dynamic-import-cache-tracking branch from 029e54c to 7879090 Compare April 29, 2025 06:00
@lubieowoce lubieowoce changed the base branch from lubieowoce/dynamic-import-cache-tracking to graphite-base/78512 April 29, 2025 13:40
@lubieowoce
Copy link
Copy Markdown
Member Author

Folded into #74152.

@lubieowoce lubieowoce closed this Apr 29, 2025
@github-actions github-actions Bot locked as resolved and limited conversation to collaborators May 14, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

CI Bypass Graphite Optimization Ignore Graphite CI optimizations, run the full CI suite. https://graphite.dev/docs/stacking-and-ci created-by: Next.js team PRs by the Next.js team. locked tests type: next

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants