fix(platform-browser-dynamic): Rename CACHED_TEMPLATE_PROVIDER to RESOURCE_CACHE_PROVIDER (#10866)

* fix(platform-browser-dynamic): Rename CACHED_TEMPLATE_PROVIDER to RESOURCE_CACHE_PROVIDER

Closes #9741

BREAKING CHANGE:

`CACHED_TEMPLATE_PROVIDER` is now renamed to `RESOURCE_CACHE_PROVIDER`

Before:

```js
import {CACHED_TEMPLATE_PROVIDER} from '@angular/platform-browser-dynamic';
```

After:

```js
import {RESOURCE_CACHE_PROVIDER} from '@angular/platform-browser-dynamic';
```

* Rename XHR -> ResourceLoader
This commit is contained in:
Hans
2016-08-17 09:24:44 -07:00
committed by vikerman
parent 951ecb4d90
commit 40e160c22c
29 changed files with 213 additions and 190 deletions

View File

@ -123,8 +123,8 @@ export class CodeGenerator {
static create(
options: AngularCompilerOptions, cliOptions: NgcCliOptions, program: ts.Program,
compilerHost: ts.CompilerHost, reflectorHostContext?: ReflectorHostContext,
xhr?: compiler.XHR): CodeGenerator {
xhr = xhr || {
resourceLoader?: compiler.ResourceLoader): CodeGenerator {
resourceLoader = resourceLoader || {
get: (s: string) => {
if (!compilerHost.fileExists(s)) {
// TODO: We should really have a test for error cases like this!
@ -152,7 +152,7 @@ export class CodeGenerator {
logBindingUpdate: false,
useJit: false
});
const normalizer = new DirectiveNormalizer(xhr, urlResolver, htmlParser, config);
const normalizer = new DirectiveNormalizer(resourceLoader, urlResolver, htmlParser, config);
const expressionParser = new Parser(new Lexer());
const elementSchemaRegistry = new DomElementSchemaRegistry();
const console = new Console();

View File

@ -147,7 +147,7 @@ export class Extractor {
options: tsc.AngularCompilerOptions, translationsFormat: string, program: ts.Program,
compilerHost: ts.CompilerHost, htmlParser: compiler.i18n.HtmlParser,
reflectorHostContext?: ReflectorHostContext): Extractor {
const xhr: compiler.XHR = {
const resourceLoader: compiler.ResourceLoader = {
get: (s: string) => {
if (!compilerHost.fileExists(s)) {
// TODO: We should really have a test for error cases like this!
@ -169,7 +169,7 @@ export class Extractor {
useJit: false
});
const normalizer = new DirectiveNormalizer(xhr, urlResolver, htmlParser, config);
const normalizer = new DirectiveNormalizer(resourceLoader, urlResolver, htmlParser, config);
const expressionParser = new Parser(new Lexer());
const elementSchemaRegistry = new DomElementSchemaRegistry();
const console = new Console();