Open NullVoxPopuli opened 2 years ago
args is stable proxy for component instance, as I remember, kinda related: https://github.com/emberjs/ember.js/issues/19130, internals: https://github.com/glimmerjs/glimmer-vm/blob/master/packages/@glimmer/manager/lib/util/args-proxy.ts
Is that same code used for the HelperManager? components aren't involved here.
But also, does that mean, no matter how many times I update args, all args
are the same reference? If that's intended that's fine -- I can work around that :D
@NullVoxPopuli you could check how "captureRenderTree" function is working, because args is objects in result (not proxies)
how do I do that? I've never used captureRenderTree
-- also, how does that work if my reproduction tests don't use the DOM?
🐞 Describe the Bug
I have a resource implementation that passes the previous instance of a resource to the next instance of a resource, but the args are the same in both resources. My hunch is that there is either a bug in the HelperManager I've made, or I don't understand something about the HelperManager (maybe likely?).
🔬 Minimal Reproduction
Observe that:![image](https://user-images.githubusercontent.com/199018/134063729-b6c3fc02-84e7-4dfe-865d-fcc8db6d47b3.png)
😕 Actual Behavior
createCache's previous instance's args have the same values as the current instance's args.
The only work around I can think of is to consume all args eagerly in
createCache
and setargs
to a vanilla object, rather than the tracked proxy / thunk that args currently are.🤔 Expected Behavior
The previous instance's args are unchanged
🌍 Environment
➕ Additional Context