Skip to content
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

What does FrozenArray mean in dictionaries? #900

Closed
saschanaz opened this issue Jun 28, 2020 · 9 comments
Closed

What does FrozenArray mean in dictionaries? #900

saschanaz opened this issue Jun 28, 2020 · 9 comments

Comments

@saschanaz
Copy link
Member

Web Share has this dictionary:

dictionary ShareData {
  FrozenArray<File> files;
  USVString title;
  USVString text;
  USVString url;
};

I guess it has nothing special as a dictionary member or as an argument. Should this be prevented to clarify things?

@annevk
Copy link
Member

annevk commented Jun 29, 2020

For an output dictionary it might make sense, but maybe it's best forbidden to align with attributes, indeed.

@domenic
Copy link
Member

domenic commented Jun 29, 2020

In general it would be good to align FrozenArray<> more with ObservableArray<>, in order to fix #810. See my previous plan in #810 (comment), which I think still holds and is more or less what I did for ObservableArray<>

@marcoscaceres
Copy link
Member

Filed w3c/web-share#165 for Web Share. Also came up in Payment Handler API w3c/payment-handler#372 - I've not followed the ObservableArray discussion, but if we can recommend against people using FrozenArray as per the OP, that would be great (ban it outright, even better so tooling catch these and warn spec Editors).

@foolip
Copy link
Member

foolip commented Apr 30, 2021

I noticed a new case of this in web-platform-tests/wpt#28739 and dug up all the current cases of FrozenArray<T> dictionary members:
https://immersive-web.github.io/hit-test/#idl-index
https://immersive-web.github.io/webxr/#idl-index
https://w3c.github.io/orientation-sensor/#idl-index
https://wicg.github.io/shape-detection-api/#idl-index
https://wicg.github.io/shape-detection-api/text.html#idl-index
https://wicg.github.io/ua-client-hints/#idl-index

It looks like in most cases it was just copy-pasted from an interface. While one can make sense of what this means and create the frozen arrays, it does seem kind of pointless. Whenever a dictionary is returned it's a new object, is there really any point in making arrays within frozen?

@foolip
Copy link
Member

foolip commented Apr 30, 2021

cc @yoavweiss since WICG/ua-client-hints#228 is very recent, and any rationale might still be in memory :) Or was it just copypasta as it appears?

@amtunlimited
Copy link

@foolip WICG/ua-client-hints#228 was me, and yes it was just copypasta. I'll get it fixed soon-ish

@foolip
Copy link
Member

foolip commented Apr 30, 2021

Thanks for confirming @amtunlimited!

@domenic
Copy link
Member

domenic commented Apr 30, 2021

I think we should prohibit this, FWIW.

@domenic
Copy link
Member

domenic commented Apr 3, 2024

Let's roll this into #1399.

@domenic domenic closed this as completed Apr 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

6 participants