Standard Vue was designed for using a build step to build single-page applications (SPAs) with heavy interactions. However, the most significant difference is that petite-vue was made for progressive enhancement. As mentioned, it provides the same template syntax and model provided by standard Vue. Petite-vue is similar to Vue in many ways. Driven by package is responsible for handling reactivity in both Vue and Alpine petite-vue uses this same reactivity technique. Therefore, petite-vue runs on a webpage and does not need a compiler, decreasing the overall size. Unlike Vue, React, and most other frontend libraries and frameworks, petite-vue does not use the virtual DOM. For example, petite-vue uses template interpolation like and template event listeners like. As a subset of Vue itself, petite-vue uses most of the same syntax of Vue. Vue compatible template syntaxĪ developer who is already familiar with the Vue template syntax will find it easy to transition between Vue and petite-vue. petite-vue, on the other hand, has a bundle size of only 6. Instead, you can simply include it in a script tag to get its features in an HTML page: Īt the time of writing, the latest versions of Vue and Alpine have respective bundle sizes of 34.2kB and 13.5kB minified and gzipped. With petite-vue, you don’t have to worry about build tooling. To understand how petite-vue works, we have to consider its fundamental features. Petite-vue is optimized for small interactions on existing HTML pages that are rendered by a server framework, thereby simplifying progressive enhancement. You can begin building a website statically with just HTML, then add interactivity or client states to pages. Progressive enhancement is a methodology that allows a web developer to begin programming with HTML and include other technologies as needed. We’ll also cover getting started with petite-vue and look at a few of its use cases. In this article, we’ll explore what petite-vue does, how it works, and how it compares to both standard Vue and Alpine. For developers who are familiar with Vue and want to add Vue to a project that renders on the server side, petite-vue offers the perfect approach. petite-vue: An Alpine alternative for progressive enhancementĮditor’s note: This article was last updated 12 August 2022 to reflect changes to petite-vue, including bundle size.Īccording to Evan You, the creator of Vue, petite-vue is an alternative distribution of Vue inspired by Alpine that is optimized for progressive enhancement. He is also a technical writer and works as a Node.js consultant, helping clients build and maintain their Node.js applications. Kelvin Omereshone Follow Kelvin is an independent software maker currently building Sailscasts, a platform to learn server-side JavaScript.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |