Comments (6)
@justin808 For indentation in heredoc, we could use http://api.rubyonrails.org/classes/String.html#method-i-strip_heredoc to remove white spaces from beginning.
from react_on_rails.
@samnang We originally did it that way, but it's super hard as well for changing the indentation. The code is also going to be slightly faster not using it. On a somewhat related note, we should maybe put some of the code for the client side into a file included in application.js.
Take a look at: https://github.com/shakacode/react_on_rails/blob/master/spec/dummy/spec/sample_generated_js/client-generated.js
I think we only need a few parameters to a client side method call:
- name of globally exposed variable (property to be put on window): 'helloWorldES5Data0'
- name of id for element: 'HelloWorldES5-react-component-0'
- name of component: 'HelloWorldES5'
- trace: boolean
- expect turbolinks: boolean
from react_on_rails.
I think that moving javascript into .js file which should be included in Rails' application.js is a good idea. If we need to add some runtime logic, than we can change extension to .js.erb and do some preprocessing for javascript code. And even cache it all or partially for performance gain.
from react_on_rails.
@szyablitsky Let me know if you'd like to do this. Or anybody else does, please let me know.
from react_on_rails.
@samnang and I made amazing progress from this today.
from react_on_rails.
Fixed by #44.
from react_on_rails.
Related Issues (20)
- Pack generation runs with nil components_subdirectory HOT 3
- Concurrency performance HOT 3
- When server-bundle.js register a lot of server render components making the server render performance reduce big HOT 2
- Remove `request_digest` from `render_options` for version 14 HOT 1
- Convert spec/dummy/client to Typescript
- Change primary branch name from `master` to `main` HOT 2
- Add support for Vite
- Fix CI failure
- Server side rendering window behaves differently than Node.js? HOT 7
- React Component won't mount until all assets are loaded HOT 2
- Adjustment of Minimum Required Ruby Version for Versions 12.5.x HOT 5
- Webpacker constants still being referenced HOT 1
- Clarification and reorganization of test conditions in configuration specs HOT 2
- `react_on_rails:generate_packs` should add the import statement to the entry point even if the packs already exist
- Bump Rescript in examples due to build-time errors HOT 2
- How to refresh CSRF token? HOT 4
- uninitialized constant `ReactOnRails::Configuration::Webpacker` HOT 4
- Running `react_on_rails:install` is not compatible with Shakapacker v8 HOT 1
- Add lock file for creating packs
- Update doc for the auto bundles
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_on_rails.