Skip to content
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

fix(types): fix handlers and attributes types #578

Merged
merged 5 commits into from
Mar 30, 2023

Conversation

Shyrro
Copy link
Contributor

@Shyrro Shyrro commented Mar 21, 2023

📝 Description

Add TS support for Svelte normalizer

⛳️ Current behavior (updates)

Current behavior returns errors on TS with the "attributes" and "handlers". This modifications aims to solve that.

🚀 New behavior

When using the svelte normalizer, we expect the return to be an object with "attributes" and "handlers" instead.

💣 Is this a breaking change (Yes/No):

No

@changeset-bot
Copy link

changeset-bot bot commented Mar 21, 2023

🦋 Changeset detected

Latest commit: 81a69af

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

💥 An error occurred when fetching the changed packages and changesets in this PR
Some errors occurred when validating the changesets config:
The package "svelte-ts" depends on the ignored package "@zag-js/shared", but "svelte-ts" is not being ignored. Please add "svelte-ts" to the `ignore` option.

@vercel
Copy link

vercel bot commented Mar 21, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
zag-nextjs ✅ Ready (Inspect) Visit Preview Mar 30, 2023 at 11:52AM (UTC)
zag-solid ✅ Ready (Inspect) Visit Preview Mar 30, 2023 at 11:52AM (UTC)
zag-vue ✅ Ready (Inspect) Visit Preview Mar 30, 2023 at 11:52AM (UTC)

@Shyrro
Copy link
Contributor Author

Shyrro commented Mar 25, 2023

Hey @segunadebayo !

Thanks for your feedback 🙏

I pushed a commit containing the changes asked. Let me know if i need to change something else. 😊

PS: with Abraham we noticed that attributes and handlers coming from the Svelte normalizer, are lightly typed compared to other frameworks. For example in react getRootProps will have the attributes returned by the normalize function(eg: "tabindex"), whereas in Svelte the attributes type will be Record<string, any>.
I am still looking for a way to improve this. Let me know if you want me to find a solution for this before moving on to the rest with Svelte. Thanks again 🙏

@Shyrro Shyrro requested a review from segunadebayo March 25, 2023 15:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants