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

Allow overlapping BCD keys without creating ambiguity #1173

Open
foolip opened this issue Jun 3, 2024 · 5 comments
Open

Allow overlapping BCD keys without creating ambiguity #1173

foolip opened this issue Jun 3, 2024 · 5 comments
Labels
enhancement New feature or request

Comments

@foolip
Copy link
Collaborator

foolip commented Jun 3, 2024

#1164 was caused by javascript.statements.import being part of both CSS modules and JS modules. In this situation, looking up a feature by BCD key finds two features, so consumers need something more to determine the status of javascript.statements.import.

The <source> element is a good illustration of the problem. The <audio> and <video> elements aren't yet in web-features, but if we add them, it would make sense for the <source> element (and HTMLMediaElement interface) to be part of both features, which shipped at the same time. But the <source> element is also a part of the <picture> element which shipped much later. Rather than picking a feature which gets to claim each BCD key, it would be good if overlap was handled gracefully.

This also has implications for #979.

@foolip
Copy link
Collaborator Author

foolip commented Jun 3, 2024

It looks like javascript.statements.import is the only key that did belong to two features.

@foolip
Copy link
Collaborator Author

foolip commented Jun 3, 2024

Rather than having rules that consumers need to handle for this rare situation, it would be good if we can bake the behavior we want into compute-baseline in #979. Something like:

  • Our recommended way of getting the Baseline status of a BCD key is together with a web-features identifier, like computeBaselineForPartOfFeature('js-modules', 'javascript.statements.import'). This would clamp the dates so that the part of the feature is never claimed to be older than the overall feature.
  • Theres's also a computeBaselineForCompatKey('javascript.statements.import') which would find the features that includes the compat key, and clamp to the oldest of the found featuers.

This would end up having the right effect on https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import at least.

@ddbeck
Copy link
Collaborator

ddbeck commented Jun 6, 2024

#1204 is a step toward the ideas @foolip has mentioned above, though very incompletely.

@captainbrosset
Copy link
Contributor

@ddbeck now that #1204 is done, does that bring us closer to being able to use the same BCD keys in multiple features?

@ddbeck
Copy link
Collaborator

ddbeck commented Nov 29, 2024

@captainbrosset I'm not sure. This limitation came at MDN's request. I meet with the MDN folks periodically, so I'm going to talk to them next week and see what blockers, if any, remain from their perspective. I don't think any other consumers care.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants