rsnext/test
Zack Tanner 2fbdac6f82
fix prefetch bailout detection for nested loading segments (#67358)
### What
When PPR is off, app router prefetches will render the component tree up
until it encounters a `loading` segment, at which point it'll just
return some metadata about the segment and won't do any further
rendering. This is an optimization to ensure prefetches are lightweight
and don't potentially invoke expensive dynamic subtrees. However,
there's a bug in this logic that is causing it to bail unexpectedly if a
segment deeper in the tree contained a `loading.js` file.

This would mean the loading state wouldn't be triggered until the second
request for the full RSC data is initiated, resulting in an unintended
delta between when a link is clicked and the loading state is shown.

### Why
The `shouldSkipComponentTree` flag was incorrectly being set to `true`
even if the `loading.js` segment appeared deeper in the tree. Prefetch
requests from the client will always contain `FlightRouterState`, so the
logic to check for loading deeper in the tree will always be missed.


### How
This removes the `flightRouterState` check as it doesn't make sense:
prefetches will currently _always_ include the `flightRouterState`,
causing this to always short-circuit. I believe that this check is
vestigial from when we were generating static `prefetch.rsc` outputs
which is no longer the case.

This mirrors a [similar
check](b87d8fc499/packages/next/src/server/app-render/create-component-tree.tsx (L393))
when determining if parallel route(s) should be rendered.
2024-07-01 16:11:09 -07:00
..
.stats-app chore: update pnpm to 9.4.0 (#64945) 2024-06-28 04:41:35 -07:00
development Test that nonlatin characters don’t cause hard reloads in hmr (#67077) 2024-06-26 11:05:26 -07:00
e2e fix prefetch bailout detection for nested loading segments (#67358) 2024-07-01 16:11:09 -07:00
examples Replace createNextDescribe with nextTestSetup (#64817) 2024-04-25 12:06:12 -06:00
integration fix(next/image): undo tight coupling between priority=true and fetchPriority=high (#67351) 2024-07-01 14:42:42 -04:00
lib Replace hasRedbox() (#67025) 2024-06-20 10:37:32 +02:00
production Ensure required-server-files test can exit cleanly (#66765) 2024-07-02 00:05:28 +02:00
unit fix(next/image): undo tight coupling between priority=true and fetchPriority=high (#67351) 2024-07-01 14:42:42 -04:00
.gitignore ci(workflow): enable test trace upload (#51107) 2023-06-12 17:14:13 +00:00
build-turbopack-build-tests-manifest.js Ensure production integration test results are uploaded (#63706) 2024-03-26 10:41:16 +01:00
build-turbopack-dev-tests-manifest.js Rename turbopack-tests-manifest to turbopack-dev-tests-manifest (#63409) 2024-03-19 10:26:14 +01:00
build-turbopack-tests-manifest.d.ts Update Turbopack test manifest from GitHub Actions artifact (#58394) 2023-11-24 16:48:12 +01:00
deploy-tests-manifest.json Fix noindex is missing on static not-found page (#67135) 2024-06-23 21:56:08 +02:00
get-test-filter.js fix e2e deployment test action (#66721) 2024-06-11 20:59:43 +00:00
jest-setup-after-env.ts Decrease default test timeouts (#56116) 2023-09-27 23:55:20 +00:00
ppr-tests-manifest.json Add timeout/retry handling for fetch cache (#66652) 2024-06-10 11:34:36 -07:00
readme.md
related-tests-manifest.json Reapply "chore(test): run related E2E deploy tests on PRs" (#64682) (#64712) 2024-04-19 11:02:43 +02:00
test-file.txt
turbopack-build-tests-manifest.json Ensure required-server-files test can exit cleanly (#66765) 2024-07-02 00:05:28 +02:00
turbopack-dev-examples-manifest.json Fix last examples for Turbopack (#64020) 2024-04-03 16:02:52 +02:00
turbopack-dev-tests-manifest.json Update Turbopack development test manifest (#67093) 2024-06-21 10:27:34 +02:00

See Testing for more information on how you can run/write/debug tests for Next.js.