Skip to content

Releases: stratiformltd/react-loadable-visibility

Bug fixes

19 Jun 11:26
5a2b468
Compare
Choose a tag to compare

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

19 Jun 00:01
Compare
Choose a tag to compare

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`

11 Dec 12:05
Compare
Choose a tag to compare

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

20 Jun 23:54
Compare
Choose a tag to compare

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

24 Oct 04:21
Compare
Choose a tag to compare

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

28 Sep 15:43
Compare
Choose a tag to compare

Checks that window is undefined for some SSR environments.

Pass down the `className` prop

12 Sep 09:50
Compare
Choose a tag to compare

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

10 Jul 19:25
Compare
Choose a tag to compare
v2.3.0

Fix bug with overlapping trackedElement key and bump version

Wrapping span is an inline-block

10 Jul 18:15
Compare
Choose a tag to compare
v2.2.0

Tweak ignored files and bump version

Cleanup imports

10 Jul 09:42
Compare
Choose a tag to compare

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.