Skip to content

Fix ReactDomClient bug #1278

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

Merged
merged 9 commits into from
May 19, 2023

Conversation

Judahmeek
Copy link
Collaborator

@Judahmeek Judahmeek commented May 18, 2023

Summary

This closes #1276 & #1277

Other Information

Remove this paragraph and mention any other important and relevant information such as benchmarks.

Pull Request checklist

  • Add/update test to cover these changes
  • Update documentation
  • Update CHANGELOG file

@Judahmeek Judahmeek force-pushed the fix-bug-with-requiring-react-dom-with-sporockets branch from 6233b2b to b6811a0 Compare May 18, 2023 18:01
@Judahmeek Judahmeek requested review from ahangarha and justin808 May 18, 2023 18:16
Copy link
Collaborator

@ahangarha ahangarha left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the improvements 👍🏾

I have made some comments for refactoring.

Comment on lines +27 to +29
- run: bundle exec rake react:update
- run: bundle exec rake ujs:update
- run: ./check_for_uncommitted_files.sh
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it is better to extract this logic into another rake task and use it in both:

  • Release script
  • CI

Is will be DRY and also prevents adding bash script in the root of the project.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not convinced.

- 2.6.5
# TODO restore testing against JRuby w/ therubyrhino
# - jruby-9.3.7.0
ruby: [2.7]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not related to this PR, but I think we should add ruby 3 to the matrix for our tests.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

followup PR

@@ -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
Release.make_sure_react_and_ujs_are_updated_and_commited
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With this change, we don't need the commit_the_changes method anymore.

Comment on lines +90 to +102
def make_sure_react_and_ujs_are_updated_and_commited
status = `git status --porcelain`

return if $CHILD_STATUS.success? && status == ''

error = if $CHILD_STATUS.success?
'Running react:update and ujs:update resulted in uncommitted changes. Please commit those changes & confirm that CI passes before continuing.'
else
'You do not have Git installed. Please install Git, and commit your changes before continuing'
end
raise(error)
end

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As mentioned before, this can become a separate rake task

- 2.6.5
# TODO restore testing against JRuby w/ therubyrhino
# - jruby-9.3.7.0
ruby: [2.7]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

followup PR

Comment on lines +27 to +29
- run: bundle exec rake react:update
- run: bundle exec rake ujs:update
- run: ./check_for_uncommitted_files.sh
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not convinced.

}
}

export default reactDomClient
export default reactDomClient
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Judahmeek set your edit to add the extra line at the end.

@justin808
Copy link
Collaborator

@justin808 justin808 merged commit 714936f into master May 19, 2023
@justin808 justin808 deleted the fix-bug-with-requiring-react-dom-with-sporockets branch May 19, 2023 20:38
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.

Server side rendering broken in 2.7
3 participants