The goal is to have the "copy" removed from expandInstanceForEnv at some point.
workaround while investigating search-app
- added new method Y.mojito.util.deepFreeze
- for now: deepFreeze the instance, and return copy
@caridy Can you please review so that we can merge into search-perf ?
@imalberto why is this condition not good anymore? Assuming that all dependencies are "addons" is incorrect, because they could be anything. At least we need a guard for addons[addonName] before calling addons[addonName](command, adapter, ac).
addons[addonName](command, adapter, ac)
For now, if we are copying when cacheValue exists and also when returning after caching, we can remove the deepFreeze for now.
@imalberto do we need this after all? if yes, can you clean it?
I'll close this PR. deepFreeze cost is too high. Will handle the loading of ac.addons in a separate PR.