• Design a set of re-usable components in Sketch that get turned into JavaScript widgets and used in a product
• The JavaScript widgets are are modified, extended, and changed. Maybe a line here, a color here. Designers now sometimes have component designs don’t quite match what they look like in the wild
• This tool now lets them re-create the Sketch file from the components as the look in the wild. That means when designers work on whole pages, made up of widgets, they’ll look exactly like they would in the wild.
to complete the explanation, sketch is a vector-based design tool that has an api for scriptable generation of components. this library lets you generate sketch widgets from react code; i presume that those widgets are then higher-level shapes stored as single entitles in sketch, so that when you update the react code, sketch files that use those components now use the updated versions.
also, from their faq, there is no two-way binding; they do not attempt to extract react code from sketch files. the idea is that the react code is the source of truth.
from a programmer's perspective, sketch is sort of like an exploratory repl where you can play with bits of code (widgets here), composing them into larger functions (sketches), and when you're satisfied with the design you edit your source file and reload the state of the repl so you can continue exploring.
Super excited to open source this — I'm trying my best to bring design & engineering closer together at Airbnb (and in the world), this has been a super useful project.
I'll be hanging out in this thread all day if you have any questions / want to flame me :)
To help clarify why this is a big deal, I'd like to share why I've been so excited about this project...
[tl;dr] - This is the first tool I'm aware of that actually allows you to generate both API docs and design tools from the same source.
Static documentation is a lie waiting to happen. Once docs are even slightly out of date, people lose trust and eventually abandon them.
On the engineering side of the dev/design process, this is easy to work around. We generate documentation from code and structured comments, which allows us to trust our docs as an up-to-date point of truth.
If you're building a design system that both engineers and designers will work with, there's no real solution to keeping sketch symbols and React components in sync. You're essentially stuck maintaining "static documentation" for designers in the form of a sketch file.
More often than not, things get busy, or someone forgets to commit a change to the sketch file, and the sketch symbols fall behind the code used in production.
Developers start to receive mocks that don't match the "standard" components they're using. Designers start to wonder why fidelity is lost by the time features make it to production. The design system falls apart.
`sketch-reactapp` will help us deal with the static documentation problem the same way we deal with it on the engineering side of things: generate from source.
This is the first tool I'm aware of that actually allows you to generate both API docs and design tools from the same source.
Sounds intriguing, but I'm also a little confused about the flow of "code that generates sketch files"... what is the purpose of Sketch in all this?
I would think programs like Sketch are useful in general because they give designers a nice way to design things without adding the extra layers of abstraction that code brings (i.e. they can just draw things with a mouse instead of writing instructions that tell the computer how to draw things). But if Sketch is just another rendering layer of react components, then what is the point of having it... why not just look at the rendering in a web browser?
Or am I misunderstanding and there's a way for react code to be generated from Sketch? (Despite this statement in your blog post: "As the industry has coalesced around Sketch, people have sought to generate code from Sketch. This is exciting, but for our challenges we wanted to do the exact opposite — to keep DLS in sync we have to generate Sketch files from code.")
Hi Jon. Any plans to extract interactions as code from modern prototyping tools (e.g. Principle) to Xcode?
AirBnB recently released Lottie that requires After Effects but when compared to Principle, AE feels like Photoshop compared to Sketch. I have a feeling that not many UX designers on Mac want to go back to Adobe tools. Certainly, I don't want to touch Adobe tools again.
So, to be clear, a month ago there was an announcement about an app called Sketch (renamed to Snack now apparently) that was a playground for React code, but people said it was a bad name choice because Sketch is already a ui/ux dev/design tool in this space.
But this tool is related to that ui/ux version of Sketch (but with/for React), and not the mis-named Sketch (that was for React)?
1) Using a text editor like Visual Studio Code, write core components in react-primitives. This code can be largely the same as your real react-native code with all it's handling of layout and internationalization.
3) Use react-sketchapp to transform your core components in react-primitives to sketch symbols. If you have a large design system and support multiple languages, then this will save you a lot of time as the number of combinations of layout, language and potential input values are explosive.
4) Use sketch to design your new feature. Use sketch symbols to quickly pull in core components. If you need to create a new core component go back to step 1. With all your fancy tooling, it can be as fast as 1 minute to build a new page.
5) When core components change, go back to the "source of truth", the react-primitives code and modify that. Re-run react-sketchapp. Now all sketch files that depend on that core component will be automatically updated because of updated sketch symbols.
This looks great. And Sketch is incredible. I wish there was something like it available on Linux, or I could run it on Linux somehow. Seeing how important a tool it's becoming to web design makes me uneasy as it's shutting out my ability to do anything design related :/
I keep an old Mac around for exactly this reason. However since version 43 they've switched to a new file format offering "more powerful integrations for third-party developers".
The new format is a ZIP containing a bunch of JSON files per page, so maybe someone will come up with a cross-platform viewer or similar.
Would it be possible to use this on the server to create complicated PDF files for download (react -> sketch -> pdf), without using something like this current process (react dom -> html, css -> phantomjs -> pdf)?
Yeah sure - the caveat is that you have to run it on OSX rather than Linux. We have a bunch of Mac Pros & Mac Minis laying around the office doing CI funtimes.
I also hear whisperings of a react-pdf renderer but I haven't seen it
This will come really handy, thank you. I'm trying to build a better infrastructure at work; do you have anything written up about how you work at Airbnb? Your "bring design & engineering closer together" mission sounds like what I'm trying to accomplish, would like to read/chat more about it.
I asked something similar when AirBnb announced Lottie, and the team (Jon Gold included) replied with great insights.
I hope you find this helpful: https://news.ycombinator.com/item?id=13547053
Noticed the heavy CPU usage as well. The laptop still performed admirably but estimated remaining battery time fell below 2H on a full charge so I smelled something amiss. Turned out the videos on this page continue playing even when the tab is open in the background (not active tab, nor active window). Seems like a complete waste of cycles. (Opera Beta)
The classic way for reusing style and layout in web development is to have the style in CSS-files. CSS-files have a URL, so you can include CSS across web pages and take advantage of CDN's and browser caching. CSS have it's problems, but CSS is far superior to in-lining the style al la components.
It's good practice to use the native browser components, the component might work very different on a smart-watch, vs a big screen PC, native HTML component will work on both devices! And native HTML components also work with JavaScript turned off! and for visually impaired people using different kinds of screen readers.
Jon was gracious enough to visit us at CollectiveHealth to describe their DLS processes as well as give us a glimpse of what was coming.
Design Systems and related tooling makes total sense at certain scale and I can definitely see both designer and developer efficiency gains from consistent building blocks that Design Systems provide.
Jon I'm curious if this would still make sense if AirBnB weren't so invested in React and React Native.
We have just recently started using React for new products that our team develops, doing the design in Sketch. This was already a huge improvement in efficiency compared to doing design in Photoshop and building products with Angular. I'm super excited to try this library on our next project and see how it can streamline the design and development cycle.
It would be even cooler if it could render React components written for the web without modification, maybe in a transparent webview. I'm guessing Sketch would need to add support for that.
If we can figure a way to translate React DOM to React Native-style components then this will be doable.
You could write a codemod that turned <div> into <View>, <h1-6> into <Text> etc, but there's complexity in standardizing layout systems & CSS properties too. React Native-style components provide the best chance of us using React as a truly universal platform.
I'd really like to try to integrate some of this design philosophy (and what your team lays out in that DLS blog post, too) in my team's design flow. Thanks for this!
mshenfield|8 years ago
• Design a set of re-usable components in Sketch that get turned into JavaScript widgets and used in a product
• The JavaScript widgets are are modified, extended, and changed. Maybe a line here, a color here. Designers now sometimes have component designs don’t quite match what they look like in the wild
• This tool now lets them re-create the Sketch file from the components as the look in the wild. That means when designers work on whole pages, made up of widgets, they’ll look exactly like they would in the wild.
zem|8 years ago
also, from their faq, there is no two-way binding; they do not attempt to extract react code from sketch files. the idea is that the react code is the source of truth.
from a programmer's perspective, sketch is sort of like an exploratory repl where you can play with bits of code (widgets here), composing them into larger functions (sketches), and when you're satisfied with the design you edit your source file and reload the state of the repl so you can continue exploring.
hoodoof|8 years ago
The website doesn't explain it like this.
unknown|8 years ago
[deleted]
jongold|8 years ago
Super excited to open source this — I'm trying my best to bring design & engineering closer together at Airbnb (and in the world), this has been a super useful project.
I'll be hanging out in this thread all day if you have any questions / want to flame me :)
akdetrick|8 years ago
[tl;dr] - This is the first tool I'm aware of that actually allows you to generate both API docs and design tools from the same source.
Static documentation is a lie waiting to happen. Once docs are even slightly out of date, people lose trust and eventually abandon them.
On the engineering side of the dev/design process, this is easy to work around. We generate documentation from code and structured comments, which allows us to trust our docs as an up-to-date point of truth.
If you're building a design system that both engineers and designers will work with, there's no real solution to keeping sketch symbols and React components in sync. You're essentially stuck maintaining "static documentation" for designers in the form of a sketch file.
More often than not, things get busy, or someone forgets to commit a change to the sketch file, and the sketch symbols fall behind the code used in production.
Developers start to receive mocks that don't match the "standard" components they're using. Designers start to wonder why fidelity is lost by the time features make it to production. The design system falls apart.
`sketch-reactapp` will help us deal with the static documentation problem the same way we deal with it on the engineering side of things: generate from source.
This is the first tool I'm aware of that actually allows you to generate both API docs and design tools from the same source.
Congratulations on the launch!
jordanlev|8 years ago
I would think programs like Sketch are useful in general because they give designers a nice way to design things without adding the extra layers of abstraction that code brings (i.e. they can just draw things with a mouse instead of writing instructions that tell the computer how to draw things). But if Sketch is just another rendering layer of react components, then what is the point of having it... why not just look at the rendering in a web browser?
Or am I misunderstanding and there's a way for react code to be generated from Sketch? (Despite this statement in your blog post: "As the industry has coalesced around Sketch, people have sought to generate code from Sketch. This is exciting, but for our challenges we wanted to do the exact opposite — to keep DLS in sync we have to generate Sketch files from code.")
meagher|8 years ago
bdickason|8 years ago
3stripe|8 years ago
Smirnoff|8 years ago
AirBnB recently released Lottie that requires After Effects but when compared to Principle, AE feels like Photoshop compared to Sketch. I have a feeling that not many UX designers on Mac want to go back to Adobe tools. Certainly, I don't want to touch Adobe tools again.
thebouv|8 years ago
But this tool is related to that ui/ux version of Sketch (but with/for React), and not the mis-named Sketch (that was for React)?
Naming is fun.
jongold|8 years ago
- react-dom
- react-native
- react-vr
- react-hardware
- react-blessed
- react-three
- react-aframe
etc
it felt like the right thing to do was a descriptive "this is what it is" name rather than a "marketing name" that would be more confusing.
dikaiosune|8 years ago
https://blog.expo.io/expo-sketch-expo-snack-a444f8dec72b
rhizome|8 years ago
Yeah, about that.
Are you saying that the "React Sketch.app" in the title is/should/will be "React Snack.app?"
unknown|8 years ago
[deleted]
udkl|8 years ago
1) Create designs in sketch (mainly core components)
2) Code those designs in React that will generate the React translated version of the sketch
3) Use the react generated sketch to build non-core component designs in sketch . .
4) When the core design changes, update the react component to match the new designs
5) All the other components in the sketch will automatically start using the new updated sketch component
joekim|8 years ago
1) Using a text editor like Visual Studio Code, write core components in react-primitives. This code can be largely the same as your real react-native code with all it's handling of layout and internationalization.
https://github.com/lelandrichardson/react-primitives/
2) Create a library of core components. In aggregate, this library is your DLS (Design Language System)
http://airbnb.design/building-a-visual-language/
3) Use react-sketchapp to transform your core components in react-primitives to sketch symbols. If you have a large design system and support multiple languages, then this will save you a lot of time as the number of combinations of layout, language and potential input values are explosive.
http://airbnb.design/painting-with-code/
4) Use sketch to design your new feature. Use sketch symbols to quickly pull in core components. If you need to create a new core component go back to step 1. With all your fancy tooling, it can be as fast as 1 minute to build a new page.
https://twitter.com/karrisaarinen/status/849733176150773761
5) When core components change, go back to the "source of truth", the react-primitives code and modify that. Re-run react-sketchapp. Now all sketch files that depend on that core component will be automatically updated because of updated sketch symbols.
L_Rahman|8 years ago
ChicagoBoy11|8 years ago
scrollaway|8 years ago
lucaspiller|8 years ago
The new format is a ZIP containing a bunch of JSON files per page, so maybe someone will come up with a cross-platform viewer or similar.
Edit: I found this which works with basic Sketch files: https://animaapp.github.io/sketch-web-viewer/
1rae|8 years ago
jongold|8 years ago
I also hear whisperings of a react-pdf renderer but I haven't seen it
itschekkers|8 years ago
FanaHOVA|8 years ago
jongold|8 years ago
Design Ops (the org that contains my team - Design Tools) - http://airbnb.design/designops-airbnb/
The Way We Build (head of design @alexoid talking about our process) - http://airbnb.design/the-way-we-build/
Building a Visual Language (on our design system) http://airbnb.design/building-a-visual-language/
72mena|8 years ago
afandian|8 years ago
enra|8 years ago
ziikutv|8 years ago
jvzr|8 years ago
z3t4|8 years ago
vladgur|8 years ago
Design Systems and related tooling makes total sense at certain scale and I can definitely see both designer and developer efficiency gains from consistent building blocks that Design Systems provide. Jon I'm curious if this would still make sense if AirBnB weren't so invested in React and React Native.
jongold|8 years ago
You could still use it for styleguides for type & color etc, if you keep those definitions in JSON.
if not, probably not :(
xrjn|8 years ago
throaway4242|8 years ago
jongold|8 years ago
brijeshb42|8 years ago
https://github.com/brijeshb42/react-sketchapp-boilerplate
mixedbit|8 years ago
rtkwe|8 years ago
tlrobinson|8 years ago
It would be even cooler if it could render React components written for the web without modification, maybe in a transparent webview. I'm guessing Sketch would need to add support for that.
jongold|8 years ago
You could write a codemod that turned <div> into <View>, <h1-6> into <Text> etc, but there's complexity in standardizing layout systems & CSS properties too. React Native-style components provide the best chance of us using React as a truly universal platform.
see https://github.com/airbnb/react-sketchapp/issues/37 & https://github.com/airbnb/react-sketchapp/issues/29#issuecom... for some more context
If you have any ideas on solving I'd love to see them in GitHub so I don't lose track of them :)
chadlavi|8 years ago
hoodoof|8 years ago
fiatjaf|8 years ago
libria|8 years ago