Skip to content

Removed required keyword arguments for Ruby 2.0 compatibility#392

Closed
zimmru wants to merge 9 commits intoshakacode:masterfrom
zimmru:rails2_0_0
Closed

Removed required keyword arguments for Ruby 2.0 compatibility#392
zimmru wants to merge 9 commits intoshakacode:masterfrom
zimmru:rails2_0_0

Conversation

@zimmru
Copy link
Copy Markdown

@zimmru zimmru commented Apr 19, 2016

react_on_rails currently requires Ruby 2.1, but it's really only a handful of lines that use required keyword arguments. This commit removes those so that react_on_rails is compatible with Ruby 2.0.


This change is Reviewable

@justin808
Copy link
Copy Markdown
Member

@zimmru Any reason you can't move to Ruby 2.1?

@robwise
Copy link
Copy Markdown
Contributor

robwise commented Apr 20, 2016

Seems like an easy win for extra compatibility though

@ricochet2200
Copy link
Copy Markdown

For those of us that can't use rvm (no internet access, rpm requirements, etc.) or already have other gems that force a ruby version, changing ruby versions is a really big deal. In my case 2.1 is a deal breaker. Ideally this gem should match the ruby requirements of rails 4, which is "Ruby 2.0 preferred; 1.9.3+ required".

With such a small number of rails projects using react, it seems wise to me to try to be as inclusive as possible to make it more mainstream. I agree with @robwise, this seems like an easy win for the extra compatibility.

@thewoolleyman
Copy link
Copy Markdown
Contributor

I agree, it's a good change to make easier adoption.

However, I would want to see some sort of linter check added as part of this PR which would fail if any incompatible syntax is added, if that's possible. Otherwise other incompatible stuff will just get added in the future.

@justin808
Copy link
Copy Markdown
Member

Sounds good -- Once this passes CI, I'll review and merge.

@justin808
Copy link
Copy Markdown
Member

Reviewed 2 of 2 files at r1.
Review status: all files reviewed at latest revision, all discussions resolved, some commit checks failed.


Comments from Reviewable

@justin808
Copy link
Copy Markdown
Member

@zimmru I can't merge this until it passes CI.

@zimmru
Copy link
Copy Markdown
Author

zimmru commented Apr 26, 2016

There were a bunch of recent commits that use Ruby 2.1 features, so it's no longer the handful of lines that are different. Probably not worth trying to maintain at this point.

@zimmru zimmru closed this Apr 26, 2016
@justin808
Copy link
Copy Markdown
Member

@zimmru Are you able to update to Ruby 2.1?

Are there any strong reasons that people want to use an advanced tool like React on Rails, with an old version of Ruby?

@zimmru
Copy link
Copy Markdown
Author

zimmru commented Apr 26, 2016

@justin808 It's, of course, easy to update my dev machine to Ruby 2.1. The issue is at work, where our servers have Ruby 2.0 on them. Updating them is a bit of a pain.

@thewoolleyman
Copy link
Copy Markdown
Contributor

@zimmru Yep. I feel your pain, but that's why Containers (e.g. Docker) and PaaS are all the rage and the direction of the future - persistent servers are difficult to move forward without effort and risk - even if you use tools like Chef and Ansible to automatically and declaratively update them.

But, it's a good direction, for good reasons...

@ricochet2200
Copy link
Copy Markdown

@thewoolleyman It is important to note that PaaS is not always an option for those that must host their own stuff. If you are required to deploy on other people's hardware this becomes even more problematic as many times you will not have access to the internet. For complex installations, containers aren't always a feasible solution.

@justin808
Copy link
Copy Markdown
Member

If we get several people that want this, and the PR is good, I'll merge.

@justin808 justin808 reopened this Apr 26, 2016
@thewoolleyman
Copy link
Copy Markdown
Contributor

@justin808 I still think we should require a linter to fail in CI if newer syntax is used to consider this mergeable. Otherwise, we'll just have a continuous stream of issues like this as people inadvertently use newer syntax on master and in pull requests.

@justin808
Copy link
Copy Markdown
Member

