I use frameworks. I like frameworks. But my default move for a new feature is still a plain <script> tag.
The checklist
Before adding a dependency, I ask:
- Can the platform already do this?
- Will I still be maintaining this in three years?
- How many kilobytes am I paying for what I actually use?
Surprisingly often, the platform wins.
Example: a tiny accordion
document.querySelectorAll('[data-accordion] button').forEach((btn) => {
btn.addEventListener('click', () => {
const open = btn.getAttribute('aria-expanded') === 'true';
btn.setAttribute('aria-expanded', String(!open));
btn.nextElementSibling.hidden = open;
});
});
Twelve lines, no build step, accessible by default. (Or just use <details> and write zero.)
When I do reach for more
- Complex shared state across many components
- Large teams that need conventions enforced
- Heavy animation timelines — that's where GSAP earns its place
The goal isn't purity. It's choosing the smallest tool that does the job well.