Order flag properties - #30469
Order flag properties#30469
Conversation
|
Tip: Review these changes grouped by change (recommended for most PRs), or grouped by feature (for large PRs). |
|
A little bikeshedding for you, @Elchi3. Do you know how frequent one sort order is versus another? It feels like But I suppose the "right" thing to do is to use the most frequent existing sort order (or to put this another way, to modify the fewest instances), to limit conflicts to open PRs. |
1943015 to
4319920
Compare
I would argue |
|
I have no strong feelings. As you can see with my second commit, the diff is smaller with |
I don't think we should care about minimizing changes, or limiting conflicts to open PRs. There are only 6 PRs that change flag data:
Resolving the merge conflicts should be straight-forward in all cases. |
|
How would we feel about allowing … {
"flags": ["Contact Picker API"],
// …
"flags": ["-unstable-webgpu"],
}… and replacing those as build time by: {
"flags": [{"name": "Contact Picker API", "type": "preference"}],
// …
"flags": [{"name": "-unstable-webgpu", "type": "runtime_flag"}],
}If we're okay with that, we can make that change first, and then I don't have strong opinions about the order of the expanded form (where a specific pref value needs to be set). |
I don't think that's true. See https://peter.sh/experiments/chromium-command-line-switches/ |
No, I'm not a fan of that. Flags are a fairly uncommon kind of data and I don't think we should increase magic (and complexity) on things that are the much less likely to get scrutiny than more common patterns in our data. Anyway, I still like the smaller diff with type first. In the absence of a clear reason to choose one sort over another, aligning to the status quo like a good option. And if someone still wants a different sort, then they can advocate for it affirmatively in a follow up PR. (Also, if we're nominating things to invest new linting effort into, I'd like to return to the idea of allowlisting flag names in the browser |
I don't see any preference starting with All runtime flags start with |
I don't think BCD should publish list of browser flags/runtime flags, but I could imagine creating a browser-flag-inventory package (like mdn-content-inventory) outside of the MDN org. |
|
OK, it seems like more discussion is needed about flags. I'm glad there is an appetite to do more work on them. For this PR, can we come to a decision, though? I scoped this PR just to get stable flag objects... |
|
If we're open to allowing short-hands in the future (which simplifies manual and automated authoring, and increases readability by reducing noise), I don't have strong opinions about the ordering. Otherwise, the most important property (the The status quo is not necessarily intentional.
Edit: I retract the above characterization. What I was trying, poorly, to express was a concern about the consequences of postponing the decision: after normalizing the repository to |
@caugner What are you on about? This is out of line. A false accusation of intransigence is unprofessional and unwarranted. I said that I liked the type-first order. I never said I was firmly committed to it. I characterized my own position as "bikeshedding." I called the small-diff approach the procedurally "right" choice (in sneer quotes!), informed by my experience with the migrations process of old, which is explicitly diff conscious. I am not certain that type-first is the best option. I am open to other considerations. For example, we have not sought other contributors' input; I suspect Hamish and Chris have higher-than-average experience authoring this kind of data and might have valuable contributions to such a discussion. In the absence of a quick and easy consensus, I earnestly wished to get something merged (for Florian to achieve the stability goal) and to let the the many threads here (sort order, build-time transformations, flag allowlists, etc.) to find their way to their own PRs and issues. To close, I regret expressing my opinion here and bringing up extraneous issues. I am going to mark this PR approved, but otherwise withdraw from discussion here. You may sort it any which way you like. |
Apologies. I sincerely regret my wording. I misinterpreted your reasoning and the intention behind your suggestion, and I should not have made that assumption about your position. Let's land this order, even if it's not the one I consider preferable and Florian initially suggested. Then let me make the case for the shorthand in one of our next meetings. |
Summary
To update BCD programmatically, for example from the OWD Collector project, diffs are cleaner when ordering is guaranteed. We already have this for several structures. I'm currently working on adding support for collecting flag data to the Collector project and I would benefit from a stable property order in the flag object.
This PR updates
stringify-and-order-properties.jsand enforces sorting:And then I ran
npm run fix, to fix the data.Test results and supporting details
I added a test to
stringify-and-order-properties.test.jsRelated issues
None, I think.