afrad / angular2-websocket

Websocket wrapper for angular2 based on angular-websocket
Apache License 2.0
210 stars 84 forks source link

Why PeerDependencies? #67

Open lattice0 opened 7 years ago

lattice0 commented 7 years ago

Hi, I'd like to understand why the package.json lists PeerDependencies? Because I don't see any heavy usage of RxJs, for example, that would be broken in other versions of 5.x, so why the beta is a peer dependency? Wouldn't it be better to move to a regular dependency?

I got these unmet dependencies:

npm WARN angular2-websocket@0.9.0 requires a peer of reflect-metadata@^0.1.8 but none was installed.
npm WARN angular2-websocket@0.9.0 requires a peer of rxjs@5.0.0-beta.12 but none was installed.
npm WARN angular2-websocket@0.9.0 requires a peer of typescript@^2.1.1 but none was installed.
npm WARN angular2-websocket@0.9.0 requires a peer of zone.js@^0.6.25 but none was installed.

I believe, by what I've read in the source, that at least typescript and rxjs would work with the newest version

lattice0 commented 7 years ago

I'm very confused. If peer dependencies are needed, why there's no information about installing them at the ReadMe?

Also, I've moved the dependencies to dependencies in an attempt to fix it, but I'm getting this one error:

node_modules/angular2-websocket/angular2-websocket.d.ts(36,30): error TS2304: Cannot find name 'Promise'.

(which is also given if I try to run a .ts file that imports the original unaltered websocket-angular module)

bkdotcom commented 7 years ago

for me:

npm WARN angular2-websocket@0.9.1 requires a peer of @angular/common@^2.0.0 but none was installed.
npm WARN angular2-websocket@0.9.1 requires a peer of @angular/compiler@^2.0.0 but none was installed.
npm WARN angular2-websocket@0.9.1 requires a peer of @angular/core@^2.0.0 but none was installed.
npm WARN angular2-websocket@0.9.1 requires a peer of rxjs@5.0.0-beta.12 but none was installed.
npm WARN angular2-websocket@0.9.1 requires a peer of zone.js@^0.6.25 but none was installed.

my package.json:

  "dependencies": {
    "@angular/common": "^4.0.0",
    "@angular/compiler": "^4.0.0",
    "@angular/core": "^4.0.0",
    "@angular/forms": "^4.0.0",
    "@angular/http": "^4.0.0",
    "@angular/platform-browser": "^4.0.0",
    "@angular/platform-browser-dynamic": "^4.0.0",
    "@angular/router": "^4.0.0",
    "angular2-websocket": "^0.9.1",
    "bootstrap": "^3.3.7",
    "core-js": "^2.4.1",
    "intl": "^1.2.5",
    "ngx-cookie": "^1.0.0",
    "rxjs": "^5.3.0",
    "zone.js": "^0.8.4"
  },

not compatible with latest version?