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

deprecate and remove if helper #95

Closed
jimmyhchan opened this issue Oct 29, 2014 · 4 comments · Fixed by #110
Closed

deprecate and remove if helper #95

jimmyhchan opened this issue Oct 29, 2014 · 4 comments · Fixed by #110

Comments

@jimmyhchan
Copy link
Contributor

We have strongly discouraged the use of the if helper. Can we formally deprecate and remove it?

@rragan
Copy link
Contributor

rragan commented Oct 29, 2014

Is the deprecation because it uses eval or because it encourages logic in templates? This will break lots of folks (sadly). Maybe we can create a dustjs-helper-deprecated file and folks who want to use it would have to pull that one in as well.

There is my alternative which does not use eval and limits the scope of expressions allowed for people who need it. https://github.com/rragan/dust-motes/tree/master/src/helpers/control/if

@smfoote
Copy link
Contributor

smfoote commented Oct 29, 2014

I would say the primary motivation for removing @if is because it uses eval, but I think the additional logic it allows in templates is also a step in the wrong direction for a "logicless" template language.

I say we deprecate and remove it. This is versioned software, so if the new version breaks someone's templates, they can just keep using the old version.

@jimmyhchan
Copy link
Contributor Author

I don't intend for this to happen suddenly. This will cause some pain for folks. Hopefully this issue will conclude with

  • timeline for removal
  • recommendation for those who still need the deprecated functionality

We definitely want a way for folks to opt into using the deprecated helper, but it should not be the default. Would love some thought around the options (separate repo, separate branch, a flag somehow...)

@sethkinast
Copy link
Contributor

A good first step would be to start throwing a warn when the helper is
invoked.

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 a pull request may close this issue.

4 participants