Skip to content

is the gem compatible with react-rails? #86

Answered by ElMassimo
killernova asked this question in Q&A
Discussion options

You must be logged in to vote

Hi there!

I haven't used react-rails, but the server-side rendering functionality seems to depend on webpacker.

The react_ujs library it provides seems to rely on either globals or Webpack's require.context.

If you are not using server-side rendering and are not using require.context, then it should be possible for you to migrate your react-rails project to Vite.


Otherwise, react-rails won't work out of the box with Vite, and requires additional work to integrate with Vite Ruby.

I'd suggest contacting the authors to check if they would be interested—it should be possible to allow passing a glob instead of require.context to "register" the available components.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by ElMassimo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants