-
-
Notifications
You must be signed in to change notification settings - Fork 638
Add centralized help and support messaging system #1803
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
Changes from 5 commits
55b820a
2c67f41
8e1875d
e7a3b6a
8976d09
f769676
882b43c
6c21f69
0e0f18b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -140,16 +140,22 @@ _Requires creating a free account._ | |
| - Node.js >= 20 (CI tested: 20 - 22) | ||
| - A JavaScript package manager (npm, yarn, pnpm, or bun) | ||
|
|
||
| # Support | ||
|
|
||
| - [Click to join **React + Rails Slack**](https://join.slack.com/t/reactrails/shared_invite/zt-38oicm9d0-OO0V~bdg4aYNuZuUbRFSXg). | ||
|
|
||
| - [**Subscribe**](https://app.mailerlite.com/webforms/landing/l1d9x5) for announcements of new releases of React on Rails and of our latest [blog articles](https://blog.shakacode.com) and tutorials. | ||
| - [Discussions](https://github.com/shakacode/react_on_rails/discussions): Post your questions regarding React on Rails | ||
| - **[forum.shakacode.com](https://forum.shakacode.com)**: Other discussions | ||
| - **[@railsonmaui on Twitter](https://twitter.com/railsonmaui)** | ||
| - _See [NEWS.md](https://github.com/shakacode/react_on_rails/tree/master/NEWS.md) for more notes over time._ | ||
| - See [Projects](https://github.com/shakacode/react_on_rails/tree/master/PROJECTS.md) using and [KUDOS](https://github.com/shakacode/react_on_rails/tree/master/KUDOS.md) for React on Rails. Please submit yours! Please edit either page or [email us](mailto:[email protected]) and we'll add your info. We also **love stars** as it helps us attract new users and contributors. | ||
| <!-- TROUBLESHOOTING_LINKS_START --> | ||
| # 🆘 Get Help & Support | ||
|
|
||
| **Need immediate help?** Here are your options, ordered by response time: | ||
|
|
||
| - 🚀 **Professional Support**: [[email protected]](mailto:[email protected]) - Fastest resolution for bugs, upgrades, and consulting | ||
| - 💬 **React + Rails Slack**: [Join our community](https://invite.reactrails.com) - Chat with other developers | ||
| - 🆓 **GitHub Issues**: [Report bugs](https://github.com/shakacode/react_on_rails/issues) - Community support | ||
| - 📖 **Discussions**: [Ask questions](https://github.com/shakacode/react_on_rails/discussions) - General help | ||
|
|
||
| **Additional Resources:** | ||
| - [**Subscribe**](https://app.mailerlite.com/webforms/landing/l1d9x5) for announcements of new releases and tutorials | ||
| - **[forum.shakacode.com](https://forum.shakacode.com)** - Development discussions | ||
| - **[@railsonmaui on Twitter](https://twitter.com/railsonmaui)** - Updates and tips | ||
| - [Projects using React on Rails](https://github.com/shakacode/react_on_rails/tree/master/PROJECTS.md) - Submit yours! | ||
| <!-- TROUBLESHOOTING_LINKS_END --> | ||
|
|
||
| ## Contributing | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -83,6 +83,10 @@ def calc_message(component_name, console_messages, err, js_code, props) | |
| MSG | ||
|
|
||
| end | ||
|
|
||
| # Add help and support information | ||
| message << "\n#{Utils.default_troubleshooting_section}\n" | ||
|
|
||
|
Comment on lines
+86
to
+89
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Avoid duplicate help blocks; prefer dynamic content with fallback. If upstream raises an error that already includes the help section, Apply this diff: - # Add help and support information
- message << "\n#{Utils.default_troubleshooting_section}\n"
+ # Add help and support information (once, dynamic with fallback)
+ unless message.include?('Get Help & Support:')
+ message << "\n#{Utils.help_and_support_section}\n"
+ endAnd add these helpers in def self.help_and_support_section
@help_and_support_section ||= begin
extract_troubleshooting_section
rescue StandardError
nil
end || default_troubleshooting_section
end
def self.append_help_section_once(str)
return str if str&.include?('Get Help & Support:')
[str, help_and_support_section].compact.join("\n\n")
end🤖 Prompt for AI Agents |
||
| [backtrace, message] | ||
| end | ||
| end | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -77,6 +77,7 @@ def exec_server_render_js(js_code, render_options, js_evaluator = nil) | |||||||||||||||||||||||||||||||||||||||||||||
| if err.message.include?("ReferenceError: self is not defined") | ||||||||||||||||||||||||||||||||||||||||||||||
| msg << "\nError indicates that you may have code-splitting incorrectly enabled.\n" | ||||||||||||||||||||||||||||||||||||||||||||||
| end | ||||||||||||||||||||||||||||||||||||||||||||||
| msg << "\n#{Utils.default_troubleshooting_section}\n" | ||||||||||||||||||||||||||||||||||||||||||||||
| raise ReactOnRails::Error, msg, err.backtrace | ||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+80
to
81
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Append help once and use dynamic README-backed content. This risks duplicate help blocks when wrapped by higher-level errors and uses the static default. Apply this diff: - msg << "\n#{Utils.default_troubleshooting_section}\n"
+ msg << "\n#{Utils.help_and_support_section}\n" unless msg.include?('Get Help & Support:')📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||||||
| end | ||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -122,7 +123,7 @@ def read_bundle_js_code | |||||||||||||||||||||||||||||||||||||||||||||
| rescue StandardError => e | ||||||||||||||||||||||||||||||||||||||||||||||
| msg = "You specified server rendering JS file: #{server_js_file}, but it cannot be " \ | ||||||||||||||||||||||||||||||||||||||||||||||
| "read. You may set the server_bundle_js_file in your configuration to be \"\" to " \ | ||||||||||||||||||||||||||||||||||||||||||||||
| "avoid this warning.\nError is: #{e}" | ||||||||||||||||||||||||||||||||||||||||||||||
| "avoid this warning.\nError is: #{e}\n\n#{Utils.default_troubleshooting_section}" | ||||||||||||||||||||||||||||||||||||||||||||||
| raise ReactOnRails::Error, msg | ||||||||||||||||||||||||||||||||||||||||||||||
| end | ||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
124
to
128
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Preserve original backtrace when re-raising; also prefer dynamic help. Current raise drops Apply this diff: - msg = "You specified server rendering JS file: #{server_js_file}, but it cannot be " \
+ msg = "You specified server rendering JS file: #{server_js_file}, but it cannot be " \
"read. You may set the server_bundle_js_file in your configuration to be \"\" to " \
- "avoid this warning.\nError is: #{e}\n\n#{Utils.default_troubleshooting_section}"
- raise ReactOnRails::Error, msg
+ "avoid this warning.\nError is: #{e}\n\n#{Utils.help_and_support_section}"
+ raise ReactOnRails::Error, msg, e.backtrace📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -149,11 +150,12 @@ def create_js_context | |||||||||||||||||||||||||||||||||||||||||||||
| msg = "ERROR when compiling base_js_code! " \ | ||||||||||||||||||||||||||||||||||||||||||||||
| "See file #{file_name} to " \ | ||||||||||||||||||||||||||||||||||||||||||||||
| "correlate line numbers of error. Error is\n\n#{e.message}" \ | ||||||||||||||||||||||||||||||||||||||||||||||
| "\n\n#{e.backtrace.join("\n")}" | ||||||||||||||||||||||||||||||||||||||||||||||
| "\n\n#{e.backtrace.join("\n")}" \ | ||||||||||||||||||||||||||||||||||||||||||||||
| "\n\n#{Utils.default_troubleshooting_section}" | ||||||||||||||||||||||||||||||||||||||||||||||
| Rails.logger.error(msg) | ||||||||||||||||||||||||||||||||||||||||||||||
| trace_js_code_used("Error when compiling JavaScript code for the context.", base_js_code, | ||||||||||||||||||||||||||||||||||||||||||||||
| file_name, force: true) | ||||||||||||||||||||||||||||||||||||||||||||||
| raise e | ||||||||||||||||||||||||||||||||||||||||||||||
| raise ReactOnRails::Error, msg | ||||||||||||||||||||||||||||||||||||||||||||||
| end | ||||||||||||||||||||||||||||||||||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Keep the original backtrace/cause; use dynamic help. Raising without Apply this diff: - msg = "ERROR when compiling base_js_code! " \
+ msg = "ERROR when compiling base_js_code! " \
"See file #{file_name} to " \
"correlate line numbers of error. Error is\n\n#{e.message}" \
- "\n\n#{e.backtrace.join("\n")}" \
- "\n\n#{Utils.default_troubleshooting_section}"
+ "\n\n#{e.backtrace.join("\n")}" \
+ "\n\n#{Utils.help_and_support_section}"
Rails.logger.error(msg)
trace_js_code_used("Error when compiling JavaScript code for the context.", base_js_code,
file_name, force: true)
- raise ReactOnRails::Error, msg
+ raise ReactOnRails::Error, msg, e.backtrace📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||||||
| end | ||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -227,7 +229,7 @@ def file_url_to_string(url) | |||||||||||||||||||||||||||||||||||||||||||||
| encoding_type = match[:encoding] | ||||||||||||||||||||||||||||||||||||||||||||||
| response.body.force_encoding(encoding_type) | ||||||||||||||||||||||||||||||||||||||||||||||
| rescue StandardError => e | ||||||||||||||||||||||||||||||||||||||||||||||
| msg = "file_url_to_string #{url} failed\nError is: #{e}" | ||||||||||||||||||||||||||||||||||||||||||||||
| msg = "file_url_to_string #{url} failed\nError is: #{e}\n\n#{Utils.default_troubleshooting_section}" | ||||||||||||||||||||||||||||||||||||||||||||||
| raise ReactOnRails::Error, msg | ||||||||||||||||||||||||||||||||||||||||||||||
| end | ||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+232
to
234
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Preserve backtrace and avoid duplicate/static help. Apply this diff: - msg = "file_url_to_string #{url} failed\nError is: #{e}\n\n#{Utils.default_troubleshooting_section}"
- raise ReactOnRails::Error, msg
+ msg = "file_url_to_string #{url} failed\nError is: #{e}\n\n#{Utils.help_and_support_section}"
+ raise ReactOnRails::Error, msg, e.backtrace📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -57,6 +57,8 @@ def self.invoke_and_exit_if_failed(cmd, failure_message) | |
| MSG | ||
|
|
||
| puts wrap_message(msg) | ||
| puts "" | ||
| puts default_troubleshooting_section | ||
|
|
||
| # Rspec catches exit without! in the exit callbacks | ||
| exit!(1) | ||
|
|
@@ -278,5 +280,15 @@ def self.prepend_to_file_if_text_not_present(file:, text_to_prepend:, regex:) | |
|
|
||
| puts "Prepended\n#{text_to_prepend}to #{file}." | ||
| end | ||
|
|
||
| def self.default_troubleshooting_section | ||
| <<~DEFAULT | ||
| 📞 Get Help & Support: | ||
| • 🚀 Professional Support: [email protected] (fastest resolution) | ||
| • 💬 React + Rails Slack: https://invite.reactrails.com | ||
| • 🆓 GitHub Issues: https://github.com/shakacode/react_on_rails/issues | ||
| • 📖 Discussions: https://github.com/shakacode/react_on_rails/discussions | ||
| DEFAULT | ||
| end | ||
| end | ||
| end | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -123,6 +123,24 @@ namespace :react_on_rails do | |
| puts Rainbow("=" * 80).red | ||
| end | ||
|
|
||
| def show_help_and_support | ||
| puts "" | ||
| troubleshooting_content = ReactOnRails::Utils.extract_troubleshooting_section | ||
| # Display the troubleshooting content with color formatting | ||
| troubleshooting_content.split("\n").each do |line| | ||
| case line | ||
| when /^📞/ | ||
| puts Rainbow(line).magenta.bold | ||
| when /^\s*•\s*🚀/ | ||
| puts Rainbow(line).yellow | ||
| when /^\s*•/ | ||
| puts Rainbow(line).cyan | ||
| else | ||
| puts Rainbow(line).white unless line.strip.empty? | ||
| end | ||
| end | ||
| end | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Terminal output loses actual URLs (link text only). Because Utils.convert_markdown_to_terminal strips links to plain text, this colored printer will show “Join our community” without the invite URL. Fix the conversion in Utils to preserve “text: URL”. See my comment in utils.rb Lines 309-316. 🤖 Prompt for AI Agents |
||
|
|
||
| # rubocop:disable Metrics/AbcSize | ||
| def handle_standard_error(error) | ||
| puts "" | ||
|
|
@@ -142,11 +160,7 @@ namespace :react_on_rails do | |
| puts Rainbow(" 2. Check Rails logs: tail -f log/development.log").white | ||
| puts Rainbow(" 3. Verify all dependencies are installed: bundle install && npm install").white | ||
| puts Rainbow(" 4. Clear cache: rm -rf tmp/cache").white | ||
| puts "" | ||
| puts Rainbow("📞 GET HELP:").magenta.bold | ||
| puts Rainbow(" • Create an issue: https://github.com/shakacode/react_on_rails/issues").cyan | ||
| puts Rainbow(" • Community discussions: https://github.com/shakacode/react_on_rails/discussions").cyan | ||
| puts Rainbow(" • Professional support: https://www.shakacode.com/react-on-rails-pro").cyan | ||
| show_help_and_support | ||
| puts Rainbow("=" * 80).red | ||
| end | ||
| # rubocop:enable Metrics/AbcSize | ||
|
|
||
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.
Guard against double-adding the help section.
Use a helper that appends the block once and prefers the dynamically extracted text.
Apply this diff:
🤖 Prompt for AI Agents