Permalink
Browse files

feat: add support for TypeScript 3.1 (#26151)

PR Close #26151
  • Loading branch information...
IgorMinar authored and alxhub committed Sep 27, 2018
1 parent f455518 commit 9993c723359dad79e1162ec728572f7f6c817f5c

This file was deleted.

Oops, something went wrong.

This file was deleted.

Oops, something went wrong.

This file was deleted.

Oops, something went wrong.
@@ -1,6 +1,6 @@
{
"name": "angular-integration",
"description": "Assert that users with TypeScript 2.7 can type-check an Angular application",
"description": "Assert that users with TypeScript 3.0 can type-check an Angular application",
"version": "0.0.0",
"license": "MIT",
"dependencies": {
@@ -22,7 +22,7 @@
"@angular/upgrade": "file:../../dist/packages-dist/upgrade",
"@types/jasmine": "2.5.41",
"rxjs": "file:../../node_modules/rxjs",
"typescript": "2.7.x",
"typescript": "3.1.x",
"zone.js": "file:../../node_modules/zone.js"
},
"scripts": {
@@ -4,7 +4,7 @@
"experimentalDecorators": true,
"module": "commonjs",
"moduleResolution": "node",
"outDir": "../../dist/typings_test_ts28/",
"outDir": "../../dist/typings_test_ts30/",
"rootDir": ".",
"target": "es5",
"lib": [
@@ -127,7 +127,7 @@
"tslint": "5.7.0",
"tslint-eslint-rules": "4.1.1",
"tsutils": "2.20.0",
"typescript": "~3.0.1",
"typescript": "~3.1.1",
"uglify-es": "^3.3.9",
"universal-analytics": "0.4.15",
"vlq": "0.2.2",
@@ -11,7 +11,7 @@
},
"peerDependencies": {
"@angular/compiler-cli": "0.0.0-PLACEHOLDER",
"typescript": ">=3.0.1 <3.1"
"typescript": ">=3.1.1 <3.2"
},
"repository": {
"type": "git",
@@ -23,7 +23,7 @@
},
"peerDependencies": {
"@angular/compiler": "0.0.0-PLACEHOLDER",
"typescript": ">=3.0.1 <3.1"
"typescript": ">=3.1.1 <3.2"
},
"engines" : {
"node" : ">=8.0"
@@ -72,14 +72,14 @@ const defaultEmitCallback: TsEmitCallback =
* Minimum supported TypeScript version
* ∀ supported typescript version v, v >= MIN_TS_VERSION
*/
const MIN_TS_VERSION = '3.0.1';
const MIN_TS_VERSION = '3.1.1';
/**
* Supremum of supported TypeScript versions
* ∀ supported typescript version v, v < MAX_TS_VERSION
* MAX_TS_VERSION is not considered as a supported TypeScript version
*/
const MAX_TS_VERSION = '3.1.0';
const MAX_TS_VERSION = '3.2.0';
class AngularCompilerProgram implements Program {
private rootNames: string[];
@@ -151,7 +151,7 @@ export class InertBodyHelper {
el.removeAttribute(attrName);
}
}
let childNode = el.firstChild;
let childNode = el.firstChild as Node | null;
while (childNode) {
if (childNode.nodeType === Node.ELEMENT_NODE) this.stripCustomNsAttrs(childNode as Element);
childNode = childNode.nextSibling;
@@ -116,10 +116,12 @@ function ngBackPatch_node_modules_libB_module_LibAModule() {
export const AppModuleFactory: NgModuleFactory<AppModule>&{patchedDeps: boolean} = {
moduleType: AppModule,
patchedDeps: false,
create(parentInjector: Injector | null): NgModuleRef<AppModule>{
this.patchedDeps && ngBackPatch_node_modules_libB_module() && (this.patchedDeps = true);
return details_elided;}
patchedDeps: false, create(parentInjector: Injector | null): NgModuleRef<AppModule>{
if (!this.patchedDeps) {
ngBackPatch_node_modules_libB_module();
this.patchedDeps = true;
} return details_elided;
}
};
// BEGIN FILE: src/app.ngfactory.ts
@@ -165,7 +165,7 @@ export function createCustomElement<P>(
// Listen for events from the strategy and dispatch them as custom events
this.ngElementEventsSubscription = this.ngElementStrategy.events.subscribe(e => {
const customEvent = createCustomEvent(this.ownerDocument, e.name, e.value);
const customEvent = createCustomEvent(this.ownerDocument !, e.name, e.value);
this.dispatchEvent(customEvent);
});
}
@@ -74,8 +74,8 @@ export function createCustomEvent(doc: Document, name: string, detail: any): Cus
/**
* Check whether the input is an `Element`.
*/
export function isElement(node: Node): node is Element {
return node.nodeType === Node.ELEMENT_NODE;
export function isElement(node: Node | null): node is Element {
return !!node && node.nodeType === Node.ELEMENT_NODE;
}
/**
@@ -118,7 +118,7 @@ export class BrowserDomAdapter extends GenericBrowserDomAdapter {
get attrToPropMap(): any { return _attrToPropMap; }
contains(nodeA: any, nodeB: any): boolean { return nodeContains.call(nodeA, nodeB); }
querySelector(el: Element, selector: string): any { return el.querySelector(selector); }
querySelector(el: HTMLElement, selector: string): any { return el.querySelector(selector); }
querySelectorAll(el: any, selector: string): any[] { return el.querySelectorAll(selector); }
on(el: Node, evt: any, listener: any) { el.addEventListener(evt, listener, false); }
onAndCancel(el: Node, evt: any, listener: any): Function {
@@ -276,7 +276,7 @@ export class BrowserDomAdapter extends GenericBrowserDomAdapter {
getAttribute(element: Element, attribute: string): string|null {
return element.getAttribute(attribute);
}
getAttributeNS(element: Element, ns: string, name: string): string {
getAttributeNS(element: Element, ns: string, name: string): string|null {
return element.getAttributeNS(ns, name);
}
setAttribute(element: Element, name: string, value: string) { element.setAttribute(name, value); }
@@ -119,7 +119,7 @@ export abstract class DomAdapter {
abstract hasAttribute(element: any, attribute: string): boolean;
abstract hasAttributeNS(element: any, ns: string, attribute: string): boolean;
abstract getAttribute(element: any, attribute: string): string|null;
abstract getAttributeNS(element: any, ns: string, attribute: string): string;
abstract getAttributeNS(element: any, ns: string, attribute: string): string|null;
abstract setAttribute(element: any, name: string, value: string): any;
abstract setAttributeNS(element: any, ns: string, name: string, value: string): any;
abstract removeAttribute(element: any, attribute: string): any;
@@ -135,7 +135,7 @@ export class DominoAdapter extends BrowserDomAdapter {
}
getBaseHref(doc: Document): string {
const base = this.querySelector(doc.documentElement, 'base');
const base = this.querySelector(doc.documentElement !, 'base');
let href = '';
if (base) {
href = this.getHref(base);
@@ -1497,8 +1497,8 @@ export interface HttpDownloadProgressEvent extends HttpProgressEvent {
export declare class HttpErrorResponse extends HttpResponseBase implements Error {
readonly error: any | null;
readonly message: string;
readonly name: string;
readonly ok: boolean;
readonly name = "HttpErrorResponse";
readonly ok = false;
constructor(init: {
error?: any;
headers?: HttpHeaders;
@@ -26,7 +26,7 @@ export declare const APP_ID: InjectionToken<string>;
export declare const APP_INITIALIZER: InjectionToken<(() => void)[]>;
export declare class ApplicationInitStatus {
readonly done: boolean;
readonly done = false;
readonly donePromise: Promise<any>;
constructor(appInits: (() => any)[]);
}
@@ -624,7 +624,7 @@ export declare abstract class Query {
export declare class QueryList<T> {
readonly changes: Observable<any>;
readonly dirty: boolean;
readonly dirty = true;
readonly first: T;
readonly last: T;
readonly length: number;
@@ -11,7 +11,7 @@
"test": "test"
},
"peerDependencies": {
"typescript": "^3.0.1"
"typescript": "~3.1.1"
},
"dependencies": {
"chalk": "^2.3.1",
@@ -24,7 +24,7 @@
"@types/node": "^10.9.2",
"chai": "^4.1.2",
"jasmine": "^3.1.0",
"typescript": "~3.0.1"
"typescript": "~3.1.1"
},
"repository": {},
"keywords": [

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.

0 comments on commit 9993c72

Please sign in to comment.