Commit Graph

2 Commits

Author SHA1 Message Date
Hartley McGuire 7d116c93cf
Convert rails-ujs to ES2015 modules
Building and linting are setup similar to other packages

Most of the changes are related to converting from sprockets requires to
ESM imports/export. However, there are a few notable changes as well:

- A few methods have been refactored to store the Rails object in a
  closure so that properties on it can be overriden by applications (as
  documented and tested). This also resulted in the "start" module
  getting inlined so that it can use the resulting functions.

- The logic for running Rails.start() automatically had to change
  because Rollup uses a slightly different module format than the
  previous coffeescript bundle. The Rollup bundle does not set
  window.Rails until the end up the bundle, so the condition had to be
  updated and window.Rails had to be set manually to ensure backwards
  compatability with scripts listening to the rails:attachBindings event
2022-07-07 21:52:08 -04:00
Guillermo Iguaran ad3a47759e Add rails-ujs to Action View 2016-11-26 01:23:07 -05:00