petite-vue[1] is a small version of vue, with far fewer features but also far smaller bundle size. Even You says it's "done". There haven't been changes in over a year.
- No virtual dom. It directly uses the DOM <template> and cloneNode.
- It scans the entire page, looking for v-scope. This may work well for me, as I would no longer need to have JS code that looks for specific IDs and mounts Vue on them. But you can also specify an ID.
- It seems to use v-effect expressions in the html instead of watch functions in the javascript
- There's no computed or render functions or SSR
- No reactivity for Set and Map
- Seems to have no event system[2]
- Has a very different component system (discussion[3]) that doesn't feel like Vue's components
- No transition, keep-alive, suspense, teleport
- Other missing features
I decided to rewrite some of the circle drawing code[4] in petite-vue. Observations at the end.
Thoughts:
- Not having a component system with props down events up was disorienting.
- The non-component parts of my template seemed to work without much change!
v-scope
seems like it might be even more useful for my tutorials than how vue usually works.- Not having computed setters was inconvenient. I tried using
get
andset
but those don't work either because I can't pass the pair of them to a component like the drag handle. I tried usingget
and a separate setter function, but that made the page reactive but the components were not reactive. I ended up having to pass in a separate getter and setter function to the component, because theget
function wasn't reactive.
My initial conclusion is that I love the bundle size and the intended use, but … I also want a more fully featured component system. Petite-Vue being an abandoned project is probably ok if it did everything I wanted.
Source: learning-petite-vue.js