Dirty update to Angular RC6
authorChocobozzz <florian.bigard@gmail.com>
Tue, 6 Sep 2016 20:40:57 +0000 (22:40 +0200)
committerChocobozzz <florian.bigard@gmail.com>
Tue, 6 Sep 2016 20:40:57 +0000 (22:40 +0200)
41 files changed:
client/config/helpers.js
client/config/webpack.common.js
client/config/webpack.dev.js
client/config/webpack.prod.js
client/package.json
client/src/app/account/account.component.ts
client/src/app/account/index.ts
client/src/app/admin/admin.component.ts
client/src/app/admin/admin.routes.ts
client/src/app/admin/friends/friend-add/friend-add.component.ts
client/src/app/admin/friends/friend-list/friend-list.component.ts
client/src/app/admin/friends/friends.component.ts
client/src/app/admin/friends/friends.routes.ts
client/src/app/admin/friends/index.ts
client/src/app/admin/index.ts
client/src/app/admin/menu-admin.component.ts
client/src/app/admin/users/user-add/user-add.component.ts
client/src/app/admin/users/user-list/user-list.component.ts
client/src/app/admin/users/users.component.ts
client/src/app/admin/users/users.routes.ts
client/src/app/app.component.ts
client/src/app/app.module.ts [new file with mode: 0644]
client/src/app/app.routes.ts
client/src/app/app.service.ts [new file with mode: 0644]
client/src/app/environment.ts [new file with mode: 0644]
client/src/app/index.ts [new file with mode: 0644]
client/src/app/login/login.component.ts
client/src/app/menu.component.ts
client/src/app/shared/search/search.component.ts
client/src/app/videos/video-add/video-add.component.ts
client/src/app/videos/video-list/video-list.component.ts
client/src/app/videos/video-list/video-miniature.component.ts
client/src/app/videos/video-watch/video-watch.component.ts
client/src/app/videos/videos.component.ts
client/src/app/videos/videos.routes.ts
client/src/custom-typings.d.ts
client/src/main.ts
client/src/polyfills.ts
client/src/vendor.ts
client/tsconfig.json
client/typings.json [deleted file]

index 24d7dae9f406b7e8c4f7fc603c62c8ef96ce6cdb..6268d2628fbfdf067e1e7a773e6f6c83f29a4216 100644 (file)
@@ -8,10 +8,15 @@ function hasProcessFlag (flag) {
   return process.argv.join('').indexOf(flag) > -1
 }
 
+function isWebpackDevServer () {
+  return process.argv[1] && !!(/webpack-dev-server$/.exec(process.argv[1]))
+}
+
 function root (args) {
   args = Array.prototype.slice.call(arguments, 0)
   return path.join.apply(path, [ROOT].concat(args))
 }
 
 exports.hasProcessFlag = hasProcessFlag
+exports.isWebpackDevServer = isWebpackDevServer
 exports.root = root
index 2ff3a1506497687a4ba6ec3e3f0500c52fab5ceb..6edc9400c504dbfcc97828d8485cbef628eec65b 100644 (file)
@@ -5,7 +5,7 @@ const helpers = require('./helpers')
  * Webpack Plugins
  */
 
-var CopyWebpackPlugin = (CopyWebpackPlugin = require('copy-webpack-plugin'), CopyWebpackPlugin.default || CopyWebpackPlugin)
+const CopyWebpackPlugin = require('copy-webpack-plugin')
 const HtmlWebpackPlugin = require('html-webpack-plugin')
 const ForkCheckerPlugin = require('awesome-typescript-loader').ForkCheckerPlugin
 const WebpackNotifierPlugin = require('webpack-notifier')
@@ -15,7 +15,8 @@ const WebpackNotifierPlugin = require('webpack-notifier')
  */
 const METADATA = {
   title: 'PeerTube',
-  baseUrl: '/'
+  baseUrl: '/',
+  isDevServer: helpers.isWebpackDevServer()
 }
 
 /*
@@ -69,10 +70,7 @@ module.exports = {
     root: helpers.root('src'),
 
     // remove other default values
-    modulesDirectories: [ 'node_modules' ],
-
-    packageAlias: 'browser'
-
+    modulesDirectories: [ 'node_modules' ]
   },
 
   output: {
@@ -92,27 +90,15 @@ module.exports = {
      */
     preLoaders: [
 
-      /*
-       * Tslint loader support for *.ts files
-       *
-       * See: https://github.com/wbuchwalter/tslint-loader
-       */
-      // { test: /\.ts$/, loader: 'tslint-loader', exclude: [ helpers.root('node_modules') ] },
-
-      /*
-       * Source map loader support for *.js files
-       * Extracts SourceMaps for source files that as added as sourceMappingURL comment.
-       *
-       * See: https://github.com/webpack/source-map-loader
-       */
       {
-        test: /\.js$/,
-        loader: 'source-map-loader',
-        exclude: [
-          // these packages have problems with their sourcemaps
-          helpers.root('node_modules/rxjs'),
-          helpers.root('node_modules/@angular')
-        ]
+        test: /\.ts$/,
+        loader: 'string-replace-loader',
+        query: {
+          search: '(System|SystemJS)(.*[\\n\\r]\\s*\\.|\\.)import\\((.+)\\)',
+          replace: '$1.import($3).then(mod => mod.__esModule ? mod.default : mod)',
+          flags: 'g'
+        },
+        include: [helpers.root('src')]
       }
 
     ],
@@ -134,7 +120,11 @@ module.exports = {
        */
       {
         test: /\.ts$/,
-        loader: 'awesome-typescript-loader',
+        loaders: [
+          'awesome-typescript-loader',
+          'angular2-template-loader',
+          '@angularclass/hmr-loader'
+        ],
         exclude: [/\.(spec|e2e)\.ts$/]
       },
 
@@ -193,16 +183,6 @@ module.exports = {
      */
     new ForkCheckerPlugin(),
 
-    /*
-     * Plugin: OccurenceOrderPlugin
-     * Description: Varies the distribution of the ids to get the smallest id length
-     * for often used ids.
-     *
-     * See: https://webpack.github.io/docs/list-of-plugins.html#occurrenceorderplugin
-     * See: https://github.com/webpack/docs/wiki/optimization#minimize
-     */
-    new webpack.optimize.OccurenceOrderPlugin(true),
-
     /*
      * Plugin: CommonsChunkPlugin
      * Description: Shares common code between the pages.
index 50193bf58f18c7f2e61e4eb48c271083853c5f27..fede169323144af5f557ad84711b4226190ce93f 100644 (file)
@@ -6,15 +6,18 @@ const commonConfig = require('./webpack.common.js') // the settings that are com
  * Webpack Plugins
  */
 const DefinePlugin = require('webpack/lib/DefinePlugin')
+const NamedModulesPlugin = require('webpack/lib/NamedModulesPlugin')
 
 /**
  * Webpack Constants
  */
 const ENV = process.env.ENV = process.env.NODE_ENV = 'development'
+const HOST = process.env.HOST || 'localhost'
+const PORT = process.env.PORT || 3000
 const HMR = helpers.hasProcessFlag('hot')
 const METADATA = webpackMerge(commonConfig.metadata, {
-  host: 'localhost',
-  port: 3000,
+  host: HOST,
+  port: PORT,
   ENV: ENV,
   HMR: HMR
 })
@@ -81,7 +84,10 @@ module.exports = webpackMerge(commonConfig, {
      *
      * See: http://webpack.github.io/docs/configuration.html#output-chunkfilename
      */
-    chunkFilename: '[id].chunk.js'
+    chunkFilename: '[id].chunk.js',
+
+    library: 'ac_[name]',
+    libraryTarget: 'var'
 
   },
 
@@ -109,7 +115,9 @@ module.exports = webpackMerge(commonConfig, {
         'NODE_ENV': JSON.stringify(METADATA.ENV),
         'HMR': METADATA.HMR
       }
-    })
+    }),
+
+    new NamedModulesPlugin()
   ],
 
   /**
@@ -124,6 +132,17 @@ module.exports = webpackMerge(commonConfig, {
     resourcePath: 'src'
   },
 
+  devServer: {
+    port: METADATA.port,
+    host: METADATA.host,
+    historyApiFallback: true,
+    watchOptions: {
+      aggregateTimeout: 300,
+      poll: 1000
+    },
+    outputPath: helpers.root('dist')
+  },
+
   /*
    * Include polyfills or mocks for various node stuff
    * Description: Node configuration
index 7ce5727d32bbfed1d6c7bad41c71c5035d39fb9e..4e7d96a4b1f8e83caa48abd1041d228ae0fc9966 100644 (file)
@@ -9,10 +9,12 @@ const commonConfig = require('./webpack.common.js') // the settings that are com
 /**
  * Webpack Plugins
  */
+// const ProvidePlugin = require('webpack/lib/ProvidePlugin')
 const DefinePlugin = require('webpack/lib/DefinePlugin')
-const DedupePlugin = require('webpack/lib/optimize/DedupePlugin')
+const NormalModuleReplacementPlugin = require('webpack/lib/NormalModuleReplacementPlugin')
+// const IgnorePlugin = require('webpack/lib/IgnorePlugin')
+// const DedupePlugin = require('webpack/lib/optimize/DedupePlugin')
 const UglifyJsPlugin = require('webpack/lib/optimize/UglifyJsPlugin')
-const CompressionPlugin = require('compression-webpack-plugin')
 const WebpackMd5Hash = require('webpack-md5-hash')
 
 /**
@@ -110,7 +112,7 @@ module.exports = webpackMerge(commonConfig, {
      * See: https://webpack.github.io/docs/list-of-plugins.html#defineplugin
      * See: https://github.com/webpack/docs/wiki/optimization#deduplication
      */
