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

Update Popper.js to v2.x #29842

Closed
NemoDima opened this issue Dec 12, 2019 · 33 comments · Fixed by #31178
Closed

Update Popper.js to v2.x #29842

NemoDima opened this issue Dec 12, 2019 · 33 comments · Fixed by #31178

Comments

@NemoDima
Copy link

Hello

Could you please plan the process of updating Popper.js to ver2.0.0. X ?
As a result, a lot of bugs will be fixed: https://github.com/popperjs/popper.js/labels/Fixed%20in%20v2
One of them is my floating-ui/floating-ui#835

I'll be appreciated.
Regards, Dmytro

@XhmikosR
Copy link
Member

Sorry, v2.0.0 isn't released. When this happen we'll revisit it later.

@FezVrasta
Copy link
Contributor

We just released the first alpha (@popperjs/core@2.0.0-alpha.1).

It would be awesome to get some feedback.

@XhmikosR XhmikosR reopened this Jan 22, 2020
@XhmikosR XhmikosR added the v5 label Jan 22, 2020
@XhmikosR
Copy link
Member

@Johann-S any thoughts how to proceed with the 2.x update? I see popper.js 2.x doesn't properly support IE 11 and requires polyfills...

@FezVrasta
Copy link
Contributor

FezVrasta commented Jan 22, 2020

We left a note about the IE support:
https://popper.js.org/docs/v2/browser-support/#ie10-and-older

Now that Microsoft ships a browser, compatible with old Microsoft operative systems, with support for compatibility mode, there's no reason for anyone to stick to Internet Explorer.

Big corporations can upgrade to a Microsoft browser, and keep their legacy websites working. Users can upgrade even if they run an operative system that didn't support Edge before.

In any case, with polyfills, Popper 2 should just work. I'm quite sure websites that support IE need to include polyfills for several reasons already.

Bootstrap itself ships polyfills with it, but it embeds them, making it impossible for consumers to reuse them in other parts of the application.

@XhmikosR
Copy link
Member

Now that Microsoft ships a browser, compatible with old Microsoft operative systems, with support for compatibility mode, there's no reason for anyone to stick to Internet Explorer.

As much as it might seem logical to you (and me), things aren't like that. The fact that Microsoft switched to another engine means nothing for corporate environments, despite them (Microsoft) trying to ignore this fact. IE cannot be diminished in one day.

That being said, and since we are already late in releasing v5, I think we might as well drop IE 11 support. As long as we offer a solution for people regarding the JS part.

The problem is that if we are going to really drop IE support (since this is the only thing that would really benefit us size-wise), things would start looking broken. I'm not sure we are this point yet. Which means, we'd need to semi drop IE support. And that's something that I'm not sure it's good either.

@FezVrasta
Copy link
Contributor

FezVrasta commented Jan 22, 2020

