-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rewrite as react-components-rails #139
base: master
Are you sure you want to change the base?
Conversation
README.md
Outdated
|
||
```javascript | ||
//= require "turbolinks" | ||
ReactComponentsRails.setup({ Hello }) // ES6 shorthand for {Hello: Hello} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since turbolink has been deprecated in rails7 in favor of turbo-rails, we have made it work as follows.
However, this method may affect performance.
ReactComponentsRails.setup({ Hello }) // ES6 shorthand for {Hello: Hello} | |
document.addEventListener("turbo:load", function() { | |
ReactComponentsRails.setup({ Hello }) // ES6 shorthand for {Hello: Hello} | |
}) |
during "compilation" with esbuild I get this error:
I don't know microbundle, but as a workaround changing the default field to ./dist/react-components-rails.module.js my application package.json contains:
|
Sorry, it took me quite a lot of time to come back to this project. The gem should now be fixed, I reworked the JS build process and added support for the new React 18+ render API. I just published I plan to merge this to |
This avoids the need to call `regenerator-runtime` when transpiled
Also use the direct import from `react-dom` as fallback, not our own variable
I tested the latest beta ( Lodash is also removed, this package no longer has any dependency :) |
It's on production for some times now without any problem :) my configuration at this time:
Can we expect a new non beta release? |
We are also successfully building with 1.0.0-beta.4 on both React 17 (with the my documented webpack workaround) and React 18 on webpack 5. It would be great to see this merged to |
@renchap I notice that ujs integration hasn't yet been implemented. Would you like some assistance completing this branch? |
As discussed in #132, this is a rename and rewrite of this library.
Webpacker is now deprecated and wont get any new updates, but this library no longer relied on Webpacker.
The new name,
react-components-rails
, shows this (thanks @yubele for the suggestion).I chose to start a new project nearly from scratch to have a much simpler and modern development setup for this. I copied the existing source code so it should behave the same way, but the Javascript library is now build using
microbundle
and written in Typescript.TODO: