jeremyckahn / shifty

The fastest TypeScript animation engine on the web
https://jeremyckahn.github.io/shifty/doc/
MIT License
1.54k stars 88 forks source link

Default import issue #114

Closed kimmobrunfeldt closed 4 years ago

kimmobrunfeldt commented 4 years ago

Hi,

I'm forwarding an issue mentioned in progressbar.js. The gist is here: https://github.com/kimmobrunfeldt/progressbar.js/issues/256

This import exmaple doesn't seem to work (I quickly tested with node shell):

> const shifty = require('shifty');
undefined
> shifty.tween({ from: { x: 0 }, to: { x: 10 } });
Thrown:
TypeError: shifty.tween is not a function
jeremyckahn commented 4 years ago

Hi @kimmobrunfeldt! Thanks for logging this issue. I think this is a result of my bundling of Shifty for ES6 environments. I think the most practical solution for CommonJS loaders is to do what @RoyMudie did here: https://github.com/kimmobrunfeldt/progressbar.js/issues/256#issuecomment-598230415

...Which sure enough reveals an error in my documentation. 😅Apologies about that. I will fix that for you when I get a chance!

jeremyckahn commented 4 years ago

Note: This should be improved in 2.9.1: All modules are now published as ES6 modules. https://github.com/jeremyckahn/shifty/commit/3180c28345a2c10e44aca37a21a18b63c10814ab