You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
attributeSlotElement in processAttributeWithoutOverride can use the createSlotTemplateNode function in elements.js
hasSlotOverridingAttribute can 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
Consistency in the returned values: the caller of processNode expects a Context object to be returned
in processInclude, return node can be changed to return context
same for processPanelSrc
in processInclude, the if (isUrl) { ... } block is never reached as _getFileExistsNode above 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
The text was updated successfully, but these errors were encountered:
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:
attributeSlotElement
inprocessAttributeWithoutOverride
can use thecreateSlotTemplateNode
function in elements.jshasSlotOverridingAttribute
can be used in other processor functions, e.g.processDropdownAttributes
, to reduce code duplicationSuggestions includePanelProcessor:
In the code review for popovers, @ryoarmanda pointed out several issues that could be applied to
processInclude
andprocessPanelSrc
as well (details can be found here):processInclude
, if the src attribute is found to be emptyprocessInclude
, if the maximum callstack size is exceededprocessNode
expects aContext
object to be returnedprocessInclude
,return node
can be changed toreturn context
processPanelSrc
processInclude
, theif (isUrl) { ... }
block is never reached as_getFileExistsNode
above 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
The text was updated successfully, but these errors were encountered: