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

Avoid loading ActionView::Base during initialization #1659

Merged
merged 2 commits into from
Feb 17, 2023

Conversation

camertron
Copy link
Contributor

@camertron camertron commented Feb 16, 2023

What are you trying to accomplish?

This un-reverts the revert of #1528. I was unable to reproduce the Sorbet issue that caused us to revert, and there are a lot of good reasons to avoid loading ActionView::Base during initialization.

All credit goes to @jdelStrother for the implementation.

@camertron camertron changed the title No av base during init Avoid loading ActionView::Base during initialization Feb 16, 2023
@camertron camertron marked this pull request as ready for review February 16, 2023 23:58
@joelhawksley joelhawksley merged commit 01510f3 into main Feb 17, 2023
@joelhawksley joelhawksley deleted the no_av_base_during_init branch February 17, 2023 16:35
boardfish added a commit that referenced this pull request Jun 18, 2023
boardfish added a commit that referenced this pull request Jun 21, 2023
boardfish added a commit that referenced this pull request Jul 19, 2023
camertron added a commit that referenced this pull request Aug 23, 2023
…1774)

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

This reverts commit 01510f3.

* Initialize ViewComponent::Config with defaults before framework load

This commit introduces `ViewComponent::Config.current`, which should not be used directly by consumers of ViewComponent, but is used as the common thread from which `ViewComponent::Base` and `Rails.application.config.view_component` will load their config once each is ready. It'll make config available from the very start with the intent of not relying upon the framework to find these options - we can manually set anything reliant on Action View, for example, within app/engine config.

* Only include URL helpers if app is loaded

* Get this across the finish line

---------

Co-authored-by: Cameron Dutro <camertron@gmail.com>
claudiob pushed a commit to claudiob/view_component that referenced this pull request Dec 22, 2023
)

* Avoid loading ActionView::Base during initialization

* Add CHANGELOG entry
claudiob pushed a commit to claudiob/view_component that referenced this pull request Dec 22, 2023
…iewComponent#1774)

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

This reverts commit 01510f3.

* Initialize ViewComponent::Config with defaults before framework load

This commit introduces `ViewComponent::Config.current`, which should not be used directly by consumers of ViewComponent, but is used as the common thread from which `ViewComponent::Base` and `Rails.application.config.view_component` will load their config once each is ready. It'll make config available from the very start with the intent of not relying upon the framework to find these options - we can manually set anything reliant on Action View, for example, within app/engine config.

* Only include URL helpers if app is loaded

* Get this across the finish line

---------

Co-authored-by: Cameron Dutro <camertron@gmail.com>
claudiob pushed a commit to claudiob/view_component that referenced this pull request Jan 3, 2024
)

* Avoid loading ActionView::Base during initialization

* Add CHANGELOG entry
claudiob pushed a commit to claudiob/view_component that referenced this pull request Jan 3, 2024
…iewComponent#1774)

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

This reverts commit 01510f3.

* Initialize ViewComponent::Config with defaults before framework load

This commit introduces `ViewComponent::Config.current`, which should not be used directly by consumers of ViewComponent, but is used as the common thread from which `ViewComponent::Base` and `Rails.application.config.view_component` will load their config once each is ready. It'll make config available from the very start with the intent of not relying upon the framework to find these options - we can manually set anything reliant on Action View, for example, within app/engine config.

* Only include URL helpers if app is loaded

* Get this across the finish line

---------

Co-authored-by: Cameron Dutro <camertron@gmail.com>
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.

2 participants