stimulusreflex / stimulus_reflex

Build reactive applications with the Rails tooling you already know and love.
https://docs.stimulusreflex.com
MIT License
2.28k stars 172 forks source link

Re-assignment of constant `reflexRoot` #473

Closed scottbarrow closed 3 years ago

scottbarrow commented 3 years ago

Bug Report

Please help us help you by filling out any applicable information in this template and removing the rest!

Describe the bug

upon upgrading to vite-rails, it has identified a constant reassignment

To Reproduce

Install vite-rails

Expected behavior

No errrors

Screenshots or reproduction

Screen Shot 2021-03-17 at 2 51 39 PM

Versions

StimulusReflex

External tools

Browser

n/a

cromega commented 1 year ago

Could we have a 3.4.2 release with this in? and potentially other fixes that make the library usable with esbuild please?

leastbad commented 1 year ago

Could we have a 3.4.2 release with this in? and potentially other fixes that make the library usable with esbuild please?

Yes! Coming very soon @cromega. This is what is currently in the #announcements channel on our Discord:

I just pushed a new update to the upcoming SR installer that supports Shakapacker and Vite. SR now supports all major bundlers in their default configuration:

Rails 6.1: webpacker 5.4.3, shakapacker, vite Rails 7: importmap, esbuild, shakapacker, vite

You don't need to have SR/CR checked out locally; just create a rails new and pop this into your Gemfile:

gem "cable_ready", github: "stimulusreflex/cable_ready", branch: "master"
gem "stimulus_reflex", github: "stimulusreflex/stimulus_reflex", branch: "new_installer"

and this into your package.json:

"dependencies": {
  "stimulus_reflex": "stimulusreflex/dev-builds#stimulus_reflex/0c16f4f"
},
"resolutions": {
  "cable_ready": "cableready/dev-builds#cable_ready/3531e43"
}

Then run rails stimulus_reflex:install. That's it.

Of course, there's lots more information in https://github.com/stimulusreflex/stimulus_reflex/pull/610 but you can just skip to the good part.