angularangular-cliangular-seed

Taking benefit of a new Angular release candidate?


I for one is pretty exited every time Angular(two) comes out with a new version. They just released rc3 last night and i figured - Let's try it out.

Creating a new angular 2 project is not as easy as just downloading a zip and link it in your entry page, especially if you want to write it in TypeScript. You soon find out that there are several different options though. They kinda all boil down to using npm and configuring a package.json file.

So how do you create a working package.json file? Well they released a CLI tool (https://cli.angular.io/) to help you create a new project - and boy, do i love that! I just did a fresh install of the CLI and created a project.

These are the dependencies:

  "dependencies": {
    "@angular/common": "2.0.0-rc.1",
    "@angular/compiler": "2.0.0-rc.1",
    "@angular/core": "2.0.0-rc.1",
    "@angular/http": "2.0.0-rc.1",
    "@angular/platform-browser": "2.0.0-rc.1",
    "@angular/platform-browser-dynamic": "2.0.0-rc.1",
    "@angular/router": "3.0.0-alpha.3",
    "es6-shim": "0.35.1",
    "reflect-metadata": "0.1.3",
    "rxjs": "5.0.0-beta.6",
    "systemjs": "0.19.26",
    "zone.js": "0.6.12"
  }

As you can see, all the @angular (except router) versions point to rc.1 and not the newest rc.3. Why is that? I guess i could manually change all the rc.1 to rc.3 but would that just work and what about the router. I know from the release notes (http://angularjs.blogspot.dk/2016/06/rc3-now-available.html) that specific changes was made to that.

At this point, manually changing the dependencies would be kinda like poking a stick in your brain and twirl it around. It might help, but it probably would just mess it up.


TL;DR: How do you start using this new release candidate? How are we supposed to test it? Wouldn't a short list of (new) dependencies be required for everybody to start testing? It it just a teaser (the new rc3) and are we ment to wait for the CLI (or perhaps seed project) to update before we can actually use it?


Solution

  • This comes a bit late, but for other people needing this. You need the --next flag of the Angular CLI:

    $ ng update --help --next Use the prerelease version, including beta and RCs.

    Like this, which should be able to find versions like 14.0.0-rc.1:

    ng update --next @angular/core @angular/cli
    

    If you don't include the --next flag and try to specify the version directly, you'll get errors like:

    $ ng update @angular/core@14 @angular/cli@14
    An unhandled exception occurred: No matching version found for @angular/cli@14.