-
Notifications
You must be signed in to change notification settings - Fork 142
Closed
Description
Is your request related to a problem?
These classes could use some refactoring (details below) following #1780 where a few helper functions were created but have not been implemented throughout. The code review for this PR pointed out some improvements that could be made for related methods as well.
Describe the solution you'd like
Suggestions MdAttributeRenderer:
attributeSlotElementinprocessAttributeWithoutOverridecan use thecreateSlotTemplateNodefunction in elements.jshasSlotOverridingAttributecan be used in other processor functions, e.g.processDropdownAttributes, to reduce code duplication
Suggestions includePanelProcessor:
In the code review for popovers, @ryoarmanda pointed out several issues that could be applied to processInclude and processPanelSrc as well (details can be found here):
- Early returns in places where fall-through behaviour is undesirable, e.g.
- in
processInclude, if the src attribute is found to be empty - in
processInclude, if the maximum callstack size is exceeded
- in
- Consistency in the returned values: the caller of
processNodeexpects aContextobject to be returned- in
processInclude,return nodecan be changed toreturn context - same for
processPanelSrc
- in
- in
processInclude, theif (isUrl) { ... }block is never reached as_getFileExistsNodeabove will catch any URLs first. Hence, the URL check can be moved up to before_getFileExistsNode.
Describe alternatives you've considered
N/A
Additional context
N/A