JavaScript in 2026: What Actually Matters for Modern Websites

In 2026 the JavaScript that matters is the JavaScript you don't ship. Use plain HTML and CSS, reach for native browser APIs like dialog and IntersectionObserver, and only add a framework when a real interactive feature demands one. Less code, fewer dependencies, faster sites.
Part of the complete web development guide.
On this page
- Ship less JavaScript, not more
- Use the platform: modern browser APIs
- A dialog example that used to be 40 lines of code
- Server rendering beats client rendering for most content
- TypeScript is the default now
- Stop fighting the bundler
- Accessibility is not a JavaScript problem, but JavaScript often breaks it
- What I’d actually do in 2026
- FAQ
- Do I need a JavaScript framework for my business site?
- Is TypeScript worth the setup cost?
- What’s the fastest way to improve an existing site’s performance?
Most JavaScript advice you’ll find online is written for a version of the web that no longer exists. Frameworks have matured, browsers have caught up, and the real problems in 2026 are different from the ones we were solving in 2019. If you’re maintaining a site or planning a rebuild, here’s what I’d actually focus on.
Ship less JavaScript, not more
The single biggest performance win on most sites is deleting code, not adding it. A typical marketing site or small business site does not need a client-side framework at all. It needs HTML, a bit of CSS, and maybe 3KB of JavaScript for a mobile menu and a form handler.
I’ve rebuilt more than a few sites where the previous version shipped 400KB of JavaScript to render a page of static text. The fix wasn’t a clever optimization. It was removing the framework.
Before you reach for a build tool, ask what the JavaScript actually does. If the answer is “handles a hamburger menu,” you don’t need React.
Use the platform: modern browser APIs
Browsers in 2026 ship features that used to require libraries. A few I use regularly:
<dialog>for modals, with built-in focus trapping and backdrop handlingIntersectionObserverfor lazy loading and scroll animationsfetchwithAbortControllerfor cancellable requests- CSS
@containerqueries, which often replace JavaScript resize listeners entirely View Transitionsfor page-to-page animation without a routing library
Every one of those replaces a dependency you’d otherwise maintain, patch, and eventually migrate off of.
A dialog example that used to be 40 lines of code
<dialog id="contact">
<form method="dialog">
<h2>Get in touch</h2>
<label>Email <input type="email" name="email" required></label>
<button value="cancel">Cancel</button>
<button value="send">Send</button>
</form>
</dialog>
<script>
const dialog = document.getElementById('contact');
document.querySelector('#open-contact')
.addEventListener('click', () => dialog.showModal());
</script>
That’s it. Focus management, escape-to-close, and the backdrop are all handled by the browser. Five years ago this was a library.
Server rendering beats client rendering for most content
If your page is content that search engines and humans need to read, render it on the server. Client-side rendering made sense when servers were slow and browsers were fast. That tradeoff flipped a while ago.
In 2026 the pragmatic default for most sites is server-rendered HTML with small islands of interactivity where you actually need them. Astro, SvelteKit, and Next.js all support this pattern well. You don’t have to pick one and marry it. Pick based on what your team can maintain.
If you’re working with a developer on a rebuild, this is a conversation worth having early. The architecture decision you make on day one is the one you live with for years. That’s part of why I handle custom web development the way I do, building for the maintenance window, not just the launch.
TypeScript is the default now
This is no longer a debate. If you’re writing JavaScript for anything that will be maintained by more than one person, use TypeScript. The tooling is mature, the editor experience is better, and the bugs it catches are the boring ones you’d otherwise find in production.
You don’t need to go all-in on strict mode on day one. Start with allowJs: true and tighten over time.
// tsconfig.json
{
"compilerOptions": {
"target": "ES2022",
"module": "ESNext",
"moduleResolution": "bundler",
"strict": true,
"noUncheckedIndexedAccess": true,
"skipLibCheck": true
}
}
noUncheckedIndexedAccess alone catches a category of bug that has bitten me more times than I’d like to admit.
Stop fighting the bundler
Bundlers are fine. They’re also a common source of wasted hours. Two rules I follow:
- Let the framework handle the config. Custom webpack setups are a maintenance tax nobody pays back.
- Test the production build, not just dev. Half the bugs I see only show up after minification or tree-shaking.
Vite won this round for most projects, and its defaults are sane. If you find yourself writing a plugin to fix a plugin, that’s a signal.
Accessibility is not a JavaScript problem, but JavaScript often breaks it
Most accessibility failures I see on client sites are not caused by missing ARIA. They’re caused by JavaScript that reimplements something the browser already does correctly. Custom dropdowns, custom modals, custom form validation. Each one is a chance to break keyboard navigation.
Use native elements first. <button>, <dialog>, <details>, <select>. Reach for ARIA only when there is genuinely no native option, and test with a keyboard before you ship.
What I’d actually do in 2026
For a typical business site:
- Server-rendered HTML, minimal client JavaScript
- Native browser APIs instead of libraries for common UI
- TypeScript for anything over a few hundred lines
- Vite or the framework’s built-in bundler, no custom config
- Measure with real user metrics, not just Lighthouse scores
None of this is exciting. That’s the point. The job in 2026 is to build things that still work in 2031 without a rewrite, and the boring choices are usually the ones that get you there.
FAQ
Do I need a JavaScript framework for my business site?
Usually no. If your site is mostly content with a contact form and a mobile menu, plain HTML and a small script will outperform and outlast a framework setup.
Is TypeScript worth the setup cost?
Yes, if the code will be maintained. The setup is a few minutes and the bugs it prevents are the kind that cost hours to track down in production.
What’s the fastest way to improve an existing site’s performance?
Measure first, then remove JavaScript you don’t need. Deleting a dependency almost always beats optimizing it.