-    new DedupePlugin(),
+    // new DedupePlugin(),
 
     /**
      * Plugin: DefinePlugin
@@ -156,19 +158,16 @@ module.exports = webpackMerge(commonConfig, {
       // comments: true, //debug
 
       beautify: false, // prod
-
-      mangle: {
-        screw_ie8: true,
-        keep_fnames: true
-      }, // prod
-
-      compress: {
-        screw_ie8: true
-      }, // prod
-
+      mangle: { screw_ie8: true, keep_fnames: true }, // prod
+      compress: { screw_ie8: true }, // prod
       comments: false // prod
     }),
 
+    new NormalModuleReplacementPlugin(
+      /angular2-hmr/,
+      helpers.root('config/modules/angular2-hmr-prod.js')
+    ),
+
     /**
      * Plugin: CompressionPlugin
      * Description: Prepares compressed versions of assets to serve
index ed7daf98e0216ee8b3260727b88bc1c7baf93d44..952997d1f97259c6db56c8d72bae140354e6d464 100644 (file)
     "url": "git://github.com/Chocobozzz/PeerTube.git"
   },
   "scripts": {
-    "postinstall": "typings install",
     "test": "standard && tslint -c ./tslint.json src/**/*.ts",
     "webpack": "webpack"
   },
   "license": "GPLv3",
   "dependencies": {
-    "@angular/common": "2.0.0-rc.4",
-    "@angular/compiler": "2.0.0-rc.4",
-    "@angular/core": "2.0.0-rc.4",
-    "@angular/forms": "^0.2.0",
-    "@angular/http": "2.0.0-rc.4",
-    "@angular/platform-browser": "2.0.0-rc.4",
-    "@angular/platform-browser-dynamic": "2.0.0-rc.4",
-    "@angular/router": "3.0.0-beta.2",
-    "angular-pipes": "^2.0.0",
-    "awesome-typescript-loader": "^0.17.0",
+    "@angular/common": "2.0.0-rc.6",
+    "@angular/compiler": "2.0.0-rc.6",
+    "@angular/core": "2.0.0-rc.6",
+    "@angular/forms": "2.0.0-rc.6",
+    "@angular/http": "2.0.0-rc.6",
+    "@angular/platform-browser": "2.0.0-rc.6",
+    "@angular/platform-browser-dynamic": "2.0.0-rc.6",
+    "@angular/router": "3.0.0-rc.2",
+    "@angularclass/hmr": "^1.0.1",
+    "@angularclass/hmr-loader": "^1.0.1",
+    "@types/core-js": "^0.9.28",
+    "@types/node": "^6.0.38",
+    "@types/source-map": "^0.1.26",
+    "@types/uglify-js": "^2.0.27",
+    "@types/webpack": "^1.12.29",
+    "angular-pipes": "^3.0.0",
+    "angular2-template-loader": "^0.5.0",
+    "awesome-typescript-loader": "^2.2.1",
     "bootstrap-loader": "^1.0.8",
     "bootstrap-sass": "^3.3.6",
     "compression-webpack-plugin": "^0.3.1",
     "ie-shim": "^0.1.0",
     "intl": "^1.2.4",
     "json-loader": "^0.5.4",
-    "ng2-bootstrap": "1.0.24",
+    "ng2-bootstrap": "1.1.1",
     "ng2-file-upload": "^1.0.3",
     "node-sass": "^3.7.0",
     "normalize.css": "^4.1.1",
     "raw-loader": "^0.5.1",
     "reflect-metadata": "0.1.3",
     "resolve-url-loader": "^1.4.3",
-    "rxjs": "5.0.0-beta.6",
+    "rxjs": "5.0.0-beta.11",
     "sass-loader": "^3.2.0",
     "source-map-loader": "^0.1.5",
+    "string-replace-loader": "^1.0.3",
     "style-loader": "^0.13.1",
     "ts-helpers": "^1.1.1",
-    "tslint": "^3.7.4",
+    "tslint": "3.15.0-dev.0",
     "tslint-loader": "^2.1.4",
-    "typescript": "^1.8.10",
-    "typings": "^1.0.4",
+    "typescript": "^2.0.0",
     "url-loader": "^0.5.7",
-    "webpack": "^1.13.1",
+    "webpack": "^2.1.0-beta.21",
     "webpack-md5-hash": "0.0.5",
-    "webpack-merge": "^0.13.0",
+    "webpack-merge": "^0.14.1",
     "webpack-notifier": "^1.3.0",
     "webtorrent": "^0.96.0",
-    "zone.js": "0.6.12"
+    "zone.js": "0.6.17"
   },
   "devDependencies": {
     "codelyzer": "0.0.28",
index 54939f43bc4ef117804afa1300a59773c63e4cd3..a22738d3f509a6ce011db8a7140ea923ff22c266 100644 (file)
@@ -1,15 +1,13 @@
-import { Validators } from '@angular/common';
+import {  } from '@angular/common';
 import { Component, OnInit } from '@angular/core';
-import { FormControl, FormGroup, REACTIVE_FORM_DIRECTIVES } from '@angular/forms';
+import { FormControl, FormGroup, Validators } from '@angular/forms';
 import { Router } from '@angular/router';
 
 import { AccountService } from './account.service';
 
 @Component({
   selector: 'my-account',
-  template: require('./account.component.html'),
-  providers: [ AccountService ],
-  directives: [ REACTIVE_FORM_DIRECTIVES ]
+  template: require('./account.component.html')
 })
 
 export class AccountComponent implements OnInit {
index 7445003fd33579ce58820b45df084a0710486a45..823d9fe5fd95faee4b514602d4483d22459f221a 100644 (file)
@@ -1,2 +1,3 @@
 export * from './account.component';
 export * from './account.routes';
+export * from './account.service';
index 82f2529ec9c12ef738826560c9e52d863c2190e7..64a7400e7e954d5c8d3660a054b7c2c06cb132e7 100644 (file)
@@ -1,9 +1,7 @@
 import { Component } from '@angular/core';
-import { ROUTER_DIRECTIVES } from '@angular/router';
 
 @Component({
-    template: '<router-outlet></router-outlet>',
-    directives: [ ROUTER_DIRECTIVES ]
+  template: '<router-outlet></router-outlet>'
 })
 
 export class AdminComponent {
index 80b3ecbc1354bbe8c55e1d86aefeeea557b9a7ca..1fcace99491087bcfd6fd67458d890fe675a188d 100644 (file)
@@ -1,10 +1,10 @@
-import { RouterConfig } from '@angular/router';
+import { Routes } from '@angular/router';
 
 import { AdminComponent } from './admin.component';
 import { FriendsRoutes } from './friends';
 import { UsersRoutes } from './users';
 
-export const AdminRoutes: RouterConfig = [
+export const AdminRoutes: Routes = [
   {
     path: 'admin',
     component: AdminComponent,
index 2b2aceb8ab95a65814b2b785f145d91bf290d9f2..55aed9156a6364c628de5305ff66271d0d053b7e 100644 (file)
@@ -1,5 +1,5 @@
 import { Component, OnInit } from '@angular/core';
-import { FormControl, FormGroup, REACTIVE_FORM_DIRECTIVES } from '@angular/forms';
+import { FormControl, FormGroup } from '@angular/forms';
 import { Router } from '@angular/router';
 
 import { validateUrl } from '../../../shared';
@@ -8,8 +8,7 @@ import { FriendService } from '../shared';
 @Component({
   selector: 'my-friend-add',
   template: require('./friend-add.component.html'),
-  styles: [ require('./friend-add.component.scss') ],
-  directives: [ REACTIVE_FORM_DIRECTIVES ]
+  styles: [ require('./friend-add.component.scss') ]
 })
 export class FriendAddComponent implements OnInit {
   friendAddForm: FormGroup;
@@ -80,12 +79,13 @@ export class FriendAddComponent implements OnInit {
 
     this.friendService.makeFriends(notEmptyUrls).subscribe(
       status => {
-        if (status === 409) {
-          alert('Already made friends!');
-        } else {
+        // TODO: extractdatastatus
+        // if (status === 409) {
+        //   alert('Already made friends!');
+        // } else {
           alert('Make friends request sent!');
           this.router.navigate([ '/admin/friends/list' ]);
-        }
+        // }
       },
       error => alert(error)
     );
index 38d4799a6ecf3babce1d9564386bb024296110c9..c76fc4df2e2e6b09acb725decc70cbc9f1bf094c 100644 (file)
@@ -1,13 +1,11 @@
 import { Component, OnInit } from '@angular/core';
-import { ROUTER_DIRECTIVES } from '@angular/router';
 
 import { Friend, FriendService } from '../shared';
 
 @Component({
   selector: 'my-friend-list',
   template: require('./friend-list.component.html'),
-  styles: [ require('./friend-list.component.scss') ],
-  directives: [ ROUTER_DIRECTIVES ]
+  styles: [ require('./friend-list.component.scss') ]
 })
 export class FriendListComponent implements OnInit {
   friends: Friend[];
index e66280f01a158945a2d564e828338b581b8bf276..bc3f54158fef093f4c7d04f14f5f96c78f8b6549 100644 (file)
@@ -1,12 +1,7 @@
 import { Component } from '@angular/core';
-import { ROUTER_DIRECTIVES } from '@angular/router';
-
-import { FriendService } from './shared';
 
 @Component({
-    template: '<router-outlet></router-outlet>',
-    directives: [ ROUTER_DIRECTIVES ],
-    providers: [ FriendService ]
+    template: '<router-outlet></router-outlet>'
 })
 
 export class FriendsComponent {
index 42b4a6c14351ed121ad44aa19c5c347b47143969..7fdef68f90585eb361f85c5882b63f3188c298b4 100644 (file)
@@ -1,10 +1,10 @@
-import { RouterConfig } from '@angular/router';
+import { Routes } from '@angular/router';
 
 import { FriendsComponent } from './friends.component';
 import { FriendAddComponent } from './friend-add';
 import { FriendListComponent } from './friend-list';
 
-export const FriendsRoutes: RouterConfig = [
+export const FriendsRoutes: Routes = [
   {
       path: 'friends',
       component: FriendsComponent,
index f3110e31db4670209409d201edee0c6cdf204561..dd4df2538e4a5d305f1e87e0cd5f8181315c6b50 100644 (file)
@@ -1,4 +1,5 @@
 export * from './friend-add';
 export * from './friend-list';
 export * from './shared';
+export * from './friends.component';
 export * from './friends.routes';
index 292973681afadebd1dcb5062bcd248fd7323eab9..3d0e67b151d516814927939607b862f0ac2ec303 100644 (file)
@@ -1,3 +1,4 @@
+export * from './friends';
 export * from './users';
 export * from './admin.component';
 export * from './admin.routes';
index 788592872903025356ce730340a2332a2e200b74..a9115d49f92d86858575c74475344c7fef06f998 100644 (file)
@@ -1,9 +1,7 @@
 import { Component } from '@angular/core';
-import { ROUTER_DIRECTIVES } from '@angular/router';
 
 @Component({
   selector: 'my-menu-admin',
-  template: require('./menu-admin.component.html'),
-  directives: [ ROUTER_DIRECTIVES ]
+  template: require('./menu-admin.component.html')
 })
 export class MenuAdminComponent { }
index 8dd98cc5c60e13f9451248953410d5d85178033e..e3f4b2e1aa266506f472b1abbc6803a2373cebd1 100644 (file)
@@ -1,14 +1,12 @@
-import { Validators } from '@angular/common';
 import { Component, OnInit } from '@angular/core';
-import { FormGroup, FormControl, REACTIVE_FORM_DIRECTIVES } from '@angular/forms';
+import { FormGroup, FormControl, Validators } from '@angular/forms';
 import { Router } from '@angular/router';
 
 import { UserService } from '../shared';
 
 @Component({
   selector: 'my-user-add',
-  template: require('./user-add.component.html'),
-  directives: [ REACTIVE_FORM_DIRECTIVES ]
+  template: require('./user-add.component.html')
 })
 export class UserAddComponent implements OnInit {
   userAddForm: FormGroup;
index c89a61bcadd7aa0e89e7827875ec6435b553a552..d3827eb288dad602ff3c19b5afc152711b55363e 100644 (file)
@@ -1,5 +1,4 @@
 import { Component, OnInit } from '@angular/core';
-import { ROUTER_DIRECTIVES } from '@angular/router';
 
 import { User } from '../../../shared';
 import { UserService } from '../shared';
@@ -7,8 +6,7 @@ import { UserService } from '../shared';
 @Component({
   selector: 'my-user-list',
   template: require('./user-list.component.html'),
-  styles: [ require('./user-list.component.scss') ],
-  directives: [ ROUTER_DIRECTIVES ]
+  styles: [ require('./user-list.component.scss') ]
 })
 export class UserListComponent implements OnInit {
   totalUsers: number;
index 46aa0862f058ed7f2ec34e9864418814ce37beb8..37e3b158d1c0757447b2107843ac9316fca68829 100644 (file)
@@ -1,12 +1,7 @@
 import { Component } from '@angular/core';
-import { ROUTER_DIRECTIVES } from '@angular/router';
-
-import { UserService } from './shared';
 
 @Component({
-    template: '<router-outlet></router-outlet>',
-    directives: [ ROUTER_DIRECTIVES ],
-    providers: [ UserService ]
+    template: '<router-outlet></router-outlet>'
 })
 
 export class UsersComponent {
index 0457c3843c038497a22f1accc699c08bf2789373..eb71bd0ae0b6801cb0dc55e3e8e485e5ffa21629 100644 (file)
@@ -1,10 +1,10 @@
-import { RouterConfig } from '@angular/router';
+import { Routes } from '@angular/router';
 
 import { UsersComponent } from './users.component';
 import { UserAddComponent } from './user-add';
 import { UserListComponent } from './user-list';
 
-export const UsersRoutes: RouterConfig = [
+export const UsersRoutes: Routes = [
   {
       path: 'users',
       component: UsersComponent,
index 9d05c272ffc1f47c05f28a78bcafa2fa5a7df62b..e81993a3f0ed2bd4b6ecb7a5b752ef0a9c4389eb 100644 (file)
@@ -1,17 +1,10 @@
 import { Component } from '@angular/core';
-import { Router, ROUTER_DIRECTIVES } from '@angular/router';
-
-import { MenuAdminComponent } from './admin';
-import { MenuComponent } from './menu.component';
-import { RestExtractor, RestService, SearchComponent, SearchService } from './shared';
-import { VideoService } from './videos';
+import { Router } from '@angular/router';
 
 @Component({
     selector: 'my-app',
     template: require('./app.component.html'),
-    styles: [ require('./app.component.scss') ],
-    directives: [ MenuAdminComponent, MenuComponent, ROUTER_DIRECTIVES, SearchComponent ],
-    providers: [ RestExtractor, RestService, VideoService, SearchService ]
+    styles: [ require('./app.component.scss') ]
 })
 
 export class AppComponent {
diff --git a/client/src/app/app.module.ts b/client/src/app/app.module.ts
new file mode 100644 (file)
index 0000000..950b3c4
--- /dev/null
@@ -0,0 +1,130 @@
+import { NgModule, ApplicationRef } from '@angular/core';
+import { BrowserModule } from '@angular/platform-browser';
+import { FormsModule, ReactiveFormsModule } from '@angular/forms';
+import { HttpModule, RequestOptions, XHRBackend } from '@angular/http';
+import { RouterModule } from '@angular/router';
+import { removeNgStyles, createNewHosts } from '@angularclass/hmr';
+
+import { FileSelectDirective } from 'ng2-file-upload/ng2-file-upload';
+import { ProgressbarModule } from 'ng2-bootstrap/components/progressbar';
+import { PaginationModule } from 'ng2-bootstrap/components/pagination';
+import { BytesPipe } from 'angular-pipes/src/math/bytes.pipe';
+
+/*
+ * Platform and Environment providers/directives/pipes
+ */
+import { ENV_PROVIDERS } from './environment';
+import { routes } from './app.routes';
+// App is our top level component
+import { AppComponent } from './app.component';
+import { AppState } from './app.service';
+import { AccountComponent, AccountService } from './account';
+import { LoginComponent } from './login';
+import {
+  LoaderComponent,
+  VideosComponent,
+  VideoAddComponent,
+  VideoListComponent,
+  VideoMiniatureComponent,
+  VideoSortComponent,
+  VideoWatchComponent,
+  VideoService
+} from './videos';
+import {
+  FriendsComponent,
+  FriendAddComponent,
+  FriendListComponent,
+  FriendService,
+  UsersComponent,
+  UserAddComponent,
+  UserListComponent,
+  UserService,
+  AdminComponent,
+  MenuAdminComponent
+} from './admin';
+import { MenuComponent } from './menu.component';
+import { AuthService, AuthHttp, RestExtractor, RestService, SearchComponent, SearchService } from './shared';
+
+// Application wide providers
+const APP_PROVIDERS = [
+  AppState,
+
+  {
+    provide: AuthHttp,
+    useFactory: (backend: XHRBackend, defaultOptions: RequestOptions, authService: AuthService) => {
+      return new AuthHttp(backend, defaultOptions, authService);
+    },
+    deps: [ XHRBackend, RequestOptions, AuthService ]
+  },
+
+  AuthService,
+  RestExtractor,
+  RestExtractor, RestService, VideoService, SearchService, FriendService, UserService, AccountService
+];
+/**
+ * `AppModule` is the main entry point into Angular2's bootstraping process
+ */
+@NgModule({
+  bootstrap: [ AppComponent ],
+  declarations: [
+    AppComponent,
+    BytesPipe,
+    FileSelectDirective,
+    AccountComponent,
+    LoginComponent,
+    LoaderComponent,
+    VideosComponent,
+    VideoAddComponent,
+    VideoListComponent,
+    VideoSortComponent,
+    VideoMiniatureComponent,
+    VideoWatchComponent,
+    FriendsComponent,
+    FriendAddComponent,
+    FriendListComponent,
+    UsersComponent,
+    UserAddComponent,
+    UserListComponent,
+    AdminComponent,
+    MenuAdminComponent,
+    MenuComponent,
+    SearchComponent
+  ],
+  imports: [ // import Angular's modules
+    BrowserModule,
+    FormsModule,
+    ReactiveFormsModule,
+    HttpModule,
+    RouterModule.forRoot(routes),
+    ProgressbarModule,
+    PaginationModule
+  ],
+  providers: [ // expose our Services and Providers into Angular's dependency injection
+    ENV_PROVIDERS,
+    APP_PROVIDERS
+  ]
+})
+export class AppModule {
+  constructor(public appRef: ApplicationRef, public appState: AppState) {}
+  hmrOnInit(store) {
+    if (!store || !store.state) return;
+    console.log('HMR store', store);
+    this.appState._state = store.state;
+    this.appRef.tick();
+    delete store.state;
+  }
+  hmrOnDestroy(store) {
+    const cmpLocation = this.appRef.components.map(cmp => cmp.location.nativeElement);
+    // recreate elements
+    const state = this.appState._state;
+    store.state = state;
+    store.disposeOldHosts = createNewHosts(cmpLocation);
+    // remove styles
+    removeNgStyles();
+  }
+  hmrAfterDestroy(store) {
+    // display new elements
+    store.disposeOldHosts();
+    delete store.disposeOldHosts;
+  }
+}
index d7194cb4feca3cf6419da8e0e94644f65ec90400..03e2bce5128102984d063c4cc6c4bf4043cb7cef 100644 (file)
@@ -1,11 +1,11 @@
-import { RouterConfig } from '@angular/router';
+import { Routes } from '@angular/router';
 
 import { AccountRoutes } from './account';
 import { LoginRoutes } from './login';
 import { AdminRoutes } from './admin';
 import { VideosRoutes } from './videos';
 
-export const routes: RouterConfig = [
+export const routes: Routes = [
   {
     path: '',
     redirectTo: '/videos/list',
diff --git a/client/src/app/app.service.ts b/client/src/app/app.service.ts
new file mode 100644 (file)
index 0000000..033c219
--- /dev/null
@@ -0,0 +1,36 @@
+
+import { Injectable } from '@angular/core';
+
+@Injectable()
+export class AppState {
+  _state = { };
+
+  constructor() { ; }
+
+  // already return a clone of the current state
+  get state() {
+    return this._state = this._clone(this._state);
+  }
+  // never allow mutation
+  set state(value) {
+    throw new Error('do not mutate the `.state` directly');
+  }
+
+
+  get(prop?: any) {
+    // use our state getter for the clone
+    const state = this.state;
+    return state.hasOwnProperty(prop) ? state[prop] : state;
+  }
+
+  set(prop: string, value: any) {
+    // internally mutate our state
+    return this._state[prop] = value;
+  }
+
+
+  _clone(object) {
+    // simple object clone
+    return JSON.parse(JSON.stringify( object ));
+  }
+}
diff --git a/client/src/app/environment.ts b/client/src/app/environment.ts
new file mode 100644 (file)
index 0000000..8bba89c
--- /dev/null
@@ -0,0 +1,50 @@
+
+// Angular 2
+// rc2 workaround
+import { enableDebugTools, disableDebugTools } from '@angular/platform-browser';
+import { enableProdMode, ApplicationRef } from '@angular/core';
+// Environment Providers
+let PROVIDERS = [
+  // common env directives
+];
+
+// Angular debug tools in the dev console
+// https://github.com/angular/angular/blob/86405345b781a9dc2438c0fbe3e9409245647019/TOOLS_JS.md
+let _decorateModuleRef = function identity(value) { return value; };
+
+if ('production' === ENV) {
+  // Production
+  disableDebugTools();
+  enableProdMode();
+
+  PROVIDERS = [
+    ...PROVIDERS,
+    // custom providers in production
+  ];
+
+} else {
+
+  _decorateModuleRef = (modRef: any) => {
+    const appRef = modRef.injector.get(ApplicationRef);
+    const cmpRef = appRef.components[0];
+
+    let _ng = (<any>window).ng;
+    enableDebugTools(cmpRef);
+    (<any>window).ng.probe = _ng.probe;
+    (<any>window).ng.coreTokens = _ng.coreTokens;
+    return modRef;
+  };
+
+  // Development
+  PROVIDERS = [
+    ...PROVIDERS,
+    // custom providers in development
+  ];
+
+}
+
+export const decorateModuleRef = _decorateModuleRef;
+
+export const ENV_PROVIDERS = [
+  ...PROVIDERS
+];
diff --git a/client/src/app/index.ts b/client/src/app/index.ts
new file mode 100644 (file)
index 0000000..da53f6a
--- /dev/null
@@ -0,0 +1 @@
+export * from './app.module';
index 1e0ba0fe8c2a666538c870c552a64b1ab472deba..7a4e15c2c28ff607ebc973d44c9d8dc98f17058e 100644 (file)
@@ -1,14 +1,12 @@
 import { Component, OnInit } from '@angular/core';
-import { Validators } from '@angular/common';
-import { FormControl, FormGroup, REACTIVE_FORM_DIRECTIVES } from '@angular/forms';
+import { FormControl, FormGroup, Validators } from '@angular/forms';
 import { Router } from '@angular/router';
 
 import { AuthService } from '../shared';
 
 @Component({
   selector: 'my-login',
-  template: require('./login.component.html'),
-  directives: [ REACTIVE_FORM_DIRECTIVES ]
+  template: require('./login.component.html')
 })
 
 export class LoginComponent implements OnInit {
index 6b08301dfea114665823db356696aa5822e16bb9..425a12e5d021ce79541418435daa834a489e53f9 100644 (file)
@@ -1,12 +1,11 @@
 import { Component, OnInit } from '@angular/core';
-import { Router, ROUTER_DIRECTIVES } from '@angular/router';
+import { Router } from '@angular/router';
 
 import { AuthService, AuthStatus } from './shared';
 
 @Component({
   selector: 'my-menu',
-  template: require('./menu.component.html'),
-  directives: [ ROUTER_DIRECTIVES ]
+  template: require('./menu.component.html')
 })
 export class MenuComponent implements OnInit {
   isLoggedIn: boolean;
index 853f5dc7c2cab121aac6a51d678db5d8204b5ede..7878471dc03213835808e8fd38e4ed45432816dc 100644 (file)
@@ -1,16 +1,13 @@
 import { Component, OnInit } from '@angular/core';
 import { Router } from '@angular/router';
 
-import { DROPDOWN_DIRECTIVES} from  'ng2-bootstrap/components/dropdown';
-
 import { Search } from './search.model';
 import { SearchField } from './search-field.type';
 import { SearchService } from './search.service';
 
 @Component({
-    selector: 'my-search',
-    template: require('./search.component.html'),
-    directives: [ DROPDOWN_DIRECTIVES ]
+  selector: 'my-search',
+  template: require('./search.component.html')
 })
 
 export class SearchComponent implements OnInit {
index 900ef1da336f90687315bfd9322c6ce13e4a0c38..f0695d76890320b9500f862f13a239f3d70ecf1b 100644 (file)
@@ -1,20 +1,15 @@
-import { Validators } from '@angular/common';
 import { Component, ElementRef, OnInit } from '@angular/core';
-import { FormControl, FormGroup, REACTIVE_FORM_DIRECTIVES } from '@angular/forms';
+import { FormControl, FormGroup, Validators } from '@angular/forms';
 import { Router } from '@angular/router';
 
-import { BytesPipe } from 'angular-pipes/src/math/bytes.pipe';
-import { PROGRESSBAR_DIRECTIVES } from 'ng2-bootstrap/components/progressbar';
-import { FileSelectDirective, FileUploader } from 'ng2-file-upload/ng2-file-upload';
+import { FileUploader } from 'ng2-file-upload/ng2-file-upload';
 
 import { AuthService } from '../../shared';
 
 @Component({
   selector: 'my-videos-add',
   styles: [ require('./video-add.component.scss') ],
-  template: require('./video-add.component.html'),
-  directives: [ FileSelectDirective, PROGRESSBAR_DIRECTIVES, REACTIVE_FORM_DIRECTIVES ],
-  pipes: [ BytesPipe ]
+  template: require('./video-add.component.html')
 })
 
 export class VideoAddComponent implements OnInit {
index 9a9ffe29fd441efcf29e619a90641fa48c6d1e51..fa8e497aab8338760093676a11a1d93da03aded8 100644 (file)
@@ -1,27 +1,19 @@
 import { ChangeDetectorRef, Component, OnDestroy, OnInit } from '@angular/core';
-import { AsyncPipe } from '@angular/common';
-import { ActivatedRoute, Router, ROUTER_DIRECTIVES } from '@angular/router';
+import { ActivatedRoute, Router } from '@angular/router';
 import { BehaviorSubject } from 'rxjs/BehaviorSubject';
 
-import { PAGINATION_DIRECTIVES } from 'ng2-bootstrap/components/pagination';
-
 import {
-  LoaderComponent,
   SortField,
   Video,
   VideoService
 } from '../shared';
 import { AuthService, AuthUser, RestPagination, Search, SearchField } from '../../shared';
-import { VideoMiniatureComponent } from './video-miniature.component';
-import { VideoSortComponent } from './video-sort.component';
 import { SearchService } from '../../shared';
 
 @Component({
   selector: 'my-videos-list',
   styles: [ require('./video-list.component.scss') ],
-  pipes: [ AsyncPipe ],
-  template: require('./video-list.component.html'),
-  directives: [ LoaderComponent, PAGINATION_DIRECTIVES, ROUTER_DIRECTIVES, VideoMiniatureComponent, VideoSortComponent ]
+  template: require('./video-list.component.html')
 })
 
 export class VideoListComponent implements OnInit, OnDestroy {
index 84bab950e450d295b69dd74ca3728fcd3076a9ad..38317f8320b20668dc399f81f45a59b010a4044d 100644 (file)
@@ -1,6 +1,4 @@
-import { DatePipe } from '@angular/common';
 import { Component, Input, Output, EventEmitter } from '@angular/core';
-import { ROUTER_DIRECTIVES } from '@angular/router';
 
 import { SortField, Video, VideoService } from '../shared';
 import { User } from '../../shared';
@@ -8,9 +6,7 @@ import { User } from '../../shared';
 @Component({
   selector: 'my-video-miniature',
   styles: [ require('./video-miniature.component.scss') ],
-  template: require('./video-miniature.component.html'),
-  directives: [ ROUTER_DIRECTIVES ],
-  pipes: [ DatePipe ]
+  template: require('./video-miniature.component.html')
 })
 
 export class VideoMiniatureComponent {
index d260e55c7c71050e3c11cd6c0612d86ec1cde640..2a60e932770be3903495644004ae0ed518df48a7 100644 (file)
@@ -1,18 +1,13 @@
 import { Component, ElementRef, NgZone, OnDestroy, OnInit } from '@angular/core';
 import { ActivatedRoute } from '@angular/router';
 
-import { BytesPipe } from 'angular-pipes/src/math/bytes.pipe';
-
-import { LoaderComponent, Video, VideoService } from '../shared';
+import { Video, VideoService } from '../shared';
 import { WebTorrentService } from './webtorrent.service';
 
 @Component({
   selector: 'my-video-watch',
   template: require('./video-watch.component.html'),
-  styles: [ require('./video-watch.component.scss') ],
-  providers: [ WebTorrentService ],
-  directives: [ LoaderComponent ],
-  pipes: [ BytesPipe ]
+  styles: [ require('./video-watch.component.scss') ]
 })
 
 export class VideoWatchComponent implements OnInit, OnDestroy {
index 76252afbb25b75d6683f9118de23b31a278cac40..591e7523d1db690d18530044b9eed7090d8597e1 100644 (file)
@@ -1,9 +1,7 @@
 import { Component } from '@angular/core';
-import { ROUTER_DIRECTIVES } from '@angular/router';
 
 @Component({
-    template: '<router-outlet></router-outlet>',
-    directives: [ ROUTER_DIRECTIVES ]
+  template: '<router-outlet></router-outlet>'
 })
 
 export class VideosComponent {
index 1f088b376b1bb81e85f59c31831725cc43a845bf..074f96596e1a81e5feeb806e98877fc244cecfee 100644 (file)
@@ -1,11 +1,11 @@
-import { RouterConfig } from '@angular/router';
+import { Routes } from '@angular/router';
 
 import { VideoAddComponent } from './video-add';
 import { VideoListComponent } from './video-list';
 import { VideosComponent } from './videos.component';
 import { VideoWatchComponent } from './video-watch';
 
-export const VideosRoutes: RouterConfig = [
+export const VideosRoutes: Routes = [
   {
     path: 'videos',
     component: VideosComponent,
index 14c7d8aded9c4f0c5cebfbb015c7e01692be1d7a..95787181f4cb5e03a2e377c39dab9283d2f191e0 100644 (file)
@@ -1,15 +1,27 @@
 /*
  * Custom Type Definitions
  * When including 3rd party modules you also need to include the type definition for the module
- * if they don't provide one within the module. You can try to install it with typings
+ * if they don't provide one within the module. You can try to install it with @types
 
-typings install node --save
+npm install @types/node
+npm install @types/lodash
 
- * If you can't find the type definition in the registry we can make an ambient definition in
+ * If you can't find the type definition in the registry we can make an ambient/global definition in
  * this file for now. For example
 
-declare module "my-module" {
-  export function doesSomething(value: string): string;
+declare module 'my-module' {
+ export function doesSomething(value: string): string;
+}
+
+ * If you are using a CommonJS module that is using module.exports then you will have to write your
+ * types using export = yourObjectOrFunction with a namespace above it
+ * notice how we have to create a namespace that is equal to the function we're
+ * assigning the export to
+
+declare module 'jwt-decode' {
+  function jwtDecode(token: string): any;
+  namespace jwtDecode {}
+  export = jwtDecode;
 }
 
  *
@@ -17,33 +29,65 @@ declare module "my-module" {
  *
 
 declare var assert: any;
+declare var _: any;
+declare var $: any;
 
  *
  * If you're importing a module that uses Node.js modules which are CommonJS you need to import as
+ * in the files such as main.browser.ts or any file within app/
  *
 
 import * as _ from 'lodash'
 
- * You can include your type definitions in this file until you create one for the typings registry
- * see https://github.com/typings/registry
+ * You can include your type definitions in this file until you create one for the @types
  *
  */
 
+// support NodeJS modules without type definitions
+declare module '*';
 
 // Extra variables that live on Global that will be replaced by webpack DefinePlugin
 declare var ENV: string;
 declare var HMR: boolean;
+declare var System: SystemJS;
+
+interface SystemJS {
+  import: (path?: string) => Promise<any>;
+}
+
 interface GlobalEnvironment {
   ENV;
   HMR;
+  SystemJS: SystemJS;
+  System: SystemJS;
 }
 
+interface Es6PromiseLoader {
+  (id: string): (exportName?: string) => Promise<any>;
+}
+
+type FactoryEs6PromiseLoader = () => Es6PromiseLoader;
+type FactoryPromise = () => Promise<any>;
+
+type AsyncRoutes = {
+  [component: string]: Es6PromiseLoader |
+                               Function |
+                FactoryEs6PromiseLoader |
+                         FactoryPromise
+};
+
+
+type IdleCallbacks = Es6PromiseLoader |
+                             Function |
+              FactoryEs6PromiseLoader |
+                       FactoryPromise ;
+
 interface WebpackModule {
   hot: {
     data?: any,
     idle: any,
     accept(dependencies?: string | string[], callback?: (updatedDependencies?: any) => void): void;
-    decline(dependencies?: string | string[]): void;
+    decline(deps?: any | string | string[]): void;
     dispose(callback?: (data?: any) => void): void;
     addDisposeHandler(callback?: (data?: any) => void): void;
     removeDisposeHandler(callback?: (data?: any) => void): void;
@@ -54,66 +98,26 @@ interface WebpackModule {
   };
 }
 
+
 interface WebpackRequire {
-  context(file: string, flag?: boolean, exp?: RegExp): any;
+    (id: string): any;
+    (paths: string[], callback: (...modules: any[]) => void): void;
+    ensure(ids: string[], callback: (req: WebpackRequire) => void, chunkName?: string): void;
+    context(directory: string, useSubDirectories?: boolean, regExp?: RegExp): WebpackContext;
 }
 
+interface WebpackContext extends WebpackRequire {
+    keys(): string[];
+}
 
 interface ErrorStackTraceLimit {
   stackTraceLimit: number;
 }
 
 
-
 // Extend typings
 interface NodeRequire extends WebpackRequire {}
 interface ErrorConstructor extends ErrorStackTraceLimit {}
+interface NodeRequireFunction extends Es6PromiseLoader  {}
 interface NodeModule extends WebpackModule {}
 interface Global extends GlobalEnvironment  {}
-
-
-declare namespace Reflect {
-  function decorate(decorators: ClassDecorator[], target: Function): Function;
-  function decorate(
-    decorators: (PropertyDecorator | MethodDecorator)[],
-    target: Object,
-    targetKey: string | symbol,
-    descriptor?: PropertyDescriptor): PropertyDescriptor;
-
-  function metadata(metadataKey: any, metadataValue: any): {
-    (target: Function): void;
-    (target: Object, propertyKey: string | symbol): void;
-  };
-  function defineMetadata(metadataKey: any, metadataValue: any, target: Object): void;
-  function defineMetadata(
-    metadataKey: any,
-    metadataValue: any,
-    target: Object,
-    targetKey: string | symbol): void;
-  function hasMetadata(metadataKey: any, target: Object): boolean;
-  function hasMetadata(metadataKey: any, target: Object, targetKey: string | symbol): boolean;
-  function hasOwnMetadata(metadataKey: any, target: Object): boolean;
-  function hasOwnMetadata(metadataKey: any, target: Object, targetKey: string | symbol): boolean;
-  function getMetadata(metadataKey: any, target: Object): any;
-  function getMetadata(metadataKey: any, target: Object, targetKey: string | symbol): any;
-  function getOwnMetadata(metadataKey: any, target: Object): any;
-  function getOwnMetadata(metadataKey: any, target: Object, targetKey: string | symbol): any;
-  function getMetadataKeys(target: Object): any[];
-  function getMetadataKeys(target: Object, targetKey: string | symbol): any[];
-  function getOwnMetadataKeys(target: Object): any[];
-  function getOwnMetadataKeys(target: Object, targetKey: string | symbol): any[];
-  function deleteMetadata(metadataKey: any, target: Object): boolean;
-  function deleteMetadata(metadataKey: any, target: Object, targetKey: string | symbol): boolean;
-}
-
-
-// We need this here since there is a problem with Zone.js typings
-interface Thenable<T> {
-  then<U>(
-    onFulfilled?: (value: T) => U | Thenable<U>,
-    onRejected?: (error: any) => U | Thenable<U>): Thenable<U>;
-  then<U>(
-    onFulfilled?: (value: T) => U | Thenable<U>,
-    onRejected?: (error: any) => void): Thenable<U>;
-  catch<U>(onRejected?: (error: any) => U | Thenable<U>): Thenable<U>;
-}
index 7caabe9141f38005127418feeb8505b6e3ca9b24..70bf4853782ed6ac515d453e34b36ea955e0300a 100644 (file)
@@ -1,35 +1,20 @@
-import { enableProdMode, provide } from '@angular/core';
-import { disableDeprecatedForms, provideForms } from '@angular/forms';
-import {
-  HTTP_PROVIDERS,
-  RequestOptions,
-  XHRBackend
-} from '@angular/http';
-import { bootstrap }    from '@angular/platform-browser-dynamic';
-import { provideRouter } from '@angular/router';
+import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
+import { decorateModuleRef } from './app/environment';
+import { bootloader } from '@angularclass/hmr';
+/*
+ * App Module
+ * our top level module that holds all of our components
+ */
+import { AppModule } from './app';
 
-import { routes } from './app/app.routes';
-import { AuthHttp, AuthService, RestExtractor } from './app/shared';
-import { AppComponent } from './app/app.component';
-
-if (process.env.ENV === 'production') {
-  enableProdMode();
+/*
+ * Bootstrap our Angular app with a top level NgModule
+ */
+export function main(): Promise<any> {
+  return platformBrowserDynamic()
+    .bootstrapModule(AppModule)
+    .then(decorateModuleRef)
+    .catch(err => console.error(err));
 }
 
-bootstrap(AppComponent, [
-  HTTP_PROVIDERS,
-  provide(AuthHttp, {
-    useFactory: (backend: XHRBackend, defaultOptions: RequestOptions, authService: AuthService) => {
-      return new AuthHttp(backend, defaultOptions, authService);
-    },
-    deps: [ XHRBackend, RequestOptions, AuthService ]
-  }),
-
-  AuthService,
-  RestExtractor,
-
-  provideRouter(routes),
-
-  disableDeprecatedForms(),
-  provideForms()
-]);
+bootloader(main);
index 740a563bb96bf5b4197ce5cfad0d29ca4c38a21c..65e211459ba76a3dae8adfc8e350061e0020073a 100644 (file)
@@ -6,9 +6,28 @@ require('intl/locale-data/jsonp/en.js');
 import 'ie-shim'; // Internet Explorer
 
 // Prefer CoreJS over the polyfills above
-import 'core-js/es6';
+import 'core-js/es6/symbol';
+import 'core-js/es6/object';
+import 'core-js/es6/function';
+import 'core-js/es6/parse-int';
+import 'core-js/es6/parse-float';
+import 'core-js/es6/number';
+import 'core-js/es6/math';
+import 'core-js/es6/string';
+import 'core-js/es6/date';
+import 'core-js/es6/array';
+import 'core-js/es6/regexp';
+import 'core-js/es6/map';
+import 'core-js/es6/set';
+import 'core-js/es6/weak-map';
+import 'core-js/es6/weak-set';
+import 'core-js/es6/typed';
+import 'core-js/es6/reflect';
+// see issue https://github.com/AngularClass/angular2-webpack-starter/issues/709
+// import 'core-js/es6/promise';
+
 import 'core-js/es7/reflect';
-require('zone.js/dist/zone');
+import 'zone.js/dist/zone';
 
 // Typescript emit helpers polyfill
 import 'ts-helpers';
index df03bc5f42dc2d358974fc52845d9f1a2c8ff1a5..95356d9d0a01172b1bc9ee41e57d24045210612e 100644 (file)
@@ -12,10 +12,13 @@ import '@angular/forms';
 import '@angular/http';
 import '@angular/router';
 
+import '@angularclass/hmr';
+
 // RxJS
 import 'rxjs/Observable';
 import 'rxjs/Subject';
 import 'rxjs/add/operator/catch';
+import 'rxjs/add/operator/mergeMap';
 import 'rxjs/add/operator/map';
 import 'rxjs/add/observable/throw';
 
index 7dc1a2457dc4ba979651fa72a82c7b73997be030..c4e2a880473c37ace7c190c0177e408f8c3706b2 100644 (file)
@@ -3,24 +3,39 @@
     "target": "es5",
     "module": "commonjs",
     "moduleResolution": "node",
-    "sourceMap": true,
     "emitDecoratorMetadata": true,
     "experimentalDecorators": true,
-    "noImplicitAny": false,
-    "noEmitHelpers": true
+    "allowSyntheticDefaultImports": true,
+    "sourceMap": true,
+    "noEmitHelpers": true,
+    "strictNullChecks": false,
+    "baseUrl": "./src",
+    "paths": [
+    ],
+    "lib": [
+      "dom",
+      "es6"
+    ],
+    "types": [
+      "hammerjs",
+      "jasmine",
+      "node",
+      "protractor",
+      "selenium-webdriver",
+      "source-map",
+      "uglify-js",
+      "webpack"
+    ]
   },
+  "exclude": [
+    "node_modules",
+    "dist"
+  ],
   "awesomeTypescriptLoaderOptions": {
-    "forkChecker": true
+    "forkChecker": true,
+    "useWebpackText": true
   },
   "compileOnSave": false,
   "buildOnSave": false,
-  "filesGlob": [
-    "**/*.ts",
-    "!node_modules/**"
-  ],
-  "exclude": [
-    "node_modules",
-    "typings/main",
-    "typings/main.d.ts"
-  ]
+  "atom": { "rewriteTsconfig": false }
 }
diff --git a/client/typings.json b/client/typings.json
deleted file mode 100644 (file)
index 9a8891f..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-{
-  "globalDependencies": {
-    "es6-shim": "registry:dt/es6-shim#0.31.2+20160317120654",
-    "jasmine": "registry:dt/jasmine#2.2.0+20160412134438",
-    "node": "registry:dt/node#4.0.0+20160509154515"
-  }
-}