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

Add Intl.toString #7020

Merged
merged 1 commit into from
Nov 3, 2020
Merged

Add Intl.toString #7020

merged 1 commit into from
Nov 3, 2020

Conversation

hamishwillee
Copy link
Contributor

This adds BCD info for Intl.prototype[@@toStringTag] which was added in FF83. See bug report https://bugzilla.mozilla.org/show_bug.cgi?id=1670053

Docs are here: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/@@toStringTag

I tried this out on other browsers including latest chrome and opera and it works. However not sure how to record that because when I tried setting values to true the test tells me that the I'm not allowed. Similarly null. I suspect I could add specific versions, but I don't know when this went in.

@github-actions github-actions bot added the data:js Compat data for JS/ECMAScript features. https://developer.mozilla.org/docs/Web/JavaScript label Oct 23, 2020
"version_added": false
},
"safari": {
"version_added": false
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, no. Intl[@@toStringTag] is https://trac.webkit.org/changeset/266015/webkit, and it is not included in Safari 14 yet.

"version_added": false
},
"safari_ios": {
"version_added": false
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ditto.

@hamishwillee
Copy link
Contributor Author

@Constellation So what needs to happen for this to merge/progress?

@chrisdavidmills FYI, I tested this on Opera and the interactive example worked. But when I tried to set supported as true I got the following error:
image
Ditto for setting the ones I don't know to null.

@chrisdavidmills
Copy link
Contributor

FYI, I tested this on Opera and the interactive example worked. But when I tried to set supported as true I got the following error ; Ditto for setting the ones I don't know to null.

Hrm, I'm not sure why that is. @ddbeck, does JS BCD not longer accept true or null values? Sounds like possibly some weirdness in @hamishwillee 's local testing, as the CI run has passed for this one.

@ddbeck
Copy link
Collaborator

ddbeck commented Oct 26, 2020

@chrisdavidmills @hamishwillee That is weird, but I can't explain why it's passing CI. We do require real values in JavaScript though, so we should be getting an error in CI: https://github.com/mdn/browser-compat-data/blob/master/test/linter/test-real-values.js#L13

@hamishwillee
Copy link
Contributor Author

That is weird, but I can't explain why it's passing CI. We do require real values in JavaScript though, so we should be getting an error in CI: https://github.com/mdn/browser-compat-data/blob/master/test/linter/test-real-values.js#L13

@chrisdavidmills @ddbeck It passes CI because I've set the values to false as "the only passing choice I had". That means "not supported". I would like to set to true (supported but I don't know the version) and null (I don't know if it is supported). If I changed to null or false then I'd get the error.

Could be wrong, but

  • that bit you're pointing at is the name string for the browser not version_added. The relevant code for error is here: https://github.com/mdn/browser-compat-data/blob/master/test/linter/test-real-values.js#L60-L79
  • I interpret that as saying that once you've set that a particular browser is supported you can't then go saying that you don't know whether a particular feature is supported. I would guess the theory is that you should in this case have partial support in the parent level. That seems both strictly correct and daft - because it means that if you add a new feature to an API then all the parents that say "supported" would now become partial support - lots of churn.

This check was added October 4 in #4122.

@chrisdavidmills
Copy link
Contributor

@foolip @jpmedley Hi folks, could you help @hamishwillee figure out Chromium support for this? Thanks ;-)

@gilmoreorless
Copy link
Contributor

Looks like Intl[@@toStringTag] was added in V8 8.6.

That should mean it's in Chrome 86 and equivalents. Also Node.js 15.0.0 (which I've checked manually).

@foolip
Copy link
Contributor

foolip commented Oct 28, 2020

I've used https://software.hixie.ch/utilities/js/live-dom-viewer/?saved=8636 to confirm Chrome 86 is when this changed.

But I do wonder why this behavior matters to web developers, why does it matter what Intl.toString() will return?

@hamishwillee
Copy link
Contributor Author

hamishwillee commented Oct 29, 2020

