docs/FAQ.md
react-sketchapp evolved out of our need to generate high-quality, consistent Sketch assets for our design system at Airbnb. Wrapping Sketchโs imperative API is a pragmatic solution for a great developer experience and predictable rendering.
console.log?You have multiple options to view the logs:
Using the sketch-dev-tools
Console.app -> ~/Library/Logs -> com.bohemiancoding.sketch -> Plugin Output.log
in the terminal
skpm log -f
in the terminal
tail -F ~/Library/Logs/com.bohemiancoding.sketch3/Plugin\ Output.log
Occasionally this file disappears โ in that case, run this and then try tailing again.
touch ~/Library/Logs/com.bohemiancoding.sketch3/Plugin\ Output.log
For more information, check out the Sketch developer documentation.
Sketch has a developer mode which refreshes plugins before running. If you're using skpm this should be set up automatically, but just in case try running
defaults write com.bohemiancoding.sketch3.plist AlwaysReloadScript -bool YES
<View> & <Text>? Where are the shapes? Talk to me about your API decisions!Early versions of react-sketchapp mirrored Sketch's layers โ <Rect>, <Oval>, <Star> etc. This was adequate for rendering simplistic designs such as grids of color palettes, but our focus is on production design systems.
At some point, we had to translate from our component codebase's primitives to Sketch's shapes. We tried translating trees of React Native elements into <Rect>s etc, but it felt clumsy. Not every Sketch property has an analog in react-native, but most react-native properties are translatable to Sketch.
By aligning with react-native's API we:
react-primitives (a platform independent set of primitives)Where it makes sense we're open to creating Sketch-specific components โthere's no analog for <Artboard> on web or mobileโbut the goal of react-sketchapp is to bring design & engineering closer together.
You can use the SVG API to draw arbitrary shapes.
Not currently. FlexBox is the closest we have to a predictable, cross-platform layout specification โ by using it, we can use the same styles on every platform we build for.
We currently use yoga.
Nope.
Isomorphisms are compelling but our focus is on tools that we can use day-to-day to improve the productivity of designers and engineers working on large-scale production applications.
Getting production-ready semantics out of Sketch is more difficult than generating production-ready Sketch templates from React components ๐
Our solution is to keep our our design systemโs source of truth in code, and use react-sketchapp to compose & consume it.
To edit our design system, we are free to leverage any technology that can create React components, or be compiled to JSX, such as:
Treating Sketch primarily as a rendering target for cross-platform components pushes you to store components & style in code โ you're then free to build translation layers for any other design tool that exposes an API.
Given equivalent API support it would be possible to simultaneously render to react-sketchapp, react-figma, react-xd & react-quark.
Rather than tying us into one design tools, reasoning about design in cross-platform primitives frees us to use the tooling we want.
Of course!
TypeScript definitions are published with the npm package.