Stimulus
importmap-rails
Stimulus | importmap-rails | |
---|---|---|
111 | 26 | |
12,466 | 1,010 | |
0.2% | 1.1% | |
6.4 | 8.0 | |
about 22 hours ago | 14 days ago | |
TypeScript | Ruby | |
MIT License | MIT License |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
Stimulus
-
Turbo Streaming Modals in Ruby on Rails
I also recommend checking out the docs for Stimulus and Turbo to familiarise yourself with all their features and the APIs used in this series.
-
Google: Angular and Wiz Are Merging
Any tips on preparing to work with Wiz as an incoming intern. I heard its identical to Stimulus: https://stimulus.hotwired.dev/
-
How to integrate Component Architecture into Symfony?
use Stimulus
- Stimulus: A modest JavaScript framework for the HTML you already have
-
Build Drag and Drop with Rails Hotwire
With Stimulus, you've got a powerful tool to take your app's interactivity up a notch. For even more awesome features and Stimulus wizardry, check out the Stimulus Documentation.
-
Supercharge your Stimulus controllers with Custom APIs
The next version of Stimulus makes it easier to access parts of the private API thanks to my pull request.
-
Why are you still using jQuery?
I like Stimulus, it was a bit pushed by Symfony with their ux thing.
-
Too Much JavaScript? Why the Frontend Needs to Build Better
I thought it'd be https://stimulus.hotwired.dev/ for a minute but I think that ecosystem is tied too closely with rails.
-
Learn Stimulus in Ruby on Rails by Building a Toggle)
Hey HN!
For those new to Rails, Stimulus (https://stimulus.hotwired.dev/) is a way to sprinkle frontend javascript code into your Rails views.
I held off using Stimulus in my Rails apps for a long time because I didn't understand it — the data= attributes looked weird, and the connection between my Rails views and Stimulus javascript controllers was confusing.
So I decided to write the guide I wish I had when I was learning Stimulus.
Hope you enjoy it! I'm happy to answer any questions, feel free to ask any.
Thanks, Harrison
-
Your first Stimulus controller — Learn Stimulus by building a toggle in your Rails app
Hey /r/rails, these past few weeks, I've been working on a beginner's guide to Stimulus and I'm excited to finally share it!
importmap-rails
-
The Rails asset pipeline, old and new
It is implemented as a thor task in lib/importmap/cmmands.rb
-
RubyJS-Vite
With importmaps (https://github.com/rails/importmap-rails) and Hotwire (https://hotwired.dev/), you write plain js and serve it.
Also packages are served via CDN. There is no tree shaking. Rails got rid of the whole bundling step.
-
First commits in a Ruby on Rails app
Importmap audit - “checks the NPM registry for known security issues”
-
Asset compilation taking ~ 12 mins
It worked, but JS changes were not coming through. Digging into the Importmap docs (see 'sweeping the cache', it monitors changes according to the setting config.importmap.cache_sweepers. So, by adding the locations where I have my JS files, I also got JS changes passed through.
-
Is the default importmap method unrealistic in the most popular real world use cases?
You can't use TypeScript, or anything that requires pre-compile, with importmap. answered issue
-
Ruby on Rails with React on Typescript using importmaps
Let's begin by installing the necessary dependencies. The first gem generates the importmap object, manages caching, and helps with library installations, among other things. I recommend reading the entire readme to become familiar with its capabilities. The second gem will be discussed later, it is used to compile JSX files. Gemfile
-
Pirep.io collects the unpublished, local knowledge on public, private, and unmapped airport that anyone can contribute to
Yeah, those were brand new right around the time I started this project a few years ago with Rails 7 (or was it 6.1?). I actually ended up removing them in favor of importmap-rails since I wanted as simple of a frontend as possible and I wasn't sure of relying on what was, at the time, a brand new way of doing frontend work. Things change so quickly in JS-land that I'm always hesitant to make something a dependency unless it has a strong track record of being continuously maintained.
-
Dusting off my rails knowledge, need some tips / guidance on rails 7 and production
source "https://rubygems.org" git_source(:github) { |repo| "https://github.com/#{repo}.git" } ruby "3.1.0" # Bundle edge Rails instead: gem "rails", github: "rails/rails", branch: "main" gem "rails", "~> 7.0.4", ">= 7.0.4.2" # The original asset pipeline for Rails [https://github.com/rails/sprockets-rails] gem "sprockets-rails" # Use sqlite3 as the database for Active Record gem "sqlite3", "~> 1.4" # Use the Puma web server [https://github.com/puma/puma] gem "puma", "~> 5.0" # Use JavaScript with ESM import maps [https://github.com/rails/importmap-rails] gem "importmap-rails" # Hotwire's SPA-like page accelerator [https://turbo.hotwired.dev] gem "turbo-rails" # Hotwire's modest JavaScript framework [https://stimulus.hotwired.dev] gem "stimulus-rails" # Build JSON APIs with ease [https://github.com/rails/jbuilder] gem "jbuilder" gem "mongoid" gem "mongoid-grid_fs" gem 'bootstrap', '~> 5.2.2' #sourced from https://github.com/twbs/bootstrap-rubygem gem 'rack-cors' # Windows does not include zoneinfo files, so bundle the tzinfo-data gem gem "tzinfo-data", platforms: %i[ mingw mswin x64_mingw jruby ] # Reduces boot times through caching; required in config/boot.rb gem "bootsnap", require: false
- Simple Modern JavaScript Using JavaScript Modules and Import Maps
-
A powerful search feature with what Rails provides out of the box
Also, installing StimulusReflex seems quite not easy for the moment: It seems there are some quirks along the way if you're using import-maps for managing javascript dependencies as I do. Embracing the Rails way at least prevents you from this sort of issue.
What are some alternatives?
turbo-rails - Use Turbo in your Ruby on Rails app
jsbundling-rails - Bundle and transpile JavaScript in Rails with esbuild, rollup.js, or Webpack.
htmx - </> htmx - high power tools for HTML
esbuild-rails - Esbuild Rails plugin
hotwire-rails - Use Hotwire in your Ruby on Rails app
esbuilder - Integrate esbuild into Rails
django-unicorn - The magical reactive component framework for Django ✨
vite_ruby - ⚡️ Vite.js in Ruby, bringing joy to your JavaScript experience
Alpine.js - A rugged, minimal framework for composing JavaScript behavior in your markup.
esbuild-live-reload
inertia - Inertia.js lets you quickly build modern single-page React, Vue and Svelte apps using classic server-side routing and controllers.
webpack - A bundler for javascript and friends. Packs many modules into a few bundled assets. Code Splitting allows for loading parts of the application on demand. Through "loaders", modules can be CommonJs, AMD, ES6 modules, CSS, Images, JSON, Coffeescript, LESS, ... and your custom stuff.