-
Notifications
You must be signed in to change notification settings - Fork 23
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
Spike: Software Design Patterns #3016
Closed
1 task done
Labels
Comments
denyo
added
component
Adds or changes of the components
to be refined
issue has to be refined
technical debt
team efficiency
labels
Jan 29, 2024
denyo
added a commit
that referenced
this issue
Feb 6, 2024
denyo
added a commit
that referenced
this issue
Feb 6, 2024
1 task
denyo
added a commit
that referenced
this issue
Feb 12, 2024
denyo
added a commit
that referenced
this issue
Feb 12, 2024
denyo
added a commit
that referenced
this issue
Feb 12, 2024
denyo
added a commit
that referenced
this issue
Feb 13, 2024
denyo
added a commit
that referenced
this issue
Feb 13, 2024
denyo
added a commit
that referenced
this issue
Feb 13, 2024
…heckbox-wrapper, pin-code, radio-button-wrappera and switch | bh | #3016
denyo
added a commit
that referenced
this issue
Feb 13, 2024
denyo
added a commit
that referenced
this issue
Feb 13, 2024
denyo
added a commit
that referenced
this issue
Feb 13, 2024
denyo
added a commit
that referenced
this issue
Feb 13, 2024
denyo
added a commit
that referenced
this issue
Feb 13, 2024
denyo
added a commit
that referenced
this issue
Feb 19, 2024
denyo
added a commit
that referenced
this issue
Feb 19, 2024
denyo
added a commit
that referenced
this issue
Feb 19, 2024
denyo
added a commit
that referenced
this issue
Feb 19, 2024
denyo
added a commit
that referenced
this issue
Feb 20, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Scope
We have several components that have identical props, behavior or events, e.g. all buttons, all links or form (wrapper) components.
Currently this identical behavior is maintained, synchronized and tested manually for the most part and differences are easy to miss. We call it redundant puzzles.
Therefore, we want to give some software design patterns a shot in order to extract the behavior introduced in #3009 which is duplicated in like 6 components.
While inheritance would probably be the best choice, stencil does not support it, however it seems
are possible.
Some 3rd party custom decorators:
@ConstructibleStyle
(https://github.com/bodinaren/stencil-constructible-style) could replace manually callingattachComponentCss()
in eachrender()
lifecycle@ClickOutside
(https://github.com/jarrvis/stencil-click-outside) is something we got at least inp-popover
,p-select-wrapper
andp-multi-select
Not sure if they would could be applied 1:1 but at least they can be used for reference.
Notes
Acceptance criteria
Conclusion
@Prop
,@Watch
and@State
need to stay in the stencil components, otherwise these don't work (most likely because of what happens in the stencil compiler which extracts decorated members only from components)@use
decorator mixes objects or classes into the stencil component, duplicate members/functions get overridden because of prototype merging, but this could be worked around with proper typing like prefixing lifecycle hooks with_
like_connectedCallback
which are then called via mixinclass Button implements IBaseButton
) but optional modifier doesn't force one to specify them which has impact on typings in wrappers, however, this could be corrected upon wrapper generationThe text was updated successfully, but these errors were encountered: