Show HN: Plain Vanilla – a tutorial website for vanilla web development
The article discusses web development using only HTML, CSS, and JavaScript, emphasizing Web Components and modern CSS. It encourages experienced developers to explore this simpler, standards-based approach for building applications.
Read original articleThe article provides an overview of web development using only vanilla techniques, emphasizing the use of HTML, CSS, and JavaScript without frameworks or build tools. It covers key topics such as components, styling, site creation, and application development. Web Components are highlighted as the fundamental building blocks for creating higher-level primitives, replacing the component-based approaches of frameworks like React or Vue. The article also discusses leveraging modern CSS capabilities to eliminate the need for tools like CSS Modules or SASS. It guides readers on how to create web projects and single-page applications while managing routing and state without relying on server-side logic or complex frameworks.
The tutorial is aimed at individuals already familiar with HTML, CSS, and JavaScript, and it suggests that beginners start with resources like The Odin Project or MDN Learn. The article contrasts the simplicity and low maintenance of the plain vanilla approach with the complexity and maintenance demands of modern frameworks. It encourages developers to explore this method after gaining experience with popular frameworks, as it allows for a deeper understanding of browser tools and the creation of reliable, long-lasting web applications. The techniques discussed are based solely on web standards, which are expected to remain relevant for decades. The article concludes by inviting readers to learn more about using Web Components for content composition.
Related
New Web Development: Or, why Copilots and chatbots are bad for modern web dev
The analysis critiques Copilots, chatbots, and React for web development, citing slow sites, complex code, and high costs. It advocates for a shift to browser APIs, CSS, and HTML for better performance and lower expenses. Transition challenges include finding developers skilled in vanilla JavaScript. Organizations are urged to prioritize simplicity, efficiency, and core web technology training.
We moved away from web components – learnings from a Component-First DevTool
Corbado, a startup, transitioned to framework-specific components like passkeys for user authentication in 2024. The move aimed to improve developer experience and meet evolving needs efficiently. The blog post covers benefits, challenges, strategies, and recommendations for startups considering a similar shift. It explores scenarios favoring a component-first strategy and details building web components using various technologies. The discussion guides developers in navigating the JavaScript UI component-first startup landscape.
I disagree with your statement: "Don't use the plain vanilla approach until you've tried some of the popular web development frameworks and have learned why you might want to do without, and until you're confident on how to structure a codebase without the help of a framework."
I was writing vanilla javascript for years before I began using frameworks, so when I encounter a new one, I understand exactly what problem it's trying to solve. For any beginners, I personally recommend just building websites directly, without any framework assistance.
You don't have to use every feature out there. Getters that return 1 element that will never change. Splitting what should have been 1 style.css into 5 different files. Too many "best practices" for "complex" software.
I've written all of that from scratch because I got tired of maintaining node.js
But when splitting up the js file into pieces and using es6 modules, say 12 different files, Chrome makes 8 TCP connections on 8 different sockets, and each connection has its own TCP handshake (and TLS handshake for https). How do you bundle things without using a build system or a bundler? Import maps help, and it's not difficult to simply hash the page and copy the asset to a "dist/" folder with the hash appended, but it's still slow on first page load.
I'm not a web developer professionally (or network engineer), so I'm learning about web networking myself for the first time. It might be helpful to add a section about "traffic shaping"? I've smacked together a service worker that does the work of caching well-enough for now, but I'm definitely doing something rather strange and reinventing something. My page loaded significantly faster when it was just 1 JS file, no caching needed.
But the browser evolves:
- Convenient and flexible browser APIs totally replaced jQuery
- HTTP2 HPACK, multiplexing and connection coalescing make SPA and bundlers unnecessary
- Web Component and Shadow DOMs helps you write modular HTML and CSS
etc etc
And developer needs to evolve, too! These frameworks make too many leaky abstractions that developers should think about. It turns out if they don't encounter problems at the beginning, they will meet them later with interest.
I was going to write a similar document, but thankfully you write it so well!
P.S. I'm also not against the framework to solve engineering problems like testing or CI/CD.
[0] https://caniuse.com/?search=web%20components [1] https://stackoverflow.com/a/11487293/691156
A working version can be found here: https://hastebin.skyra.pw/xonoseruyi.ts
There is currently no documentation, but most of the function names are self explanatory.
I last did hands-on (professional) development back in the jquery era, but have amassed a certain degree of familiarity with modern frameworks by contracting / PM-ing various projects others chose to build with them.
To be honest, I'd no idea how far "vanilla" capabilities had progressed. My last couple of personal projects I built with jquery, because I still know it, a framework would be way overkill, and, you know, why the hell not? Your presentation has me excited to learn something new. Again, thanks.
Related
New Web Development: Or, why Copilots and chatbots are bad for modern web dev
The analysis critiques Copilots, chatbots, and React for web development, citing slow sites, complex code, and high costs. It advocates for a shift to browser APIs, CSS, and HTML for better performance and lower expenses. Transition challenges include finding developers skilled in vanilla JavaScript. Organizations are urged to prioritize simplicity, efficiency, and core web technology training.
We moved away from web components – learnings from a Component-First DevTool
Corbado, a startup, transitioned to framework-specific components like passkeys for user authentication in 2024. The move aimed to improve developer experience and meet evolving needs efficiently. The blog post covers benefits, challenges, strategies, and recommendations for startups considering a similar shift. It explores scenarios favoring a component-first strategy and details building web components using various technologies. The discussion guides developers in navigating the JavaScript UI component-first startup landscape.