@foolip Thanks. My understanding is that we document everything and let developers work out what interests them. @gilmoreorless Thanks!

We're going to run into lots more questions on "what version is this introduced in" now we've removed the option to put in "true" or "null". So irrespective of whether this one is of interested, we need more "scalable" ways to work out version.

Personally, I'd find it handy as an end user if there was some way to enter the current version as "true" - ie "works from at least xxxx".

@chrisdavidmills @ddbeck

  • I was able to to track down that opera 72 corresponds to Chrome 86, and I presume Chrome 86 == Chromium 86 for this purpose. Is there a table mapping chromium builds to the browsers/libraries that use them? I.e. how do I find out what version edge, webview, opera for android etc, uses of chromium?
  • @ddbeck [FIXED] This update fails locally due to the node value of 15.0.0 - however that is listed as a valid version. Thoughts?
    image

@gilmoreorless
Copy link
Contributor

This update fails locally due to the node value of 15.0.0 - however that is listed as a valid version. Thoughts?

It looks like you unfortunately created your branch in the small time window where the data for nodejs releases had a typo. It was fixed in #7018, so rebasing your branch off the latest master should fix that error.

@chrisdavidmills
Copy link
Contributor

* I was able to to track down that opera 72 corresponds to Chrome 86, and I presume Chrome 86 == Chromium 86 for this purpose. Is there a table mapping chromium builds to the browsers/libraries that use them? I.e. how do I find out what version edge, webview, opera for android etc, uses of chromium?

@ddbeck or @foolip would be better placed to answer that. Do we have anything like this? If not, we really should have; I spend ages looking up which version of Chrome corresponds to Chromium a, Chromium b, etc., when I do BCD work ;-)

@Constellation
Copy link
Contributor

@hamishwillee Safari 14.2 includes this support. So the version is 14.2.

@hamishwillee
Copy link
Contributor Author

Thanks @Constellation - will this also be on the iOS Safari version 14.2?
@ddbeck We currently only have Safari 14 (not 14.2). When/who does updates of this JSON? I plan to just leave as false for now.

@hamishwillee
Copy link
Contributor Author

hamishwillee commented Nov 2, 2020

I was able to to track down that opera 72 corresponds to Chrome 86, and I presume Chrome 86 == Chromium 86 for this purpose. Is there a table mapping chromium builds to the browsers/libraries that use them? I.e. how do I find out what version edge, webview, opera for android etc, uses of chromium?

@ddbeck or @foolip would be better placed to answer that. Do we have anything like this? If not, we really should have; I spend ages looking up which version of Chrome corresponds to Chromium a, Chromium b, etc., when I do BCD work ;-)

What Chris said.

We can't simultaneously require that accurate values for versions be listed without also making it possible to work out what those values might be.

Right now I have no choice but to ask you guys for: edge, chrome android, ie, nodejs, opera android, safari, webview, opera

For the others I can do a little digging:

@ddbeck
Copy link
Collaborator

ddbeck commented Nov 2, 2020

@hamishwillee @chrisdavidmills BCD itself has largely complete data about which browsers correspond to each other: take a peek at the files in the browsers directory. You'll find that most entries have an "engine" and "engine_version" field. So you can check that Chrome X is Blink X is Opera Y and so on. This can also be done, for example, between historic versions of Safari (by comparing WebKit version numbers).

I'll grant that reading plain JSON isn't particularly ergonomic. I've started on a little web tool that makes these comparisons easier, but I haven't had time to finish it or share it. If it's a major hurdle, I can prioritize it, but it so far hasn't been a big enough hurdle for me alone to justify it.

For Chromium, it's typical that are not gated to specific browsers, though (rarely) there are discrepancies between desktop and Android releases. But in most cases, knowing one version means that the data in browsers can complete the other Chromium-derivatives.

