Skip to content

Releases: alexreardon/raf-stub

3.0.0

09 Jul 01:06
Compare
Choose a tag to compare

✅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 flow@0.102.0
  • 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

2.0.2

22 Mar 23:35
Compare
Choose a tag to compare

Improvements

  • Upgrading to flow 0.68

2.0.0

09 Jan 22:24
Compare
Choose a tag to compare

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)

1.0.4

26 Dec 08:28
Compare
Choose a tag to compare

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.

1.0.3

22 Dec 04:16
Compare
Choose a tag to compare

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

1.0.2

21 Dec 23:36
Compare
Choose a tag to compare

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

1.0.0

29 Jul 07:07
Compare
Choose a tag to compare

API changes

(none)

Other changes

0.4.0

15 Jun 01:59
Compare
Choose a tag to compare

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.

0.3.0

25 May 22:45
Compare
Choose a tag to compare
  • 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