refactor(compiler): split compiler and core (#18683)

After this, neither @angular/compiler nor @angular/comnpiler-cli depend
on @angular/core.

This add a duplication of some interfaces and enums which is stored
in @angular/compiler/src/core.ts

BREAKING CHANGE:
- `@angular/platform-server` now additionally depends on
  `@angular/platform-browser-dynamic` as a peer dependency.


PR Close #18683
This commit is contained in:
Tobias Bosch
2017-08-16 09:00:03 -07:00
committed by Miško Hevery
parent a0ca01d580
commit 0cc77b4a69
107 changed files with 1504 additions and 1564 deletions

View File

@ -21,76 +21,16 @@ export enum ViewEncapsulation {
*
* This is the default option.
*/
Emulated,
Emulated = 0,
/**
* Use the native encapsulation mechanism of the renderer.
*
* For the DOM this means using [Shadow DOM](https://w3c.github.io/webcomponents/spec/shadow/) and
* creating a ShadowRoot for Component's Host Element.
*/
Native,
Native = 1,
/**
* Don't provide any template or style encapsulation.
*/
None
}
/**
* Metadata properties available for configuring Views.
*
* For details on the `@Component` annotation, see {@link Component}.
*
* ### Example
*
* ```
* @Component({
* selector: 'greet',
* template: 'Hello {{name}}!',
* })
* class Greet {
* name: string;
*
* constructor() {
* this.name = 'World';
* }
* }
* ```
*
* @deprecated Use Component instead.
*
* {@link Component}
*/
export class ViewMetadata {
/** {@link Component#templateUrl} */
templateUrl: string|undefined;
/** {@link Component#template} */
template: string|undefined;
/** {@link Component#stylesUrl} */
styleUrls: string[]|undefined;
/** {@link Component#styles} */
styles: string[]|undefined;
/** {@link Component#encapsulation} */
encapsulation: ViewEncapsulation|undefined;
/** {@link Component#animation} */
animations: any[]|undefined;
/** {@link Component#interpolation} */
interpolation: [string, string]|undefined;
constructor(opts: {
templateUrl?: string,
template?: string,
encapsulation?: ViewEncapsulation,
styles?: string[],
styleUrls?: string[],
animations?: any[],
interpolation?: [string, string]
} = {}) {
this.templateUrl = opts.templateUrl;
this.template = opts.template;
this.styleUrls = opts.styleUrls;
this.styles = opts.styles;
this.encapsulation = opts.encapsulation;
this.animations = opts.animations;
this.interpolation = opts.interpolation;
}
None = 2
}