mohsinulhaq/react-popper-tooltip

Update deprecated sub-dependency

bponomarenko opened this issue ยท 7 comments

Describe the bug
Latest version of the react-popper-tooltip depends on v1 of the react-popper library, which by itself depends on v1 of popper.js. poperjs v1 is deprecated in favor of @popperjs/core package.

Additional context
There is already new version of the react-popper (latest is 2.2.3) which depends on a newer @popperjs/core (and it is a peer dependency now).

I second the request to update to popperjs v2. This can bring about potential size savings and better position stability.
Looking at the migration guide, some API has breaking changes. For example, modifiers changed from a dictionary to a list ({followCursorModifier: { enabled: true }} is now [{name: 'followCursorModifier', enabled: true}].
https://popper.js.org/docs/v2/migration-guide/

react-popper followed this API update with their v2.

@mohsinulhaq So this leaves the question: should react-popper-tooltip go to v3 with breaking changes, or do internal re-mapping to keep its API?

@mike-shtil @bponomarenko I would release v3 with the breaking changes and probably look into introducing hooks as the primary way to use the package. But unfortunately, I don't have the bandwidth to work on the change currently. However, please feel free to contribute if you want. ๐Ÿ™‚

@mike-shtil @bponomarenko I have published react-popper-tooltip@3.0.0-alpha.0
Please try it out and let me know if it works fine.
There are only two breaking changes. modifiers is now an array and closeOnOutOfBoundaries has been renamed to closeOnReferenceHidden. Both of the changes reflect the corresponding breaking change in popper-js v2.

@bponomarenko did you get to try it out? does it work fine?
I am going for a stable release.

@mohsinulhaq Sorry for the late reply. Honestly to say, I don't have live projects which are using it atm, so it is hard for me to test it.

@mohsinulhaq I tested out the alpha on a small use-case I built on 2.11.1 last week (not using on full project yet). It works well. v3 release should be good to go

Note: There are some other breaking changes in popper-js v2 too; but I think the users can take care of it. This link is useful:

https://popper.js.org/docs/v2/migration-guide/#10-update-modifiers

we can add a 'migration' section with this link in the readme here, & possibly something like 'these are the docs for popper-js@v2' + a link to the old docs readme in #95?

Also, thanks for making this! ๐Ÿ™‚

I have released v3 with an upgraded popper-js dependency to v2. ๐ŸŽ‰