next.js
01c7c850 - Freeze loaded manifests (#64313)

Commit
1 year ago
Freeze loaded manifests (#64313) Manifests in the runtime should be treated as immutable objects to ensure that side effects aren't created that depend on the mutability of these shared objects. Instead, mutable references should be used in places where this is desirable. This also introduces the new `DeepReadonly` utility type, which when paired with existing manifest types, will modify every field to be read only, ensuring that the type system will help catch accidental modifications to these loaded manifest values as well. Future work could eliminate these types by modifying the manifest types themselves to be read only, only allowing code that generated them to be writable. Closes NEXT-3069
Author
Committer
Parents
Loading