TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Plain Vanilla Web

1518 pointsby andrewrn12 days ago

98 comments

bob102911 days ago
I&#x27;ve transcended the vanilla&#x2F;framework arguments in favor of &quot;do we even need a website for this?&quot;.<p>I&#x27;ve discovered that when you start getting really cynical about the actual need for a web application - <i>especially</i> in B2B SaaS - you may become surprised at how far you can take the business without touching a browser.<p>A vast majority of the hours I&#x27;ve spent building web sites &amp; applications has been devoted to administrative-style UI&#x2F;UX wherein we are ultimately giving the admin a way to mutate fields in a database somewhere such that the application behaves to the customer&#x27;s expectations. In many situations, it is clearly 100x faster&#x2F;easier&#x2F;less bullshit to send the business a template of the configuration (Excel files) and then load+merge their results directly into the same SQL tables.<p>The web provides one type of UI&#x2F;UX. It isn&#x27;t the only way for users to interact with your product or business. Email and flat files are far more flexible than any web solution.
评论 #43958462 未加载
评论 #43962204 未加载
评论 #43960312 未加载
评论 #43959677 未加载
评论 #43959070 未加载
评论 #43958129 未加载
评论 #43959237 未加载
评论 #43959541 未加载
评论 #43959575 未加载
评论 #43958047 未加载
评论 #43959157 未加载
评论 #43958068 未加载
评论 #43960209 未加载
评论 #43959747 未加载
评论 #43958844 未加载
评论 #43969791 未加载
评论 #43959366 未加载
评论 #43968890 未加载
评论 #43961353 未加载
评论 #43959772 未加载
donohoe12 days ago
I&#x27;m not against frameworks, but in many cases, they&#x27;re unnecessary. I&#x27;ve always questioned why we should add 100KB of JavaScript to a page before writing a single line of real code.<p>My team and I built <a href="https:&#x2F;&#x2F;restofworld.org" rel="nofollow">https:&#x2F;&#x2F;restofworld.org</a> without any frameworks. The feedback, from surveys, outreach, and unsolicited emails, has been overwhelmingly positive, especially around usability and reading experience.<p>We might adopt a framework eventually (I do appreciate how their opinionated structure can cut down on endless debates), but for now, plain JavaScript serves us really well.
评论 #43956777 未加载
评论 #43956604 未加载
评论 #43957422 未加载
评论 #43956855 未加载
评论 #43956012 未加载
评论 #43956222 未加载
评论 #43956897 未加载
评论 #43956272 未加载
评论 #43957967 未加载
评论 #43956132 未加载
评论 #43957376 未加载
评论 #43957332 未加载
评论 #43958248 未加载
评论 #43971293 未加载
评论 #43960575 未加载
评论 #43960204 未加载
评论 #43956050 未加载
评论 #43958582 未加载
评论 #43960177 未加载
评论 #43957939 未加载
评论 #43956553 未加载
评论 #43964741 未加载
评论 #43973251 未加载
评论 #43957042 未加载
评论 #43956643 未加载
评论 #43956466 未加载
评论 #43955956 未加载
评论 #43957760 未加载
pelagicAustral12 days ago
I work for about 2k users, they do not give a shit about reactivity... build a monolith, make it comfy, embrace page refresh (nobody gives a fuck about that in the real world), and get shit done.
评论 #43955981 未加载
评论 #43955738 未加载
评论 #43956625 未加载
评论 #43955758 未加载
评论 #43955796 未加载
评论 #43955790 未加载
评论 #43955962 未加载
评论 #43959023 未加载
评论 #43957707 未加载
评论 #43959176 未加载
评论 #43955659 未加载
评论 #43957282 未加载
评论 #43969797 未加载
coolhand212012 days ago
Very nice! I wish this was the world we lived in. I&#x27;m from the before times, when W3C stuff was all we had, and it was miserable because it was so immature, and we hired people who &quot;knew jQuery, but not JS&quot;. But if I&#x27;m being honest post query selector frameworks don&#x27;t have a strong cost benefit argument - testing frameworks notwithstanding, which are quite lovely.<p>I run sites that serve hundreds of millions per day and we pour a ton of resources into these projects. We&#x27;re trapped in a framework (react) prison of our own creation. All failures are those of complexly. Highly coupled state machines with hacked, weaved, minified, compiled, transpiled, shmanzpiled etc. into unreadable goop in production. Yes I know source maps, but only when needed, and they are yet another layer of complexity that can break - and they do. How I long for the good old days before frameworks.<p>Perhaps nostalgia and the principle of KISS (and a few others) is clouding my judgement here, after all, frameworks are made for a reason. But it&#x27;s difficult to imagine a new engineer having any more difficulty with vanilla than learning framework after framework.
评论 #43956407 未加载
评论 #43959212 未加载
评论 #43956001 未加载
评论 #43958058 未加载
评论 #43955723 未加载
90s_dev12 days ago
I am not sold on web-components yet. Especially now with @scoped and import{type:css}, I think there&#x27;s still a lot of merit to rendering an element statically, shipping it, and updating it dynamically via modern JS. I&#x27;m not sold on <i>how</i> people typically do that, and I think we should keep trying to innovate <i>outside of</i> the typical frameworks like React&#x2F;Svelte, but I definitely don&#x27;t see <i>any part</i> of web-components being useful to <i>any</i> type of site I run (and I run several disparate types).
评论 #43957090 未加载
评论 #43956774 未加载
评论 #43957142 未加载
评论 #43962866 未加载
评论 #43955943 未加载
red_admiral11 days ago
Once you&#x27;re building custom components in JS files, aren&#x27;t you basically writing your own microframework?<p>Sure you don&#x27;t need bundlers and compilers (such as TS to JS), but at some point you might need async updates on `fetch()` of components that also share state with other components. At this point you&#x27;re into framework territory, whether using your own or someone else&#x27;s.<p>Producing a framework with those features that still fits in a single small size JS file would be great, especially if it can do component updates to shared state (without updating the DOM each turn, hence shadow DOM).
评论 #43962563 未加载
评论 #43974536 未加载
dmje11 days ago
This entire endless conversation would be made SO much easier if we spent some time thinking about the difference between web APP and web SITE. They get conflated all the time and although there is of course a Venn diagram where there’s a bit of crossover, they’re basically entirely distinct beasts that require entirely different technical approaches.
chrisweekly12 days ago
This is a great resource.<p>IMHO everyone building for the web should understand how it works and know how to use the foundational web stack, leveraging the web platform per se. Then, by all means use a build system and your preferred frameworks at your discretion, remaining aware of tradeoffs.<p>For my part, one of the things I like best about Remix (&#x2F;React-router v7+) is its explicit philosophical alignment with leveraging web standards and doing more by doing less (e.g. mutate server data using... the HTML form tag).<p>I also highly recommend <a href="https:&#x2F;&#x2F;every-layout.dev" rel="nofollow">https:&#x2F;&#x2F;every-layout.dev</a> which showcases eye-opening, mind-expanding techniques for implementing performant, accessible, flexible web layouts using only browser-native CSS.<p>Context: I&#x27;ve been professionally involved with web development since 1998.
NoSalt11 days ago
I know I am in the VAST minority, or perhaps the only one, but I cannot stand frameworks. Sure, there may be a lot of power in them, but there is also a lot of bloat and complexity. IMHO, this &quot;power&quot; can easily be achieved with libraries instead of an IOC framework. After you learn a, typically terse and confusing, framework language, you have to know that framework language along with the base language (Java, C#, JavaScript, Python, etc.) I feel like frameworks are only as popular as they are because product owners and managers like to tick-off the number of tools their developers use; makes them look important, knowledgeable, and efficient.
评论 #43965312 未加载
评论 #43967054 未加载
评论 #43962901 未加载
评论 #43969813 未加载
FjordWarden12 days ago
I don&#x27;t find WebComponents a good replacement for what in other web frameworks are called components. For one thing they don&#x27;t support complex values like Objects and Arrays as attributes. The amount of boilerplate you have to write is way too high, and you still don&#x27;t have reactivity. I do vanilla-ish JS using signals[1]. Not everything the W3C releases should be canon, XHTML is a testament to that.<p>[1] <a href="https:&#x2F;&#x2F;wrnrlr.github.io&#x2F;prelude&#x2F;" rel="nofollow">https:&#x2F;&#x2F;wrnrlr.github.io&#x2F;prelude&#x2F;</a>
评论 #43974643 未加载
评论 #43957146 未加载
mmcnl12 days ago
This guide assumes web components is a viable alternative for frameworks like React or Vue. That&#x27;s a very superficial assumption. React and Vue render the UI as declarative function of state, with the help of components. That&#x27;s why we use those frameworks. Web components don&#x27;t solve the state management problem.
评论 #43956964 未加载
评论 #43955965 未加载
评论 #43955899 未加载
评论 #43956062 未加载
hanlonsrazor12 days ago
Seems like this is more for the hobbyists - building webpages for the love of the act. Frameworks are built to be standardized, enforce best practices via their design, and allow developers to &#x27;hit the ground running&#x27;, so to speak.<p>No web site is intrinsically valuable - the information and functionality it wraps is what holds its value. Developing the access to that information and function, enforcing correctness, and the timeliness of that development is what frameworks empower orgs to deliver at much lower cost in the present and future, vs. vanilla web dev.
评论 #43957206 未加载
评论 #43957264 未加载
andrewmcwatters12 days ago
I have some notes here at andrewmcwatters&#x2F;custom-elements <a href="https:&#x2F;&#x2F;github.com&#x2F;andrewmcwatters&#x2F;custom-elements">https:&#x2F;&#x2F;github.com&#x2F;andrewmcwatters&#x2F;custom-elements</a>.<p>My business doesn&#x27;t use React anymore, and I&#x27;m so happy I don&#x27;t have to do pointless maintenance.<p>A side note, included in my repository: you update your element&#x27;s innerHtml from the constructor, not from the connectedCallback. MDN and the web standards seem to be inconsistent on this, and elsewhere people write about it, too.<p>People talk a lot about data and binding, etc. I think it&#x27;s weird, it&#x27;s like people have forgotten how to just use setters. You can call a render() method from a setter, and it does the same thing WebKit et al do when you call an internal setter on an HTML element.<p>I don&#x27;t see the value in these frameworks anymore.
neiman12 days ago
I did a small project last week<i>. It&#x27;s completely vanilla and works great. It&#x27;s a web tool for writing long threads for Mastodon.<p>I kept on wondering while making it if I was doing it wrong without any framework. Because that&#x27;s what everyone else seems to expect.<p></i> Splinter, splinter.almonit.club, if anyone cares.
braden-lk12 days ago
Very cool overview and a great article—it’s fascinating to see how far web components have come. Data passing, interactivity, and state management still seem pretty tedious in vanilla, though!
评论 #43955679 未加载
评论 #43956802 未加载
评论 #43955819 未加载
评论 #43959042 未加载
d_burfoot12 days ago
Note that you can make things even simpler than this: just use vanilla JS to compose HTML strings, and plug them into divs using innerHTML = &quot;...&quot;. When your state changes due to user input, just rebuild the page using the new data.<p>I&#x27;ve been building many simple apps using this technique, it works fine. I&#x27;m sure there is some kind of performance hit; it&#x27;s almost never an issue. I have never seen any browser compatibility issues.
评论 #43956146 未加载
评论 #43967444 未加载
评论 #43956307 未加载
评论 #43959951 未加载
评论 #43956582 未加载
评论 #43956087 未加载
montag11 days ago
Spend five minutes on webcomponents.org for a depressing ride. Broken links, broken demos, ghost town community and shuttered chat servers. Sponsored and abandoned by the Google Polymer team, or so it appears. Just sad.
评论 #43962063 未加载
daitangio12 days ago
Hum for me vanilla is html+css. If you throw in javascript language, I do not see the &#x27;vanilla&#x27; anymore :)<p>I ended up using hugo + isso (for commenting) and it works very well. I moved to this setup after the wordpress drama, and even if I miss something, freedom has no price: <a href="https:&#x2F;&#x2F;gioorgi.com&#x2F;2024&#x2F;liberta-come-aria&#x2F;" rel="nofollow">https:&#x2F;&#x2F;gioorgi.com&#x2F;2024&#x2F;liberta-come-aria&#x2F;</a>
mikebelanger12 days ago
Great resource! I particularly like the fact that their web component section doesn&#x27;t use the shadow DOM. It&#x27;s really too bad custom elements got associated with shadow DOM, as they&#x27;re so useful beyond the more niche usage cases of the shadow DOM.
评论 #43956182 未加载
90s_dev12 days ago
&gt; The most basic structuring technique is separating CSS into multiple files. We could add all those files in order as \&lt;link&gt; tags into the index.html but this quickly becomes unworkable if we have multiple HTML pages. Instead it is better to import them into the index.css (via @import)<p>You&#x27;ll eventually need \&lt;link&gt; <i>anyway</i> for preloads, especially with web fonts, since that&#x27;s the <i>only</i> way to prevent FOUC. Personally I lean on build steps to solve this. I don&#x27;t like bundlers or frameworks, but I have grown accustomed to custom-building.
评论 #43956015 未加载
lucb1e11 days ago
Can we just use links to go between pages, instead of toggling css display:none on custom elements to show different &quot;pages&quot;? You&#x27;re replacing browser functionality with custom code. To get on par with browser default functionality, you need to implement a loading indicator, error handling, back&#x2F;forward button handling, address bar updates, opening links in a new tab when someone middle clicked or ctrl clicked, new window when they shift clicked, etc.<p><a href="https:&#x2F;&#x2F;plainvanillaweb.com&#x2F;pages&#x2F;applications.html" rel="nofollow">https:&#x2F;&#x2F;plainvanillaweb.com&#x2F;pages&#x2F;applications.html</a> This example code does exactly one of those things: update the address bar by setting the fragment identifier. Middle clicking and back&#x2F;forward buttons work because of that. Error handling (if it were to not just be static content but actually loading something from a server like a real website, which can fail) and loading indicators are not present<p>Re-implementing browser code in JavaScript is not using the &quot;plain&quot; or &quot;vanilla&quot; web functionality. You&#x27;re making your own framework at that point
评论 #43958223 未加载
klaushougesen111 days ago
Personally have had great experience in high throughput, complex paas &#x2F; saas webapps by rigourously only adding things when it was clearly needed.<p>Recommend you try to start with webcomponents + a well thought out design system -&gt; move on from there and you&#x27;re pretty sure to have a solid base from which you can always add react, lit, vue or whatever else cooks your noodle.<p>the other way around is near impossible
评论 #43964849 未加载
sebak8211 days ago
When it comes to reducing complexity—especially for Java developers—it’s worth checking out Vaadin.<p>It lets you build full web UIs without touching HTML, CSS, or JavaScript, entirely in Java. The UI logic runs on the server, meaning: no API design, no JSON mapping, no Redux — just a Java object model.<p>Vaadin follows a true full-stack approach, where frontend and backend live in a single codebase. Combined with Spring Boot or other JVM frameworks, this creates a cohesive Java application—no complex build pipelines, no split repos, and no friction between frontend&#x2F;backend roles.<p>What I personally enjoy most is the smooth developer experience: you see your changes reflected in the browser instantly — no manual builds, reload fiddling, or sluggish toolchains - just java and a bit of maven. For many internal business apps, it feels just as “plain” as the old-school server-rendered apps—just with modern capabilities like Web Components and security by default.<p>(Full disclosure: I work at Vaadin, but I’m genuinely a fan of the approach because it saves developers a lot of headaches.)
评论 #43960750 未加载
staticelf11 days ago
I tried to build an app with web components but honestly, the DX is quite bad and I abandoned the shadow DOM for light dom until I abandoned the vanilla tech stack entirely and moved the project to React. It is just so much faster to develop in React in comparison. Also when stuff goes wrong with components they many times just fail silently with no errors given to the console.<p>You have such a great community with big, very well thought out libraries like Tanstack Query that is pretty nice to work with. I can have backend and front end code in the same repository in a simple way and reuse code.<p>I also have the project in Phoenix Liveview which is also a much nicer way of using components. The thing is I don&#x27;t really know which tech stack is gonna win so I made a small prototype in both to see different advantages &#x2F; disadvantages.<p>One thing is clear tho, pretty much everything is better than using vanilla components and it&#x27;s really sad because I really do want to use vanilla components and I want them to be good.
kdbuck12 days ago
Reminds me of this classic: <a href="http:&#x2F;&#x2F;vanilla-js.com&#x2F;" rel="nofollow">http:&#x2F;&#x2F;vanilla-js.com&#x2F;</a>
评论 #43956812 未加载
评论 #43955897 未加载
pawelduda12 days ago
Other than for learning purposes or very lean projects, you&#x27;ll de-framework yourself just so that you have to spend extra time rebuilding it instead of focusing on the essence of your project
评论 #43955626 未加载
评论 #43956953 未加载
skrebbel12 days ago
I support the general idea here but just because something is in a browser doesn&#x27;t mean it&#x27;s a good formalism.<p>Notably, Web Components. They&#x27;re fantastic for <i>distributing</i> components - after all, a Web Component will work in every framework (even React, the IE of frameworks, finally added support), or even in vanilla HTML. So you can build a component once and everybody can use it. It&#x27;s fantastic.<p>But for <i>internally</i> composing a web application, Web Components are simply awful. They add nearly no helpful features that vanilla JS doesn&#x27;t already have, and they add bucketloads of extra complexity. You got attributes <i>and</i> properties, and they&#x27;re mostly the same but kinda not always and oh by the way, attributes can only be strings so good luck keeping that in sync. You got shadow DOM which is great for distribution but super restrictive if you want any sort of consistent global styling (and a total pain in devtools, especially once you go 10 levels deep). You can turn that off, of course, but you gotta know to do that. And plenty more quirks like this. It&#x27;s just.. It makes lots of easy things 5x harder and 1 hard thing 1.5x easier. Totally not worth it!<p>If you really want to not use a big clunky framework, but at the same time you have a complex enough app that composition and encapsulation is important, you&#x27;d be much better off just making your own object hierarchy (ie without extending HTMLElement), skipping all that awkward web component luggage and solely doing what they do best (tie an object to an element).<p>Or, better yet, get over yourself and just use a framework that does this for you. Your future self will thank you (and your colleagues even more so).<p>ps. rant time: If only the web browser people had gotten off their high horse and not proposed the word &quot;Web Components&quot;! If they would&#x27;ve just been named &quot;Custom Elements&quot;, which is what they are, then we wouldn&#x27;t have had 5+ years of people mistaking them for a React competitor.
评论 #43955799 未加载
评论 #43956239 未加载
评论 #43956363 未加载
评论 #43955768 未加载
sneak11 days ago
I’m tired of SPAs and webpages that don’t render without JavaScript.<p>The web is supposed to degrade gracefully if you are missing browser features, up to and including images turned off.<p>Now, web developers give you a blank page if you don’t run a megabyte of their shitty code.<p>No thank you.
评论 #43960263 未加载
jay-barronville12 days ago
In theory, “de-frameworking yourself” is cool, but in practice, it’ll just lead to you building what effectively is your own ad hoc less battle-tested, probably less secure, and likely less performant de facto framework.<p>I’m not convinced it’s worth it.<p>If you want something à la KISS[0][0], just use Svelte&#x2F;SvelteKit[1][1].<p>Nowadays, the primary exception I see to my point here is if your goal is to better understand what’s going on under the hood of many libraries and frameworks.<p>[0]: <a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;KISS_principle" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;KISS_principle</a><p>[1]: <a href="https:&#x2F;&#x2F;svelte.dev" rel="nofollow">https:&#x2F;&#x2F;svelte.dev</a>
kingbob00011 days ago
As I work on personal projects I often have this internal battle: &quot;Do I really need to use react for this small project? Doesn&#x27;t this make it more bloated than it needs to be?&quot; ...and then I create a vite react app and get up and running quickly while I still have the inspiration for the idea. There&#x27;s something to be said for having an opinionated framework that just removes a large amount of extraneous decisions that can slow progress. I want a lightweight page but that is secondary to just wanting the thing I&#x27;m trying to make.
umvi11 days ago
I&#x27;d recommend vanilla TypeScript instead of vanilla JavaScript. The benefits of typing are enormous. You don&#x27;t even need npm in the critical path either if you use VSCode since it has tsc built in
评论 #43995963 未加载
评论 #43960095 未加载
ArinaS12 days ago
I wouldn&#x27;t call a website automatically loading 7 scripts on your single visit &quot;vanilla web&quot; though.
评论 #43957746 未加载
评论 #43957633 未加载
prezjordan12 days ago
As a framework-enjoyer, I&#x27;m finding this helpful to leaf through just to learn about modern web platform tech.
Dwedit12 days ago
When you include &quot;No tools&quot; in your requirements, you&#x27;re locking yourself out of WebAssembly. WebAssembly still requires that you have a C compiler that can target WebAssembly binary format. Zig works well as a compiler for this purpose, even if it&#x27;s just building C code.<p>WebAssembly doesn&#x27;t need to be bloated, I&#x27;ve written a C program that imports nothing, and the resulting WASM file is under 3KB in size, and there&#x27;s under 10 lines of code to load it up.
评论 #43957606 未加载
eric-p711 days ago
I&#x27;ve built a library to make vanilla webcomponents reactive via a manual render() call that updates only changed nodes:<p><a href="https:&#x2F;&#x2F;vorticode.github.io&#x2F;solarite&#x2F;" rel="nofollow">https:&#x2F;&#x2F;vorticode.github.io&#x2F;solarite&#x2F;</a><p>I was planning to improve performance more before announcing it. But even as is it beats React and approaches Lit.js on the JS framework benchmarks.
评论 #43962532 未加载
andrewrn12 days ago
Interesting article about ditching frameworks. Embarassingly helpful for someone who jumped rather quick into React after learning js basics.
评论 #43956190 未加载
ricardo8112 days ago
As someone with a &#x27;full stack&#x27; history (ie basic front end knowledge compared to a full-timer on that coal face every day), I do notice a lot of the stuff jQuery does is now native to the browser, like being able to use fetch with promises in a few lines of code, or select stuff with querySelector(All)? or xpath. Then all the nice additions to CSS (and HTTP, no more sprites) that weren&#x27;t possible in the past and remove the need for frameworks.<p>I tend to rely on Bootstrap so the layout is reasonable on mobile- but that&#x27;s purely through my own lack of experience.<p>But I guess someone with a more intimate knowledge can easily get the idea of building a framework. Then add on all the use cases and feature requests...<p>Some web pages, particularly traditional media websites are absolute hell holes of bloat, but I guess that&#x27;s more about their ad serving than lean web development.
moron4hire11 days ago
The section on Web Components is... teeechnically correct. Unfortunately, it&#x27;s missing a lot of information on hidden pitfalls of doing things in certain ways<p>As an example, the examples on `connectedCallback()` don&#x27;t guard against the fact that this callback gets called every time the element gets inserted into the DOM tree. This could happen because you&#x27;ve removed it to hide it and then added it later to show it again, or it could happen because you&#x27;ve moved it to a new location in the tree (different parent, or re-ordering with respect to its siblings). Or maybe you&#x27;re not manipulating this object at all! Maybe someone else is moving around a parent element of your custom element. Whatever the case, if you&#x27;re element&#x27;s ancestor path in any way gets disconnected and then reconnected from `documentElement`, `connectedCallback()` gets called again.<p>That means that you have to spend extra effort to make sure anything you do in `connectedCallback()` either gets completely undone in `disconnectedCallback()`, or has some way of checking to make sure it doesn&#x27;t redo work that has already been done.<p>There are some other pitfalls involving attributes, child elements, styling, behavior with bundling, etc., that they never really get into. And generally speaking, you&#x27;re probably only going to find out about them from experience. I don&#x27;t think I&#x27;ve seen anywhere that goes into Web Component best practices.<p>Which is a shame, because they are incredibly powerful and I enjoy using them quite a bit. Now that my company has decided to go all in on React, I think they&#x27;ve only really seen the beginner path on both. Web Components as a beginner look harder than React as a beginner. Once you start actually building apps, I find they actually end up having to do largely the same level of manual shenanigans. But I find that I&#x27;m doing manual shenanigans to work <i>around</i> React, whereas with Web Components there isn&#x27;t any magic to work around, but there also isn&#x27;t a lot of &quot;help&quot; that you&#x27;d end up ignoring in most cases anyway.
RyanOD12 days ago
This is the approach I took for my side project website. The idea of installing a framework and dealing with hosting and whatnot just did not interest me.<p>More importantly, the needs of the site are drop-dead simple so no need to install a Ferrari when all I need is a bicycle.<p>Plain vanilla site served from Github FTW!
评论 #43956991 未加载
jdlyga11 days ago
Who else considers plain vanilla web to be writing websites in pure html like it&#x27;s 1995?
评论 #43969605 未加载
montag11 days ago
There are caveats and warnings already by the time we&#x27;ve added an `&lt;x-header&gt;`, and the attribute boilerplate seems onerous right from the start. It pains me to say that almost a decade on, I&#x27;m still not a fan of web components.
klysm12 days ago
Good to understand, but most likely better to stick with react for production stuff anyway
评论 #43955662 未加载
评论 #43955612 未加载
typedef_struct11 days ago
Some good patterns here. An Event with a callback (what you&#x27;re calling [context protocol](<a href="https:&#x2F;&#x2F;github.com&#x2F;webcomponents-cg&#x2F;community-protocols&#x2F;blob&#x2F;main&#x2F;proposals&#x2F;context.md">https:&#x2F;&#x2F;github.com&#x2F;webcomponents-cg&#x2F;community-protocols&#x2F;blob...</a>)) I think will prove useful.<p>My main gripe with web components is that while they expose the first half of the tree traversal (from the outside in, via connectedCallback), they don&#x27;t provide access to the second half, after child elements have been created. (akin to Initialize and Load events from ye olde .NET)
troupo12 days ago
Any attempt to show that vanilla web components are somehow a viable solution always read like a parody.<p>The boilerplate, the innerHTML strings, the long list of caveats, the extra code to make basic things like forms work, manually attaching styles etc. etc.
lerp-io11 days ago
&quot;However, this rich functionality comes at the cost of framework and tooling complexity&quot; this makes not sense, can someone explain how doing stuff in raw DOM is less complex than using react that is doing stuff for you?
评论 #43957858 未加载
评论 #43957892 未加载
docuru11 days ago
I&#x27;ve learned that people use what they familiar with.<p>At first, I learned and use plain HTML&#x2F;CSS&#x2F;PHP and I thought that was good. At college, they taught .NET framework and for some years, that was my go to techstack. Then I started to learn about more languages and frameworks. At some point, it&#x27;s hard to switch between them<p>Now I stick with one thing, unless that platform doesn&#x27;t support it. This also allow me to be a lot more productive since I know most of the thing needed to be done<p>Sure I can start with vanilla web, or some new framework but it&#x27;ll take a lot more of time and just not worth it
doc_manhat12 days ago
Question - why would you do this in <i>current year</i>? Is it that much more performant? I might be ignorant but frameworks seem to be the lingua franca for a reason - they make your life much easier to manage once set up!
评论 #43956163 未加载
评论 #43955628 未加载
评论 #43955789 未加载
评论 #43969696 未加载
评论 #43962398 未加载
评论 #43955643 未加载
评论 #43955833 未加载
评论 #43957653 未加载
评论 #43955642 未加载
Julesman11 days ago
GPT agrees with me.<p>The site positions itself as advocating for simplicity and minimalism in web development—stressing plain HTML, CSS, and JavaScript—but then pivots into building the entire project using React. That’s a contradiction.<p>If the goal is truly &quot;plain vanilla web,&quot; introducing React (with its build tools, dependencies, and abstraction layers) runs counter to that ethos. A truly minimalist approach would skip frameworks entirely or at most use small, native JS modules.<p>So yes, it&#x27;s philosophically inconsistent. Want to dig into a better alternative stack that sticks to that principle?
tanepiper12 days ago
When I built my new project (<a href="https:&#x2F;&#x2F;teskooano.space" rel="nofollow">https:&#x2F;&#x2F;teskooano.space</a>) I decided to go all vanilla web for it.<p>No regrets, except I found myself also building a framework....
andrewstuart12 days ago
I’m building a plain vanilla web application right now.<p>The main reason is I want direct control of the DOM and despite having 10 years or more react experience, it is too frustrating to deal with the react abstractions when you want direct dom control.<p>The interesting thing is that it’s the LLM&#x2F;AI that makes this possible for me. LLMs are incredibly good at plain JavaScript.<p>With an LLM as capable as Gemini you rarely even need libraries - whatever your goal the LLM can often directly implement it for you, so you end up with few of no dependencies.
redbell10 days ago
Truly valuable content! This got 1.4k points so far (and counting) for a reason. I have read the full four chapters in one shot, until I hit <i>Go build something vanilla!</i>. I&#x27;m definitely bookmarking it.<p>Also, at the beginning of the first chapter, I read:<p>&gt; In theory it&#x27;s possible to extend other classes.. but in practice <i>this doesn&#x27;t work yet in Safari</i>.<p>And was like, Ugh! It&#x27;s always Safari that ruins the party!
frollogaston11 days ago
Am I misunderstanding something, or is the routing example suggesting I put an entire HTML webpage inside a JS string? This doesn&#x27;t look like a reasonable alternative to React with JSX.<p><a href="https:&#x2F;&#x2F;plainvanillaweb.com&#x2F;pages&#x2F;applications.html" rel="nofollow">https:&#x2F;&#x2F;plainvanillaweb.com&#x2F;pages&#x2F;applications.html</a><p>Also, &quot;the hash-based routing approach is effectively invisible to search engines.&quot;
deepsun12 days ago
&gt; Styling.<p>The problem I found is that my full-SSR project doesn&#x27;t use any Node.js at all, and it works fine for everything but CSS, because in order to use includes and variables I need a CSS compiler.<p>For example, I use a CSS library that defines a very nice style class &quot;alib-link&quot; for all links. I would want to set it for all &lt;a&gt; elements, without adding `class=&quot;alib-link&quot;` all the time. It&#x27;s easy with a CSS-preprocrssor, but how to avoid using one?
评论 #43956895 未加载
Abishek_Muthian11 days ago
I’m using HTMX and Hyperscript exclusively for interactivity and I’m loving the simplicity of it.<p>Problems of FAANG are not our problems, yet they&#x27;ve somehow convinced majority of software architects that complexity is good.<p>My only concern is when I use HTMX&#x2F;Hyperscript in my FOSS projects will others be comfortable contributing to it even though it has very little learning curve but they have to empty their React cup.
sagaro10 days ago
One of the best torchbearers for Vanilla Web is Bartosz Ciechanowski[0]. The best part the code is super readable [1].<p>[0] <a href="https:&#x2F;&#x2F;ciechanow.ski&#x2F;" rel="nofollow">https:&#x2F;&#x2F;ciechanow.ski&#x2F;</a> [1] <a href="https:&#x2F;&#x2F;ciechanow.ski&#x2F;js&#x2F;watch.js" rel="nofollow">https:&#x2F;&#x2F;ciechanow.ski&#x2F;js&#x2F;watch.js</a>
jjcm12 days ago
A solid overview with some great tips.<p>One recommendation is to change the mental model here. In my eyes it isn’t “don’t use a framework”, it’s “build the framework you need”. It’s tremendously easy to set up an extension of HTMLElement that has 90% of the functionality you’d want out of react. My SPA non.io is built like this - one master component that has class functions I want, and one script for generic functions.
评论 #43955825 未加载
评论 #43955911 未加载
bryanhogan12 days ago
Love to see this!<p>Although I do think there is merit to &quot;light&quot; frameworks such as Astro, with its scoped styling and better component syntax. But at the same time, independence is also important.<p>I started something similar with <a href="https:&#x2F;&#x2F;webdev.bryanhogan.com&#x2F;" rel="nofollow">https:&#x2F;&#x2F;webdev.bryanhogan.com&#x2F;</a> which focuses on writing good and scalable HTML and CSS.
sn0n12 days ago
I missed the part where they show how to do something similar to ejs or PHP HTML includes for things like header.html and footer.html.
评论 #43957076 未加载
lenerdenator12 days ago
From the people who brought you vanilla-js.com<p><a href="http:&#x2F;&#x2F;vanilla-js.com&#x2F;" rel="nofollow">http:&#x2F;&#x2F;vanilla-js.com&#x2F;</a>
cadamsdotcom11 days ago
This website covers a fair bit of React - in particular, it seems Web Components can be used to create components with both state &amp; props.<p>One can imagine a cross-compiler so you could write React, but have it compiled to React-free javascript - leaving no React dependency in production.<p>Would be a lift, but looks superficially possible.<p>What are the blockers to this?
评论 #43960234 未加载
einpoklum12 days ago
The navigation bar of that site to not stay put, vertically, when you click one of the links.<p>That in itself undermines a lot of the author&#x27;s message, as they were not able to reasonably de-framework themselves.<p>(And - it&#x27;s not hard to get the navbar right, in any number of ways. But you do have to do a bit of work before you preach things to others.)
phoronixrly12 days ago
Man, the example web components seem to work great if you wish to hide data from scraping and search indexing... And if you try to work around this, you end up with something very very similar to <a href="https:&#x2F;&#x2F;stimulus.hotwired.dev&#x2F;" rel="nofollow">https:&#x2F;&#x2F;stimulus.hotwired.dev&#x2F;</a> .
评论 #43955919 未加载
mschuster9112 days ago
From <a href="https:&#x2F;&#x2F;plainvanillaweb.com&#x2F;pages&#x2F;components.html" rel="nofollow">https:&#x2F;&#x2F;plainvanillaweb.com&#x2F;pages&#x2F;components.html</a> I see this piece:<p><pre><code> if (!this.#span) </code></pre> What is <i>that</i> kind of magic syntax sugar?! A shorthand for document.getElementById?
评论 #43956336 未加载
nobody4211 days ago
<a href="http:&#x2F;&#x2F;youmightnotneedjs.com" rel="nofollow">http:&#x2F;&#x2F;youmightnotneedjs.com</a>
rtcode_io12 days ago
<a href="https:&#x2F;&#x2F;clock.rt.ht&#x2F;::code" rel="nofollow">https:&#x2F;&#x2F;clock.rt.ht&#x2F;::code</a> has a sophisticated custom &lt;analog-clock&gt; HTML element!<p><a href="https:&#x2F;&#x2F;go.rt.ht" rel="nofollow">https:&#x2F;&#x2F;go.rt.ht</a> has other custom elements!
gcau11 days ago
If you do this with no build step, how can you have cache busting of your component files? or is there an alternative solution that doesn&#x27;t sacrifice on performance (but also doesn&#x27;t serve stale files or an inconsistent version between files)?
评论 #43959709 未加载
myfonj11 days ago
Am I the only one who (still) does not feel comfortable seeing JavaScript being intertwined into the so-called &quot;vanilla&quot; web in a way that seems more like a hard dependency and not the progressive enhancement we were taught should be the approach for serious public websites?<p>The page <a href="https:&#x2F;&#x2F;plainvanillaweb.com&#x2F;pages&#x2F;sites.html" rel="nofollow">https:&#x2F;&#x2F;plainvanillaweb.com&#x2F;pages&#x2F;sites.html</a> uses custom components for all code examples and embedded content. Without JavaScript, it merely shows &quot;enable scripting to view ..&#x2F;XYZ.html&quot; in place of all code examples and demos. Better than having no fallback at all, I suppose, yet still not &quot;navigable&quot;.<p>The fact that it does not even bother to build these custom components on any native element with a similar purpose—like, say, a link that users could follow to see the text document (*), or a plain old iframe (**)—is grim.<p>Web components are indeed useful for prototyping and personal testing, but are they really beyond the threshold where it is safe to serve them in the wild, potentially harming some users?<p>(*) I know, view-source: links and embeds are sadly blocked by browsers nowadays. Makes very little sense to me. Someone likely managed to exploit it for some nasty purposes, so now we are &quot;protected&quot;, I suppose.<p>(**) See? In the olden days even iframes were said to have a link fallback inside, for user agents that did not support them.
评论 #43962319 未加载
评论 #43961219 未加载
wewewedxfgdf11 days ago
Is there any clean solution to the innerhtml problem in plain JavaScript applications, that does not require a virtual DOM or component lifecycle AND has Jetbrains IDE support?<p>I&#x27;d like to use lit-html but Jetbrains does not support it - very annoying.
评论 #43957519 未加载
anhtran11 days ago
No one cares how many pedals you have on your guitar pedalboard. But if you hit one wrong note, everyone in the audience will hear it and talk about it. Playing pedals is primarily for you and your team, not your audience.
nickevante11 days ago
With advent LLM driven development,the traditional web frameworks may soon be rendered obsolete.<p>All the framework abstractions we made for humans coding productivity will need to be re-visited! I support plain vanilla web for this reason.
bl_valance12 days ago
I&#x27;ve been recently going this route, everything is static. If I can&#x27;t host them on an S3 bucket, then I&#x27;m building it wrong.<p>Sites are way too bloated nowadays, a lot of the content being served can be static and cached.
dalmo311 days ago
In today&#x27;s episode of I Hate JavaScript Frameworks, So I Built My Own...
hsnice1611 days ago
I had built a component library with HTML and CSS, and had named it &quot;Vanilla Web&quot; :)<p><a href="https:&#x2F;&#x2F;vanilla-web.netlify.app&#x2F;" rel="nofollow">https:&#x2F;&#x2F;vanilla-web.netlify.app&#x2F;</a>
jonplackett12 days ago
As a react dev I find this fascinating - in the same way I was fascinated by the foraging walk I went on the other day - but was SO HAPPY that supermarkets exist when I saw how much effort it is.
评论 #43955530 未加载
webprofusion11 days ago
Ironically the style of this site lets it down, the 2006 look (post-css, pre-gradients and big buttons) makes it feel like it&#x27;s an outdated framework.
评论 #43958823 未加载
coxley11 days ago
Thank you! This is the resource I&#x27;ve been wanting to hand-feed web components to me.<p>Looking forward to playing around with some personal projects. :)
est11 days ago
SPAs are generally not worth it nowadays. Why a &gt;20MB .min.js just for few lines of text content?<p>Yeah I don&#x27;t need your shitty onclick hijacks. Thanks.
Uptrenda11 days ago
If every website did this I wonder if there would be a measurable impact on things like: battery life, performance, and bandwidth usage.
lozzo11 days ago
I am so very pleased to see a site called &quot;plain vanilla web dot com&quot; being almost at the top of hackernews in 2025.
runlaszlorun11 days ago
Is connected callback still needed over a constructor? I read somewhere it&#x27;s not needed but couldn&#x27;t say where that was
lenkite12 days ago
If they just had HTML imports and template substitution, you wouldn&#x27;t need Javascript nor web components for a lot of apps.
namuol11 days ago
Lost me at Web Components. There are many things the web does great, but Web Components is not one of them. Can we move on?
评论 #43960760 未加载
Ygg211 days ago
I&#x27;m seriously starting to wonder do we even need JavaScript. Or images. How much could you do with UTF-8 web page.
评论 #43970000 未加载
solumos11 days ago
I know not with what tools Web 3.0 will be built, but Web 4.0 will be built with vanilla HTML, CSS and Javascript.
deepriverfish11 days ago
my issue with doing web development without frameworks is how to best manage the app state. In react things like redux help with this, but in my experience state management becomes a mess without frameworks, maybe it&#x27;s a skill issue on my side I don&#x27;t know.
评论 #43967083 未加载
createaccount9910 days ago
Webcomponents are such a mess! Never ever will I use them as they are presented.
andrewmcwatters12 days ago
I think routing components are mostly out of date now that CSS View Transitions exist.
Meneth11 days ago
Nice, but it&#x27;s no <a href="https:&#x2F;&#x2F;motherfuckingwebsite.com&#x2F;" rel="nofollow">https:&#x2F;&#x2F;motherfuckingwebsite.com&#x2F;</a><p>See also <a href="http:&#x2F;&#x2F;bettermotherfuckingwebsite.com&#x2F;" rel="nofollow">http:&#x2F;&#x2F;bettermotherfuckingwebsite.com&#x2F;</a><p>and <a href="https:&#x2F;&#x2F;thebestmotherfucking.website&#x2F;" rel="nofollow">https:&#x2F;&#x2F;thebestmotherfucking.website&#x2F;</a>
peter-m8010 days ago
What about state management? All little demos ignore this
naveed12511 days ago
It’s cool and I wish I had a use case for it.
fitsumbelay11 days ago
I always appreciate a reminder of this site
EGreg12 days ago
I think there are two separate things.<p>The static websites and beautiful designs<p>With a lot of iframes and widgets, running some kind of services like Disqus chatrooms were<p>It’s far more secure, too.
pjmlp12 days ago
Loved the whole point being made.
nomaxx11712 days ago
Web components are honestly the first time I have seen web stuff in years and thought &quot;that actually looks nice&quot;.<p>Maybe it&#x27;s time for me to crawl out of my systems-software-only hole and play around with the web again.
quantadev11 days ago
There&#x27;s another solution to the &quot;Plain Vanilla Web&quot;. It&#x27;s called Markdown.
mwilcox11 days ago
aNd jaVaSCripT
encom12 days ago
<p><pre><code> &lt;!DOCTYPE HTML PUBLIC &quot;-&#x2F;&#x2F;W3C&#x2F;&#x2F;DTD HTML 4.01&#x2F;&#x2F;EN&quot; &quot;http:&#x2F;&#x2F;www.w3.org&#x2F;TR&#x2F;html4&#x2F;strict.dtd&quot;&gt; </code></pre> Anything more is for the kids on my lawn.
spoonsort12 days ago
Be wary of building a website without a framework to abstract stuff like DOM usage and page generation. Raw webdev is <i>hard</i>, due to lots of compatibility issues at every level (CSS, HTML, JS) and are moving targets. You shouldn&#x27;t even try it until you understand protocol design and have implemented some medium complexity standards like IRC and a basic DNS client or server.