parent
e5e5c24d48
commit
5cf82f8f3f
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "angular-integration",
|
"name": "angular-integration",
|
||||||
"description": "Assert that users with TypeScript 2.6 can type-check an Angular application",
|
"description": "Assert that users with TypeScript 2.7 can type-check an Angular application",
|
||||||
"version": "0.0.0",
|
"version": "0.0.0",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|
|
@ -0,0 +1,47 @@
|
||||||
|
/**
|
||||||
|
* @license
|
||||||
|
* Copyright Google Inc. All Rights Reserved.
|
||||||
|
*
|
||||||
|
* Use of this source code is governed by an MIT-style license that can be
|
||||||
|
* found in the LICENSE file at https://angular.io/license
|
||||||
|
*/
|
||||||
|
|
||||||
|
import * as compiler from '@angular/compiler';
|
||||||
|
import * as compilerTesting from '@angular/compiler/testing';
|
||||||
|
import * as core from '@angular/core';
|
||||||
|
import * as coreTesting from '@angular/core/testing';
|
||||||
|
import * as forms from '@angular/forms';
|
||||||
|
import * as http from '@angular/http';
|
||||||
|
import * as httpTesting from '@angular/http/testing';
|
||||||
|
import * as platformBrowser from '@angular/platform-browser';
|
||||||
|
import * as platformBrowserTesting from '@angular/platform-browser/testing';
|
||||||
|
import * as platformBrowserDynamic from '@angular/platform-browser-dynamic';
|
||||||
|
import * as platformServer from '@angular/platform-server';
|
||||||
|
import * as platformServerTesting from '@angular/platform-server/testing';
|
||||||
|
import * as platformWebworker from '@angular/platform-webworker';
|
||||||
|
import * as platformWebworkerDynamic from '@angular/platform-webworker-dynamic';
|
||||||
|
import * as router from '@angular/router';
|
||||||
|
import * as routerTesting from '@angular/router/testing';
|
||||||
|
import * as serviceWorker from '@angular/service-worker';
|
||||||
|
import * as upgrade from '@angular/upgrade';
|
||||||
|
|
||||||
|
export default {
|
||||||
|
compiler,
|
||||||
|
compilerTesting,
|
||||||
|
core,
|
||||||
|
coreTesting,
|
||||||
|
forms,
|
||||||
|
http,
|
||||||
|
httpTesting,
|
||||||
|
platformBrowser,
|
||||||
|
platformBrowserTesting,
|
||||||
|
platformBrowserDynamic,
|
||||||
|
platformServer,
|
||||||
|
platformServerTesting,
|
||||||
|
platformWebworker,
|
||||||
|
platformWebworkerDynamic,
|
||||||
|
router,
|
||||||
|
routerTesting,
|
||||||
|
serviceWorker,
|
||||||
|
upgrade,
|
||||||
|
};
|
|
@ -0,0 +1,30 @@
|
||||||
|
{
|
||||||
|
"name": "angular-integration",
|
||||||
|
"description": "Assert that users with TypeScript 2.8 can type-check an Angular application",
|
||||||
|
"version": "0.0.0",
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"@angular/animations": "file:../../dist/packages-dist/animations",
|
||||||
|
"@angular/common": "file:../../dist/packages-dist/common",
|
||||||
|
"@angular/compiler": "file:../../dist/packages-dist/compiler",
|
||||||
|
"@angular/compiler-cli": "file:../../dist/packages-dist/compiler-cli",
|
||||||
|
"@angular/core": "file:../../dist/packages-dist/core",
|
||||||
|
"@angular/forms": "file:../../dist/packages-dist/forms",
|
||||||
|
"@angular/http": "file:../../dist/packages-dist/http",
|
||||||
|
"@angular/platform-browser": "file:../../dist/packages-dist/platform-browser",
|
||||||
|
"@angular/platform-browser-dynamic": "file:../../dist/packages-dist/platform-browser-dynamic",
|
||||||
|
"@angular/platform-server": "file:../../dist/packages-dist/platform-server",
|
||||||
|
"@angular/platform-webworker": "file:../../dist/packages-dist/platform-webworker",
|
||||||
|
"@angular/platform-webworker-dynamic": "file:../../dist/packages-dist/platform-webworker-dynamic",
|
||||||
|
"@angular/router": "file:../../dist/packages-dist/router",
|
||||||
|
"@angular/service-worker": "file:../../dist/packages-dist/service-worker",
|
||||||
|
"@angular/upgrade": "file:../../dist/packages-dist/upgrade",
|
||||||
|
"@types/jasmine": "2.5.41",
|
||||||
|
"rxjs": "file:../../node_modules/rxjs",
|
||||||
|
"typescript": "2.8.x",
|
||||||
|
"zone.js": "file:../../node_modules/zone.js"
|
||||||
|
},
|
||||||
|
"scripts": {
|
||||||
|
"test": "tsc"
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,24 @@
|
||||||
|
{
|
||||||
|
"compilerOptions": {
|
||||||
|
"emitDecoratorMetadata": true,
|
||||||
|
"experimentalDecorators": true,
|
||||||
|
"module": "commonjs",
|
||||||
|
"moduleResolution": "node",
|
||||||
|
"outDir": "../../dist/typings_test_ts28/",
|
||||||
|
"rootDir": ".",
|
||||||
|
"target": "es5",
|
||||||
|
"lib": [
|
||||||
|
"es5",
|
||||||
|
"dom",
|
||||||
|
"es2015.collection",
|
||||||
|
"es2015.iterable",
|
||||||
|
"es2015.promise"
|
||||||
|
],
|
||||||
|
"types": [],
|
||||||
|
"strictNullChecks": true
|
||||||
|
},
|
||||||
|
"files": [
|
||||||
|
"include-all.ts",
|
||||||
|
"node_modules/@types/jasmine/index.d.ts"
|
||||||
|
]
|
||||||
|
}
|
|
@ -110,11 +110,11 @@
|
||||||
"source-map": "0.5.7",
|
"source-map": "0.5.7",
|
||||||
"source-map-support": "0.4.18",
|
"source-map-support": "0.4.18",
|
||||||
"systemjs": "0.18.10",
|
"systemjs": "0.18.10",
|
||||||
"tsickle": "^0.27.2",
|
"tsickle": "^0.28.0",
|
||||||
"tslint": "5.7.0",
|
"tslint": "5.7.0",
|
||||||
"tslint-eslint-rules": "4.1.1",
|
"tslint-eslint-rules": "4.1.1",
|
||||||
"tsutils": "2.20.0",
|
"tsutils": "2.20.0",
|
||||||
"typescript": "2.7.x",
|
"typescript": "2.8.x",
|
||||||
"uglify-es": "^3.3.9",
|
"uglify-es": "^3.3.9",
|
||||||
"universal-analytics": "0.4.15",
|
"universal-analytics": "0.4.15",
|
||||||
"vlq": "0.2.2",
|
"vlq": "0.2.2",
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"@angular/compiler-cli": "0.0.0-PLACEHOLDER",
|
"@angular/compiler-cli": "0.0.0-PLACEHOLDER",
|
||||||
"typescript": ">=2.7.2 <2.8"
|
"typescript": ">=2.7.2 <2.9"
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
"chokidar": "^1.4.2"
|
"chokidar": "^1.4.2"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"typescript": ">=2.7.2 <2.8",
|
"typescript": ">=2.7.2 <2.9",
|
||||||
"@angular/compiler": "0.0.0-PLACEHOLDER"
|
"@angular/compiler": "0.0.0-PLACEHOLDER"
|
||||||
},
|
},
|
||||||
"engines" : {
|
"engines" : {
|
||||||
|
|
|
@ -108,7 +108,7 @@ const MIN_TS_VERSION = '2.7.2';
|
||||||
* ∀ supported typescript version v, v < MAX_TS_VERSION
|
* ∀ supported typescript version v, v < MAX_TS_VERSION
|
||||||
* MAX_TS_VERSION is not considered as a supported TypeScript version
|
* MAX_TS_VERSION is not considered as a supported TypeScript version
|
||||||
*/
|
*/
|
||||||
const MAX_TS_VERSION = '2.8.0';
|
const MAX_TS_VERSION = '2.9.0';
|
||||||
|
|
||||||
class AngularCompilerProgram implements Program {
|
class AngularCompilerProgram implements Program {
|
||||||
private rootNames: string[];
|
private rootNames: string[];
|
||||||
|
|
|
@ -141,13 +141,13 @@ class SanitizingHtmlSerializer {
|
||||||
const elAttrs = element.attributes;
|
const elAttrs = element.attributes;
|
||||||
for (let i = 0; i < elAttrs.length; i++) {
|
for (let i = 0; i < elAttrs.length; i++) {
|
||||||
const elAttr = elAttrs.item(i);
|
const elAttr = elAttrs.item(i);
|
||||||
const attrName = elAttr.name;
|
const attrName = elAttr !.name;
|
||||||
const lower = attrName.toLowerCase();
|
const lower = attrName.toLowerCase();
|
||||||
if (!VALID_ATTRS.hasOwnProperty(lower)) {
|
if (!VALID_ATTRS.hasOwnProperty(lower)) {
|
||||||
this.sanitizedSomething = true;
|
this.sanitizedSomething = true;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
let value = elAttr.value;
|
let value = elAttr !.value;
|
||||||
// TODO(martinprobst): Special case image URIs for data:image/...
|
// TODO(martinprobst): Special case image URIs for data:image/...
|
||||||
if (URI_ATTRS[lower]) value = _sanitizeUrl(value);
|
if (URI_ATTRS[lower]) value = _sanitizeUrl(value);
|
||||||
if (SRCSET_ATTRS[lower]) value = sanitizeSrcset(value);
|
if (SRCSET_ATTRS[lower]) value = sanitizeSrcset(value);
|
||||||
|
|
|
@ -146,7 +146,7 @@ export class InertBodyHelper {
|
||||||
// loop backwards so that we can support removals.
|
// loop backwards so that we can support removals.
|
||||||
for (let i = elAttrs.length - 1; 0 < i; i--) {
|
for (let i = elAttrs.length - 1; 0 < i; i--) {
|
||||||
const attrib = elAttrs.item(i);
|
const attrib = elAttrs.item(i);
|
||||||
const attrName = attrib.name;
|
const attrName = attrib !.name;
|
||||||
if (attrName === 'xmlns:ns1' || attrName.indexOf('ns1:') === 0) {
|
if (attrName === 'xmlns:ns1' || attrName.indexOf('ns1:') === 0) {
|
||||||
el.removeAttribute(attrName);
|
el.removeAttribute(attrName);
|
||||||
}
|
}
|
||||||
|
|
|
@ -64,7 +64,7 @@ export function create(info: any /* ts.server.PluginCreateInfo */): ts.LanguageS
|
||||||
}
|
}
|
||||||
|
|
||||||
function typescriptOnly(ls: ts.LanguageService): ts.LanguageService {
|
function typescriptOnly(ls: ts.LanguageService): ts.LanguageService {
|
||||||
return {
|
const languageService: ts.LanguageService = {
|
||||||
cleanupSemanticCache: () => ls.cleanupSemanticCache(),
|
cleanupSemanticCache: () => ls.cleanupSemanticCache(),
|
||||||
getSyntacticDiagnostics: tryFilenameCall(ls.getSyntacticDiagnostics),
|
getSyntacticDiagnostics: tryFilenameCall(ls.getSyntacticDiagnostics),
|
||||||
getSemanticDiagnostics: tryFilenameCall(ls.getSemanticDiagnostics),
|
getSemanticDiagnostics: tryFilenameCall(ls.getSemanticDiagnostics),
|
||||||
|
@ -117,8 +117,13 @@ export function create(info: any /* ts.server.PluginCreateInfo */): ts.LanguageS
|
||||||
getDefinitionAndBoundSpan: tryFilenameOneCall(ls.getDefinitionAndBoundSpan),
|
getDefinitionAndBoundSpan: tryFilenameOneCall(ls.getDefinitionAndBoundSpan),
|
||||||
getCombinedCodeFix:
|
getCombinedCodeFix:
|
||||||
(scope: ts.CombinedCodeFixScope, fixId: {}, formatOptions: ts.FormatCodeSettings) =>
|
(scope: ts.CombinedCodeFixScope, fixId: {}, formatOptions: ts.FormatCodeSettings) =>
|
||||||
tryCall(undefined, () => ls.getCombinedCodeFix(scope, fixId, formatOptions))
|
tryCall(undefined, () => ls.getCombinedCodeFix(scope, fixId, formatOptions)),
|
||||||
};
|
// TODO(kyliau): dummy implementation to compile with ts 2.8, create real one
|
||||||
|
getSuggestionDiagnostics: (fileName: string) => [],
|
||||||
|
// TODO(kyliau): dummy implementation to compile with ts 2.8, create real one
|
||||||
|
organizeImports: (scope: ts.CombinedCodeFixScope, formatOptions: ts.FormatCodeSettings) => [],
|
||||||
|
} as ts.LanguageService;
|
||||||
|
return languageService;
|
||||||
}
|
}
|
||||||
|
|
||||||
oldLS = typescriptOnly(oldLS);
|
oldLS = typescriptOnly(oldLS);
|
||||||
|
|
|
@ -156,7 +156,8 @@ export class MockCache {
|
||||||
headers: {},
|
headers: {},
|
||||||
} as DehydratedResponse;
|
} as DehydratedResponse;
|
||||||
|
|
||||||
resp.headers.forEach((value, name) => { dehydratedResp.headers[name] = value; });
|
resp.headers.forEach(
|
||||||
|
(value: string, name: string) => { dehydratedResp.headers[name] = value; });
|
||||||
|
|
||||||
dehydrated[url] = dehydratedResp;
|
dehydrated[url] = dehydratedResp;
|
||||||
});
|
});
|
||||||
|
|
|
@ -11,7 +11,7 @@ import {ApplicationRef, ChangeDetectorRef, ComponentFactory, ComponentRef, Event
|
||||||
import * as angular from './angular1';
|
import * as angular from './angular1';
|
||||||
import {PropertyBinding} from './component_info';
|
import {PropertyBinding} from './component_info';
|
||||||
import {$SCOPE} from './constants';
|
import {$SCOPE} from './constants';
|
||||||
import {getAttributesAsArray, getComponentName, hookupNgModel, strictEquals} from './util';
|
import {getComponentName, hookupNgModel, strictEquals} from './util';
|
||||||
|
|
||||||
const INITIAL_VALUE = {
|
const INITIAL_VALUE = {
|
||||||
__UNINITIALIZED__: true
|
__UNINITIALIZED__: true
|
||||||
|
|
|
@ -32,19 +32,6 @@ export function directiveNormalize(name: string): string {
|
||||||
.replace(DIRECTIVE_SPECIAL_CHARS_REGEXP, (_, letter) => letter.toUpperCase());
|
.replace(DIRECTIVE_SPECIAL_CHARS_REGEXP, (_, letter) => letter.toUpperCase());
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getAttributesAsArray(node: Node): [string, string][] {
|
|
||||||
const attributes = node.attributes;
|
|
||||||
let asArray: [string, string][] = undefined !;
|
|
||||||
if (attributes) {
|
|
||||||
let attrLen = attributes.length;
|
|
||||||
asArray = new Array(attrLen);
|
|
||||||
for (let i = 0; i < attrLen; i++) {
|
|
||||||
asArray[i] = [attributes[i].nodeName, attributes[i].nodeValue !];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return asArray || [];
|
|
||||||
}
|
|
||||||
|
|
||||||
export function getComponentName(component: Type<any>): string {
|
export function getComponentName(component: Type<any>): string {
|
||||||
// Return the name of the component or the first line of its stringified version.
|
// Return the name of the component or the first line of its stringified version.
|
||||||
return (component as any).overriddenName || component.name || component.toString().split('\n')[0];
|
return (component as any).overriddenName || component.name || component.toString().split('\n')[0];
|
||||||
|
|
12
yarn.lock
12
yarn.lock
|
@ -5886,9 +5886,9 @@ trim-off-newlines@^1.0.0:
|
||||||
version "1.0.1"
|
version "1.0.1"
|
||||||
resolved "https://registry.yarnpkg.com/trim-off-newlines/-/trim-off-newlines-1.0.1.tgz#9f9ba9d9efa8764c387698bcbfeb2c848f11adb3"
|
resolved "https://registry.yarnpkg.com/trim-off-newlines/-/trim-off-newlines-1.0.1.tgz#9f9ba9d9efa8764c387698bcbfeb2c848f11adb3"
|
||||||
|
|
||||||
tsickle@^0.27.2:
|
tsickle@^0.28.0:
|
||||||
version "0.27.2"
|
version "0.28.0"
|
||||||
resolved "https://registry.yarnpkg.com/tsickle/-/tsickle-0.27.2.tgz#f33d46d046f73dd5c155a37922e422816e878736"
|
resolved "https://registry.yarnpkg.com/tsickle/-/tsickle-0.28.0.tgz#6cd6fa004766c6ad9261b599c83866ee97cc7875"
|
||||||
dependencies:
|
dependencies:
|
||||||
minimist "^1.2.0"
|
minimist "^1.2.0"
|
||||||
mkdirp "^0.5.1"
|
mkdirp "^0.5.1"
|
||||||
|
@ -5989,9 +5989,9 @@ typedarray@^0.0.6:
|
||||||
version "0.0.6"
|
version "0.0.6"
|
||||||
resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777"
|
resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777"
|
||||||
|
|
||||||
typescript@2.7.x:
|
typescript@2.8.x:
|
||||||
version "2.7.2"
|
version "2.8.3"
|
||||||
resolved "https://registry.yarnpkg.com/typescript/-/typescript-2.7.2.tgz#2d615a1ef4aee4f574425cdff7026edf81919836"
|
resolved "https://registry.yarnpkg.com/typescript/-/typescript-2.8.3.tgz#5d817f9b6f31bb871835f4edf0089f21abe6c170"
|
||||||
|
|
||||||
typescript@~2.6.2:
|
typescript@~2.6.2:
|
||||||
version "2.6.2"
|
version "2.6.2"
|
||||||
|
|
Loading…
Reference in New Issue