Using CommonJS Modules in Rails with Browserify

  • Tutorial

Hi,


Javascript and Front-end as a whole are getting harder and harder. In my opinion, the standard delivery of Rails does not meet the modern needs of the Front-end developer. In addition, using Sprockets makes your code very Rails-specific, which makes it harder to build new developers unfamiliar with Rails.


In this video, using an example of a simple React.js application, I will show how you can migrate from Sprockets to Browserify.


This approach provides the following bonuses:


  • Managing Javascript package dependencies through npm;
  • The best tolling and integration with the IDE;
  • Decrease in frontend and backend connectivity;
  • The ability to highlight the frontend in a separate application and repository. That may not be a bonus at first glance, but it’s quite convenient when you work as a large team on a large application.


The application code is available on the github: https://github.com/nLight/tutorial-rails-react-browserify


Also popular now: