sprockets
Rack-based asset packaging system (by rails)
Webpacker
Use Webpack to manage app-like JavaScript modules in Rails (by rails)
sprockets | Webpacker | |
---|---|---|
4 | 55 | |
925 | 5,312 | |
0.3% | 0.0% | |
3.3 | 4.1 | |
25 days ago | about 1 month ago | |
Ruby | Ruby | |
MIT License | MIT License |
The number of mentions indicates the total number of mentions that we've tracked plus the number of user suggested alternatives.
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.
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.
sprockets
Posts with mentions or reviews of sprockets.
We have used some of these posts to build our list of alternatives
and similar projects. The last one was on 2023-05-01.
-
Ruby on Rails with React on Typescript using importmaps
Have you noticed that we used JSX syntax? It is not what the browser understands by default. In Rails, the Sprockets gem is responsible for translating from the languages that developers like to write to the languages that the browser can run. However, it doesn't compile JSX by default. You can learn from the Sprockets fascinating readme on how to befriend it with new file types, but for JSX it is already done by the creator of the jass-react-jsx gem. Therefore, there is no reason to write the code again that is already written and working. It uses Babel, a JavaScript library that converts one JavaScript to another. It requires Node.js to run. I can't imagine a case where you have a Rails app installed but Node.js isn't, but the fact that I can't imagine it doesn't mean that it's impossible. So lets add babel to our app: Console
-
A Quick and Easy Guide to the Asset Pipeline in Rails 7
Sprockets actually does define those tasks: https://github.com/rails/sprockets/blob/main/lib/rake/sprocketstask.rb
-
February Gnarly Learnings #1: An Introduction to Propshaft
What an exciting couple of months it has been for the Rails community! Rails 7 was released in December of 2021 and this month we are welcoming Propshaft. David Heinemeier Hansson (DHH), the creator of Rails, released a post on Feb. 11 introducing the community to the new and improved asset pipeline for Rails. While Propshaft likely won't be the default until at least Rails 8, it promises a simpler solution to asset management over its predecessor, Sprockets. Sprockets, the current default asset pipeline library, has grown increasingly heavy over the years as it has attempted to shoulder all things related to bundling, minifying, transpiling, and compressing. Enabled by the new era of tech that makes Rails 7 possible, Propshaft is touted as being "absolutely tiny" in comparison and aims to provide the following: a configurable load path for your assets, digest stamping for long-expiry cache and better performance, a development server that removes the need to pre-compile assets, and basic compilers instead of full transpilers. Sprockets will require relatively long-term support and will remain the default for now but fret not! You can create a Rails 7+ app using Propshaft, or upgrade an existing app and start using it now.
-
Using Hotwire Turbo in Rails with legacy JavaScript
after being in beta for 3 years, Sprockets 4 was released, with support for ES6 and source maps in the asset pipeline (2019), to serve people still hesitant with webpack,
Webpacker
Posts with mentions or reviews of Webpacker.
We have used some of these posts to build our list of alternatives
and similar projects. The last one was on 2024-04-28.
-
The Rails asset pipeline, old and new
This is done through the Webpacker::DevServerProxy which is a rack middleware that is added by Webpacker.
-
Asset Pipeline JS Migration
Using Webpacker in Rails provides several advantages over the traditional asset pipeline. First, Webpacker uses JavaScript modules, which allows for better code organization and improved code reusability. Second, it offers modern frontend build tools, such as Babel and PostCSS, for transforming and compiling assets. Third, it provides faster build times and faster runtime performance through code splitting and lazy loading. Fourth, it offers better integration with JavaScript frameworks such as React, Vue, and Angular. Overall, Webpacker offers a more flexible and modern asset management solution for Rails applications. And while Webpacker is being retired, this initiative is to consolidate our code accordingly before moving our bundler to another solution.
-
Thank you Webpacker, Goodbye Webpacker
This article is replace Webpacker with Simpacker and webpack.
- Is enabling full source maps in production a wise default? (2017)
-
How to setup ruby on rails + Angular
in ruby on rails 7 what is the best way to properly install Angular because I can't find any documentation about it. The only tutorial that exists uses webpacker (https://github.com/rails/webpacker) but unfortunately it is no longer supported and no longer up to date in terms of security.
-
What is the pros and cons of using Rails asset pipeline vs. webpack to hold assets?
From the webpacker gem:
-
Webpacker can’t find application.js - fix or bypass completely?
Check this: https://github.com/rails/webpacker/issues/2825
-
Using Rails+ReactJS with Webpacker on VS Code?
instead of using webpacker you should move to esbuild or importmap. Webpacker has been retired a few months ago (cf https://github.com/rails/webpacker) There are videos explained how to set this up (e.g. for importmap https://learnetto.com/tutorials/how-to-use-react-with-rails-7
-
Moving from BS4 to BS5 in Rails 6, having unexpected results
Took me 2 days to find this bug report: https://github.com/rails/webpacker/issues/3188 (thanks again tagliala)
-
Webpacker 6 development continues as shakacode/shakapacker
But it's there in the webpacker README now, if anyone hasn't seen it. https://github.com/rails/webpacker
What are some alternatives?
When comparing sprockets and Webpacker you can also consider the following projects:
turbo-rails - Use Turbo in your Ruby on Rails app
shakapacker - Use Webpack to manage app-like JavaScript modules in Rails
Turbolinks - Turbolinks makes navigating your web application faster
esbuild - An extremely fast bundler for the web
propshaft - Deliver assets for Rails
Asset Sync - Synchronises Assets between Rails and S3
Stimulus - A modest JavaScript framework for the HTML you already have
Sprockets
ruby-coffee-script - Ruby CoffeeScript Compiler
jquery-ujs - Ruby on Rails unobtrusive scripting adapter for jQuery
jsbundling-rails - Bundle and transpile JavaScript in Rails with esbuild, rollup.js, or Webpack.