-
Notifications
You must be signed in to change notification settings - Fork 49
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
give advice on read-only lists #50
Comments
We agreed we should keep this open but lower priority. |
This continues to be something that people run into; see WICG/construct-stylesheets#45 for instance. |
So it's not clear to me what we need to recommend about It also seems that the notion of returning static snapshots that the initial comment here suggests was the problem in WICG/construct-stylesheets#45 because that case required an API for mutation, so I think we have at least some evidence that static snapshots aren't a good API for mutation. I think this aligns with the existing advice on live versus static objects which I think is relevant here (particularly the bit about how things that are the way state is mutated should be live). Is the intent of |
Sorry if this is covered already (it's kinda hinted at in the OP)... there is also cases I've seen where
What's the right thing to use above? A |
Always sequence for method arguments. |
There appears to be a good bit of useful background for this in whatwg/webidl#796. |
Upon further discussion with @dbaron as part of our Cork virtual f2f the following recommendation should be considered and made.
|
Return values from methods should be sequences; those give static snapshots of arrays. |
The added recommendation is about the types of static lists to be considered for API design. Addresses #50
* Add advice about read-only lists The added recommendation is about the types of static lists to be considered for API design. Addresses #50 * Addressing CR feedback * One last nit addressed
* Add advice about read-only lists The added recommendation is about the types of static lists to be considered for API design. Addresses #50 * Addressing CR feedback * One last nit addressed
In a comment on #47, which created the section on live versus static objects, @domenic wrote:
The text was updated successfully, but these errors were encountered: