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

Name and Reuse Repeating Conditions #116

Closed
piotr-wilczynski opened this issue Oct 24, 2018 · 0 comments · Fixed by #131
Closed

Name and Reuse Repeating Conditions #116

piotr-wilczynski opened this issue Oct 24, 2018 · 0 comments · Fixed by #131
Assignees
Labels
htl Issues related to HTL language rule New rule or modification of existing one.
Projects

Comments

@piotr-wilczynski
Copy link
Contributor

piotr-wilczynski commented Oct 24, 2018

Consider caching data-sly-test conditions. Additionally, this reduces code duplication.

<!--/* Bad - the same condition is evaluated multiple times */-->
<span class="uber-mode__top-bar" data-sly-test="${uberModeHelper.uberModeEnabled || forceUberMode}">
    <div class="my-component">
        Blah blah blah
    </div>
</span>
<span class="uber-mode__bottom-bar" data-sly-test="${uberModeHelper.uberModeEnabled || forceUberMode}"></span>
 
 
<!--/* Good - condition defined in one place */-->
<span class="uber-mode__top-bar" data-sly-test.uberMode="${uberModeHelper.uberModeEnabled || forceUberMode}">
    <div class="my-component">
        Blah blah blah
    </div>
</span>
<span class="uber-mode__bottom-bar" data-sly-test="${uberMode}"></span>
@piotr-wilczynski piotr-wilczynski added rule New rule or modification of existing one. htl Issues related to HTL language labels Oct 24, 2018
@GulderBone GulderBone self-assigned this Oct 30, 2018
GulderBone pushed a commit that referenced this issue Oct 30, 2018
GulderBone pushed a commit that referenced this issue Oct 30, 2018
GulderBone pushed a commit that referenced this issue Oct 30, 2018
GulderBone pushed a commit that referenced this issue Oct 30, 2018
GulderBone pushed a commit that referenced this issue Oct 30, 2018
GulderBone pushed a commit that referenced this issue Oct 30, 2018
GulderBone pushed a commit that referenced this issue Oct 30, 2018
chutch added a commit that referenced this issue Nov 5, 2018
@chutch chutch added this to TODO in AEM Rules Nov 5, 2018
GulderBone pushed a commit that referenced this issue Nov 6, 2018
GulderBone pushed a commit that referenced this issue Nov 6, 2018
GulderBone pushed a commit that referenced this issue Nov 6, 2018
chutch pushed a commit that referenced this issue Nov 7, 2018
GulderBone pushed a commit that referenced this issue May 23, 2019
GulderBone pushed a commit that referenced this issue May 27, 2019
AEM Rules automation moved this from TODO to Done May 28, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
htl Issues related to HTL language rule New rule or modification of existing one.
Projects
AEM Rules
  
Done
Development

Successfully merging a pull request may close this issue.

2 participants