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

Extract a base component for blacklight #2690

Merged
merged 2 commits into from
Apr 26, 2022
Merged

Conversation

barmintor
Copy link
Contributor

Backports #2679 to 7.x

@barmintor barmintor marked this pull request as ready for review April 26, 2022 12:43
@barmintor
Copy link
Contributor Author

Since we've made a decision on main regarding base components, I've decided to take the more conservative approach to overrides and substitute in a ViewComponent::Compiler subclass for descendants of Blacklight::Component in this PR.

This allows simple overrides of component templates that exist in the engine by placing them in the same place in the installing application. If a file in the installing application doesn't have a same-named analog in the engine, it won't be recognized - this has an impact on translation sidecars if the installing app is more expansive than the engine in language scope. But the Compiler interface is more stable, and if ViewComponent commits to an interface for sidecar files we can revisit without disrupting existing apps.

@barmintor barmintor requested a review from jcoyne April 26, 2022 14:07

module Blacklight
class Component < ViewComponent::Base
class << self
Copy link
Member

Choose a reason for hiding this comment

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

Please add documentation around what this is doing and why.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Documentary comments added.

cbeer and others added 2 commits April 26, 2022 13:58
…he installing app

- this permits overriding existing sidecar files, but not the addition of new files (e.g. translations)
@barmintor barmintor merged commit 6955a36 into release-7.x Apr 26, 2022
@barmintor barmintor deleted the 7.x-base-component branch April 26, 2022 19:06
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.

None yet

3 participants