-
Notifications
You must be signed in to change notification settings - Fork 759
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
SSR Fixes and better tests for v3.0.0 #1274
Conversation
90dc16d
to
e5e1c99
Compare
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.
Very extensive PR 🙂
It would be great if we could break it into two PRs
- Fix CI and the issue with requiring
react-dom/client
-> 2.7.1 - SSR fix -> 2.8 or 3.0
rakelib/create_release.rake
Outdated
@@ -39,7 +39,7 @@ task :create_release, %i[gem_version dry_run] do |_t, args| | |||
puts 'Updating ujs:update' | |||
Rake::Task['ujs:update'].invoke | |||
|
|||
Release.commit_the_changes('Update pre-bundled react and React ujs') unless is_dry_run |
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.
Then the commit_the_changes
method should be removed
.github/workflows/ruby.yml
Outdated
- run: bundle exec rake react:update | ||
- run: bundle exec rake ujs:update | ||
- run: ./check_for_uncommitted_files.sh |
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.
Maybe we can follow the DRY principle and create a rake task for this check. We can use it here and also in the release task.
f75f915
to
0a369c0
Compare
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.
Looking good.
Let's get PR 1278 merged and fix the conflicts.
Appraisals
Outdated
end | ||
|
||
appraise 'rails-5.2_no_sprockets_webpacker_3' do | ||
appraise 'rails-5.2_no_sprockets_shakapacker' do | ||
gem 'rails', '~> 5.2.x' |
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.
how much longer should we support rails 5.x?
Rails 5.2.1 Ended 11 months ago, (01 Jun 2022)
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.
I recommend making a yearly plan for our support for different versions of Ruby, Rails, Node, and React. Then update documentation and CI in all of our projects based on that.
It should be done in a (maximum) 30 min call with key senior developers in the team.
|
||
module_function | ||
def available? | ||
defined?(Webpacker) | ||
!!defined?(Webpacker) |
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.
Should we also add Shakapacker
to support v7+?
Rake::Task['webpacker:compile'].reenable | ||
Rake::Task['webpacker:compile'].invoke | ||
end | ||
Rake::Task['webpacker:compile'].reenable |
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.
what is this change?
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.
I removed capture_io
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.
Looking good.
Let's get PR 1278 merged and fix the conflicts.
0a369c0
to
c093961
Compare
c093961
to
b321bfe
Compare
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.
Looks ready. One debug comment left accidentally?
Do we need to update the README? and CHANGELOG? and release v3? Any upgrade guide?
CC: @ahangarha @Judahmeek
@@ -10,7 +10,9 @@ class ExecJSRenderer | |||
|
|||
def initialize(options={}) | |||
js_code = options[:code] || raise('Pass `code:` option to instantiate a JS context!') | |||
@context = ExecJS.compile(GLOBAL_WRAPPER + js_code) | |||
full_code = GLOBAL_WRAPPER + js_code | |||
# File.write("./test/dummy/tmp/latest_js_context.js", full_code) |
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.
@Judahmeek keep this comment?
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.
I had to use it to debug two different SSR error with ExecJS so yes, I'd like to keep it.
class SeparateServerBundleContainer | ||
|
||
def self.compatible? | ||
!!defined?(Webpacker) |
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.
Check for Shakapacker
?
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.
I don't want to try supporting Shakapacker v6 & v7 at the same time.
* Fully support Shakapacker, including tests & SSR
https://github.com/reactjs/react-rails/blob/master/CHANGELOG.md > If using Webpacker/Shakapacker, requires upgrading to Shakapacker v7 reactjs#1274 and reactjs#1285 It looks like react-rails v3 supports Shakapacker v7 only.
Summary
Pull Request checklist