So apparently it's impossible to reliably (and cheaply) detect proxies, which means there's no generic way to un-proxify an object recursively. What a mess.
Discussion
Is it NP-Hard?
Cc nostr:nprofile1qqsz52pcperj0srl30csqmmhd79yesv5r34uv3aamafgnly7uvwctwgpzdmhxue69uhhwmm59e6hg7r09ehkuef0zqz8vp
Is this a case where they over engineered the framework and forgot that developers might, every once in awhile use a third party library?
Yes, runes are designed to be used outside of components, which means they infect everything
I use mobx for proxy based reactivity, and I never had to worry about any of this, I can pass observable state anywhere I want without a thought, the only time I remember I am dealing with proxies is when I log proxy objects into the console, reactivity in mobx only happens when you wrap things in a autorun(), reaction() or a observer() (in case of a react component), proxies can also be disabled in mobx which is useful in some environments that don't support it, in that case it will default to Object.defineProperty hacks, don't know exactly
Yeah, the issue I'm running into is when saving events that have been infected with proxies to indexeddb. Proxies are "transparent", except when you try to clone them, in which case they crash the whole shebang 🤦♂️
I have faced this issue before, mobx exposes a toJS helper function for that, you might have to do a the classic JSON.parse(JSON.stringify()) thing
If you control the proxy code, you can. Otherwise, if it's just generic, no you can't. It's dumb and they are slow.
Try Purescript