rsnext/test/e2e/app-dir/not-found
Josh Story b5772b859a
Dynamic APIs (#60645)
formalizes the concept of dynamic APIs inside Next to allow for varying
semantics beyond just staticGenerationBailout.

### Dynamic APIs

#### `markCurrentScopeAsDynamic`
useful to bail out of default caching semantics but does not imply a
Request specific data source was read. critically, this semantic is
ignored if you are inside a cache scope

#### `trackDynamicDataAccessed`
Must be called before reading any data source that is derived from
Request specific data. Currently this is `cookies()`, `headers()`, and
`searchParams`. This kind of data access inside a cache scope is
forbidden (it always should have been, but now it will error).

#### `trackDynamicFetch`
This one is unideal but the complexity of patch-fetch's current
implementation necessitates it for now. Essentially it will postpone if
we are prerendering. Long term this should be eliminated with a refactor
of patch fetch.


### Other Improvements
Also removes the `staticGenerationBailout` implementation as it has been
replaced with more specific logic in the places it was previously being
used.

One area that has also been enhanced is the proxy for app-route modules.
Previously we proxied the Request every time however when we are doing
non-static generation executions we generally don't want the overhead of
wrapping the request. In the refactor here I also improved the runtime
performance by using static proxy handlers and I believe I also fixed a
few bugs related to `clone` and `url`

In general there has been a bit of refactoring to clarify how we should
handle various render/execution states and a reduction in implicit side
effects for proper execution.

Another callout to notice is that app-route modules do not attempt a
static generation if they are force-dynamic regardless of the PPR
setting. Previously the PPR setting would opt them into this code path
which is not necessary because PPR itself does not work for routes, only
pages.

Closes NEXT-2099
2024-01-23 16:06:12 -08:00
..
basic Dynamic APIs (#60645) 2024-01-23 16:06:12 -08:00
conflict-route Fix not-found rendering in production with edge (#53687) 2023-08-07 20:05:22 +00:00
css-precedence Ensure unique name for app dir css tests (#56088) 2023-09-27 18:38:01 +02:00
group-route Recover not found errors from flight data to render with proper boundary (#53703) 2023-08-12 08:41:47 +00:00
group-route-root-not-found Fix group routes custom root not-found (#54931) 2023-09-03 20:15:24 +00:00