repackaging: all the repackaging changes squashed

This commit is contained in:
Igor Minar
2016-04-28 17:50:03 -07:00
committed by Misko Hevery
parent 505da6c0a8
commit a66cdb469f
860 changed files with 7869 additions and 4985 deletions

View File

@ -0,0 +1 @@
export '../core/private_export.dart';

View File

@ -0,0 +1,4 @@
import {__core_private__ as r, __core_private_types__ as t} from '@angular/core';
export type ReflectionCapabilities = t.ReflectionCapabilities;
export var ReflectionCapabilities: typeof t.ReflectionCapabilities = r.ReflectionCapabilities;

View File

@ -0,0 +1 @@
export * from './platform_browser_dynamic';

View File

@ -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$$"
}
}

View File

@ -0,0 +1,101 @@
import {COMPILER_PROVIDERS, XHR} from '@angular/compiler';
import {CachedXHR} from './src/xhr/xhr_cache';
import {Provider, Type, ComponentRef} from '@angular/core';
import {isPresent} from './src/facade/lang';
import {XHRImpl} from './src/xhr/xhr_impl';
import {BROWSER_APP_COMMON_PROVIDERS, browserPlatform} from '@angular/platform-browser';
import {reflector, ReflectiveInjector, coreLoadAndBootstrap} from '@angular/core';
import {getDOM} from './platform_browser_private';
import {ReflectionCapabilities} from './core_private';
export const CACHED_TEMPLATE_PROVIDER: Array<any /*Type | Provider | any[]*/> =
/*@ts2dart_const*/ [{provide: XHR, useClass: CachedXHR}];
/**
* An array of providers that should be passed into `application()` when bootstrapping a component.
*/
export const BROWSER_APP_DYNAMIC_PROVIDERS: Array<any /*Type | Provider | any[]*/> = /*@ts2dart_const*/ [
BROWSER_APP_COMMON_PROVIDERS,
COMPILER_PROVIDERS,
{provide: XHR, useClass: XHRImpl},
];
/**
* Bootstrapping for Angular applications.
*
* You instantiate an Angular application by explicitly specifying a component to use
* as the root component for your application via the `bootstrap()` method.
*
* ## Simple Example
*
* Assuming this `index.html`:
*
* ```html
* <html>
* <!-- load Angular script tags here. -->
* <body>
* <my-app>loading...</my-app>
* </body>
* </html>
* ```
*
* An application is bootstrapped inside an existing browser DOM, typically `index.html`.
* Unlike Angular 1, Angular 2 does not compile/process providers in `index.html`. This is
* mainly for security reasons, as well as architectural changes in Angular 2. This means
* that `index.html` can safely be processed using server-side technologies such as
* providers. Bindings can thus use double-curly `{{ syntax }}` without collision from
* Angular 2 component double-curly `{{ syntax }}`.
*
* We can use this script code:
*
* {@example core/ts/bootstrap/bootstrap.ts region='bootstrap'}
*
* When the app developer invokes `bootstrap()` with the root component `MyApp` as its
* argument, Angular performs the following tasks:
*
* 1. It uses the component's `selector` property to locate the DOM element which needs
* to be upgraded into the angular component.
* 2. It creates a new child injector (from the platform injector). Optionally, you can
* also override the injector configuration for an app by invoking `bootstrap` with the
* `componentInjectableBindings` argument.
* 3. It creates a new `Zone` and connects it to the angular application's change detection
* domain instance.
* 4. It creates an emulated or shadow DOM on the selected component's host element and loads the
* template into it.
* 5. It instantiates the specified component.
* 6. Finally, Angular performs change detection to apply the initial data providers for the
* application.
*
*
* ## Bootstrapping Multiple Applications
*
* When working within a browser window, there are many singleton resources: cookies, title,
* location, and others. Angular services that represent these resources must likewise be
* shared across all Angular applications that occupy the same browser window. For this
* reason, Angular creates exactly one global platform object which stores all shared
* services, and each angular application injector has the platform injector as its parent.
*
* Each application has its own private injector as well. When there are multiple
* applications on a page, Angular treats each application injector's services as private
* to that application.
*
* ## API
*
* - `appComponentType`: The root component which should act as the application. This is
* a reference to a `Type` which is annotated with `@Component(...)`.
* - `customProviders`: An additional set of providers that can be added to the
* app injector to override default injection behavior.
*
* Returns a `Promise` of {@link ComponentRef}.
*/
export function bootstrap(
appComponentType: Type,
customProviders?: Array<any /*Type | Provider | any[]*/>): Promise<ComponentRef<any>> {
reflector.reflectionCapabilities = new ReflectionCapabilities();
var appInjector = ReflectiveInjector.resolveAndCreate(
[BROWSER_APP_DYNAMIC_PROVIDERS, isPresent(customProviders) ? customProviders : []],
browserPlatform().injector);
return coreLoadAndBootstrap(appInjector, appComponentType);
}

