4 ms·
> Origin Private FileSystem Safari’s had that for more than two years. (Chromium, more than three, Firefox, almost one.) > Import Assertions An excellent exa
by chrismorgan 3y ago
> Origin Private FileSystem
Safari’s had that for more than two years. (Chromium, more than three, Firefox, almost one.)
> Import Assertions
An excellent example of why Firefox and Safari tend to be more reserved in what they ship, in contrast to Chromium which is much more fond of shipping immature stuff.
Import assertions are dead, superseded by import attributes. V8 has deprecated import assertions and will remove them soon. See https://v8.dev/features/import-assertions https://v8.dev/features/import-assertions for more info on why.
Chromium shipping immature stuff is, from time to time, a real pain, because it makes it harder to fix problems in the spec as you sometimes have to avoid breaking real usage. Sometimes this basically makes things worse forever, because of naming things. I can’t remember a specific case in browsers, but know they exist; but a similar case is how we have some methods named includes instead of contains like they should have been because of Mootools touching stuff it shouldn’t have, and so now everyone suffers for that mistake.
- no_wizard 3y agoImport Assertions being replaced, thats cool (its replacement perhaps should have made the list if the spec is done) but OPFS is not widely supported. Its partially supported. Its not on the same interoperable standard as Chrome, for instance. hence for Interop 2024 it would have made sense to include, to close the gaps between the browsers.
- jprete 3y agoI'm really confused because the import assertions link doesn't say that they're deprecated at all, let alone why. (It's also possible I'm being served something different than you were because I'm on mobile?)
- da_chicken 3y agoI believe you meant to link this: https://v8.dev/features/import-attributes https://v8.dev/features/import-attributes That page actually explains the change: > V8 shipped the import assertions feature in v9.1. This feature allowed module import statements to include additional information by using the assert keyword. This additional information is currently used to import JSON and CSS modules inside JavaScript modules. > Since then, import assertions has evolved into import attributes. The point of the feature remains the same: to allow module import statements to include additional information. > The most important difference is that import assertions had assert-only semantics, while import attributes has more relaxed semantics. Assert-only semantics means that the additional information has no effect on how a module is loaded, only on whether it is loaded. NB: The above quotes have been edited to just the most relevant notes. See the link above for more information.
- chrismorgan 3y agoYou are correct, that is the link I meant.
- apatheticonion 3y ago> Origin Private FileSystem Question that is both on and off topic. Is the Origin Private FileSystem permanent on Safari? Apple released an update a few years ago the cleared the contents of localStorage and indexeddb for an origin if the user hadn't visited in 14 days. This makes it hard for purely offline PWAs to store data offline. e.g. I wrote an offline only exercise tracker PWA (akin to "Strong" on Android) that used indexeddb to keep records and required no account. The 14 day policy makes it basically DOA for iOS clients. Is the OPFS a viable alternative?
- streptomycin 3y agoLast I looked into it, it's not permanent in any browser. If you're low on disk space, stuff will get deleted. https://twitter.com/tomayac/status/1613605318407094275 https://twitter.com/tomayac/status/1613605318407094275 It kind of makes sense, given the constraints the browser devs have given themselves. Since there's no way for users to see/manage these OPFS files directly, there is no good alternative except automatically deleting stuff if disk space is low. What would really be nice would be if we could just create normal files and let users control them, but that doesn't seem to be in the cards. And it sucks. The #1 question I get for my PWA is "how do I stop it from sometimes deleting all my data?" and there's really no good answer.
- thayne 3y agoThere is a big difference between deleting when disk storage is low, and deleting if you haven't opened the app in 14 days.
- no_wizard 3y agoIdk what happened to it but there was momentum at one point to ship internal modules for browsers like node now has, where you would write the import as “std:lib” (much like the recent “node:fs” etc) which would completely side step these issues