Commit Graph

2 Commits

Author SHA1 Message Date
Zack Tanner 85c3d20a91 [cache components]: move flag out of experimental (#85035)
This moves `experimental.cacheComponents` to a top level config. As part
of this, I disabled some tests in `build-output-prerender` that assert
on `cacheComponents` appearing in the experimental list. In a separate
PR, I'm going to show that Cache Components is enabled next to the
bundler info.

This also updates some docs pages to remove "experimental" language.
2025-10-18 14:13:44 -07:00
Josh Story a0e5996f0a [Cache Components] Allow sync IO inside console methods (#83843)
console methods may be patched to do things like add a timestamp to the
log row. While we can't determine the meaning of reading the current
time in arbitrary contexts we can know with reasonable certainty that
any sync IO inside a console method is not being used in the logical
output of the program. To account for this we can make a special
affordance for sync IO inside of these methods that allows them to run
without interrupting the prerender early.

To do this we patch these properties on the console global and set up a
wrapper in the setter. This wrapper will make any assigned function into
another function that exits the `workUnitAsyncStorage` scope before
executing the wrapped function. This will allow `new Date()` and other
sync IO APIs to be called in the internal implementation of these
methods without triggering an error while prerendering.

Fixes NAR-403
2025-09-18 08:23:56 -07:00