Going Buildless
The article explores "buildless" web development, highlighting advancements in HTML, CSS, and JavaScript that simplify workflows. It suggests this approach is ideal for smaller projects, enhancing the developer experience.
Read original articleThe article discusses the concept of "buildless" web development, which allows developers to work directly with the files delivered to the browser without the need for complex build processes. The author reflects on the nostalgia of simpler times in web development, contrasting it with the current reliance on tools like bundlers and pipelines. While acknowledging the performance benefits of traditional build processes, the author explores recent advancements that could facilitate a buildless workflow, particularly in HTML, CSS, and JavaScript. For HTML, the article highlights the lack of standardized native imports and discusses various techniques, including web components and server-side enhancements, to achieve similar functionality. In CSS, the author notes the introduction of native features like variables and nesting, which reduce the need for preprocessors. For JavaScript, the article emphasizes the potential of ES Modules and Import Maps to eliminate the need for bundling. Ultimately, while a complete shift to buildless development may not be feasible for complex projects, it presents an appealing option for smaller sites and side projects, offering a more straightforward developer experience.
- Buildless web development allows direct editing of files without complex build processes.
- Recent advancements in HTML, CSS, and JavaScript support a buildless workflow.
- Techniques like web components and server-side enhancements can facilitate HTML imports.
- Native CSS features reduce reliance on preprocessors, while ES Modules simplify JavaScript management.
- Buildless development is more suitable for smaller projects, enhancing developer experience.
Related
Exposition of Front End Build Systems
Frontend build systems are crucial in web development, involving transpilation, bundling, and minification steps. Tools like Babel and Webpack optimize code for performance and developer experience. Various bundlers like Webpack, Rollup, Parcel, esbuild, and Turbopack are compared for features and performance.
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.
Web Crap Has Taken Control
The article critiques React's dominance in web development, citing complexity, performance issues, and excessive dependencies. It questions industry reliance on React, package management challenges, and suggests reevaluating development tools for efficiency.
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.
Server-First Web Components with DSD, Htmx, and Islands
Web Components gained universal browser support by 2020, with streaming Declarative Shadow DOM widely supported in February 2024, enabling server-rendering techniques applicable across various frameworks. A course is offered for further learning.
If you have a stupid simple HTML+CSS+JS project that nevertheless uses a build tool for some reason, a contributor should be able to clone the repo, open the README, read the instructions on how to build it and not encounter "first, install bun" (or whatever); in 90+% of cases, those instructions don't actually need be anything more complicated than "First, open the build script in a browser tab. Now drag and drop the project folder onto the build tool." You can double up and make that build script your README if you want—call it README.html.
It's baffling the numbers of folks who decided to focus on JS development because they wanted to draw on their familiarity/desire for developing for the browser and out of recognition that being able to create browser-based apps and deploy to users without making them install anything is a huge boon... and then went on to make a bunch of shoddy tooling that despite itself being nominally written in JS still requires you to download a bunch of other stuff to run it and doesn't leverage the standard JS runtime that everyone _already_ has installed.
You can't make this up.
A few tips:
* If you have a lot of JS files and want excellent performance you may still be able to skip a build step by leveraging `modulepreload`
* If you want some typing while still running without a build step, you can use JSDoc to embed TypeScript annotations for your JS[0].
* If you really want to have a mostly HTML site but don't want to manually duplicate code, I've had decent success with a technique I call "tuplates"[1][2]. Basically it's a very simple templating tool where the output is intended to be committed to git. It uses comments so it's language agnostic.
* If you go web components I highly recommend these best practices[3]. A lot of them were confusing for me at first but just keep them on your radar as you're learning.
[0]: https://www.typescriptlang.org/docs/handbook/jsdoc-supported...
[1]: Description: https://github.com/anderspitman/tuplates-js/blob/master/READ...
[2]: Latest implementation: https://github.com/anderspitman/tuplates
[3]: https://web.dev/articles/custom-elements-best-practices
I have to say, it's been a few years since I last did front-end dev work, and I was really pleasantly surprised by how much better CSS and Javascript became. All in all, it's been a really positive experience.
generally small parallel requests perform better than large single requests in a modern situation - modern browsers, HTTP 2+ etc. - in my experience - but there can be a lot of caveats about that statement.
However the import statements in the css are not downloaded in parallel last time I checked - and probably never would be because of ways css works, so this using import statements inside css instead of having a build of a single css is actually the worst possible solution I think (ok there is probably something even worse that you could build if you really wanted to but worst "reasonable" solution)
And recently I rewrote our CSS to use modern syntax and nesting and variables and etc. - no more Sass!
It worked great but then customers started to complain and send messed up screenshots.
Turns out a lot of Android phones are using an older browser and a couple of customers were locked into old versions of Chrome by corporate policy.
Fortunately this was all nesting rules. So renaming the css file to scss and running it though Sass fixed the issues.
adds more complexity
I was surprised how well module imports work in modern browsers.
I've never used css preprocessors before, so that wasn't an issue for me. I also have never nested CSS files, so that also wasn't an issue for me.
Another pain point is not having type safety on my front end calls to my backend. With TS I could use Zod on the front end as well and have type checks in place before I make those API calls. While obviously js doc tries to ensure at compile time that things are the correct shape, that isn't the same level of assurance.
But inevitably the complexity of my projects increase. My patience with focus, refresh, review cycle crashes. My first stop is usually vite, just for hot reload at first, but then for raw imports, and I do like nested CSS. When I find myself beginning to roll my own reactivity I tend to read up on the latest state of vue and svelte and drop whichever one feels right into the mix. It goes on.
All with the best intentions.
* Dependency management (use libs so you dont have to write/maintain that code yourself) * Code generation (we use that for added typesafety: jOOQ the SQL eDSL, and OpenAPI3 for generated clients + server-side DTOs) * Compilation (compile higher-level languages with strong type-safety guarantees, e.g. Kotlin, Elm, Haskell, Rust, TypeScript; to lower-level or dyn-typed/quirky languages, e.g. JS, WASM, byte-code, binaries)
Three pretty important advantages!
Sure builds come with added complexity, so it is a trade off. But when carefully picking technologies this can greatly pay back the cost of complexity.
Now, if you compile, say, JS to JS (less to CSS) with brittle build tools such as npm (shell commands in a string in a JSON called packages.json), and low quality dependencies, then the advantage your build step probably negative.
Do you not run a script to deploy your software in whatever way? If you do then what's the difference if the script builds some things as well and not just uploading?
All on the server!
Do I get nerd creds now? <3
Related
Exposition of Front End Build Systems
Frontend build systems are crucial in web development, involving transpilation, bundling, and minification steps. Tools like Babel and Webpack optimize code for performance and developer experience. Various bundlers like Webpack, Rollup, Parcel, esbuild, and Turbopack are compared for features and performance.
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.
Web Crap Has Taken Control
The article critiques React's dominance in web development, citing complexity, performance issues, and excessive dependencies. It questions industry reliance on React, package management challenges, and suggests reevaluating development tools for efficiency.
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.
Server-First Web Components with DSD, Htmx, and Islands
Web Components gained universal browser support by 2020, with streaming Declarative Shadow DOM widely supported in February 2024, enabling server-rendering techniques applicable across various frameworks. A course is offered for further learning.