mrjmd / pdb

Decoupled Blocks is a Drupal 8 module to simplify integrating javascript frameworks into your site.
https://www.drupal.org/sandbox/mrjmd/2664138
57 stars 14 forks source link

Angular version upgrade #106

Open ethanhan777 opened 7 years ago

ethanhan777 commented 7 years ago

Hello, I'm trying to upgrade version of angular from 2 to 4. I updated package.json like below:

"dependencies": {
    "@angular/common": "^4.0.0",
    "@angular/compiler": "^4.0.0",
    "@angular/core": "^4.0.0",
    "@angular/http": "^4.0.0",
    "@angular/forms": "^4.0.0",
    "@angular/platform-browser": "^4.0.0",
    "@angular/platform-browser-dynamic": "^4.0.0",
    "deferred": "0.7.5",
    "core-js": "^2.4.1",
    "systemjs": "^0.19.47",
    "reflect-metadata": "0.1.8",
    "rxjs": "^5.2.0",
    "zone.js": "^0.8.5"
  },
  "devDependencies": {
    "@types/core-js": "0.9.34",
    "@types/systemjs": "0.19.31",
    "gulp": "^3.9.0",
    "del": "^2.2.0",
    "typescript": "^2.2.2",
    "typings": "^1.4.0"
  }

source: http://jasonwatmore.com/post/2017/05/20/upgrading-from-angular-2-to-angular-4

I'm now getting an error message: "Unhandled Promise rejection: rxjs_operator_share.share is undefined ; Zone: ; Task: Promise.then ; Value: TypeError: rxjs_operator_share.share is undefined"

any help please? thanks!

razbomi commented 7 years ago

This kind of works for me ... Beware that when you upgrade system-js you will have to change the systemConfig.js because the two versions are slightly incompatable.

{
  "name": "pdb_ng2",
  "version": "1.0.1",
  "description": "Decoupled Blocks Angular 2 dependencies",
  "repository": {
    "type": "git",
    "url": "https://github.com/mrjmd/pdb.git"
  },
  "contributors": [
    "Matt Davis"
  ],
  "license": "UNLICENSED",
  "readmeFilename": "README.txt",
  "scripts": {
    "start": "npm install",
    "postinstall": "typings install",
    "tsc": "tsc",
    "tsc:w": "tsc -w",
    "typings": "typings"
  },
  "dependencies": {
    "@angular/common": "^4.4.4",
    "@angular/compiler": "^4.4.4",
    "@angular/core": "^4.4.4",
    "@angular/forms": "^4.4.4",
    "@angular/http": "^4.4.4",
    "@angular/platform-browser": "^4.4.4",
    "@angular/platform-browser-dynamic": "^4.4.4",
    "core-js": "2.5.1",
    "deferred": "0.7.8",
    "moment": "^2.18.1",
    "plugin-typescript": "^7.1.0",
    "reflect-metadata": "0.1.10",
    "rxjs": "5.4.3",
    "systemjs": "^0.20.19",
    "typescript": "^2.5.3",
    "underscore": "^1.8.3",
    "zone.js": "0.8.18"
  },
  "devDependencies": {
    "@types/core-js": "0.9.43",
    "@types/systemjs": "0.20.5",
    "gulp": "^3.9.0",
    "del": "^2.2.0",
    "typescript": "2.5.3",
    "typings": "^1.4.0"
  }
}

This is a few months back but it had something to do with system-js and typescript (which is not something you should be doing in the browser anyway)

There is a working of dynamic components with system-js, which you can use as a starting point. https://embed.plnkr.co/0HQoJA8cZuo7dxA1r4pO/

decookr commented 6 years ago

Has anyone had any luck upgrading this module to Angular 4 or 5? I'm getting similar errors to @ethanhan777 .

devbisht commented 5 years ago

Anyone successfully upgraded Angular?