refactor(select): decouple hlm from brn #253
Draft
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.
PR Checklist
Please check if your PR fulfills the following requirements:
guidelines: https://github.com/goetzrobin/spartan/blob/main/CONTRIBUTING.md#-commit-message-guidelines
PR Type
What kind of change does this PR introduce?
Which package are you modifying?
What is the current behavior?
Closes #252
What is the new behavior?
Decouple
hlm
frombrn
. There should be no mention ofhlm
insidebrn
. Otherwise it would be a logical circularity.I think that
brn
in general should contain no components, otherwise it is taking away control over the final component library from developers.IMHO,
brn
should be a set of directives and helpers to build up a component library - something along the lines of a cdk. I think that less logic inbrn
and more logic inhlm
is a good thing as it gives developers the most control. But is also more error-prone in case of future updates. Not sure what the best course of action here is, alhtough I tend to think that more code in developer's codebases is a good thing (because it gives more control).Anyway back to the PR:
What I'm unhappy about with the current solution is the fact that I had to make
updateArrowDisplay
an async function because it needs to access theviewport
ElementRef, which is now passed to the directive through a signal.Happy to hear suggestions for a cleaner solution for this.
In general I tried to leave as much code as possible inside the brn directives, although again I'm wondering how much UI-related logic should live inside brn (again, imho, none or as little as necessary - although I'm having trouble defining what necessary in this case means).
Also, I didn't touch the tests and generators yet. Once we're happy with the changes I will get to it, too.
Does this PR introduce a breaking change?
hlm
components need to be regenerated, but otherwise the API stays the same (as long asbrn
isn't mentioned in the final code)Other information