Sketch json conversion for diffing
This issue is for our backlog. We probably are not going to act upon, still it remains interesting and should be publicly discoverable in our issue backlog.
Intended use: Improve Sketch library bandwidth, by being able to diff and see what is adjusted where through the json code.
Reason for no action: See notes below, but most probably the upsides will not work when dividing the sketch library into multiple files and we have not tested out the hidden caveats yet.
First action to take: Build out testcase
- Dimitrie: https://github.com/stphnhthwy/git-example project from presentation https://www.youtube.com/watch?v=A-lNv6Szu3M
- Upsides from his workflow:
- Better compression as everything is stored in json files (Except for bitmap imports) => improves over time compared to binary file versioning => also improves pulling
- Introduces a sort of diffing capability based on json files (prob needs some way of beautify to make it somewhat human readable) => Can be done using auto-linters for subl or atom => Can be done with specific file extension git diff
- Could potentially make it possible to diff/merge changes from multiple people together, making use of code diffs (if changes are on different parts within the file).
- This works the best for limited files, where versioning is extra important… as this enables working of branches
- We could potentially use GitLab CI/CD to deploy the rendered version of the library from the json files to a download page for design.GitLab.com => Rendering of the JSON files is only possible client-side using Sketch or sketch-tool
- Downsides: 6. Diffing based on preview image will not work for bigger files with multiple artboards and/or pages => Sketch renders the preview image on last page viewed at by user and zooms out so it encompasses all artboards on a page. 7. Native GitLab sketch rendering will not be shown anymore, as everything is hidden in json files 8. Merge conflicts - no clear solution in sight
- Pedro: we could do all of the JSON magic both client-side and server-side 9. Client-side: 1. Pulling will show conflicts and allow for easier merges 2. Pushing only the Sketch file, not the JSON files, with images of every artboard inside of the Sketch file 1. Images generated by a Sketch plugin or via sketchtool 10. Server-side: 3. Users only see the .sketch file, not JSON files but… 4. We can do same magic as client-side to facilitate merging behind the scenes 5. And the images of artboards would allow us to show image diffs!
cc: @jkarthik @pedroms