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

Can't access easing functions from helpers #575

Closed
Rich-Harris opened this issue May 7, 2017 · 0 comments
Closed

Can't access easing functions from helpers #575

Rich-Harris opened this issue May 7, 2017 · 0 comments

Comments

@Rich-Harris
Copy link
Member

This...

<div in:fly='{x: -200, easing: elasticOut}'>
  wheee!!!!
</div>

<script>
  import fly from 'svelte-transitions-fly';
  import { elasticOut } from 'eases-jsnext';

  export default {
    helpers: { elasticOut },
    transitions: { fly }
  };
</script>

...doesn't work, because generator.contextualise only uses helpers (instead of state) in case of CallExpression nodes. Proposal: any reference that matches a helper always uses that helper, and we add compile-time warnings if we detect conflicts (from an introduced context, and maybe by inspecting the return value of a data function where possible) and dev-mode runtime warnings to mop up the rest.

Rich-Harris added a commit that referenced this issue May 27, 2017
Rich-Harris added a commit that referenced this issue May 28, 2017
always use helpers if referenced, not just for CallExpressions, and warn on context clashes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant