Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade from @popperjs/core to floating-ui #36497

Open
2 tasks done
benmccann opened this issue Jun 3, 2022 · 10 comments · May be fixed by #36683
Open
2 tasks done

Upgrade from @popperjs/core to floating-ui #36497

benmccann opened this issue Jun 3, 2022 · 10 comments · May be fixed by #36683

Comments

@benmccann
Copy link

Prerequisites

Proposal

Upgrade to floating-ui, which is the new version

Motivation and context

@popperjs/core is not compatible with server-side rendering (bestguy/sveltestrap#463). floating-ui has fixed this issue by correctly setting the exports map in package.json

@GeoSot
Copy link
Member

GeoSot commented Jun 8, 2022

@benmccann do you think we can change the library without the cost of major changes in config object of toolitp, popover and dropdown?

@benmccann
Copy link
Author

I'm not sure what changes would be required

@mdo
Copy link
Member

mdo commented Jun 8, 2022

I'm not sure what changes would be required

That's the primary concern for us, as @GeoSot mentions. We don't know how much work it'd be to replace this, and it'd likely be billed as a breaking change as we'd have a new dependency. That's not always the best for our end users. Without more information, we'll be left to figure it out when we can, which likely won't be until v6.

@benmccann
Copy link
Author

They've now created a migration guide: https://floating-ui.com/docs/migration

@Remzi1993
Copy link

They've now created a migration guide: https://floating-ui.com/docs/migration

I hope the Bootstrap team upgrades Popperjs. I would encourage everyone to upgrade as fast as possible to avoid any technical debt. Would be better if they just release it as version 6 or even better maybe not include it and make Bootstrap more modular, so devs can add it to Bootstrap like an add-on. Like without the add-on some things don't work and with you get extra features. This way you're not depended on updating the library yourself but the devs.

@atomiks
Copy link

atomiks commented Jun 29, 2023

From what I can see, Bootstrap doesn't expose any of Popper's API internals in a way that would prevent upgrading, which means it should be possible to keep it backwards-compatible. You can map the options to the new Floating UI ones with the same behavior after changing the dependency, and end-users wouldn't see any difference.

Cases where it'd break is non-bundled CDN usage where they reference bootstrap@5 (non-pinned) which automatically loads in new versions, and it then depends on Floating UI link instead; or they didn't have @popperjs/core installed but were using it indirectly anyway. I'm not sure if either of those should be covered by semver.

Upgrading should take less than an hour overall. Disclaimer: I am a maintainer of Floating UI. If you need help let me know!

Edit: Just realized I was on 4.0 docs accidentally, not 5.0. In v5, I can see there's a popperConfig object which complicates it quite a bit, although it's still possible to map the behavior but needs a middle layer to keep the API the same.

@Remzi1993
Copy link

Is this being worked on? I would like to use the new Floating UI

@julien-deramond
Copy link
Member

Is this being worked on? I would like to use the new Floating UI

This feature is planned for the v6 and the v6 development hasn't yet started.

@Remzi1993
Copy link

Is this being worked on? I would like to use the new Floating UI

This feature is planned for the v6 and the v6 development hasn't yet started.

Thank you so much for your reply. Do you also know if this will be implemented in a modular way, so devs can update this library indepently from Bootstrap?

@dakhnod dakhnod mentioned this issue Mar 27, 2024
3 tasks
@dakhnod
Copy link

dakhnod commented Apr 1, 2024

Is there any way to fix #39830 with popper?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants