Releases: alexreardon/raf-stub
3.0.0
✅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:
2.0.2
Improvements
- Upgrading to flow
0.68
2.0.0
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
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
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
1.0.0
API changes
(none)
Other changes
- Adopting semantic versioning for predictable dependency usage in your project! #5
0.4.0
API changes
replaceRaf(roots)
has becomereplaceRaf([roots], options)
. This allows you to use thereplaceRaf
syntax to set thestartTime
andframeDuration
for astub
.- 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 tocreateStub
,step
,flush
andreplaceRaf
. - documentation and examples of the new time mocking behaviour.
0.3.0
enhance
has been renamed toreplaceRaf
. I think this a clearer name as it better describes what the function is doing. Naming is hard.- lots more documentation and examples