question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Preact package should not have a hard dependency on prop-types

See original GitHub issue

In https://github.com/developit/preact/commit/069bc8f8a9ea4f514df034d77cadd8160ebb4baa#diff-b9cfc7f2cdf78a7f4b91a753d10865a2R63 a new top-level dependency was added on prop-types@^15.6.2. This package in turn has three dependencies, one of which has an additional dependency of its own. So as a user I end up with six Other People’s Codes on my machine (preact, prop-types, loose-envify, js-tokens, object-assign, react-is) even though I’m only using/needing/wanting one (preact).

The prop-types package itself is only needed by a “debug” sub-package hosted in this same repo, but the simple cleanup at #1460 was problematic and had to be reverted. Can a solution be found for the debug folder’s usage that still gets us back to a place where preact itself has no dependencies?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:8 (8 by maintainers)

github_iconTop GitHub Comments

2reactions
marvinhagemeistercommented, Apr 4, 2019

That’s true in theory, but looking at their git history it seems to only receive a couple commits per year. Even the recent ones were mainly maintenance tasks. So I think it would be safe to add our own checkPropTypes.

If anyone wants to take a go at this feel free to do so ✌️

1reaction
natevwcommented, Apr 9, 2019

I took a swing at a simplified checkPropTypes over in #1525, feedback appreciated. It’s not golfed specifically for code size, but I did leave out as much as I felt we could reasonably get away with.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Preact package should not have a hard dependency on prop-types ...
2 . This package in turn has three dependencies, one of which has an additional dependency of its own. So as a user...
Read more >
'prop-types' should be listed in the project's dependencies, not ...
Better answer is to just edit the lint rule. prop-types is a dev dependency, not a real dependency. See: stackoverflow.com/questions/43989739/…
Read more >
Upgrading from Preact 8.x
This document is intended to guide you through upgrading an existing Preact 8.x application to Preact X and is divided in 3 main...
Read more >
How we make npm packages work in the browser
It's a hard balance to keep, but it should be possible. We can also start caching dependencies independently in the browser, depending on...
Read more >
goober - npm
So, while I was working on a side-project I wanted a to use styled-components or more accurate the styled pattern. Looking at the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found