As I said, Popper 2 should work fine on IE 11 (and we are willing to accept PRs to fix what may be broken, if that doesn't require too many hacks)

A good plan to me would be to drop polyfills from Bootstrap, and ask users to import them manually, with a tool such as polyfill.io

@XhmikosR
Copy link
Member

As I said, Popper 2 should work fine on IE 11.

With polyfills.

So, as things are now, we have these solutions as far as I'm concerned:

  1. ignore popper 2.x and ship what we have as v5
  2. revisit IE support and drop our built-in polyfills, but update the docs with the needed snippets and stuff
  3. revisit IE support and drop it completely

The 3rd solution is something I don't think we are ready to do.

The second solution doesn't really gain us anything in the sense that the CSS prefixes will still need to be there and we will still be limited in the CSS features we use.

@FezVrasta
Copy link
Contributor

I think 2 would be a good solution. If we received feedback earlier during the development phase we could have came up with a better plan probably.

@atomiks
Copy link

atomiks commented Jan 23, 2020

I agree that 2 is best. Users should polyfill based on their target browser requirements rather than Bootstrap bundling them in.

polyfill.io is a fantastic service too, because browsers that don't need the polyfills aren't burdened with their cost - which is an advantage over bundling in the polyfills!

It would be a shame if Bootstrap didn't migrate to Popper 2, as we won't be maintaining v1 anymore. Users will likely be making issues for it due to Bootstrap's large adoption, and it will be a problem for the whole ecosystem.

As for the CSS prefixes, you could ship a "modern" build and a "legacy" build for CDN - for module bundlers the modern one will use the consumer's autoprefixer setup to automatically prefix based on their target browser requires like polyfill.io

@Johann-S
Copy link
Member

Johann-S commented Jan 23, 2020

I would prefer if we can drop IE.

  • The first solution isn't a good solution for us, because we aren't able to ship a lot of releases and we'll be stuck with an old unmaintained lib (Popper.js v1).

  • The second solution is a bit better but Polyfill.io do not provide all the needed polyfills. For example, they do not polyfill Event.preventDefault.

That's why I would prefer the third solution.

@FezVrasta
Copy link
Contributor

FezVrasta commented Jan 23, 2020

Polyfill.io can polyfill preventDefault with the Event flag:

https://polyfill.io/v3/polyfill.min.js?features=Event

Source code:
https://github.com/Financial-Times/polyfill-library/blob/master/polyfills/Event/polyfill.js#L103-L107

@XhmikosR
Copy link
Member

Let's try one more time and if now the polyfill works fine we can drop the built-in ones and unblock the popper.js update.

The only downside is that we'd need to change all templates and examples to include the polyfill. Or we could just mention it in the migration notes and in the browsers and devices page with a huge warning regarding IE support.

@FezVrasta
Copy link
Contributor

I think the huge warning regarding IE support is the way to go, it's okay to support ancient browsers, but it's not okay to tailor the whole process to take them in consideration. People who want to support such old browsers should take extra care.

@SilvioDoMine
Copy link

I think we should indeed leave IE behind. @FezVrasta said a good point.

@atomiks
Copy link

atomiks commented Jan 25, 2020

Bootstrap dropping IE11 support would be a big step to ensuring it dies off quicker. The longer we support IE the longer it will stick around...

@XhmikosR
Copy link
Member

XhmikosR commented Feb 5, 2020

If anyone can help us with dropping our custom polyfills and updating the docs accordingly, this is one less thing that's blocking us for v5. Don't forget to CC me if you make a PR.

@XhmikosR
Copy link
Member

XhmikosR commented Mar 9, 2020

In the last team group call, we decided that at this point, it might be easier for us to drop IE 11 support from v5. v4 will be supported for as long as we can (we'll update the release repo to reflect his when we release v5), so people who want to support IE can still use v4.

After we remove IE 11 support from master, we can use any help available to update the docs, update popper.js to v2 and so on.

Generally, we could use any help we could get in the JS department, so if anyone's interested in helping us out, please drop by our Slack and DM me.

@XhmikosR XhmikosR changed the title Update Popper.js to ver2.0.0. X Update Popper.js to v2.x Mar 13, 2020
@hatuhay
Copy link

hatuhay commented Mar 28, 2020

Drupal 9 is upgrading to popper 2 https://www.drupal.org/node/3112670
To continue using Bootstrap based themes, we should upgrade too.

@XhmikosR
Copy link
Member

PRs welcome as usual for master.

@FezVrasta
Copy link
Contributor

👋 I just published a new popper.js@1.x version, it's 1.16.1-lts. It's just like 1.16.1, but without the deprecation warning.

It's meant to be used by those libraries that aren't willing to update to 2.x for whatever reason (for example, Bootstrap 4.x may never update so this LTS allows to not show the deprecation warning to the users).

@Ronner
Copy link

Ronner commented Apr 6, 2020

👋 I just published a new popper.js@1.x version, it's 1.16.1-lts. It's just like 1.16.1, but without the deprecation warning.

It's meant to be used by those libraries that aren't willing to update to 2.x for whatever reason (for example, Bootstrap 4.x may never update so this LTS allows to not show the deprecation warning to the users).

Thx for doing this, however I have a question. With NPM I installed bootstrap (4.4.1) en this 1.16.1-lts version of popper.js, but npm install still gives me this message:

npm WARN bootstrap@4.4.1 requires a peer of popper.js@^1.16.0 but none is installed. You must install peer dependencies yourself.

Any way to get rid of that?

@FezVrasta
Copy link
Contributor

Bootstrap will need to update its peerDependencies to explicitly allow this new version.

@Ronner
Copy link

Ronner commented Apr 6, 2020

They require ^1.16.0 currently. Does the use of letters (-lts) in this version number confuse npm or bootstrap that it doesn't recognize it as a correct version? Or should versioning this version of popper.js not have been 1.16.2 in that case? (mind you I do not have much experience with NPM and the way it checks dependencies etc)

@FezVrasta
Copy link
Contributor

FezVrasta commented Apr 6, 2020

the -lts is a pre-release flag, so the existing ^ selector will not include it. I can't release it as 1.16.2, because doing so all the consumers who update to popper.js@latest would miss the warning.

The -lts strategy, instead, provides a way for library maintainers to explicitly opt in the LTS version.

#30517

@Ronner
Copy link

Ronner commented Apr 6, 2020

Gotcha. So now we have to wait until Bootstrap includes the -LTS version as an allowed peerDependency.

@Ronner
Copy link

Ronner commented Apr 6, 2020

Are the bootstrap devs aware of this fact?

@XhmikosR
Copy link
Member

XhmikosR commented Apr 6, 2020

We are and keeping spamming us is not helpful.

@Ronner
Copy link

Ronner commented Apr 6, 2020

I'm sorry. I never looked at the address bar in my browser. I thought I was on the popper.js repo 😊 Wasn't my intention to spam you guys.

@atomiks
Copy link

atomiks commented Jun 17, 2020

Congrats on releasing Bootstrap 5 alpha 🎉

I noticed it's still using Popper v1 though, are there plans to migrate to v2 before beta/final release?

@Johann-S
Copy link
Member

Yes we plan to do it ASAP

Terrtia added a commit to CIRCL/AIL-framework that referenced this issue Jun 19, 2020
@Johann-S Johann-S mentioned this issue Jun 25, 2020
10 tasks
@octogonz
Copy link

Can we make Popper.js optional somehow? We don't even use any Bootstrap features that require Popper, but we see this annoying warning every day.

@NemoDima
Copy link
Author

NemoDima commented Sep 7, 2020

Sorry to bother all of you, but could you provide any updates, please?
appreciate your help.

@FezVrasta
Copy link
Contributor

Popper modifiers are different in v2, you can't do that

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.

10 participants