View File

@ -0,0 +1 @@
export '../core/private_export.dart';

View File

@ -0,0 +1,4 @@
import {__platform_browser_private__ as _} from '@angular/platform-browser';
export type DomAdapter = _.DomAdapter;
export function getDOM(): _.DomAdapter { return _.getDOM() };

View File

@ -0,0 +1,21 @@
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',
sourceMap: true,
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 }),
]
}

View File

@ -0,0 +1 @@
../../facade/src

View File

@ -1,7 +1,7 @@
import {XHR} from 'angular2/src/compiler/xhr';
import {BaseException} from 'angular2/src/facade/exceptions';
import {global} from 'angular2/src/facade/lang';
import {PromiseWrapper} from 'angular2/src/facade/promise';
import {XHR} from '@angular/compiler';
import {BaseException} from '../../src/facade/exceptions';
import {global} from '../../src/facade/lang';
import {PromiseWrapper} from '../../src/facade/promise';
/**
* An implementation of XHR that uses a template cache to avoid doing an actual

View File

@ -0,0 +1,46 @@
"use strict";
var __extends = (this && this.__extends) || function (d, b) {
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
var compiler_1 = require('@angular/compiler');
var promise_1 = require('../../src/facade/promise');
var lang_1 = require('../../src/facade/lang');
var XHRImpl = (function (_super) {
__extends(XHRImpl, _super);
function XHRImpl() {
_super.apply(this, arguments);
}
XHRImpl.prototype.get = function (url) {
var completer = promise_1.PromiseWrapper.completer();
var xhr = new XMLHttpRequest();
xhr.open('GET', url, true);
xhr.responseType = 'text';
xhr.onload = function () {
// responseText is the old-school way of retrieving response (supported by IE8 & 9)
// response/responseType properties were introduced in XHR Level2 spec (supported by IE10)
var response = lang_1.isPresent(xhr.response) ? xhr.response : xhr.responseText;
// normalize IE9 bug (http://bugs.jquery.com/ticket/1450)
var status = xhr.status === 1223 ? 204 : xhr.status;
// fix status code when it is 0 (0 status is undocumented).
// Occurs when accessing file resources or on Android 4.1 stock browser
// while retrieving files from application cache.
if (status === 0) {
status = response ? 200 : 0;
}
if (200 <= status && status <= 300) {
completer.resolve(response);
}
else {
completer.reject("Failed to load " + url, null);
}
};
xhr.onerror = function () { completer.reject("Failed to load " + url, null); };
xhr.send();
return completer.promise;
};
return XHRImpl;
}(compiler_1.XHR));
exports.XHRImpl = XHRImpl;
//# sourceMappingURL=xhr_impl.js.map

View File

@ -1,6 +1,6 @@
import {PromiseWrapper, PromiseCompleter} from 'angular2/src/facade/promise';
import {isPresent} from 'angular2/src/facade/lang';
import {XHR} from 'angular2/src/compiler/xhr';
import {XHR} from '@angular/compiler';
import {PromiseWrapper, PromiseCompleter} from '../../src/facade/promise';
import {isPresent} from '../../src/facade/lang';
export class XHRImpl extends XHR {
get(url: string): Promise<string> {

View File

@ -1,23 +1,26 @@
import {Component, provide} from 'angular2/core';
import {UrlResolver, XHR} from 'angular2/compiler';
import {Component, provide} from '@angular/core';
import {UrlResolver, XHR} from '@angular/compiler';
import {
AsyncTestCompleter,
beforeEach,
beforeEachProviders,
ComponentFixture,
ddescribe,
describe,
expect,
fakeAsync,
iit,
inject,
it,
TestComponentBuilder,
tick,
xit
} from 'angular2/testing_internal';
import {BaseException} from 'angular2/src/facade/exceptions';
import {CachedXHR} from 'angular2/src/platform/browser/xhr_cache';
} from '@angular/core/testing/testing_internal';
import {expect} from '@angular/platform-browser/testing';
import {AsyncTestCompleter} from '@angular/core/testing/testing_internal';
import {
fakeAsync,
flushMicrotasks,
Log,
tick,
} from '@angular/core/testing';
import {TestComponentBuilder, ComponentFixture} from '@angular/compiler/testing';
import {BaseException} from '../../src/facade/exceptions';
import {CachedXHR} from '../../src/xhr/xhr_cache';
import {setTemplateCache} from './xhr_cache_setter';
export function main() {

View File

@ -1,5 +1,4 @@
import {
AsyncTestCompleter,
beforeEach,
ddescribe,
describe,
@ -8,11 +7,11 @@ import {
inject,
it,
xit
} from 'angular2/testing_internal';
import {XHRImpl} from 'angular2/src/platform/browser/xhr_impl';
import {PromiseWrapper} from 'angular2/src/facade/async';
import {IS_DART} from 'angular2/src/facade/lang';
} from '@angular/core/testing/testing_internal';
import {AsyncTestCompleter} from '@angular/core/testing/testing_internal';
import {XHRImpl} from '../../src/xhr/xhr_impl';
import {PromiseWrapper} from '../../src/facade/async';
import {IS_DART} from '../../src/facade/lang';
export function main() {
describe('XHRImpl', () => {
@ -24,8 +23,8 @@ export function main() {
// will be relative to here, so url200 should look like
// static_assets/200.html.
// We currently have no way of detecting this.
var urlBase = IS_DART ? '' : '/base/modules/angular2/';
var url200 = urlBase + 'test/platform/browser/static_assets/200.html';
var urlBase = IS_DART ? '' : '/base/modules/@angular/';
var url200 = urlBase + 'platform-browser-dynamic/test/browser/static_assets/200.html';
var url404 = '/bad/path/404.html';
beforeEach(() => { xhr = new XHRImpl(); });

View File

@ -0,0 +1 @@
export * from './testing/browser';

View File

@ -0,0 +1,18 @@
import {
TEST_BROWSER_STATIC_PLATFORM_PROVIDERS,
ADDITIONAL_TEST_BROWSER_PROVIDERS
} from '@angular/platform-browser/testing';
import {BROWSER_APP_DYNAMIC_PROVIDERS} from '../index';
/**
* Default platform providers for testing.
*/
export const TEST_BROWSER_DYNAMIC_PLATFORM_PROVIDERS: Array<any /*Type | Provider | any[]*/> =
/*@ts2dart_const*/ [TEST_BROWSER_STATIC_PLATFORM_PROVIDERS];
/**
* Default application providers for testing.
*/
export const TEST_BROWSER_DYNAMIC_APPLICATION_PROVIDERS: Array<any /*Type | Provider | any[]*/> =
/*@ts2dart_const*/ [BROWSER_APP_DYNAMIC_PROVIDERS, ADDITIONAL_TEST_BROWSER_PROVIDERS];

View File

@ -0,0 +1,30 @@
{
"compilerOptions": {
"baseUrl": ".",
"declaration": 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,
"sourceRoot": ".",
"target": "es2015"
},
"files": [
"index.ts",
"testing.ts",
"../typings/hammerjs/hammerjs.d.ts",
"../typings/jasmine/jasmine.d.ts",
"../../../node_modules/zone.js/dist/zone.js.d.ts"
]
}

View File

@ -0,0 +1,33 @@
{
"compilerOptions": {
"baseUrl": ".",
"declaration": 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,
"sourceRoot": ".",
"target": "es5"
},
"files": [
"index.ts",
"testing.ts",
"../typings/es6-collections/es6-collections.d.ts",
"../typings/es6-promise/es6-promise.d.ts",
"../manual_typings/globals.d.ts",
"../typings/hammerjs/hammerjs.d.ts",
"../typings/jasmine/jasmine.d.ts",
"../../../node_modules/zone.js/dist/zone.js.d.ts"
]
}