react-rails icon indicating copy to clipboard operation
react-rails copied to clipboard

Does react-rails support the latest version of Shakapacker/Webpacker?

Open aschneit opened this issue 3 years ago • 3 comments

Does react-rails support the latest version of Shakapacker/Webpacker (v6)? Thanks.

aschneit avatar Jan 31 '22 23:01 aschneit

@aschneit can you give it a try? I see no reason that it wouldn't.

justin808 avatar Feb 01 '22 22:02 justin808

Unfortunately, if you replace webpacker with shakapacker, this line no longer works:

      begin
        MAJOR, MINOR, PATCH, _ = Bundler.locked_gems.specs.find { |gem_spec| gem_spec.name == 'webpacker' }.version.segments
      rescue
        MAJOR, MINOR, PATCH, _ = [0,0,0]
      end

So you would be unable to use server side rendering with shakapacker. This MAJOR, MINOR check will need to also consider if shakapacker is installed rather than webpacker.

I'm not sure the best way forward to handle that. Perhaps check for shakapacker within the rescue block? Or provide another class, specifically for shakapacker (even though their APIs are currently identical)?

EDIT: Doi, or just evaluate gem_spec.name, checking for either 'webpacker' or 'shakapacker'. That should work.

scraton avatar Feb 22 '22 20:02 scraton

On Master it should now, next release gem will when that happens. Will leave issue open until then.

BookOfGreg avatar Feb 25 '22 00:02 BookOfGreg

@BookOfGreg I'd like to get a release shipped ASAP.

What's the process so that I can ship?

justin808 avatar Sep 30 '22 07:09 justin808

React-Rails works fine with Shakapacker 6. With ~#1252~ #1274 (for version 3) there should be no missing supported feature.

ahangarha avatar Apr 25 '23 18:04 ahangarha