Skip to content

Releases: garthenweb/react-viewport-utils

v1.12.1

10 Mar 17:48
Compare
Choose a tag to compare
  • [ab9fa7e] ensure to not update listener in case the ViewportCollector is not synchronised yet. This happens in a production build of react with server side rendering and updates the component without a need with an empty scroll and dimensions object #19

v1.12.0

16 Feb 13:52
Compare
Choose a tag to compare
  • [8325ce6, d98c87f] allow passing dependencies to useRect and useRectEffect hooks #18
  • [09a0bfb] allow passing priority to connectViewport HOC
  • [5cdd528, bca419b, 725caea] export typescript interfaces without I-prefix
  • [4149dcc] bind utils to their parent objects to avoid type errors #17
  • [02efe83] fix bug in updates of recalculateLayoutBeforeUpdat when used in combination with deferUpdateUntilIdle on a useViewportEffect hook #16
  • [7894033] fixes an issue where ObserveViewport had the default values after mounting
  • [51445ee] removes some dead code in ObserveViewport
  • [326087f] execute tests for NodeJS v13
  • [6f6d655, 54a56ec, 3731b1b] dev dependencies update

v1.11.0

20 Oct 16:06
Compare
Choose a tag to compare
  • [478f450] reduce work in idle mode
  • [035e4e2] trigger updates after prop change via scheduler to reduce layout trashing
  • [ef5f641] increase precision of layout measurement by adding a new experimentalSchedulerEnabled flag #14
  • [fd7001d] allow bundler to optimize filesize
  • [94c17fb] reduce expensive calls to cancel animation frame/ timeout
  • [68655ee] export polyfilled requestAnimationFrame
  • [dd3cd1c, 4bbcf9c] update dev dependencies

v1.10.1

08 Sep 18:51
Compare
Choose a tag to compare
  • [c9cba89] only trigger one initial scroll event. This also corrects how isScrollingRight and isScrollingDown are calculated, they are now only true in case an event that changed the regading direction was triggered (before e.g. isScrollingRight was always true in case isScrollingLeft was false which does not need to be correct)
  • [5ef35d0] always provide full viewport object for ObserveViewport, even if an update is disabled. This is especially important as version 1.9.3 where an initialize even can be fired even if all updates are disabled.

v1.10.0

08 Sep 15:10
Compare
Choose a tag to compare
  • [3f7bfa2] allow updates to hook options at runtime, so that changes are accepted for the next scheduled update. #12
  • [8346010] allow to pass dependency to effect hooks to force updates if external dependencies change. This also includes automatic updates for the useRect and useReactEffect functions as they now by default listen to the passed ref. #12
  • [c81358a] warn in case two different versions of the react-viewport-utils are used in the same tree in development mode

v1.9.4

01 Sep 22:22
Compare
Choose a tag to compare
  • [1793e97] fix definition of peer dependency for react which was changed by accident

v1.9.3

01 Sep 22:13
Compare
Choose a tag to compare
  • [0b322d4] useLayoutSnapshot was executing it's function in a way that causes layout trashing. The initial value is not generated using a common listener update in a requestAnimationFrame which should perform better. This event will be handled on all listeners so it makes sure that everything is up to date as soon as possible.
  • [dea07cb] update dependencies, which will update memoize-one to version 5.1.1 (from 5.0.0)

v1.9.2

20 Aug 20:58
Compare
Choose a tag to compare
  • [46d3632] Fixed a performance issue when the provider was rerendered, e.g. because children or hasListeners state changed. The fallback function was used for components updates in these situations which is costly. #8
  • [46d3632, 1deba6f] In case the fallback function must be triggered, we now cache it's response per instance for 1 second to not cause to much harm #10
  • [0e036bb] fix hooks argument change error #6
  • [5a87c8f] improve typescript support for snapshot functions by using unknown type instead of any
  • [ca4cfb1] fix warning and it's example in case a hook was used without a provider
  • [0235692] update dev dependencies to fix security warning
  • [7055a03] remove NEW tag from scheduler

v1.9.1

07 Jul 15:43
Compare
Choose a tag to compare
  • [94af676] fixes a regression in the last version were components went out of sync in case updates are skipped. This fix ensures, that all components are updated on idle in case they are out of sync, even if they are not registered for idle updates. This issue only exists in case the experimental scheduler was activated.

v1.9.0

22 Jun 22:57
Compare
Choose a tag to compare
  • [f4345f2] add useRect hook to observe an elements size and position
  • [18f2eae] add useViewportEffect, useScrollEffect, useDimensionsEffect and useRectEffect handler to perform side effects without updating the component
  • [d06e889] fix a bug where non idle listeners were informed for idle events, which resulted in unnessesary events
  • [7d749e8] deprecate ObserveBoundingClientRect as it has bad performance and can in most situations be replaced with the useRect hook.