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

Support for React-primitives #11

Open
WillNeill opened this issue Apr 19, 2019 · 5 comments
Open

Support for React-primitives #11

WillNeill opened this issue Apr 19, 2019 · 5 comments

Comments

@WillNeill
Copy link

@danny - serious amazing work with this library. The magic of seeing a Sketch file build and work programmatically is priceless. I've shown all my design buddies and they are speechless.

So this is an enhancement idea based on using sketch-constructor over the past week, and comparing to the build experience with Airbnb's react-sketchapp.

react-sketchapp has a lovely little compile process that converts react-primitives to json.

The beauty of this approach is that you would write your react components once, and get universal rendering to web, iOS, Andriod and Sketch.

Would be good to consider.

Thanks!

@dbanksdesign
Copy link
Member

That would be amazing to have universal rendering on web, iOS, Android, and Sketch! I'll take a look into react-primitives a bit more. My general thinking would be to maybe build that in a separate library and have examples/starter codebases that show how to hook React components into sketch-constructor. This would allow sketch-constructor to be decoupled from any front-end framework, so people are free to build Vue or Angular or other hooks into here. This would keep dependencies minimal so users don't have to pull in React libraries if they don't use React. I would imagine like a sketch-constructor-react library or something. But I'm also open to building it in the core library if it would make sense for people. Either way, I love the idea!

@WillNeill
Copy link
Author

Would love to help with this.

I'm currently working on a design system that incorporates web, mobile and sketch. Duplicating all the components and utilities as separate files for Sketch is pretty intensive.

react-primitives (or Angular / Vue variations) would help keep the components dry and works really nicely with design tokens (i.e. style dictionary).

I'm messing about with an idea to write this react-sketchapp example directly to a Sketch file using the renderToJson() method and sketch-constructor.

Any ideas very welcome

@mathieudutour
Copy link

react-sketchapp already supports writing a sketch file directly in the v3 beta. I wrote a tools to generate a sketch library from react components here: https://github.com/airbnb/Lona/tree/master/compiler/sketch-library

@WillNeill
Copy link
Author

react-sketchapp already supports writing a sketch file directly in the v3 beta. I wrote a tools to generate a sketch library from react components here: https://github.com/airbnb/Lona/tree/master/compiler/sketch-library

Hey @mathieudutour - that's awesome! Thanks for sharing.

@benjamingeorge
Copy link

react-sketchapp already supports writing a sketch file directly in the v3 beta. I wrote a tools to generate a sketch library from react components here: https://github.com/airbnb/Lona/tree/master/compiler/sketch-library

Is there any official documentation on how to do this aside from the code in your repo ?

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

No branches or pull requests

4 participants