I'm closing. If several people want Ruby 2.0, please comment.

@justin808 justin808 closed this May 6, 2016
@austinfox
Copy link
Copy Markdown

I'm using JRuby 1.7 and am unable to upgrade to JRuby 9000 (company won't allow it currently). It would be great if this issue could be re-opened

@justin808
Copy link
Copy Markdown
Member

justin808 commented Jul 2, 2016

@austinfox Your use case sounds valid. If you can make a PR that fixes this, I'll merge it. Otherwise, my team at ShakaCode can contract with your firm and get it done.

AbanoubGhadban pushed a commit that referenced this pull request Sep 25, 2025
…452)

To prepare for HTTP/2 support, we need to switch to a new HTTP client
library on the Ruby side.

Extracted from #392.

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

## Release Notes

- **New Features**
- Added support for streaming server rendering, enhancing performance
for server-rendered React components.
- Introduced functionality for replaying console logs during server
rendering for improved debugging.
- Enhanced error handling for server rendering with new configuration
options.
	- Improved handling of multipart and form data for file uploads.

- **Bug Fixes**
	- Improved handling of HTTP request errors and response status checks.

- **Documentation**
	- Updated configuration documentation for clarity on timeout settings.

- **Chores**
	- Updated dependencies and removed support for outdated versions.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Alexey Romanov <[email protected]>
AbanoubGhadban pushed a commit that referenced this pull request Sep 25, 2025
## Summary

- **New Features**
- Introduced support for HTTP/2, enhancing web performance and reducing
latency.
- Added a new script for generating SSL certificates for local
development.
  
- **Bug Fixes**
- Updated response status checks to use integer values for better
accuracy in error handling.

- **Chores**
- Enhanced `.gitignore` to exclude self-signed certificates from version
control.
- Updated project dependencies to remove outdated libraries and include
HTTPX for improved performance.

- **Documentation**
- Revised `CHANGELOG.md` to reflect new features and deprecated
technologies.


## Expectation

When communicating between a Ruby server and a Node.js server via
HTTP/2, the speed difference compared to HTTP/1.1 largely depends on the
context and nature of the communication.

1. **On Localhost:**
- **Same Speed or Slightly Faster:** Since the servers are on the same
machine (localhost), there is minimal network latency. The overhead of
HTTP/2 multiplexing, header compression, and other optimizations might
not make a huge difference because the communication happens locally,
and the network itself isn't the bottleneck. However, HTTP/2 could be
slightly faster due to its ability to send multiple requests
concurrently over a single connection. But the difference will likely be
marginal.

2. **Between Different Servers (Over the Network):**
- **Likely Faster with HTTP/2:** When communicating with a different
server over a network (not localhost), HTTP/2's advantages become more
pronounced. These advantages include:
- **Multiplexing:** Multiple requests/responses can be in flight
simultaneously over the same TCP connection without head-of-line
blocking, which reduces latency, especially in high-latency networks.
- **Header Compression:** HTTP/2 compresses headers, reducing the size
of requests and responses, which can improve speed, especially when
there are many repetitive headers (e.g., cookies).
- **Reduced Connection Overhead:** Since HTTP/2 uses fewer connections
due to multiplexing, it reduces the overhead of setting up and tearing
down connections, which can lead to faster communication, especially in
environments with higher latency.

### Summary:
- **On localhost:** The difference in speed between HTTP/2 and HTTP/1.1
will likely be negligible, though HTTP/2 might be marginally faster due
to multiplexing.
- **Over the network:** HTTP/2 will generally be faster due to
multiplexing, header compression, and reduced connection overhead,
especially in scenarios with higher latency or when multiple requests
are being made concurrently.

Closes #379.



<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

## Release Notes

- **New Features**
- Introduced streaming server rendering support for improved performance
and progressive page loading.
- Added replay functionality for console logs during server rendering to
aid debugging.
- Enhanced error handling during server rendering with new configuration
options.
- Integrated support for HTTP/2 in the node-renderer for better
performance.

- **Bug Fixes**
	- Improved error reporting and handling for HTTP requests.
	- Updated multiple JavaScript dependencies for better stability.

