next.js
a8d36ddb - Disallow `rootParams()` in `cache` scope (#75801)

Commit
1 year ago
Disallow `rootParams()` in `cache` scope (#75801) root params exposes request data and thus must be disallowed from caches unless the cache also implicitly keys the entries on the root params values. For now we will simply disallow this pattern. we will implement a strategy in the future which will allow root params to be called from inside a cache scope once we can sufficiently key the cache entries by the root params values read. The same problem will arise with variants in the future so we will eventually need to implement support The implementation removes rootParams from the workStore. This is an invitation to accidentally leak request data into cache scopes. Now rootParams are conveyed on the workUnitStore and the cache store types don't define it. closes NAR-89
Author
Parents
Loading