Closed theengineear closed 3 years ago
@codeStryke and @klebba — I updated this to match our current expectations. The test suite was update (and extended) to match.
Gonna merge since I doubt there will be any objection here. I made a note about the lines of code that might potentially be effected. They're easy to search for in a codebase.
Previously, we allowed these to be shared across all instances, it’s now only shared over time across the same instance.
Importantly, the same default value is used per-instance over and over again. Otherwise, you might unnecessarily cause additional computes when an upstream dependency gets a new default reference.
IMPORTANTLY, this means that if you wrote code like
default: () => () => (\* whatever *\)
, you need to change it todefault: () => (\* whatever *\)
. Previously, that's how you would make something per instance vs per constructor. I.e., whereas the functional syntax served as a reminder that you were setting something mutable, you now just cannot set a mutable default on the constructor at all.