Skip to content

Fatina v3.1.0

Compare
Choose a tag to compare
@kefniark kefniark released this 22 Jan 15:29
· 15 commits to develop since this release

Description

  • Update dependencies (typescript, ...)
  • Improve fatina build process
    • Replaced webpack by esbuild
    • Replaced tslint by eslint
    • Expose two version of the lib:
      • fatina.cjs.js for NodeJS
      • fatina.esm.js for Browser and Deno

Deno Compatibility

With this new ESM Build, it means Fatina also get compatible with Deno

import Fatina from 'https://cdn.skypack.dev/fatina'

Fatina.init(true);

// create a dummy object
var obj = { a: 0, b: 0, position: {x:0, y:0}};

// create a tween (api: https://kefniark.github.io/Fatina/api/tween/)
Fatina.tween(obj.position)
    .to({x: 10, y: 10}, 4)
    .onStart(() => console.log("My tween is starting !"))
    .onUpdate((dt: number, progress: number) => console.log(`My tween is updating (+${dt}ms, ${progress*100}%)`))
    .onComplete(() => console.log("My tween is finished !"))
    .start();

// simulate frame update
for (var i = 0; i < 5; i++) {
    Fatina.update(1);
}

Breaking change

Drop the default export in browser usage.

<script type="text/javascript" src="fatina.min.js"></script>

Now you have to use it as a ESM module, but you can achieve the same behavior by binding the library on the global variable yourself

<script type="module">
    import Fatina from './fatina.esm.js'
    window.Fatina = Fatina;
</script>

Full Changelog: v3.0.5...v3.1.0