Closed nicolas377 closed 2 years ago
We should probably just overhaul the options system to be stored under one chrome.storage entry. @Guy-Adler what do you think about that?
Makes sense So like one JSON object?
Yeah. It'll also be easier to make (and update) one coherent TS interface across all the files.
I'm not sure whether this should be a patch or a minor version update. Since this would be a incompatible API change, semver says we should increment the major version, but we haven't used anything like that for previous incompatible API changes. Your opinions @GeoFS-Extensions/authors?
Since we are not exposing our code to other resources (like, for example, an API), I'd say we should use the major version number for a complete change of the infrastructure (like going to a chrome extension or from manifest v2 to v3). Since it will not be noticed by most users but will affect the code, I'd say we should increment the minor version number.
That could be part of 3.3.0. Your thoughts?
I think it's a good idea
We could have a .d.ts file that exports an interface that's called Storage
that contains the types for what's saved to chrome.storage.
A lot of stuff in the infra could use some redoing, so we're going to refactor all the extension infrastructure. That's way outside the scope of this issue though, so I'm closing this issue in favor of another issue to track that.
Right now, we're storing 3 things:
update
, which can be defined by this interface:devModeEnabled
, which is just a single boolean.options
, which is defined hereWe can condense this all down into one entry. We can define its shape with a .d.ts file in the types folder that exports an interface that we can use (and maybe also the scripts type that contains the names of the scripts.