- **Documentation**
	- Updated `CHANGELOG.md` to reflect new features and changes.

- **Tests**
- Modified tests to accommodate new HTTP/2 request handling and improved
error management.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Alexey Romanov <[email protected]>
AbanoubGhadban pushed a commit that referenced this pull request Sep 26, 2025
…452)

To prepare for HTTP/2 support, we need to switch to a new HTTP client
library on the Ruby side.

Extracted from #392.

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

## Release Notes

- **New Features**
- Added support for streaming server rendering, enhancing performance
for server-rendered React components.
- Introduced functionality for replaying console logs during server
rendering for improved debugging.
- Enhanced error handling for server rendering with new configuration
options.
	- Improved handling of multipart and form data for file uploads.

- **Bug Fixes**
	- Improved handling of HTTP request errors and response status checks.

- **Documentation**
	- Updated configuration documentation for clarity on timeout settings.

- **Chores**
	- Updated dependencies and removed support for outdated versions.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Alexey Romanov <[email protected]>
AbanoubGhadban pushed a commit that referenced this pull request Sep 26, 2025
## Summary

- **New Features**
- Introduced support for HTTP/2, enhancing web performance and reducing
latency.
- Added a new script for generating SSL certificates for local
development.
  
- **Bug Fixes**
- Updated response status checks to use integer values for better
accuracy in error handling.

- **Chores**
- Enhanced `.gitignore` to exclude self-signed certificates from version
control.
- Updated project dependencies to remove outdated libraries and include
HTTPX for improved performance.

- **Documentation**
- Revised `CHANGELOG.md` to reflect new features and deprecated
technologies.


## Expectation

When communicating between a Ruby server and a Node.js server via
HTTP/2, the speed difference compared to HTTP/1.1 largely depends on the
context and nature of the communication.

1. **On Localhost:**
- **Same Speed or Slightly Faster:** Since the servers are on the same
machine (localhost), there is minimal network latency. The overhead of
HTTP/2 multiplexing, header compression, and other optimizations might
not make a huge difference because the communication happens locally,
and the network itself isn't the bottleneck. However, HTTP/2 could be
slightly faster due to its ability to send multiple requests
concurrently over a single connection. But the difference will likely be
marginal.

2. **Between Different Servers (Over the Network):**
- **Likely Faster with HTTP/2:** When communicating with a different
server over a network (not localhost), HTTP/2's advantages become more
pronounced. These advantages include:
- **Multiplexing:** Multiple requests/responses can be in flight
simultaneously over the same TCP connection without head-of-line
blocking, which reduces latency, especially in high-latency networks.
- **Header Compression:** HTTP/2 compresses headers, reducing the size
of requests and responses, which can improve speed, especially when
there are many repetitive headers (e.g., cookies).
- **Reduced Connection Overhead:** Since HTTP/2 uses fewer connections
due to multiplexing, it reduces the overhead of setting up and tearing
down connections, which can lead to faster communication, especially in
environments with higher latency.

### Summary:
- **On localhost:** The difference in speed between HTTP/2 and HTTP/1.1
will likely be negligible, though HTTP/2 might be marginally faster due
to multiplexing.
- **Over the network:** HTTP/2 will generally be faster due to
multiplexing, header compression, and reduced connection overhead,
especially in scenarios with higher latency or when multiple requests
are being made concurrently.

Closes #379.



<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

## Release Notes

- **New Features**
- Introduced streaming server rendering support for improved performance
and progressive page loading.
- Added replay functionality for console logs during server rendering to
aid debugging.
- Enhanced error handling during server rendering with new configuration
options.
- Integrated support for HTTP/2 in the node-renderer for better
performance.

- **Bug Fixes**
	- Improved error reporting and handling for HTTP requests.
	- Updated multiple JavaScript dependencies for better stability.

- **Documentation**
	- Updated `CHANGELOG.md` to reflect new features and changes.

- **Tests**
- Modified tests to accommodate new HTTP/2 request handling and improved
error management.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Alexey Romanov <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.