Cross-App Themes Design Flaw
Sunday, December 18, 2022
The following note is copied from hand-written notes. It was originally written in August 2021, 3 years into development and just a little over a month after the release of 0.12.0. It details a design flaw discovered at the time that would lead to the decision to cancel cross-app theme support. Changes made to remove this support were implemented in 0.13.0 as a result.
A solution for the flaw was proposed on December 18, 2022.
Design Flaw Note
The original idea was for themes to be cross-application.
As it stands, the design will not allow for this, as two different applications
built with different Layers versions might have different serialization
functionality. The application with the newest version will update the theme
files, making them incompatible with the app on an older Layers version. If
serialization was guaranteed never to change, then this wouldn't be an issue.
However, this is not the solution.
I'd say its time to ditch the idea of themes working cross-application.
Several things need to be changed:
- Themeable's tags can lose the 'layers' and app name prefixes
(or they can work like namespaces)
- Files should be stored on a per-application basis instead of into a single
Layers folder
Themes could still be transferred to another as long as that application isn't
built with an older Layers version; even newer versions should work fine.
Solution
When loading an old theme into a Layers app that implements a newer save function, the theme can be updated *without* replacing the old theme files. The old files and the new files could be stored simultaneously allowing for apps supporting different theme file formats to use the theme.
However, it is important to note that customization should be disabled for older versions of the theme. Also, customizations made to the newer theme won't reflect in the older one unless the theme creator/contributor redundantly makes these customizations in the older version as well.