Re: [w3ctag/design-reviews] A toggle switch control element (#384)

Ah, I think I see what we're missing. We don't have a rigorous spec (or even part of the explainer) explaining what the module import does.

The intention is for the spec to require that any implementation (no matter whether C++ or JS) not interpret std-switch elements until the corresponding module is imported. (I.e., they are treated as HTMLUnknownElement.) We should add this to the explainer. Certainly it's top of mind as we move toward writing a spec, but it should be captured in the explainer stage as well.

The current spec for built-in modules is https://github.com/heycam/webidl/pull/675. There isn't a separate implementation status for built-in modules from the features that are implemented as built-in modules; it's just a technology, like other parts of Web IDL, that can be used for implementing web platform features. Similarly, allowing web platform features to use the JS language's module system doesn't have a dedicated explainer, kind of like how async_iterable (allowing web platform features to use the JS language's async iteration features) or maplike (allowing web platform features to have APIs similar to JS's Map) don't have a dedicated explainer. It's largely plumbing between web specs and JS specs.

Some of your parenthetical alludes to how web developers can use a feature provided as a built-in module even in browsers that don't implement that built-in module. With built-in globals, this is easy: web developers use well-known polyfilling techniques like `window.SomeGlobal = window.SomeGlobal || ...`. For built-in modules, new technology is indeed needed. That is covered by https://github.com/WICG/import-maps (#340), in particular https://github.com/WICG/import-maps#for-built-in-modules-in-browsers-without-import-maps.

Thanks for these questions. Besides explaining that importing the module has that side effect, do you think any of the other things I listed would be helpful to have in the std-switch explainer?

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3ctag/design-reviews/issues/384#issuecomment-501497270

Received on Wednesday, 12 June 2019 23:58:46 UTC