Lurker News
Browsers natively handle a lot of what used to take 50 lines of JS (or a dependency): `CSS.highlights` for text range highlighting without s everywhere, `` and showModal() give you backdrops and ideal focus management, `field-sizing` to auto-grow textareas as the user types.. (Something yesterday's ftrain post touched on [0])

Models know about some of these by name, but consistently won't default to using the platform-native solution and instead prefer the incumbent +JS based pattern. We started an effort in Chrome to supplement coding agents with this key domain knowledge and we're shipping our 1.0 today, in collaboration with Firefox, MDN, and Edge.
200+ guides (~1.7MB) of curated, hand-crafted implementation best-practices from web experts, updated as the web evolves. (Open source, obv, so.. we'll welcome your bikeshedding ;) Readable versions here: [1]
I've spent the last 9 months obsessing over how to ship this as an agent skill + (Agentic RAG) CLI without blowing up your context window. (Or cedeing activation mechanics to MCP dynamic tool search). The skill description is minmaxed for activating on relevant frontend tasks. The RAG work I'm pretty proud of… originally a 500mb native stack down to a ~7MB pure-JS package, ~10ms search on your CPU.
We just introduced a deterministic 'legacy-scan' (trained on 30k github repos) to identify old 'n dusted patterns that your agent can modernize. (92% avg precision on held-out repos.)
People make a lot of claims about what coding agents are good/bad at. We wanted receipts, so we invested heavily in eval infra [2] to help us hill-climb, but also to identify when knowledge is common enough we can prune our guides. (Ofc, some of the things we thought AI didn't know turned out to be wrong :) We run codex/claude/agy against 200 tasks without the skill and then with.. In total ~1,700 playwright/AST-based assertions. Agents go from 55% pass unguided to 92% guided.
Try it out:

    DISABLE_TELEMETRY=1 npx modern-web-guidance@latest install
    DISABLE_TELEMETRY=1 npx modern-web-guidance@latest search "animate dialog modal"
    DISABLE_TELEMETRY=1 npx modern-web-guidance@latest legacy-scan ./src
If you spot something wrong or weird, give us a holler!

Longer write-up on the 1.0: https://developer.chrome.com/blog/modern-web-guidance-v1
---
0: https://news.ycombinator.com/item?id=50416456
1: https://developer.chrome.com/docs/modern-web-guidance/guides
2: https://googlechrome.github.io/modern-web-guidance-src/

Comments (146) 60 threads

Earlier comments
incrudible#
It would be hard to convince me to go all in on the latest featureset of the abomination that is HTML, CSS, DOM and to a lesser degree Javascript, governed by essentially a monopoly, a single implementation that nearly everyone uses, that is so big in code size that even a swarm of LLMs would choke on it.

I want the browser to be the thinnest layer it can be, between me and my application, which is governed by me.

flossly#
I prefer to have my templates in a compiled language: not passing a map of strings to a string with interpolation points, but actually "just code" by which I define HTML builders by combining templates/layouts/components in that same "just code".

Like HtmlFlow (Java/Kotlin) or kotlinx.html.
I pick Tailwind and Alpine.js to go with this approach because: I want to be SSR-first (with small JS-based improvements where they matter most) so NOT and SPA, i want the styling to be close to the HTML code that's being styled (no need to match between CSS definition and usage), and I also prefer to keep my tiny bits of JS close to the HTML it deals with (Alpine makes that easy and provides a clear path for implementing 99% of my JS needs).
Like everyone, LLMs code it for me :) But the result is easy to reason about for myself and my LLM. Little vanilla JS. No jQuery. Mostly just some HTML-bound Alpine instructions. And Tailwind everywhere. This way I can look at one place to see how it works: or CTRL-click my way to it.

pyrolistical#
I asked my agent to look at that list and only apply things that work on chrome, Firefox, safari iOS and safari macos

Came up with a good list for my project

zahlman#
> Browsers natively handle a lot of what used to take 50 lines of JS (or a dependency): `CSS.highlights` for text range highlighting without s everywhere

I tried to look this up and found https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/S... but the example depends on JS. How are you meant to statically specify highlighted ranges without the markup? If I'm syntax-highlighting code on a blog, it's seems a lot more practical to just use the old system than to encode a list of character ranges in a JS array and loop to assign highlights. Plus it doesn't require the reader to run JS.

Load more comments