Closed annevk closed 4 years ago
I think this now defines sufficient infrastructure to define storage and session storage APIs. It does not:
Clear-Site-Data
.A storage API would do something like:
Let map be the result of running obtain a storage bucket area map with environment, "storage", and "localStorage".
It can then use that map as it pleases, for instance in response to API calls.
(Writing this down I realize we should probably expose a separate "obtain a storage bucket area map" and a "obtain a session storage bucket area map" so APIs do not have to pass a storage type.)
It should also provide a solid basis for any kind of multiple storage bucket API though in the absence of one looks a bit complicated.
If this looks agreeable I would like, in order:
I could wait with 1 until 2 is further along, but I would greatly appreciate detailed feedback on this PR first.
I understand this to be the hierarchy:
While the following sounds very silly, my brain has a lot of trouble with there being no inherent containment relationship among the terms in use and with 3 of the 4 being generic. What about something like:
Note that now it's clearly prefixed, "storage box" would work as well. Nobody commented on that suggestion from https://github.com/whatwg/storage/issues/51#issuecomment-338227477.
I'd like to express mild support for keeping bucket. It wasn't the first word that came to my mind, but it has grown on me.
Storage box is a bit of a mouthful. I worry that developers everywhere (web apps, browsers) will end up with variables named box
instead of storageBox
. I'd definitely use the word "boxes" when discussing this concept with my colleagues.
For better or worse, "bucket" is not used in other parts of the web platform (as far as I know). I think this will make everyone's (web developers, browser vendors) life easier when searching in code / docs. I expect that this concept will be a big deal, and deserves a unique name.
Fair. Any thoughts on @asutherland's suggested names? (And the remainder of the PR? 😊)
cc @youennf
I plan to address the remainder of @domenic's comments tomorrow as well as fully adopt @asutherland's fancy naming scheme. If you all have comments beyond those now would be a great time to make them. Thanks everyone!
I did the refactoring in batches, but reviewing https://whatpr.org/storage/86.html#model is probably easier. Note that apart from the Model section this also improved various aspects of the Storage Standard itself, by making it much more clear what exactly various aspects are talking about and when things might fail and such.
(See WHATWG Working Mode: Changes for more details.)
Preview | Diff