rsnext/test
Zack Tanner 0312d4a1a9
fix revalidation issue with route handlers (#63213)
### What
When a route handler uses an API that opts it into dynamic rendering
(such as `no-store` on a fetch), and also specifies a `revalidate` time,
the `revalidate` time is ignored and route is treated as fully static.

### Why
`revalidate: 0` and `revalidate: false` have different semantic
meanings: `false` essentially means cache forever, whereas `0` means
it's dynamic. Since `0` is also falsey, the code we have to fallback
with a default `revalidate` value for route handlers is incorrectly not
marking the route as dynamic, and as a result, caching the route without
an expiration time.

### How
This updates the fallback handling for app routes respect a revalidation
value of `0`, so that the page can properly be marked dynamic.

### Test Explanation
This adds 2 new routes handlers: both have a revalidation time specified
& use `no-store` on a fetch, but only one of them specifies `export
const dynamic = 'force-static'`. The one that doesn't specify
`force-static` is correctly omitted from the prerender manifest. The one
that is `force-static` is correctly in the prerender manifest with the
right expiration time. An additional test case was added to verify that
this data refreshes after the specified interval.

Closes NEXT-2764
2024-03-12 15:57:36 -07:00
..
.stats-app chore: update pnpm version from 8.15.1 to 8.15.4 (#62979) 2024-03-07 09:22:45 +00:00
development feat(next-core): apply invalid import assertion on the remaining contexts (#63146) 2024-03-12 11:12:07 -07:00
e2e fix revalidation issue with route handlers (#63213) 2024-03-12 15:57:36 -07:00
examples feat(cli): introduce --tailwind flag (#46927) 2023-03-16 16:06:27 +01:00
integration Switch to .cjs PostCSS config (#58380) 2024-03-11 14:19:50 -07:00
lib Turbopack: sass support (#62717) 2024-03-04 11:56:55 +00:00
production fix(log): improve error when dynamic code eval is disallowed (#62999) 2024-03-12 23:31:32 +01:00
unit feat(eslint): enhance no-unwanted-polyfill w/ new endpoints (#62719) 2024-03-06 16:42:53 +00:00
.gitignore ci(workflow): enable test trace upload (#51107) 2023-06-12 17:14:13 +00:00
build-turbopack-tests-manifest.d.ts Update Turbopack test manifest from GitHub Actions artifact (#58394) 2023-11-24 16:48:12 +01:00
build-turbopack-tests-manifest.js tests are no longer flaky (#62278) 2024-02-20 14:44:11 +01:00
get-test-filter.js run tests from test suite that are not listed in the manifest (#58401) 2024-01-11 07:38:35 +00:00
jest-setup-after-env.ts Decrease default test timeouts (#56116) 2023-09-27 23:55:20 +00:00
ppr-tests-manifest.json Renew prefetch cache entry after update from server (#61573) 2024-02-20 09:07:18 -08:00
readme.md
test-file.txt
tsconfig.json chore: extends from shared base tsconfig (#59776) 2023-12-19 18:52:22 +01:00
turbopack-tests-manifest.json add support for assets in edge (#63209) 2024-03-12 21:37:16 +00:00

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