Skip to content

Do not return values from incrementVar and decrementVar helpers#160

Open
pvaladez wants to merge 1 commit intobigcommerce:masterfrom
pvaladez:pvaladez/issue111
Open

Do not return values from incrementVar and decrementVar helpers#160
pvaladez wants to merge 1 commit intobigcommerce:masterfrom
pvaladez:pvaladez/issue111

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 jairo-bc requested review from bookernath and mattolson March 7, 2022 13:30
@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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments