Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support deno #1717

Closed
Xuhv opened this issue Aug 2, 2024 · 0 comments
Closed

support deno #1717

Xuhv opened this issue Aug 2, 2024 · 0 comments

Comments

@Xuhv
Copy link

Xuhv commented Aug 2, 2024

🚀 Feature request

@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.

Object.getPrototypeOf has same behavior as __proto__ and good compatibility.

If this feaure is related to a problem you've noticed. Mention it as well

✅ Proposed solution or API

Please provide code snippets, gists, or links to the ideal design or API

klona/full has following code. In my local test, replacing x.__proto__ with Object.getPrototypeOf(x) is enough.

if (str === '[object Object]') {
	tmp = Object.create(x.__proto__ || null);
} else if (str === '[object Array]') {

↩️ Alternatives

What alternative solutions have you considered before making this request?

contribute to klona

📝 Additional Information

What resources (links, screenshots, etc.) do you have to assist this effort?

Some components like select has api(Collection) written in es6 class, klona can't clone it when running on deno because of __proto__.

@chakra-ui chakra-ui locked and limited conversation to collaborators Aug 2, 2024
@segunadebayo segunadebayo converted this issue into discussion #1719 Aug 2, 2024

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant