Topics

Note Selector

Data Version Tracking

Tuesday, March 11, 2025

The way versions get tracked within Layers data has constantly changed as the format evolved, each method failing to persist long enough to actually test it.

This is actually my excuse for why Layers hasn't been heavily marketed at this point. I didn't want developers creating Layers apps and users creating Layers data while the format was still heavily evolving. Without a fully-developed method for version tracking, updating the format of user data would be very difficult. And it was difficult to develop a version tracking method while the format kept changing.

I understand that the data format is always subject to change. It's just that in the early stages of development, the format is constantly changing while there are little-to-no users.

So, I decided to hold off on version tracking until the format reached a more developed state. Now, I feel like it is time to revisit the idea.

Types of Versions

Data is subject to three different version types: the format version, the software version, and the data version. However, relevant version types are dependent on the data type.

Format Version

The format refers to how the data is structured for serialization. Layers data is stored as specially formatted JSON data.

Since themes and styles are just types of definitions, all data types use the same general format (except that themes and styles may include additional metadata).

This format is referred to as the definition format, and its version is specified by a tag like D2, meaning "the second version of the definition format".

The format should not change often because this leads to complicated serialization changes.

Software Version

Software refers to either applications or libraries in this context.

The software version associated with a set of Layers data, specifically definitions and styles, is significant.

Since definitions/styles represent UI structure, and UI structure is subject to change between different software versions, it is important that these data types keep track of the software version they are associated with.

Data Version

A data version would be significant when changes are made to the data itself as opposed to its structure.

This version type may only be necessary for published data. For instance, if other users have downloaded a theme created by some user, then that user makes a change to that theme, a data version tag would allow the other users to know that an update is available. However, if this theme will only exist on the creator's system, then there will probably be no need for a data version tag since the creator will just always have the latest version of it.