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.

Investigate dropping all external dependencies

See original GitHub issue

We currently have two external dependencies: https://github.com/zertosh/loose-envify and https://github.com/benlesh/symbol-observable .

loose-envify appears to be used in package.json, but only as some kind of polyfill / build plugin for Browserify:

https://github.com/reduxjs/redux/blob/85024d431ca765c843561be6792edeb7890d5fce/package.json#L102-L106

symbol-observable is used in createStore as a polyfill for Symbol.observable, to allow compatibility for treating the Redux store as an observable:

https://github.com/reduxjs/redux/blob/85024d431ca765c843561be6792edeb7890d5fce/src/createStore.ts#L1

https://github.com/reduxjs/redux/blob/85024d431ca765c843561be6792edeb7890d5fce/src/createStore.ts#L331-L333

I would like to strongly consider dropping both of those dependencies if at all possible.

I question whether we need to have any specific support for Browserify in here. If there’s a build step that needs to be done, let the end users take care of it. No reason to have an installation dep just for that.

symbol-observable boils down to this 15-line file for the polyfill plus another 15 lines for figuring out what the global object is.

@davidkpiano suggests rolling our own symbol-observable if really needed.

Finally, we are currently talking about adding ts-toolbelt as a dependency for its compose function. I would like us to seriously investigate whatever other alternatives are out there to adding a dep, even if it’s one that ultimately compiles away.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:15 (15 by maintainers)

github_iconTop GitHub Comments

2reactions
markeriksoncommented, Sep 9, 2019

I have commented several times that the JS ecosystem would be well served by trying to do some consolidation and reduce tiny dependencies. There’s no reason that a CRA+TS app should end up with 1500 deps downloaded.

In Redux’s case specifically, there’s no need to add a package dependency just to get this tiny polyfill. I would love to see v5.0 have zero additional dependencies after installation.

2reactions
Andaristcommented, Sep 9, 2019

I agree that this was a strange issue on our side, and not something that happens daily - but a centralized package for those React types would actually save hours of debugging in this case. So it’s not really that “not much can be done to fix that”. I understand though that this is an edge case and not a strong argument in favor of this - just something I’ve wanted to mention.

As to the byte overhead - it’s 90 bytes difference (minified+gzipped on both). So not really something I would personally call a significant gain.

Don’t get me wrong - I’m here just to discuss as I’m interested in general reasoning/arguments behind changes like this. Lately, I’ve noticed people wanting to get rid of all dependencies and I just wonder why that is. Personally I don’t like bloated dependencies myself either, but inlining really small helpers just for sake of removing a dep is somewhat against composition for me.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How do I remove unused dependencies from the project?
m2/repository/com/google/code/ and then delete the gson folder and then as @Sergey has mentioned, Press the Reimport All Maven Projects. 1.
Read more >
Android Studio - Removed dependency is not ... - Stack Overflow
I have been removing the dependency, then deleting the external library files and then re-adding everything. – Notsileous. Feb 4, 2019 at 18:05....
Read more >
Technical Investigation: Dependency Proxy to pull from any ...
This would allow GitLab customers to easily proxy and cache container images from Amazon's or Google's registry, reducing external dependencies ...
Read more >
Are You Making Proper Use of Dependencies and Constraints?
In this article, we'll examine the use of the terms: Constraint; Interdependency; External Dependency; Task Dependency. And, for each one, we'll discuss how ......
Read more >
cmd/go: "mod tidy" doesn't delete go.sum when go ... - GitHub
It's not really a big deal, but I occasionally find myself having to manually delete go.sum files after removing all external dependencies ......
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