News for hackers. Stuff that matters.
Re:Web Locks API by simonw on Sunday November 10, 2024 @06:46PM (#42103439)
I wish the compatibility tables on MDN gave an indicator of when a feature became available.

My ideal would be a thing that says "this hit 90% of deployed browsers 4 years ago", but just seeing the date it was added to each of the significant browser families would be amazingly useful.

Re:Web Locks API by spartanatreyu on Sunday November 10, 2024 @07:22PM (#42103591)
It does.

Using the Web Locks API page as an example, let's say we want to know when `LockManager` was added to Chrome. Here are the steps:

1. View the page: https://developer.mozilla.org/en-US/docs/Web/API/Web_Locks_A... 2. Scroll down to the Browser compatibility table 3. Find the cell you're interested in, in this example we're looking at where the `LockManager` row meets the Chrome column. 4. We see a check and a version number (in this case 69).

So at this point we know that it has existed since version 69.

Now in the case that we don't know that Chrome's current version is already < 100 and we need to know when a feature gained support:

5. Click on the cell to view the timeline of that cell.

Now we know that it was released on 2018-09-04, and it never had a smaller release requiring browser flags/prefixes/experiment flags/etc...

Re:Web Locks API by simonw on Sunday November 10, 2024 @08:29PM (#42103868)
I honestly never thought to click on those! Thanks very much.

Now I'm digging around in https://github.com/mdn/browser-compat-data/blob/main/api/Loc... and trying to find the browser release dates data...

Ooh, https://bcd.developer.mozilla.org/bcd/api/v0/current/api.Loc... is even better - it expands those browser dates and it's served with access-control-allow-origin: *

Re:Web Locks API by simonw on Sunday November 10, 2024 @08:58PM (#42104014)
I used that to build this tool: https://tools.simonwillison.net/mdn-timelines#Lock

It lets you search for an API and then displays a timeline. Details on how I built it here: https://github.com/simonw/tools/commit/59323c6a30271c856aabb... and https://github.com/simonw/tools/commit/472b46fda02e912c43604...

Re:Web Locks API by simonw on Sunday November 10, 2024 @10:27PM (#42104387)
Re:Web Locks API by fragmede on Sunday November 10, 2024 @10:56PM (#42104492)
thank you for posting transcripts!
Re:Web Locks API by simonw on Sunday November 10, 2024 @11:10PM (#42104536)
I do that a lot: most of the commits in that tools repo (which doubles as my "playing around with LLM generated code" repo) include links to the relevant conversations: https://github.com/simonw/tools/commits/main/
Re:Web Locks API by chrismorgan on Monday November 11, 2024 @02:14AM (#42105085)
See also https://caniuse.com/mdn-api_lock, “Date relative” view is mostly better.
Re:Web Locks API by MayorMonty on Sunday November 10, 2024 @07:07PM (#42103522)
I think this is the idea behind the Baseline <Year> standard you see on a lot of mdn features now, it shows the year when the feature was available in all 3 major browser engines
Re:Web Locks API by pcl on Sunday November 10, 2024 @07:14PM (#42103555)
You can get this from caniuse, right? Would be a simple enough browser extension to marry the two together.

https://caniuse.com/mdn-api_lock

Re:Web Locks API by paulddraper on Sunday November 10, 2024 @09:18PM (#42104117)
caniuse.com