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

Do not return values from incrementVar and decrementVar helpers #160

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

pvaladez
Copy link

@pvaladez pvaladez commented Feb 18, 2022

What? Why?

The issue was first reported in issue #111.

The incrementVar and decrementVar helpers currently return the value of the handlebars variable, which results in the value being outputted to html.

How was it tested?

I removed the return lines on my local copy of stencil-cli/paper-handlebars, and afterward the helpers worked as expected and without printing the variable values to html.

I'm not very familiar with the paper-handlebars source, but I can see that other helper functions like assignVar do not return values.

Testing System Info

stencil-cli version: 3.6.4
node version: 12.21.0
OS: Windows 10


cc @bigcommerce/storefront-team @bookernath

@jairo-bc
Copy link
Contributor

jairo-bc commented Mar 7, 2022

@pvaladez I think some themes may rely on this kind of behaviour and this change might break backward compatibility.
Maybe you can try to use assignVar or use incremental helpers in the exact moment, where the data should be displayed?

cc @bookernath @mattolson Any thoughts?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants