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.

Petite-Vue – 5kb subset of Vue optimized for progressive enhancement

182 pointsby sshrootalmost 4 years ago

11 comments

oliwarneralmost 4 years ago
Interesting. I use full Vue for this quite a lot, mount onto specific DOM points, replace their content with (most commonly) an enhanced form, or a data table. Works well, costs 30Kb plus compat layers. You can argue all day long about the cost of 30Kb, but then you put a 200Kb image in your header.<p>Anyway, looking at the docs, my approach wouldn&#x27;t be as easy in vue-petite. It looks like Components have been functionally gutted. You can still approximate something, but you seem to lose a lot of ecosystem benefits of Vue. Theirs looks great for<p>Ultimately, this all seems like something coverage and tree-shaking <i>should</i> be able to do. If you&#x27;re only using 5Kb of Vue, only 5Kb should be bundled. One day, eh? Until then, is the additional 25Kb actually hurting your users?
评论 #27721297 未加载
评论 #27720231 未加载
评论 #27720188 未加载
评论 #27720807 未加载
Crazyontapalmost 4 years ago
If anyone of you guys have access to Vue mastery watch the tutorial where Evan creates a mini-version of Vue js in vanilla JS in like 15 minutes.<p>He also explains some of the Vue optimization tricks like why they ditched the nested JSON and how Vue caches the @click handlers, etc so they don&#x27;t need to check this on every digest cycle.<p>I wish there was a free version to link here. Really interesting stuff, shows you how much thought and effort is put in by the creators to optimise so many little things which us users of the framework never even notice is happening.
评论 #27720199 未加载
评论 #27720196 未加载
评论 #27720398 未加载
manigandhamalmost 4 years ago
This progressive enhancement is exactly why I prefer Vue and find it so productive. 95% of apps are best built as server-side rendered with reactivity on top of each page as needed (instead of the JS&#x2F;SPA monstrosities we have today).<p>Nice to see an even lighter version optimized for this use-case.
评论 #27719638 未加载
评论 #27719533 未加载
评论 #27720112 未加载
评论 #27719584 未加载
评论 #27722543 未加载
Fudgelalmost 4 years ago
There&#x27;s also Alpine.js which is trying to be a simpler version of Vue. It even uses Vue&#x27;s reactivity engine. <a href="https:&#x2F;&#x2F;alpinejs.dev&#x2F;" rel="nofollow">https:&#x2F;&#x2F;alpinejs.dev&#x2F;</a>
评论 #27719760 未加载
tarsingealmost 4 years ago
That could be the perfect solution for my Rails dev. Sprinkling views with Vue feels more natural and in line with Rails philosophy for me than the pseudo SPA approach of Stimulus. I hope it will gain traction in the community.
BiteCode_devalmost 4 years ago
htmx + petit-vue + tailwind lets your write your entire site in a modern way without leaving your html file.<p>Now, it may result in an unmaintainable mess in the long run, there is always a threshold for those things.
geenatalmost 4 years ago
Consider <a href="https:&#x2F;&#x2F;htmx.org&#x2F;" rel="nofollow">https:&#x2F;&#x2F;htmx.org&#x2F;</a>
Invizalmost 4 years ago
Always surprised by lack of mention of preact in these threads. Preact is to react is what petite-vue, but with no compromises.
elamjealmost 4 years ago
We’ve been using Vue for a while now at Parq.<p>We initially wanted to use it as a super powered jQuery, then we ended up using Vue as an SPA for part of our app (certain route served a Vue spa to users), now we are going all into the Vue ecosystem for SPA.<p>I’m a fan of using Vue incrementally, but what you will find is that no editors I have found support Vue inside html templates well. When you use Vue as a jQuery replacement, it gives you some nicety, but it ends having pretty gnarly strings to put html inside of Vue components.<p>Vue team, if you can get editors to support your string template syntax, that would be killer. Even better, if there was a way to use single file components without the full build step (I.e. bundle up single file components the first time they are needed by a client) and inject that right into the html template that would be amazing.
评论 #27721513 未加载
评论 #27720549 未加载
评论 #27719887 未加载
mardixalmost 4 years ago
There is also Litedom (which I created) that&#x27;s in the same ballpark:<p><a href="https:&#x2F;&#x2F;github.com&#x2F;mardix&#x2F;litedom" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;mardix&#x2F;litedom</a>
midrusalmost 4 years ago
By using this, how do you prevent the initial render (before js runs) the blink showing the user the raw template? That&#x27;s a big drawback, isn&#x27;t it?
评论 #27723402 未加载
评论 #27723733 未加载