From 172a5663ef548962aa4efa96efacbff08fd67b91 Mon Sep 17 00:00:00 2001 From: Victor Berchet Date: Tue, 24 May 2016 16:13:17 -0700 Subject: [PATCH] feat(platform-browser-dynamic): re-add a deprecated platform-browser-dynamic --- build.sh | 1 + .../integration_test/public_api_spec.ts | 1 + .../platform-browser-dynamic/index.ts | 12 +++++++ .../platform-browser-dynamic/package.json | 16 +++++++++ .../platform-browser-dynamic/rollup.config.js | 19 ++++++++++ .../platform-browser-dynamic/testing.ts | 4 +++ .../platform-browser-dynamic/testing_e2e.ts | 3 ++ .../tsconfig-es2015.json | 35 ++++++++++++++++++ .../tsconfig-es5.json | 36 +++++++++++++++++++ modules/@angular/platform-browser/index.ts | 5 +++ tools/public_api_guard/public_api_spec.ts | 1 + 11 files changed, 133 insertions(+) create mode 100644 modules/@angular/platform-browser-dynamic/index.ts create mode 100644 modules/@angular/platform-browser-dynamic/package.json create mode 100644 modules/@angular/platform-browser-dynamic/rollup.config.js create mode 100644 modules/@angular/platform-browser-dynamic/testing.ts create mode 100644 modules/@angular/platform-browser-dynamic/testing_e2e.ts create mode 100644 modules/@angular/platform-browser-dynamic/tsconfig-es2015.json create mode 100644 modules/@angular/platform-browser-dynamic/tsconfig-es5.json diff --git a/build.sh b/build.sh index b3c83d16c7..b338df213a 100755 --- a/build.sh +++ b/build.sh @@ -45,6 +45,7 @@ for PACKAGE in \ compiler \ common \ platform-browser \ + platform-browser-dynamic \ platform-server \ http \ router \ diff --git a/modules/@angular/integration_test/public_api_spec.ts b/modules/@angular/integration_test/public_api_spec.ts index e04148813a..543fbc1548 100644 --- a/modules/@angular/integration_test/public_api_spec.ts +++ b/modules/@angular/integration_test/public_api_spec.ts @@ -365,6 +365,7 @@ var PLATFORM_BROWSER: string[] = [ 'BROWSER_APP_PROVIDERS', 'BROWSER_APP_COMPILER_PROVIDERS', 'BROWSER_PLATFORM_PROVIDERS', + 'BROWSER_PROVIDERS', 'BROWSER_SANITIZATION_PROVIDERS', 'browserPlatform', 'BrowserPlatformLocation', diff --git a/modules/@angular/platform-browser-dynamic/index.ts b/modules/@angular/platform-browser-dynamic/index.ts new file mode 100644 index 0000000000..cacb49ff94 --- /dev/null +++ b/modules/@angular/platform-browser-dynamic/index.ts @@ -0,0 +1,12 @@ +export {bootstrap, CACHED_TEMPLATE_PROVIDER} from '@angular/platform-browser'; + +import {BROWSER_APP_PROVIDERS, BROWSER_APP_COMPILER_PROVIDERS} from '@angular/platform-browser'; + +/* @deprecated the platform-browser-dynamic module is deprecated. */ +export const BROWSER_APP_DYNAMIC_PROVIDERS: Array = [ + BROWSER_APP_PROVIDERS, + BROWSER_APP_COMPILER_PROVIDERS +]; + +console.log(`platform-browser-dynamic is deprecated, use platform-browser instead`); + diff --git a/modules/@angular/platform-browser-dynamic/package.json b/modules/@angular/platform-browser-dynamic/package.json new file mode 100644 index 0000000000..2c1f170472 --- /dev/null +++ b/modules/@angular/platform-browser-dynamic/package.json @@ -0,0 +1,16 @@ +{ + "name": "@angular/platform-browser-dynamic", + "version": "$$ANGULAR_VERSION$$", + "description": "", + "main": "index.js", + "jsnext:main": "esm/index.js", + "typings": "index.d.ts", + "author": "angular", + "license": "MIT", + "peerDependencies": { + "@angular/core": "$$ANGULAR_VERSION$$", + "@angular/common": "$$ANGULAR_VERSION$$", + "@angular/compiler": "$$ANGULAR_VERSION$$", + "@angular/platform-browser": "$$ANGULAR_VERSION$$" + } +} \ No newline at end of file diff --git a/modules/@angular/platform-browser-dynamic/rollup.config.js b/modules/@angular/platform-browser-dynamic/rollup.config.js new file mode 100644 index 0000000000..cc027f89f0 --- /dev/null +++ b/modules/@angular/platform-browser-dynamic/rollup.config.js @@ -0,0 +1,19 @@ +export default { + entry: '../../../dist/packages-dist/platform-browser-dynamic/esm/index.js', + dest: '../../../dist/packages-dist/platform-browser-dynamic/esm/platform-browser-dynamic.umd.js', + format: 'umd', + moduleName: 'ng.platformBrowserDynamic', + globals: { + '@angular/core': 'ng.core', + '@angular/common': 'ng.common', + '@angular/compiler': 'ng.compiler', + '@angular/platform-browser': 'ng.platformBrowser', + 'rxjs/Subject': 'Rx', + 'rxjs/observable/PromiseObservable': 'Rx', // this is wrong, but this stuff has changed in rxjs b.6 so we need to fix it when we update. + 'rxjs/operator/toPromise': 'Rx.Observable.prototype', + 'rxjs/Observable': 'Rx' + }, + plugins: [ +// nodeResolve({ jsnext: true, main: true }), + ] +} \ No newline at end of file diff --git a/modules/@angular/platform-browser-dynamic/testing.ts b/modules/@angular/platform-browser-dynamic/testing.ts new file mode 100644 index 0000000000..9b04951c73 --- /dev/null +++ b/modules/@angular/platform-browser-dynamic/testing.ts @@ -0,0 +1,4 @@ +export * from '@angular/platform-browser/testing'; + +console.log(`platform-browser-dynamic/testing is deprecated, use platform-browser/testing instead`); + diff --git a/modules/@angular/platform-browser-dynamic/testing_e2e.ts b/modules/@angular/platform-browser-dynamic/testing_e2e.ts new file mode 100644 index 0000000000..d65059d86e --- /dev/null +++ b/modules/@angular/platform-browser-dynamic/testing_e2e.ts @@ -0,0 +1,3 @@ +export * from '@angular/platform-browser/testing/e2e_util'; + +console.log(`platform-browser-dynamic/testing_e2e is deprecated, use platform-browser/testing_e2e instead`); \ No newline at end of file diff --git a/modules/@angular/platform-browser-dynamic/tsconfig-es2015.json b/modules/@angular/platform-browser-dynamic/tsconfig-es2015.json new file mode 100644 index 0000000000..ddf966bf72 --- /dev/null +++ b/modules/@angular/platform-browser-dynamic/tsconfig-es2015.json @@ -0,0 +1,35 @@ +{ + "angularCompilerOptions": { + "skipTemplateCodegen": true + }, + "compilerOptions": { + "baseUrl": ".", + "declaration": true, + "stripInternal": true, + "emitDecoratorMetadata": true, + "experimentalDecorators": true, + "module": "es2015", + "moduleResolution": "node", + "outDir": "../../../dist/packages-dist/platform-browser-dynamic/esm", + "paths": { + "@angular/common": ["../../../dist/packages-dist/common/"], + "@angular/compiler": ["../../../dist/packages-dist/compiler/"], + "@angular/compiler/testing": ["../../../dist/packages-dist/compiler/testing"], + "@angular/core": ["../../../dist/packages-dist/core/"], + "@angular/platform-browser": ["../../../dist/packages-dist/platform-browser"], + "@angular/platform-browser/testing": ["../../../dist/packages-dist/platform-browser/testing"] + }, + "rootDir": ".", + "sourceMap": true, + "inlineSources": true, + "target": "es2015" + }, + "files": [ + "index.ts", + "testing.ts", + "../../../node_modules/@types/hammerjs/index.d.ts", + "../../../node_modules/@types/protractor/index.d.ts", + "../../../node_modules/@types/jasmine/index.d.ts", + "../../../node_modules/zone.js/dist/zone.js.d.ts" + ] +} \ No newline at end of file diff --git a/modules/@angular/platform-browser-dynamic/tsconfig-es5.json b/modules/@angular/platform-browser-dynamic/tsconfig-es5.json new file mode 100644 index 0000000000..19989b70ac --- /dev/null +++ b/modules/@angular/platform-browser-dynamic/tsconfig-es5.json @@ -0,0 +1,36 @@ +{ + "angularCompilerOptions": { + "skipTemplateCodegen": true + }, + "compilerOptions": { + "baseUrl": ".", + "declaration": true, + "stripInternal": true, + "emitDecoratorMetadata": true, + "experimentalDecorators": true, + "module": "commonjs", + "moduleResolution": "node", + "outDir": "../../../dist/packages-dist/platform-browser-dynamic/", + "paths": { + "@angular/core": ["../../../dist/packages-dist/core"], + "@angular/common": ["../../../dist/packages-dist/common"], + "@angular/compiler": ["../../../dist/packages-dist/compiler"], + "@angular/compiler/testing": ["../../../dist/packages-dist/compiler/testing"], + "@angular/platform-browser": ["../../../dist/packages-dist/platform-browser"], + "@angular/platform-browser/testing": ["../../../dist/packages-dist/platform-browser/testing"] + }, + "rootDir": ".", + "sourceMap": true, + "inlineSources": true, + "lib": ["es6", "dom"], + "target": "es5" + }, + "files": [ + "index.ts", + "testing.ts", + "../../../node_modules/@types/hammerjs/index.d.ts", + "../../../node_modules/@types/protractor/index.d.ts", + "../../../node_modules/@types/jasmine/index.d.ts", + "../../../node_modules/zone.js/dist/zone.js.d.ts" + ] +} \ No newline at end of file diff --git a/modules/@angular/platform-browser/index.ts b/modules/@angular/platform-browser/index.ts index dd424be5ae..d47c54ce61 100644 --- a/modules/@angular/platform-browser/index.ts +++ b/modules/@angular/platform-browser/index.ts @@ -44,3 +44,8 @@ export * from './src/worker_app'; export * from './private_export'; +import {BROWSER_PLATFORM_PROVIDERS} from './src/browser'; + +/* @deprecated use BROWSER_PLATFORM_PROVIDERS */ +export const BROWSER_PROVIDERS: any[] = BROWSER_PLATFORM_PROVIDERS; + diff --git a/tools/public_api_guard/public_api_spec.ts b/tools/public_api_guard/public_api_spec.ts index 8bbbd31b47..9460855c9a 100644 --- a/tools/public_api_guard/public_api_spec.ts +++ b/tools/public_api_guard/public_api_spec.ts @@ -1225,6 +1225,7 @@ const PLATFORM_BROWSER = [ 'const BROWSER_APP_COMPILER_PROVIDERS:Array', 'const BROWSER_APP_PROVIDERS:Array', 'const BROWSER_PLATFORM_PROVIDERS:Array', + 'const BROWSER_PROVIDERS:any[]', 'const BROWSER_SANITIZATION_PROVIDERS:Array', 'const CACHED_TEMPLATE_PROVIDER:Array', 'const DOCUMENT:OpaqueToken',