To be clear, I don't expect perfection on these things, but I do expect a decent guess based on the data already in BCD, or an explanation when diverging from it. If the data is incomplete or doesn't give you a clue, then please flag that for my attention. There's a wealth of knowledge stuck in the heads of the people who work on this project; you don't have to go it alone.

@Constellation
Copy link
Contributor

@hamishwillee Yes, Safari 14.2 iOS
Can you put Safari 14.2 entry to browsers? Since we know that this is supported, false is incorrect data.

@hamishwillee
Copy link
Contributor Author

@Constellation Sorry, no can do. But we can update once @ddbeck et al have added it.

@hamishwillee
Copy link
Contributor Author

@ddbeck This should now be ready to merge - it is up to date for current browser versions (as stored in https://github.com/mdn/browser-compat-data/tree/master/browsers).

Browsers like Opera Android and Safari have not got a corresponding release version yet in BCD so I can't update those. How do we track (make sure we don't forget) those? Add a separate issue as a reminder?

PS Thanks for your info above. I now appreciate why you see this as relatively trivial - hadn't realised that the browser JSON had this level of info. Provided you know a blink, webkit, v8 version, gecko version, you have everything. I might add a PR "how to work out versions" note to the docs at some point soon.

@foolip
Copy link
Contributor

foolip commented Nov 2, 2020

I see that nobody has mentioned the mirror script yet. For features that one can reasonably assume will be the same across all browser and platforms using a particular engine, one can get away with updating just the chrome, firefox and safari data and using npm run mirror to update everything else. It does take some work to figure out how to invoke npm run mirror in the right way, but it saves time after the first few times.

@Constellation
Copy link
Contributor

@hamishwillee So, can you put null instead of false? null means "not sure". false means "not supported".

@hamishwillee
Copy link
Contributor Author

So, can you put null instead of false? null means "not sure". false means "not supported".

@Constellation Again, no. Not because I don't want to but because the toolchain no longer allows null. In fact false is correct for the listed browsers. We just need someone to add those new ones. I'm sure that it will be done, it is just not something that I consider I should do as I am new to this. There is nothing stopping you creating a PR for a new version if you wish.

Constellation added a commit to Constellation/browser-compat-data that referenced this pull request Nov 3, 2020
- iOS 14.2 Release Candidate (18B91)
- macOS Big Sur 11.0.1 beta (20B5012d)

from https://developer.apple.com/news/releases/

to list Safari data for `Intl[@@toStringTag]` in mdn#7020.
@Constellation
Copy link
Contributor

@hamishwillee OK, I see. Added in #7248

Constellation added a commit to Constellation/browser-compat-data that referenced this pull request Nov 3, 2020
- iOS 14.2 Release Candidate (18B91)
- macOS Big Sur 11.0.1 beta (20B5012d)

from https://developer.apple.com/news/releases/

to list Safari data for `Intl[@@toStringTag]` in mdn#7020.
@ddbeck
Copy link
Collaborator

ddbeck commented Nov 3, 2020

OK, a few things to cover here. First the meta stuff and then I'll actually review this PR.

Docs and matching up browsers

Thanks for your info above. I now appreciate why you see this as relatively trivial - hadn't realised that the browser JSON had this level of info. Provided you know a blink, webkit, v8 version, gecko version, you have everything. I might add a PR "how to work out versions" note to the docs at some point soon.

Thank you for your patience with me on this, @hamishwillee! It took me a while to understand where you were coming from and what the sources of confusion were. It's absolutely not trivial to get your head around BCD and I shouldn't have suggested so.

I'd welcome a PR with more docs! If you prefer, you can also open an issue and log any first impressions, initial hurdles, half-baked ideas, and such. It's been so long since I was new to any of this that I have a hard time figuring out what new contributors need. Anything you have to share for this would be greatly appreciated.

Upcoming releases

Browsers like Opera Android and Safari have not got a corresponding release version yet in BCD so I can't update those. How do we track (make sure we don't forget) those? Add a separate issue as a reminder?

