You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Closure doesn't yet have extern definitions for WebGPU.
Over in Emscripten, we are finally switching to externs instead of doing ["this"] everywhere (except everywhere we forgot and so it's broken). emscripten-core/emscripten#21144
There you can see some barebones externs I generated from the WebGPU spec's WebIDL. I think it's enough for minification to work correctly(?) but it doesn't provide much else - no function arguments, in particular.
Would there be interest in bringing this into Closure as-is, or would it need more complete definitions?
We talked internally. We'd rather not include the externs with JSCompiler by default, yet, because the API is currently only live Chrome.
Related: We're also thinking about generating externs using tsickle from TypeScript typings. That way we'd get better about adding new browser APIs to externs. But at the same time we'd only get them once at least 2 browser engines implement them, since that seems to be TS' policy.
I hope that makes sense. I'd kinda like to keep the issue open, though. We do need to add WebGPU externs eventually.
Sounds good! We're happy to use our own externs in Emscripten for now. Hopefully if anyone is searching they'll find this issue and be able to copy them.
We're currently maintaining TypeScript types for WebGPU outside of upstream TypeScript: https://github.com/gpuweb/types
We've considered pushing to get them upstream, but since we're currently maintaining extra features over what TypeScript's generated types would look like (documentation pulled from the WebGPU spec, and some extra strictness), there hasn't been much pressure. And I'm sure TypeScript will add them themselves once it reaches whatever their threshold is.
Activity
frigus02 commentedon Jan 24, 2024
Link for easy reference: https://github.com/emscripten-core/emscripten/blob/fb4bdc78cf3b99d634838418882f199e18309a5c/src/closure-externs/webgpu-externs.js
Thanks for the offer. On first glance I'd say they look nice. I'm going to check with the team if we want to include them as is.
kainino0x commentedon Jan 24, 2024
If it helps, both Safari and Firefox have made strong signals about the API - Chrome shipped with positive signals from other browsers (the only caveat being that they hadn't/haven't finished implementing).
Firefox has had it on Nightly for a while (not yet shipping to stable): https://developer.mozilla.org/en-US/docs/Web/API/WebGPU_API#browser_compatibility
Safari recently enabled it behind a flag in Safari Technology Preview: https://www.webkit.org/blog/14885/release-notes-for-safari-technology-preview-185/
frigus02 commentedon Jan 25, 2024
We talked internally. We'd rather not include the externs with JSCompiler by default, yet, because the API is currently only live Chrome.
Related: We're also thinking about generating externs using tsickle from TypeScript typings. That way we'd get better about adding new browser APIs to externs. But at the same time we'd only get them once at least 2 browser engines implement them, since that seems to be TS' policy.
I hope that makes sense. I'd kinda like to keep the issue open, though. We do need to add WebGPU externs eventually.
kainino0x commentedon Jan 25, 2024
Sounds good! We're happy to use our own externs in Emscripten for now. Hopefully if anyone is searching they'll find this issue and be able to copy them.
We're currently maintaining TypeScript types for WebGPU outside of upstream TypeScript: https://github.com/gpuweb/types
We've considered pushing to get them upstream, but since we're currently maintaining extra features over what TypeScript's generated types would look like (documentation pulled from the WebGPU spec, and some extra strictness), there hasn't been much pressure. And I'm sure TypeScript will add them themselves once it reaches whatever their threshold is.
kainino0x commentedon Apr 28, 2025
FYI, according to https://github.com/gpuweb/gpuweb/wiki/Implementation-Status/_compare/6e0baa9fdcc4914c93024f8527ae999eb27f6257...5680a7e025dfd341cd82566c96eb08919a5dcafa Firefox is tentatively planning to ship in Firefox 141 (schedule here).