Skip to content

Releases: stratiformltd/react-loadable-visibility

Bug fixes

Choose a tag to compare

@tazsingh tazsingh released this 19 Jun 11:26
5a2b468

When using @loadable/components, the usage of the fallback loader has changed. This build accommodates the new method of providing a loader.

It also has a bug fix for how elements are unobserved by the IntersectionObserver.

As always, please report any issues with a reproducible case to help with debugging. CodeSandbox is great for this! 🙏🏽

Upgrade all the things

Choose a tag to compare

@tazsingh tazsingh released this 19 Jun 00:01

See PR #23 for the code changes of this release

The following changes are part of this release:

  • Utilize @loadable/components as part of their name change.
  • Upgrade react peer dependency to >=16.8.6.
  • Rewrite loadable component to use Hooks. Previously we were bringing in a class properties Babel transform, however now we don't need it as we don't use classes internally!
  • Refactor all tests using @testing-library/react. We rely on mocks less now so the test suite should be a good indication of what works.
  • Switch primary export to @loadable/components. react-loadable is reportedly not as maintained as @loadable/components, thus we'd recommend @loadable/components as the primary backing for this library as long as you aren't using the Suspense/React.lazy option.

Please report any issues that you are seeing.

Thanks!

Detect intersection by both `isIntersecting` and `intersectionRatio`

Choose a tag to compare

@tazsingh tazsingh released this 11 Dec 12:05

Previously we were only looking at the intersectionRatio being greater than 0 to detect an intersection. Now we also look at the isIntersecting property with a fallback to intersectionRatio > 0 in browsers that don't have the isIntersecting property.

Thanks to @Zubrolet for adding this and have a look at #19 for more information 👏

SSR Memory Leak Fix

Choose a tag to compare

@tazsingh tazsingh released this 20 Jun 23:54

As described in #11, when using componentWillMount to set up visibility handlers, it would create a leak in server-side environments where componentWillUnmount is not called to clean up the handler.

This release uses componentDidMount to set up the handlers, such that it is also not called on the server to be cleaned up.

Thanks to @the83 for identifying the problem and for the fix! 🎉

Fix for Microsoft Edge

Choose a tag to compare

@tazsingh tazsingh released this 24 Oct 04:21

Microsoft Edge requires a width and height on elements for the IntersectionObserver to detect them. This release fixes an issue where those properties were not set by default.

Better SSR resilience

Choose a tag to compare

@tazsingh tazsingh released this 28 Sep 15:43

Checks that window is undefined for some SSR environments.

Pass down the `className` prop

Choose a tag to compare

@tazsingh tazsingh released this 12 Sep 09:50

In addition to having a default style of the containing box of display: inline-block, you're now also able to pass down a className for the containing box.

Fix bug with multiple tracked elements on a page

Choose a tag to compare

@tazsingh tazsingh released this 10 Jul 19:25
v2.3.0

Fix bug with overlapping trackedElement key and bump version

Wrapping span is an inline-block

Choose a tag to compare

@tazsingh tazsingh released this 10 Jul 18:15
v2.2.0

Tweak ignored files and bump version

Cleanup imports

Choose a tag to compare

@tazsingh tazsingh released this 10 Jul 09:42

Cleanup import syntax from import LoadableVisibility from 'react-loadable-visibility/lib/react-loadable' to import LoadableVisibility from 'react-loadable-visibility/react-loadable', and same for loadable-components.