zalo / CascadeStudio

A Full Live-Scripted CAD Kernel in the Browser
https://zalo.github.io/CascadeStudio/
MIT License
1.01k stars 126 forks source link

Feature request: Make project JSON more friendly for software version control #21

Closed udif closed 3 years ago

udif commented 3 years ago

At the moment, the script is saved as a single string with embedded newlines. In order to make diffing different versions easier, could you please store the multiline script as a string array? inspired by: https://stackoverflow.com/a/7744658 e.g. instead of :

    "code": "// a\n// b\n// c\n",

It would be stored as :

    "code": [
            "// a",
            "// b",
            "// c"
    ],

You could still support reading single string scripts, but write it out as a string array.

zalo commented 3 years ago

This is a great idea! Will definitely investigate 👍

zalo commented 3 years ago

Alrighty; it's implemented and merged.

Pre-multiline serialized projects will automatically be converted to multiline projects upon re-saving 👍

Thank you for the suggestion!