Giter Site home page Giter Site logo

Peer dependencies? about prism HOT 11 CLOSED

salsita avatar salsita commented on May 23, 2024
Peer dependencies?

from prism.

Comments (11)

tomkis avatar tomkis commented on May 23, 2024 1

I think @zetoke made the point albeit didn't explain it properly.

None of them are dependencies since technically you don't even need to use them, unless you want to use Sagas (redux-saga / rxjs). Generally if you are developing a library, you want to give a user full control over installed dependencies, so that we don't restrict user to have installed two versions just because redux-elm enforces different version than their application.

from prism.

zetoke avatar zetoke commented on May 23, 2024

You can control version of your sagas or rocks in your app.

from prism.

dalgard avatar dalgard commented on May 23, 2024

Is "rocks" slang for Rx observables?

This doesn't really answer my question. Why are they peer dependencies? If I decide to use either, I will simply add them as dependencies to my own project, just like redux-elm should add them as dependencies to it.

from prism.

zetoke avatar zetoke commented on May 23, 2024

Is "rocks" slang for Rx observables?

@dalgard sorry, my fault. It does not slang. Auto-correction on my phone has corrected from rxjs to rocks 😞

from prism.

dalgard avatar dalgard commented on May 23, 2024

@tomkis1 Thanks. So it comes down to avoiding an extra version. It's unfortunate that it shows up as a warning in the console, since it gives the impression that I'm doing something wrong, even when I don't need the two libs.

@zetoke It kinda makes sense as a slang word, though :)

from prism.

tomkis avatar tomkis commented on May 23, 2024

@dalgard well actually, you should install those two dependencies to avoid the warning, because either way sooner or later you will get to the point when sagas come handy ;-)

from prism.

dalgard avatar dalgard commented on May 23, 2024

No doubt – I would argue that any real-world app need a saga. Communicating correctly is important, though.

Avoiding the bundling of two different versions of the same package in one app is probably something that should be done manually when optimizing the bundle size, anyway?

from prism.

dalgard avatar dalgard commented on May 23, 2024

I'm thinking that the peer dependency feature isn't used all the time for a good reason.

Also, what about RxJS? I probably won't be using observables in my app, however great they are.

from prism.

tomkis avatar tomkis commented on May 23, 2024

So what do you suggest @dalgard should we put redux-saga and redux-saga-rxjs in dependencies instead?

from prism.

dalgard avatar dalgard commented on May 23, 2024

Only if they are actually used somewhere in redux-elm.

I can't figure out what relationship redux-elm have to these two libraries – the contents of this folder puzzles me.

from prism.

tomkis avatar tomkis commented on May 23, 2024

Maybe, but I'd still prefer to give user a chance to choose the right version of redux-saga and rxjs because they will most likely have these libraries already and the last thing we want is same library in different versions.

from prism.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.