Coder Social home page Coder Social logo

Comments (13)

christopherthielen avatar christopherthielen commented on April 20, 2024 1

Bad things happen when npm installs two copies of @uirouter/core. (note: yarn handles this with no problems). There was an explicit dependency on @uirouter/core@^5.0.0 and a transitive dependency through @uirouter/angular. npm seems to install one copy for each dependency.

I removed the explicit dependency on @uirouter/core in package.json and npm is now only installing one copy.

from sample-app-angular.

nacmacfeegle avatar nacmacfeegle commented on April 20, 2024

Seeing this too

$ npm -v
3.10.8

$ node -v
v6.9.0

$ tsc -v
Version 2.3.2

from sample-app-angular.

muscleman avatar muscleman commented on April 20, 2024

I cast routerFunc as and it compiled

from sample-app-angular.

muscleman avatar muscleman commented on April 20, 2024

I cast routerFunc as ANY and it compiled

from sample-app-angular.

nacmacfeegle avatar nacmacfeegle commented on April 20, 2024

from sample-app-angular.

muscleman avatar muscleman commented on April 20, 2024

from sample-app-angular.

DaSchTour avatar DaSchTour commented on April 20, 2024

@christopherthielen It would help a lot if there was not hard fixed version for @uirouter/core in @uirouter/angular as this also leads to major problems when using JSPM.

from sample-app-angular.

christopherthielen avatar christopherthielen commented on April 20, 2024

@DaSchTour @uirouter/angular should have a hard dependency on @uirouter/core so a given version of @uirouter/angular always behaves the same way.

What problems does this cause for jspm?

from sample-app-angular.

DaSchTour avatar DaSchTour commented on April 20, 2024

@christopherthielen the problem is, that there are different version installed. To have access to uirouter/core functions I have to install it explicitly with JSPM. But this leads to problems because uirouter/angular installs another version and so I have to instances of services and injection fails. So I have tell JSPM which version it should use for all dependencies after every update. Somehow the version and dependency handling of all uirouter modules (core, angular and rx) seams to be very inconsistent and IMHO a bit strange.

from sample-app-angular.

christopherthielen avatar christopherthielen commented on April 20, 2024

To have access to uirouter/core functions I have to install it explicitly with JSPM.

This is surprising to me. The @uirouter/* packages use what I think are typical node dependencies. core has no external deps, angular depends on a specific version of core and rx has a peer dependency on a range of versions of core.

from sample-app-angular.

DaSchTour avatar DaSchTour commented on April 20, 2024

@christopherthielen that's definitely not true. rx for example has rollup as a runtime dependency. So instead of handling core as a dependency JSPM only offers rollup as a dependency.

from sample-app-angular.

christopherthielen avatar christopherthielen commented on April 20, 2024

rx for example has rollup as a runtime dependency.

Ah yes, that's definitely wrong. I see you filed a bug ui-router/rx#5, thanks!

However, the legitimate @uirouter/rx dependencies are alrady listed as peerDependencies. It looks like JSPM supports peer deps. Why doesn't this work?

 "peerDependencies": {
    "@uirouter/core": ">=5.0.0",
    "rxjs": "^5.0.3"
  },

from sample-app-angular.

DaSchTour avatar DaSchTour commented on April 20, 2024

@christopherthielen I really have no idea. But I have no time to test this as we changed our setup. As there are so many obstacles using @angular/router with JSPM I tried to to the migration from uirouter/angularjs to uirouter/angular on JSPM but now we've build up the project from scratch with angular-cli and try to minimize the dependency to 3rd party libraries.

from sample-app-angular.

Related Issues (17)

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.