jsbundling-rails
importmap-rails
| jsbundling-rails | importmap-rails | |
|---|---|---|
| 39 | 30 | |
| 921 | 1,161 | |
| 0.4% | 1.0% | |
| 5.9 | 7.4 | |
| 7 days ago | 5 months ago | |
| Ruby | 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.
jsbundling-rails
-
Ruby on Rails 8 with Vite and Tailwind CSS 4
> But what if you want to use React?
Then just use React. There's nothing stopping you and it's well supported.
You can use either https://github.com/rails/jsbundling-rails
or https://github.com/reactjs/react-rails
Personally would also go with a No Build set up. i.e. https://hotwire.io/ and import maps.
- Rails Merging Support for Bun.sh
- Rails Frontend Bundling - Which one should I choose?
-
Is the default importmap method unrealistic in the most popular real world use cases?
I think this is more like a demo - you will not get the same features as jsbundling-rails by only following instructions in the video. For that you will need to change some other files as well. You can find out what files to be added/changed from the install script. The important bits are mostly the same as in the video, but some supplement parts are not mentioned in the video. Some people actually reported in the comment that they can't deploy such app, but I think it depends.
-
at my wits' end.. please help me figure out why javascript won't work (Rails 7 with esbuild)
I'm sorry, I didn't see that in your title. Using esbuild is 100% supported by Rails through this gem https://github.com/rails/jsbundling-rails. Have a look at the docs there to make sure that you're setup correctly.
-
Configure Stimulus with esbuild and Babel — Rails & Javascript
Rails applications are bundler-agnostic. They do not care how you bundle your javascript code. It just expects whatever comes from the bundler to be placed under app/assets, so the asset pipeline processes it. We can see this in the official jsbundling-rails gem, which consists of scripts to install different bundlers and configure a default npm build command to generate our bundles—no interaction whatsoever with the Rails configuration. This black-box bundler logic allows us to change and update our bundler system without tuning any other aspect of our Rails application.
-
foreman: not found
Hello, this is my first time setting up a rails app that also uses react, I am using https://github.com/rails/jsbundling-rails I went with esbuild because I am following this tutorial on setting it up https://www.youtube.com/watch?v=yoLJXjEV2nM, however when I run bin/dev in the terminal I get the error bin/dev: 8: exec: foreman: not found
- Ruby 3.2 + Rails 7 + Tailwind + Font Awesome - should be blazing fast, yet tests very slow. 20 requests are being made. How do I make fewer requests, create fewer objects and make this simple app super fast? Production : https pickaxe dot ca. Thank you! -Dan H
-
How to bundle assets in a Rails engine
You first install your asset handlers as you need them for your project. They can be anything from rails/jsbundling-rails and rails/tailwindcss-rails to webpacker or something custom.
-
Comparing Phoenix to Rails in December 2022
The functionality comes from https://github.com/rails/jsbundling-rails and https://github.com/rails/cssbundling-rails -- both come with Rails 7 and all you have to do is generate your app with the choices you want such as -j esbuild --css tailwind.
importmap-rails
-
Importmap or jsbundling? I use both
This is because the @lit/reactive-element package has many optional modules that were not downloaded. But if you download all optional modules, the importmap configuration will become very bloated. There is a PR in progress (#235), but it's hard to say if it will solve the problem because the issue lies in the library authors not considering the need for unbundled imports.
-
Buh-Bye Webpack and Node.js, Hello Rails and Import Maps
At a high level, the importmaps-rails Gem allows developers to import maps into their applications. The use of /bin/importmap allows engineers to update, pin, or unpin dependencies as needed. This is similar to how Maven and Gradle work in Java-based projects.
-
Polyfill supply chain attack hits 100K+ sites
Before ESM I wasn't nearly as sold on skipping the build step, but now it feels like there's a much nicer browser native way of handling dependencies, if only I can get the files in the right shape!
The Rails community are leaning into this heavily now: https://github.com/rails/importmap-rails
-
Do you know how the delivery of assets works in your Rails 7 app?
// Configure your import map in config/importmap.rb. Read more: https://github.com/rails/importmap-rails import "@hotwired/turbo-rails" import "controllers" import "bootstrap" import "@popperjs/core"
-
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
What are some alternatives?
vite_ruby - ⚡️ Vite.js in Ruby, bringing joy to your JavaScript experience
esbuild-rails - Esbuild Rails plugin
Webpacker - Use Webpack to manage app-like JavaScript modules in Rails
import-maps - Former home of import maps (now merged into HTML)
cssbundling-rails - Bundle and process CSS in Rails with Tailwind, PostCSS, and Sass via Node.js.
sprockets-rails - Sprockets Rails integration