Comments (3)
The easiest way I suppose is to register vendor after default sprockets paths are added, then due to the way priorities are done, assets.resolve('react.js')
will return user's react if it exists within the project, or ours' otherwise. Same with jsxtransformer.
Some potential problems as I started implementing:
- We always use react.js and depending on variant, either react.js, or react.min.js is available under this path. There is a certain discrepancy here, because end-user cannot do the same, i.e. he will have to use the same version of react for dev/production
- Do we want to test this? If so, probably the best way would be to duplicate dummy app, because otherwise we would have to mess with assets files inside tests.
from react-rails.
Sorry I didn't catch you before you started, but I appreciate you taking this on.
We always use react.js and depending on variant, either react.js, or react.min.js is available under this path. There is a certain discrepancy here, because end-user cannot do the same, i.e. he will have to use the same version of react for dev/production
I commented on the PR but I think we can solve this.
Do we want to test this? If so, probably the best way would be to duplicate dummy app, because otherwise we would have to mess with assets files inside tests.
Yes. We can probably just put nonsense JS in those test files so we can test them easily - doesn't necessarily need to actually be React. Another dummy app seems fine (a lot of extra files for such a simple test, but if that's what we need to do, let's do it).
from react-rails.
This is implemented in #12
from react-rails.
Related Issues (20)
- Import react_component but it' shown HOT 2
- compare/contrast and migration steps to react_on_rails HOT 5
- Component doesn't render on jsbundling-rails webpacker HOT 5
- Component not loading in rails app HOT 5
- react-rails v3.1.0 is broken HOT 1
- server_rendering.js not found following README HOT 8
- Re-organize documentations in docs folder
- server_rendering.js not found following README HOT 1
- How do I handle styling?
- esbuild HOT 1
- Error related to server_rendering.js not found with SSR HOT 3
- Setup StrictMode for components HOT 2
- get started docs r-r version HOT 1
- Rails 7.1 Renders Partial Header HOT 1
- Server side rendering `window` behaves differently than Node.js? HOT 4
- Issues with Loading React Component for Cuprite in Rails 7.1
- Hooks not working due to Invalid Hook Call HOT 2
- Move react_ujs to es module flow
- Error when use React component other than HelloWorld
- Different order for React rendering / DOM ready event in Webkit with React 18 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-rails.