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

Get rid of dom-helpers dependency #1458

Closed
ArtemZag opened this issue Nov 11, 2019 · 8 comments
Closed

Get rid of dom-helpers dependency #1458

ArtemZag opened this issue Nov 11, 2019 · 8 comments

Comments

@ArtemZag
Copy link

The last version of react-virtualized has dependency
"dom-helpers": "^2.4.0 || ^3.0.0",
But the last version of dom-helpers is 5.1.3.
My suggestion is to remove this dependency at all. You can simply copy the only required function (scrollbarSize) into your code.

@gsbelarus
Copy link

gsbelarus commented Nov 12, 2019

That is why I have to roll back to version 9.21.0. Our library which uses react-virtualized compiles well, but every project which uses this library now fails at webpack compilation stage with error message:

Module not found: Error: Can't resolve 'dom-helpers/util/scrollbarSize'

The message stands even after you add dom-helpers to projects package.json file.

@ArtemZag
Copy link
Author

@gsbelarus , looks like it has been fixed in the last version. 9.21.2. So, closing the issue.

@gsbelarus
Copy link

I have this problem exactly with 9.21.2 and rolled back to 9.21.0.

@ArtemZag
Copy link
Author

@gsbelarus , I see. So, for you the problem appeared because you had other package referencing old version of dom-helpers. In my case it was vice-versa - 9.21.2 solved my problem because now all my packages depend on the newest version of dom-helpers. Maybe you should better upgrade other packages which depend on older version of "dom-helpers" ? (if it's possible)

@gsbelarus
Copy link

We have a big mono repository maintained with lerna. All projects are updated to latest dependencies. With 9.21.2 we get an error during webpack compilation of a project which uses our library, which, in its turn, uses react-virtualized. The library itself compiles fine.

@gsbelarus
Copy link

Anyway, dom-helpers not so tiny as its name stands:

https://bundlephobia.com/result?p=dom-helpers@3.4.0

So, I would definitely recommend to get rid of it and just inline that single function.

@wuweiweiwu
Copy link
Collaborator

hi! @gsbelarus as we are only using dom-helpers via import paths like dom-helpers/scrollbarSize the bundle size impact is trivial.

I can see from your error message that it is importing dom helpers from dom-helpers/util/scrollbarSize this should not be the case in the latest release of react-virtualized

@wuweiweiwu
Copy link
Collaborator

PR that upgraded #1421

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

No branches or pull requests

3 participants