-
Notifications
You must be signed in to change notification settings - Fork 65
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Namespace for methods currently added to Window / WindowOrWorkerGlobalScope? #210
Comments
I don't feel strongly either way. It does seem like getOriginPrivateDirectory is a sufficiently different API from the picker ones that I'm not convinced it makes sense to group those together. Also in workers that is currently the only exposed method. It seems a bit weird to have a namespace for a single method. Also note that tag guidance seems to argue against the current form of the indexedDB/caches singletons. These days this should at least be a a webidl namespace instead (https://w3ctag.github.io/design-principles/#example-09c8f087). Although I'm not sure what modern APIs have actually taken that advice... |
So yeah, I guess the option then would be wrap everything in a |
although blink bindings don't currently support webidl namespaces; but they can still sort of be simulated by classes with no constructor and only static methods... Which wouldn't be exactly what webidl namespaces are like, but hopefully close enough that we could later change without breaking any code... |
Can we call this out on the TAG design review request? |
Yes, it's on my list, will do asap. |
After talking to some people, I think I'm leaning towards leaving the various file picker methods alone as free-standing methods on the global, but moving (and renaming) getOriginPrivateDirectory to StorageManager. |
The spec currently adds three methods to Window (showOpenFilePicker, showSaveFilePicker, showDirectoryPicker) and one method to WindowOrWorkerGlobalScope (getOriginPrivateDirectory).
By contrast, other modern storage APIs have a single entry point.
While I'll admit this is not a "regular" storage API (it doesn't only expose access to origin-scoped isolated storage, and its semantics depend on the underlying operating system and file system) I think it would still be nice if we hanged all methods off of a single entry point. WDYT?
The text was updated successfully, but these errors were encountered: