Skeleton Next - Update 11 - Sneak Peak of Zag.js Integration #2784
Replies: 4 comments 14 replies
-
I don't like this idea. This way with spread all params can kill Svelte optimisations. |
Beta Was this translation helpful? Give feedback.
-
My experience with Finite state machines has not been a positive one, I hope you have better luck building on Zag. |
Beta Was this translation helpful? Give feedback.
-
Hey Chris 👋, nice to meet you. I'm also Chris, maintainer of Zag.js and Ark UI. It's awesome to see you considering Zag.js as the backbone for Skeleton. Given your roadmap to support multiple frameworks, I recommend looking into Ark UI. It acts as a superset of Zag.js, embracing framework-specific improvements like the use of Context and Providers, and adding other helpful components not based on Zag.js. You might notice that We initially considered using Zag.js directly in Chakra UI but found it too tedious to implement. While this might sound vague, you'll understand better when you compare Ark UI to Zag.js. Nonetheless, I’m excited to see what you build with the toolchain. Have a great day! |
Beta Was this translation helpful? Give feedback.
-
The more I read about Skeleton Next, the more I get the impression that we're moving away from Svelte and adapting a lot of services and complexity to embrace the React world at the expense of what made Skeleton successful, simplicity. |
Beta Was this translation helpful? Give feedback.
-
Hey everyone, Chris here from Skeleton! It's been a while since our last progress update, but I wanted to showcase some big changes coming to components in Skeleton v3. As you might expect, it it turns out building and maintaining components for multiple frameworks is hard. This poses a number of both technical and logistical challenges. In fact we've been faced with many of these pain points:
The team and I have been researching the best way to overcome these issues, and thankfully we think we may have found our solution in Zag.js - an open source framework created by the same team behind Chakra UI. Like Skeleton, the Chakra team appears to have experience many of these same issues, which motivated them to introduce Zag.
What is Zag?
In simple terms, you might compare Zag to tools like Melt UI for Svelte or Radix UI for React. These provide primitive abstractions for generating the underlying structure for components - including logic and state management for common patterns such as Accordions, Tabs, Switches, and more. The result is headless components that can then utilize your own custom design system. In this case, that's the role of Skeleton!
What makes Zag unique is that it is framework agnostic, providing wrappers for popular frameworks such as React, Vue, and Solid.js. As well as pending support for Svelte, which is awaiting a stable v5 release.
The Benefits
Rather than reinventing the wheel, Skeleton can lean into Zag to generate the foundation for our suite of components. This provides a number of other benefits out of the box:
Skeleton essentially delegates the logic and state management to Zag, while focusing purely on what makes our components unique and special - integration with the Skeleton design system, support for Tailwind styling, as well as a few Skeleton-specific features sprinkled on top.
Integration Preview
Over the past week, the team and I have created an internal prototype to test Zag integration. We've been very pleased with the results. You can review updates to the component code, and preview a few examples below:
Not only is Zag quick to implement, but we've managed to provide more features and better accessibility, all with less code. This helps boost confidence that we retain API, feature, and a11y parity cross-framework. Especially since everything draws from a single source of truth - Zag.
Breaking Changes
In the short term, expect breaking changes to our existing v3 components as we migrate to Zag. This will occur naturally as we update our props and feature set to conform to Zag's standards. However once complete, our component APIs should remain much more stable. Especially for new components.
What's Next?
The good news is the team and I have already started migrating our components to utilize Zag. It's worth noting that Zag does not provide parity with every Skeleton component (App Bar and Navigation for example). However, those outliers will continue to use our standard component paradigms going forward.
Once this process is complete, we'll continue implementing all planned components, with the goal of reaching v2 parity as soon as possible. Over time (likely post-launch) you may also begin to see some really new and unique components introduced, such as QR Codes, Splitters, Timers, and more.
Zag also introduces a more streamlined path for introducing support for additional frameworks like Vue and Solid.js. This will likely come alongside major releases in the future (Skeleton v4.x and beyond).
Feedback
As always, if you have questions or feedback, we encourage you to leave a comment below.
Beta Was this translation helpful? Give feedback.
All reactions