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

Use sidecar templates for icon components #2723

Open
barmintor opened this issue May 19, 2022 · 4 comments
Open

Use sidecar templates for icon components #2723

barmintor opened this issue May 19, 2022 · 4 comments

Comments

@barmintor
Copy link
Contributor

On the committers' call @hackartisan asked whether we could leverage the limited override of sidecar templates from Blacklight::Component to provide a way to get inline SVG from the icon components without having the svg source in Ruby.

One way to do this would be to have a raw template.

See also conversation on #2670

@jcoyne
Copy link
Member

jcoyne commented May 19, 2022

@barmintor yeah, we could do that. I only made these class variable configuration as that seemed more "APIish". I'm not convinced that "just override a template" is a very good pattern in that it doesn't allow blacklight to evolve without breaking things in peoples apps.

@barmintor
Copy link
Contributor Author

Also good points! But I want to capture the ideas that came up in the call.

barmintor added a commit that referenced this issue May 19, 2022
@barmintor
Copy link
Contributor Author

This works, but I'm not sure it's better. Something to think about.

@barmintor
Copy link
Contributor Author

@jcoyne I also think, to your point, that we need to document that the component templates are private API. I think the compiler override is a necessary bridge, but it shouldn't be recommended practice.

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

No branches or pull requests

2 participants