I think an issue is the way to go. #6601 and #6620 are existing tracking issues, or you can open new issues and link between them. This is an area that haven't got a good process about yet. So if you have any commentary on the process, that'd be interesting too.

@Constellation I'm going to review this PR (and probably merge it) shortly. A quick look at #7248 leaves me with questions, so I don't want to block this on that. If you'd like to open a follow-up PR with your suggestions, that would probably be best.

Copy link
Collaborator

@ddbeck ddbeck left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, merging. Thank you! 🎉

@ddbeck ddbeck merged commit 2b56f19 into mdn:master Nov 3, 2020
Constellation added a commit to Constellation/browser-compat-data that referenced this pull request Nov 3, 2020
- iOS 14.2 Release Candidate (18B91)
- macOS Big Sur 11.0.1 beta (20B5012d)

from https://developer.apple.com/news/releases/ to list Safari data for `Intl[@@toStringTag]` in mdn#7020.
The WebKit and Safari versions are checked by installing OSes, and opening "About Safari" prompt.
@hamishwillee hamishwillee deleted the intl_tostring branch November 6, 2020 00:35
@hamishwillee
Copy link
Contributor Author

hamishwillee commented Nov 6, 2020

Thanks @ddbeck. FYI only

Regarding a process for managing features in upcoming releases #7020 (comment).

The approach used in TODO for future Opera releases is a bit messy as it already has a "conversation". I don't mind the idea of a tracking post for all future issues on a browser if the process is formalised:

  • Issue for each browser
  • Description: checklist of open items sorted by probable release. Each item links to earlier items if known and other relevant background. Also trigger for it to come active if not obvious from release.
  • Don't allow comments - these make a "forever lasting" issue like this hard to read/use
  • Periodically sweep out the completed items so it is only open actions.
  • Someone has to sweep this regularly to check if ready to do.

Alternative is to open items specific item for each missing API - i.e. I created TODO Intl.toString for SamsungAd 14+, OperaAd 16+, Safari14.2+

What I like about this is that each item is specific. It could be assigned to one person, title includes relevant item and browser version at which I should look at it. This is my preference. The downside is that you end up with lots of these.

You could of course go further and create individual items for each API/browser "TODO Intl.toString for SamsungAd 14+". I like that too, but of course you end up with even more clutter in your project.

@hamishwillee
Copy link
Contributor Author

hamishwillee commented Nov 6, 2020

Re "Docs and matching up browsers":

Almost everything about the process is covered in https://github.com/mdn/browser-compat-data/blob/master/docs/contributing.md and its linked doc https://wiki.developer.mozilla.org/en-US/docs/MDN/Contribute/Processes/Matching_features_to_browser_version. There is just a LOT to take in, and even now I know this, I still think the job is by its nature not easy.

I think perhaps that it might be worth linking https://wiki.developer.mozilla.org/en-US/docs/MDN/Contribute/Processes/Matching_features_to_browser_version into the readme alongside "contributing" - it is a key doc.
Then updating that doc with an overview/summary which notes:

  • Many browsers share the same engine, so provided you can find a release for one you can take a reasonable guess that it will be in all (the exceptions being listed in the matching features doc above.)
  • https://github.com/mdn/browser-compat-data/blob/master/browsers/ has information about the versions for all release browsers along with their engine.
  • Maybe a summary list of the best resource finding info with link down docs for more detail.

Best though I just keep trying this for a bit until I am sure I won't be injecting confusion :-)

@ddbeck
Copy link
Collaborator

ddbeck commented Nov 6, 2020

@hamishwillee

Thanks for the assessment of the docs situation. I opened #7304 based on your comment. 👍

The approach used in TODO for future Opera releases is a bit messy as it already has a "conversation".

You're right. We've got #6561 open, but that's a mess too. I've commented there that we've got to find a better (likely, more automated) approach to that particular problem. In the mean time, I would suggest opening individual issues, as you've done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
data:js Compat data for JS/ECMAScript features. https://developer.mozilla.org/docs/Web/JavaScript
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants