All Projects → ElMassimo → jumpstart-vite

ElMassimo / jumpstart-vite

Licence: MIT license
⚡️ Jumpstart a new Rails app with Vite.js + Turbo + Stimulus, and more

Projects that are alternatives of or similar to jumpstart-vite

stimulus-turbolinks-demo
A Stimulus + Turbolinks Demo of an app called Proposahoy!
Stars: ✭ 30 (-55.22%)
Mutual labels:  stimulusjs
avatar
Simple online tool for cropping images from an URL, your clipboard, or your disk.
Stars: ✭ 63 (-5.97%)
Mutual labels:  vitejs
html5-blank-slate
A blank starter theme that incorporates Bootstrap 5 with WordPress and Vite for frontend tooling.
Stars: ✭ 21 (-68.66%)
Mutual labels:  vitejs
Stimulus reflex
Build reactive applications with the Rails tooling you already know and love.
Stars: ✭ 1,928 (+2777.61%)
Mutual labels:  stimulusjs
js from routes
🛣️ Generate path helpers and API methods from your Rails routes
Stars: ✭ 75 (+11.94%)
Mutual labels:  vitejs
vite-plugin-theme-preprocessor
css theme preprocessor plugin for vite
Stars: ✭ 144 (+114.93%)
Mutual labels:  vitejs
stimulus todomvc
[WIP] An implementation of TodoMVC using Ruby on Rails and StimulusJS
Stars: ✭ 14 (-79.1%)
Mutual labels:  stimulusjs
vite-plugins
🌱 为社区尽一份绵薄之力
Stars: ✭ 63 (-5.97%)
Mutual labels:  vitejs
insta-share
Instant File Sharing powered by IPFS Networks. Build with Vue 3 and ViteJS
Stars: ✭ 53 (-20.9%)
Mutual labels:  vitejs
preview-pro
Use pro-layout in vitejs. preview https://sendya.github.io/preview-pro/index.html
Stars: ✭ 71 (+5.97%)
Mutual labels:  vitejs
tailwind-dashboard-template
Mosaic Lite is a free admin dashboard template built on top of Tailwind CSS and fully coded in React. Made by
Stars: ✭ 1,662 (+2380.6%)
Mutual labels:  vitejs
vue-next-admin
🎉🎉🔥基于vue3.x 、Typescript、vite、Element plus等,适配手机、平板、pc 的后台开源免费模板库(vue2.x请切换vue-prev-admin分支)
Stars: ✭ 1,002 (+1395.52%)
Mutual labels:  vitejs
react-boilerplate
React 18, React-Router, Typescript, Vite, Babel 7, React-Testing-Library, Vitest
Stars: ✭ 27 (-59.7%)
Mutual labels:  vitejs
stimulus-rails-nested-form
A Stimulus controller to create new fields on the fly to populate your Rails relationship.
Stars: ✭ 54 (-19.4%)
Mutual labels:  stimulusjs
vexip-ui
A Vue 3 UI library, Highly customizable property values, Full TypeScript, Performance should be good.
Stars: ✭ 488 (+628.36%)
Mutual labels:  vitejs
stimulus-remote-rails
A Stimulus controller to handle Rails UJS events.
Stars: ✭ 18 (-73.13%)
Mutual labels:  stimulusjs
jplayer-skin-audiocheck
A responsive HTML5 jPlayer skin with playlist.
Stars: ✭ 16 (-76.12%)
Mutual labels:  vitejs
vite-plugin-ssr
Like Next.js / Nuxt but as do-one-thing-do-it-well Vite plugin.
Stars: ✭ 1,703 (+2441.79%)
Mutual labels:  vitejs
shotgun
Ready to go Rails App with TailwindCSS, ViewComponent, Devise, and more!
Stars: ✭ 25 (-62.69%)
Mutual labels:  stimulusjs
dragonfly-dag
完全支持Vue3和Vitejs的DAG流程图组件
Stars: ✭ 54 (-19.4%)
Mutual labels:  vitejs


Jumpstart Rails with Vite

License

This repo is a fork of the Jumpstart Rails template, which is like Laravel Spark, for Rails.

This fork replaces webpacker with Vite Rails, and extends the basic setup to include a working Stimulus example and Hotwire integration.

Features ⚡️

  • 💡 Instant server start
  • ⚡️ Blazing fast hot reload
  • 🚀 Stimulus + Turbo Hotwire
  • 🛤 Path and API Helpers: JS From Routes
  • And more!

It adds vite-plugin-stimulus-hmr for instant feedback on changes to your Stimulus controllers, vite-plugin-full-reload to automatically refresh the page when editing the Rails layout or templates, and JS From Routes to automatically generate path and API helpers from the routes.

Demo 🎥

Changes to Stimulus controllers don't require a full page refresh.

Screen Shot 2021-02-15 at 13 27 22

This feature is powered by vite-plugin-stimulus-hmr.

Installation 💿

rails new myapp -d postgresql -m https://raw.githubusercontent.com/ElMassimo/jumpstart-vite/master/template.rb

For the rest of the instructions, head to Jumpstart Rails.


Video Comparison 🎥

Webpacker on the left, Vite on the right. I run foreman start, wait until the page loads, then kill the process and run it a second time.

Screen Shot 2021-02-12 at 10 03 51

Webpacker

Installing the vanilla Jumpstart template takes 5 minutes, be prepared to watch node-sass spin for a while, along with all the webpack dependencies.

jumpstart-webpacker-node-sassjumpstart-webpacker-installation

Once it's installed, and we have run bin/rake db:create db:migrate, we'll start it twice:

Screen Shot 2021-02-11 at 17 21 03

Cold start is particularly slow, and it locks Rails rendering.


Vite ⚡️

Installing the Jumpstart template with Vite takes 1 minute.

jumpstart-vite-installation

Once it's installed, and we have run bin/rake db:create db:migrate, we'll start it twice:

Screen Shot 2021-02-11 at 17 21 25

Loads only 9 seconds after foreman start, and is also running a Stimulus example.

Subsequent loads are significantly faster.


How does it work? 🤔

Vite is powered by esbuild, which can process files significantly faster than Webpack.

Vite does not bundle your code during development, which means as your app grows, the dev server will still start fast, and your changes will continue be updated instantly.

In production, Vite bundles your code with tree-shaking, lazy-loading, and common chunk splitting out of the box, to achieve optimal loading performance.


Special Thanks 🙌

  • Jumpstart Rails: 👉 Have in mind they have also built Jumpstart Pro which also includes payments with Stripe & Braintree, team accounts, TailwindCSS, and much more.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].