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
halflife#
Finally.

This is exactly what I need when I need it. The amount of pull requests I reviewed with a mess of codes that can be switched to 2 lines of modern features made me write such tools myself, only half assed since I have other things to do.

phyzix57616 replies#
"Best Practices" are pretty much dead in the AI era. Pretty soon no one is going to read any of the code AI produces and that's a scary thought.
natorion#
Best practices are not dead if they result in better user experience. The focus is less on developer ergonomics though - true that.
paulirish2 replies#
IMO maintainability is the next frontier. If we just allow coding agents to accrete 1k-LOC solutions to problems, the codebases run quick away from our ability to maintain _some_ level of understanding.

So I'll take a 1-line CSS solution over 60 lines of ResizeObserver/setTimeout business. But.. best practices for frontend isn't just the code.. it's ensuring quality UX, that keyboard navigability works, that layout doesn't shift on users.

aidos#
Once again, thank you for all the work you and the team have done to improve the web and the experience for developers working with it.
noosphr2 replies#
You just regenerate the codebase, like how you do a recompile in C. Writing code is 2026 is worth as much as writing machine code was in 1996.
soon_to_be_sb1 reply#
Jesus! what a horrible idea!

Are you in the business of selling tokens/electricity/gpus by any chance? Then good for you!
But terrible for everyone else....

Continue this thread — 1 reply

ozim#
Ugh it is Uncle Bob, not going to torture AI with this guy.

But the fun part is that all of the proper software engineering practices are aimed at lowering amount of context a developer has to keep in his mind. So it directly applies to agent context. Less verbose code, less tokens to burn, separation of concerns, lower chance agent breaks something unrelated etc.

brlewis4 replies#
I am not generally against using AI to reduce the amount of information you need to pay attention to, and I was not joking. There are multiple places in that interview with good articulation of the reasons why software fundamentals still matter, and what happens when you don't look at at least some of the AI-generated code.

Continue this thread — 4 replies

sublinear1 reply#
The "modern web primitives" are also not even necessarily the "best practice".

Browser-specific implementation gotchas tend to take about a decade to iron out for reasons that never have anything to do with code quality. Users are fickle and so are browser vendors, but that's a different topic.
At the end of the day, there's just no escaping lots of manual testing across device and browser combinations if your goal is a polished result and not just something that "works".
AI has done nothing to make this problem go away. If anything, it's made it worse because people don't even want to look at the code now!

zeroq#
Exactly.

I've recently finished a browser game specifically targeting an old iPad Air 1 we had lying around the house.
I had a working version after a weekend, but it took me a month to make it run smoothly on an over 10 years old mobile device. And the most recent browser available is almost 10 years old.
Surprisingly I didn't missed too many "modern" JS features, as these were mostly functional programming oriented which doesn't play well with optimization anyways, and the ES6 was more than enough as a programming platform.
Anyway, what I'm trying to say is that "the best practice" should be making your apps fast and accessible - as much as you can without having to sacrifice something you value - instead of chasing the latest and shiniest.
Don't be a fashion driven developer. :)

jefftk#
This is mostly best practices for making websites work better, not for pretty HTML.
stronglikedan#
just tell the AI to use best practices when writing code /s
SoftTalker1 reply#
Remeber, the features you don't use are the ones you don't have to support, or scramble to replace when they are deprecated.

Keep your effing websites simple.

zahlman#
In my book, new "baseline" CSS features that handle common design tasks count as simpler (and more user-friendly) than involving JavaScript to set them up, even if it's "vanilla" JS. The user's browser should as much as possible be treating my content as data rather than code and just doing fancy rendering on it, as long as I'm not explicitly trying to show the user a cool program. The browser may be huge, but it's only one thing that has to be huge for the benefit of every site.

(I have much the same instinct about the UNIX philosophy. Bash is not too big. Shell programs should be even bigger so that query programs can be smaller — because otherwise they grow huge lists of options that largely overlap, for things like table formatting, and provide an inconsistent UX.)

fumar#
I added this a few months ago and Claude Doctor has not removed it. It must be working and getting use.

Load more comments