Reorganise configuration across Rails app and component classes#2210
Closed
Reorganise configuration across Rails app and component classes#2210
Conversation
c7cf9a7 to
f6afae9
Compare
Preview namespace additionally added to config object in this commit to test config inheritance. Much more cleanup to be done around making as many things as possible component-local.
From here, we can start moving options to be component-local.
…hortcut to components
We're now at the stage where everything on this object lives on Rails.application.config.view_component.
f6afae9 to
b159d1e
Compare
Collaborator
Author
|
Gave this a day's work while my internet was down. I've gotten to a point where all config lives on
I think more options need to be component-local, but there are cases like the above where it's not possible without more changes to how ViewComponent is used...
That hopefully gets us to the stage where everything works, but from there I'll need to:
|
This was referenced Feb 19, 2025
Closed
Collaborator
Author
|
Chatted about this at maintainer office hours last night, and we came to the conclusion that:
|
This was referenced Mar 14, 2025
Closed
Collaborator
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR aims to rework configuration such that individual component instances can be configured differently, with the end goal of ensuring that applications and engines can define their configuration separately. We're taking a scorched earth approach here, though it will be important to ensure that the migration path from v3 is straightforward.
NOTE: This branch is a WIP – I'll squish things down before it's ready to share.
#1945 sheds some good light on the kinds of problems we're looking to solve here. Big thanks to @Slotos for their really helpful comment on that issue.