Skip to content

Verify tree shaking is done properly with popper #630

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

Closed
edwinbbu opened this issue Nov 18, 2021 · 5 comments
Closed

Verify tree shaking is done properly with popper #630

edwinbbu opened this issue Nov 18, 2021 · 5 comments

Comments

@edwinbbu
Copy link
Contributor

Ref: https://popper.js.org/docs/v2/performance/

@amaldinesh7 _a

performance _t

@edwinbbu
Copy link
Contributor Author

@ajmaln _a Can you check this out.

@gitemit gitemit bot assigned ajmaln and unassigned amaldinesh7 Nov 30, 2021
@ajmaln
Copy link
Contributor

ajmaln commented Dec 1, 2021

@edwinbbu as per https://popper.js.org/docs/v2/performance/, to implement treeshaking, the createPopper import should be like below:

import { createPopper } from '@popperjs/core/lib/popper-lite';

Since we are using usePopper hook from react-popper, the import for createPopper is not following the treeshaking approach on the library. Ref: https://github.com/popperjs/react-popper/blob/master/src/usePopper.js#L4.

Also there is an open issue for enabling tree shaking in react-popper.

cc: @amaldinesh7

@karthiknmenon
Copy link
Contributor

@ajil-paul _a could you please check?

cc: @ajmaln, @amaldinesh7

@gitemit gitemit bot assigned ajil-paul and unassigned ajmaln Jan 10, 2022
@ajil-paul
Copy link
Contributor

We are using react-popper for usePopper hook. The react-popper is importing the @popperjs/core module of Popper(19.3k)
For tree shaking, they should use @popperjs/core/lib/popper-lite module.
In the issue about enabling tree shaking, they said they can't import @popperjs/core/lib/popper-lite module in react-popper

@ajil-paul ajil-paul removed their assignment Jan 26, 2022
@amaldinesh7
Copy link
Contributor

Closing the issue for now, since the react-popper doesn't support tree shaking as of now.

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

No branches or pull requests

5 participants