Closed dschuff closed 4 months ago
There is one important potential complication here: ~2~ 1 of the 3 browsers have already shipped this method as part of the legacy exception proposal. (even though none have shipped js-types yet, ~Chrome and~ Safari implement the type method, but Firefox does not).
That leaves a few options:
Practically speaking, I think all of these risks are very low. I haven't seen any code or users that have used Tag.type(), nor heard anyone complain about anything working on e.g. ~Chrome~Safari but not Firefox because of this, so it seems unlikely that removing Tag.type() would break anyone. I also think there's little chance that we'll want to change the JS types proposal in a way that's incompatible with this (so the risk of keeping it is also low). Anyone have thoughts?
@dtig @eqrion @ddegazio @SPY @aheejin @rossberg @Ms2ger @ajklein
Ugh, that's disappointing. I think the important question is what implementations will do:
a. Firefox also starts shipping this, matching Chrome and Safari (somewhat weirdly inconsistent api) b. Nothing changes (no interop until the rest of js-types ships) c. Chrome and Safari unship temporarily (small but perhaps existent compat risk, feels like busywork)
Possibly the path of least resistance to interop is a., if Firefox is willing to do that. In that case this PR should only remove the advisement. (If we go for c., I'd suggest creating a companion PR to add the method to js-types before merging this one.)
I believe only Safari has shipped the type
method without a flag guard. This can be seen on wpt.fyi. It matches my reading of the V8 code in Chromium, which adds the method only when the entire JS Types proposal is enabled.
So from Chrome's perspective, removing the type
method from the spec seems like the right thing to do.
Oops, looks like I forgot I had the "experimental WebAssembly" flag enabled when I tested chrome 😅. I updated the OP
This method mirrors the type methods on the other interfaces (Global, Memory, etc) as defined in the JS type reflection proposal (https://github.com/WebAssembly/js-types/blob/main/proposals/js-types/Overview.md) Since this proposal will be standardized first, JS types should be rebased on top of exception-handling, and this method should be moved there.