Raf Stub Versions Save

Accurate and predictable testing of requestAnimationFrame and cancelAnimationFrame

v3.0.0

4 years ago

✅No API breaking changes.

The paths to the bundled files have changed. If you are consuming the package through npm, yarn or similar then you will be all good

Changes:

  • Upgraded to [email protected]
  • Only publishing src and dist to npm rather than the whole package
  • Exporting Stub type
  • Adding prettier #51
  • Moving to latest babel and other dev deps #51
  • Moved to rollup to generate bundles, rather than @babel/cli
  • Renamed generated files

v2.0.2

6 years ago

Improvements

  • Upgrading to flow 0.68

v2.0.0

7 years ago

API changes

1. Finally removing the depreciated the replaceRaf 0.3.x api.

Deprecated api

function replaceRaf(...rest: Array<Object>): void

replaceRaf();
replaceRaf(global, window, anotherRoot);

Stable api

type ReplaceRafOptions = {
    frameDuration?: number,
    startTime?: number
};

function replaceRaf(roots?: Object[] = [], { frameDuration = defaultFrameDuration, startTime = now() }: ReplaceRafOptions = {}) 

replaceRaf();
replaceRaf([global, window, anotherRoot]);
replaceRaf([global, window, anotherRoot], { frameDuration = 1000 / 60, startTime = performance.now() })

2. changing argument name for ReplaceRafOptions.

// old
type ReplaceRafOptions = {
    duration?: number,
    startTime?: number
};

replaceRaf([window], { duration = 1000 / 60, startTime = performance.now() });

// new
type ReplaceRafOptions = {
    // name has changed
    frameDuration?: number,
    startTime?: number
};

replaceRaf([window], { frameDuration = 1000 / 60, startTime = performance.now() });

Changing from duration to frameDuration brings the function names in line with createStub() and also the docs. The docs actually always had the argument named as frameDuration whereas the code had duration.

Other changes

(none)

v1.0.4

7 years ago

API changes

(none)

Other changes

#33 - Removing unneeded package engines requirement. Previously there was a cleanup in 1.0.2 to tighten up a lot of things which included adding an engines requirement. This was an attempt to reduce the chance of consumers getting errors from older node versions that I have not tested on. In the future I may see how far back you can go with raf-stub but my suspicion is that it can go back so far that any engines requirement would not be that meaningful. I can look into this further in the future if the need arises.

v1.0.3

7 years ago

API changes

(none)

Other changes

This is a minor addition to the previous release that adds also publishes .flow files into the lib folder. This allows for rich flow integration in your project with correct auto complete and type checking for arguments.

More details on the process around this: https://medium.com/@ryyppy/shipping-flowtype-definitions-in-npm-packages-c987917efb65#.f8uaswrz8

v1.0.2

7 years ago

API changes

(none)

Other changes

  • Adopting flow compile time type checking for internal and api stability
  • Now using yarn for faster build times and more predictable versioning
  • Updating some eslint rules
  • Add es6 "module" entry point to package.json

v1.0.0

7 years ago

API changes

(none)

Other changes

v0.4.0

7 years ago

API changes

  • replaceRaf(roots) has become replaceRaf([roots], options). This allows you to use the replaceRaf syntax to set the startTime and frameDuration for a stub.
  • The existing api replaceRaf(roots) will continue to work but has been depreciated and will be removed in a future major release.

Other changes

  • added the ability to control the time value that is passed to requestAnimationFrame callbacks. This has added relevant options to createStub, step, flush and replaceRaf.
  • documentation and examples of the new time mocking behaviour.

v0.3.0

7 years ago
  • enhance has been renamed to replaceRaf. I think this a clearer name as it better describes what the function is doing. Naming is hard.
  • lots more documentation and examples