Skip to content
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

Revert "Avoid loading ActionView::Base during initialization (#1528)" #1626

Merged
merged 3 commits into from
Jan 11, 2023

Conversation

jonrohan
Copy link
Member

What are you trying to accomplish?

Reverting #1528

I went to update view_component from 2.74.0 to 2.81.0 the sorbet checks for Primer View Components in GitHub.com's codebase and it ended up removing a lot of the definitions from the rbi file.

What approach did you choose and why?

To find what caused it, I rolled to each version until I found one that didn't break, we were on 2.74.0 in dotcom and it broke after upgrading to 2.75.0.

Anything you want to highlight for special attention from reviewers?

@Spone
Copy link
Collaborator

Spone commented Jan 11, 2023

@jonrohan please also see #1571 (comment)

@camertron
Copy link
Contributor

@Spone ah yeah thanks for that 😄 We discussed reverting the PR during office hours today as well.

@joelhawksley joelhawksley merged commit 223c55d into main Jan 11, 2023
@joelhawksley joelhawksley deleted the revert_test branch January 11, 2023 23:34
@bradparker
Copy link
Contributor

Hi there 👋. The PR this reverts got us out of a sticky situation. Now that it's reverted, we're stuck again and are unable to upgrade from 2.81 to 2.82. It's a bit of a funny one and involves a dependency doing something a little unusual. I'll try and explain in case it's helpful.

Here's what happens for us.

The result is render_to_body ends up falling all the way through to the default case: https://github.com/rails/rails/blob/08b3cc3d3254d92647a0812a9c9b6f8b22375ac6/actionpack/lib/abstract_controller/rendering.rb#L51-L52. And we get an empty string where we expected a JSON document rendered via a jbuilder template.

Am I making sense? Have I missed something? Is there an alternative we should be pursuing do you think? Is there another way JBuilder could be achieving what they want?

Any and all help is greatly appreciated :)

@camertron
Copy link
Contributor

Hey @bradparker, thanks for bringing this up! As @jonrohan mentioned above, we reverted #1528 because it caused a bunch of Sorbet .rbi files to disappear when we tried to update ViewComponent in github.com's monorepo 😱 We tracked the breakage down to this PR and sure enough, reverting it fixed the problem. Since dotcom doesn't suffer from the problem #1528 was trying to solve, we didn't hesitate to revert it. Loading ActionView::Base too early sounds like something we should fix for a bunch of reasons though. Let me dig in today or tomorrow and see if I can figure out the Sorbet issue.

@camertron
Copy link
Contributor

Alright, so interestingly the Sorbet issue appears to have gone away, i.e. I couldn't reproduce it again. All dotcom tests pass too, so I'd say let's revert the revert. Here's the PR: #1659

claudiob pushed a commit to claudiob/view_component that referenced this pull request Dec 22, 2023
…ponent#1528)" (ViewComponent#1626)

* Revert "Avoid loading ActionView::Base during initialization (ViewComponent#1528)"

This reverts commit 22dbe8f.

* Put back changelog

* Adding changelog for revert
claudiob pushed a commit to claudiob/view_component that referenced this pull request Jan 3, 2024
…ponent#1528)" (ViewComponent#1626)

* Revert "Avoid loading ActionView::Base during initialization (ViewComponent#1528)"

This reverts commit 22dbe8f.

* Put back changelog

* Adding changelog for revert
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.

5 participants