You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@zag-js/core use klona/full as structuredClone, but it uses __proto__ property which is not implemented in deno. It leads to some components not works with deno.
Replace __proto__ with Object.getPrototypeOf can be able to solve the problem.
🧱 Problem Statement / Justification
Please provide valid reason(s) why this should added
Some framework like remix can run on the deno and deno's framework fresh use preact, , so I think it would be beneficial to support deno.
This discussion was converted from issue #1717 on August 02, 2024 09:43.
Heading
Bold
Italic
Quote
Code
Link
Numbered list
Unordered list
Task list
Attach files
Mention
Reference
Menu
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
🚀 Feature request
@zag-js/core
useklona/full
as structuredClone, but it uses__proto__
property which is not implemented indeno
. It leads to some components not works with deno.Replace
__proto__
withObject.getPrototypeOf
can be able to solve the problem.🧱 Problem Statement / Justification
Some framework like remix can run on the deno and deno's framework fresh use preact, , so I think it would be beneficial to support deno.
Object.getPrototypeOf has same behavior as
__proto__
and good compatibility.✅ Proposed solution or API
klona/full
has following code. In my local test, replacingx.__proto__
withObject.getPrototypeOf(x)
is enough.↩️ Alternatives
contribute to klona
📝 Additional Information
Some components like select has api(Collection) written in es6 class,
klona
can't clone it when running on deno because of__proto__
.Beta Was this translation helpful? Give feedback.
All reactions