-
-
Notifications
You must be signed in to change notification settings - Fork 638
Support direct react components and server console messages and linting #20
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
Conversation
- Add support to React components generated with React.createClass() - Add “generator” property to allow creating a React component via a function - Add HelloES5 component to the dummy application
- Renaming Ruby variables to snake case - Make ReactRenderer#render_js_react_element a class method - Improve generated JS code
* Added console & error logging * Catch exceptions and log them on the server side * Issue with HelloWorld component is not loade properly. Visit /focused to see the issue * Created /focused so that a specific part can be individually tested. * Lots of cleanup and refactoring. * Consistency with using suffix App for generator functions * Added default for generator_function
@alexfedoseev @josiasds Please pull this code. I need some help. This is really close, but if you go to http://localhost:3000/focused then you'll see the error which is that the HelloWorld component is not found. This is doing simple client rendering. Same issue server rendering. Thanks. Also, we added the option for the helper of |
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.
Why do we need to split definition and export if we don't do anything with exported class?
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.
@alexfedoseev We don't need to split. We were experimenting. Voodoo coding.
app/helpers/react_on_rails_helper.rb
Outdated
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.
shouldn't it be aligned?
index.html.erb crashing need to put all the example in separate web pages with clear explanations of what is being demonstrated
* Also catches when generator_function is set to true when it's not a generator function. * Reuse the same catch on both client and server. * Started to format JS code better. * Some readme improvements
README.md
Outdated
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.
typo: "these lines to"
# Conflicts: # README.md # spec/dummy/Gemfile.lock # spec/dummy/bin/setup # spec/dummy/spec/rails_helper.rb # spec/dummy/spec/spec_helper.rb
All tests passing
Support direct react components and server console messages and linting
Implements --rspack flag for react_on_rails:install generator to use Rspack bundler instead of Webpack, providing ~20x faster builds. ## Changes - Added --rspack option to install_generator.rb and base_generator.rb - Conditional dependency installation (rspack vs webpack packages) - Auto-configures shakapacker.yml for rspack with SWC transpiler - Created bin/switch-bundler utility to switch bundlers post-install ## Key Features - Rspack packages: @rspack/core, @rspack/cli, @rspack/plugin-react-refresh - Compatible with --typescript and --redux options - Reversible via bin/switch-bundler script - Supports npm, yarn, and pnpm package managers ## Usage rails generate react_on_rails:install --rspack bin/switch-bundler rspack # Switch existing app Based on patterns from react_on_rails-demos PR #20 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Implements unified configuration approach where the same webpack config files work with both webpack and rspack bundlers, based on the assets_bundler setting in shakapacker.yml. ## Changes **development.js.tt**: - Add config import from shakapacker to access assets_bundler setting - Conditional React Refresh plugin loading: - Rspack: @rspack/plugin-react-refresh - Webpack: @pmmmwh/react-refresh-webpack-plugin - Prevents "window not found" errors when using rspack **serverWebpackConfig.js.tt**: - Replace hardcoded webpack require with bundler variable - Bundler conditionally requires @rspack/core or webpack - Use bundler.optimize.LimitChunkCountPlugin instead of webpack-specific - Eliminates warnings about webpack when using rspack **RSPACK_IMPLEMENTATION.md**: - Document webpack config template changes - Explain unified configuration approach ## Benefits - Single set of config files works for both bundlers - No warnings when using rspack about webpack.config.js - Seamless switching between bundlers via bin/switch-bundler - Follows pattern from react_on_rails-demos PR #20 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Implements --rspack flag for react_on_rails:install generator to use Rspack bundler instead of Webpack, providing ~20x faster builds. ## Changes - Added --rspack option to install_generator.rb and base_generator.rb - Conditional dependency installation (rspack vs webpack packages) - Auto-configures shakapacker.yml for rspack with SWC transpiler - Created bin/switch-bundler utility to switch bundlers post-install ## Key Features - Rspack packages: @rspack/core, @rspack/cli, @rspack/plugin-react-refresh - Compatible with --typescript and --redux options - Reversible via bin/switch-bundler script - Supports npm, yarn, and pnpm package managers ## Usage rails generate react_on_rails:install --rspack bin/switch-bundler rspack # Switch existing app Based on patterns from react_on_rails-demos PR #20 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Implements unified configuration approach where the same webpack config files work with both webpack and rspack bundlers, based on the assets_bundler setting in shakapacker.yml. ## Changes **development.js.tt**: - Add config import from shakapacker to access assets_bundler setting - Conditional React Refresh plugin loading: - Rspack: @rspack/plugin-react-refresh - Webpack: @pmmmwh/react-refresh-webpack-plugin - Prevents "window not found" errors when using rspack **serverWebpackConfig.js.tt**: - Replace hardcoded webpack require with bundler variable - Bundler conditionally requires @rspack/core or webpack - Use bundler.optimize.LimitChunkCountPlugin instead of webpack-specific - Eliminates warnings about webpack when using rspack **RSPACK_IMPLEMENTATION.md**: - Document webpack config template changes - Explain unified configuration approach ## Benefits - Single set of config files works for both bundlers - No warnings when using rspack about webpack.config.js - Seamless switching between bundlers via bin/switch-bundler - Follows pattern from react_on_rails-demos PR #20 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Implements --rspack flag for react_on_rails:install generator to use Rspack bundler instead of Webpack, providing ~20x faster builds. ## Changes - Added --rspack option to install_generator.rb and base_generator.rb - Conditional dependency installation (rspack vs webpack packages) - Auto-configures shakapacker.yml for rspack with SWC transpiler - Created bin/switch-bundler utility to switch bundlers post-install ## Key Features - Rspack packages: @rspack/core, @rspack/cli, @rspack/plugin-react-refresh - Compatible with --typescript and --redux options - Reversible via bin/switch-bundler script - Supports npm, yarn, and pnpm package managers ## Usage rails generate react_on_rails:install --rspack bin/switch-bundler rspack # Switch existing app Based on patterns from react_on_rails-demos PR #20 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Implements unified configuration approach where the same webpack config files work with both webpack and rspack bundlers, based on the assets_bundler setting in shakapacker.yml. ## Changes **development.js.tt**: - Add config import from shakapacker to access assets_bundler setting - Conditional React Refresh plugin loading: - Rspack: @rspack/plugin-react-refresh - Webpack: @pmmmwh/react-refresh-webpack-plugin - Prevents "window not found" errors when using rspack **serverWebpackConfig.js.tt**: - Replace hardcoded webpack require with bundler variable - Bundler conditionally requires @rspack/core or webpack - Use bundler.optimize.LimitChunkCountPlugin instead of webpack-specific - Eliminates warnings about webpack when using rspack **RSPACK_IMPLEMENTATION.md**: - Document webpack config template changes - Explain unified configuration approach ## Benefits - Single set of config files works for both bundlers - No warnings when using rspack about webpack.config.js - Seamless switching between bundlers via bin/switch-bundler - Follows pattern from react_on_rails-demos PR #20 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Visit /focused to see the issue
Replace #19