Testing 10 JavaScript Frameworks on Their HTML Defaults

Published on February 12, 2025, filed under (RSS feed for all categories).

I don’t know how it is for you, but, traditionally a front-of-the-frontend developer, I’ve always been skeptical about JavaScript frameworks. I’ve been attributing a good part of the HTML crisis—that most sites ship invalid and fantasy HTML—to them.

That’s something I wanted to probe. I took 10 popular JavaScript frameworks, spun up their demo or started or base projects (using all defaults), and validated the HTML source (both raw and hydrated).

Modern JavaScript Frameworks and Their HTML

Framework HTML Errors/ Warnings Source HTML Errors/ Warnings Hydrated Comments
React with Next.js 0/0 0/0 Unnecessary trailing slashes on void elements
Vue.js with Vite 0/0 0/6 Unnecessary use of type attributes
Angular 0/0 59/0 Invalid use of bogus _ngcontent-* attributes
Svelte 0/0 0/5 Unnecessary trailing slashes on void elements (demo source), unnecessary use of type attributes (demo hydrated)
Ember.js 0/1 0/2 Unnecessary trailing slash on void element (source), unnecessary use of type attributes (hydrated)
Astro 1/1 1/1 Nesting and heading issues
Meteor with React 0/58 0/58 Unnecessary use of type attributes
Qwik 24/21 22/21 Bogus attributes
Remix with Vite 2+/0 0/1 “Fatal Error: Cannot recover after last error. Any further errors will be ignored.”; then, unnecessary use of type attributes
Stimulus 1/1 1/0 Missing title

Why Out-of-the-Box HTML Matters

Before I give my view on these results, let’s be clear: This is pretty rough. It looks at the out-of-the-box experience with these frameworks, one that cannot represent how the teams behind the frameworks use and advocate for HTML in other places, or how the frameworks end up being used. It’s also no analysis of each prevalent HTML writing style and its adequacy.

But, this still gives us a taste. That taste is important for two reasons:

  1. Some users may not replace but build on the HTML used by frameworks. Any accessibility, performance, and conformance issues are then inherited and spread.

  2. The HTML used by frameworks sends a signal in terms of the importance of HTML: It can send a useful signal, making HTML a first-class language important to master, or it can send a poor signal, as if HTML quality wouldn’t matter.

Both is relevant because frameworks are multipliers—the more popular a framework, the greater the effect. *

Observations and Conclusion

There are two things I think we can note:

  1. Frameworks, like websites, come with pretty embarrassing HTML errors (and warnings). Use trailing slashes for void elements? I know some don’t mind these, but that’s XHTML–HTML. type attributes on scripts and style sheets? That’s 90s/2000s coding. Custom namespaces? That, too, is reminiscent of times past.

  2. But, it’s not that bad! The good thing about those embarrassing HTML errors is that they’re pretty easy to fix. â€  Like a professional frontend developer would (I keep rubbing people’s noses in this because HTML conformance is good for our field), framework teams could validate the output of their HTML and fix the problems. And, there are frameworks that come with valid output. This is basic, yes, but basic is where it starts.

Personally, am I less skeptical about JavaScript frameworks now? Yes!—I actually even got a bit curious about some, like Svelte and Astro. And maybe my view changes further, with more projects that necessitate them—and JavaScript frameworks ensuring their HTML output does at least meet the most basic of professional standards. Peace âśŚď¸Ź

* If you ask me, this needs a lot more attention, to the point where our frameworks, site generators, and content management systems are opinionated but flawless in terms of their out-of-the-box quality. What impact has WordPress had, to use a different example, on the average HTML quality on the Web? With their popularity, they could literally lift all boats.

† Frankly, this point also makes the whole topic of HTML conformance incredibly frustrating. Most issues are super-easy to fix. And yet—grant me to exaggerate to make the point—our field, where people earn three or four times as much as a police officer, fire fighter, or nurse, can’t be bothered to close a tag or rename an attribute. When we act like this, we are not being professionals, and we do a disservice to our field—because we don’t take our own work serious enough to do it right. It’s imperative that frontend developers ship valid code.

Was this useful or interesting? Share this post (e.g., on Mastodon or on Bluesky), and support my work by learning with my ebooks!

About Me

Jens Oliver Meiert, on November 9, 2024.

I’m Jens (long: Jens Oliver Meiert), and I’m a web developer, manager, and author. I’ve worked as a technical lead and engineering manager for small and large enterprises, I’m an occasional contributor to web standards (like HTML, CSS, WCAG), and I write and review books for O’Reilly and Frontend Dogma.

I love trying things, not only in web development and engineering management, but also in other areas like philosophy. Here on meiert.com I share some of my experiences and views. (I value you being critical, interpreting charitably, and giving feedback.)