diff --git a/ng-sample/gruntfile.js b/ng-sample/gruntfile.js deleted file mode 100644 index 8c5dc29fa..000000000 --- a/ng-sample/gruntfile.js +++ /dev/null @@ -1,71 +0,0 @@ -var path = require("path"); -var fs = require("fs"); -var shelljs = require("shelljs"); - -module.exports = function(grunt) { - grunt.loadNpmTasks('grunt-ts'); - grunt.loadNpmTasks('grunt-contrib-copy'); - grunt.loadNpmTasks('grunt-contrib-clean'); - grunt.loadNpmTasks('grunt-shell'); - - var nsDistPath = process.env.NSDIST || '../deps/NativeScript/bin/dist'; - var angularDistPath = process.env.ANGULARDIST || '../'; - - var modulesPath = grunt.option("modulesPath", path.join(nsDistPath, 'modules')); - - var angularSrcPath = grunt.option("angularSrcPath") || "../src" - - grunt.initConfig({ - shell: { - localInstallAngular: { - command: "npm install \"<%= angularPackagePath %>\"" - }, - localInstallModules: { - command: "npm install \"<%= nsPackagePath %>\"" - }, - }, - }); - - grunt.registerTask("checkModules", function() { - if (!grunt.file.exists(modulesPath)) { - grunt.fail.fatal("Modules path does not exist."); - } - }); - - grunt.registerTask("getNSPackage", function() { - var packageFiles = grunt.file.expand({ - cwd: nsDistPath - },[ - 'tns-core-modules*.tgz' - ]); - var nsPackagePath = path.join(nsDistPath, packageFiles[0]); - grunt.config('nsPackagePath', nsPackagePath); - }); - - grunt.registerTask("getAngularPackage", function() { - var packageFiles = grunt.file.expand({ - cwd: angularDistPath - },[ - 'angular2-*.tgz' - ]); - var angularPackagePath = path.join(angularDistPath, packageFiles[0]); - grunt.config('angularPackagePath', angularPackagePath); - }); - - grunt.registerTask("updateModules", [ - "getNSPackage", - "shell:localInstallModules", - ]); - - grunt.registerTask("updateAngular", [ - "getAngularPackage", - "shell:localInstallAngular", - ]); - - grunt.registerTask("prepare", [ - "updateModules", - "updateAngular", - ]); - - grunt.registerTask("default", ["prepare"]); -} diff --git a/ng-sample/package.json b/ng-sample/package.json index 3d9055902..b93bcb2f5 100644 --- a/ng-sample/package.json +++ b/ng-sample/package.json @@ -23,15 +23,15 @@ }, "homepage": "https://github.com/NativeScript/template-hello-world", "dependencies": { - "tns-core-modules": "^1.6.0-angular-4", - "angular2": "2.0.0-beta.2", + "tns-core-modules": "^1.6.0-angular-5", + "angular2": "2.0.0-beta.3", "parse5": "1.4.2", "punycode": "1.3.2", "querystring": "0.2.0", "url": "0.10.3", "reflect-metadata": "0.1.2", "rxjs": "5.0.0-beta.0", - "zone.js": "0.5.10" + "zone.js": "0.5.11" }, "devDependencies": { "grunt": "0.4.5", diff --git a/package.json b/package.json index da87cc7f3..b796ee07c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "nativescript-angular", - "version": "0.0.27", + "version": "0.0.29", "description": "", "homepage": "http://www.telerik.com", "bugs": "http://www.telerik.com", @@ -14,8 +14,8 @@ }, "scripts": {}, "dependencies": { - "tns-core-modules": "^1.6.0-angular-4", - "angular2": "2.0.0-beta.2", + "tns-core-modules": "^1.6.0-angular-5", + "angular2": "2.0.0-beta.3", "es6-shim": "^0.33.3", "parse5": "1.4.2", "punycode": "1.3.2", @@ -23,7 +23,7 @@ "url": "0.10.3", "reflect-metadata": "0.1.2", "rxjs": "5.0.0-beta.0", - "zone.js": "0.5.10" + "zone.js": "0.5.11" }, "devDependencies": { "grunt": "0.4.5", diff --git a/src/global.d.ts b/src/global.d.ts index 33007e4e0..57fdd6224 100644 --- a/src/global.d.ts +++ b/src/global.d.ts @@ -1,3 +1,6 @@ +/// +/// +/// declare var assert: any; interface Map { diff --git a/src/nativescript-angular/application.ts b/src/nativescript-angular/application.ts index af81fd0da..1ec990f3f 100644 --- a/src/nativescript-angular/application.ts +++ b/src/nativescript-angular/application.ts @@ -1,12 +1,8 @@ +//Import globals before the zone, so the latter can patch the global functions +import 'globals'; +import "zone.js/dist/zone.js" import 'reflect-metadata'; import './polyfills/array'; -import 'globals'; -//HACK: Unhack our global lazy loaded functions hack to make zone monkey patching work. -var __dummy_setTimeout = global.setTimeout; -var __dummy_clearTimeout = global.clearTimeout; -var __dummy_setInterval = global.setInterval; -var __dummy_clearInterval = global.clearInterval; -import './zone'; import {isPresent, Type} from 'angular2/src/facade/lang'; import {Promise, PromiseWrapper} from 'angular2/src/facade/async'; import {platform, ComponentRef, PLATFORM_DIRECTIVES, PLATFORM_PIPES} from 'angular2/core'; diff --git a/src/nativescript-angular/renderer.ts b/src/nativescript-angular/renderer.ts index 0340e6fa3..e4b7076a8 100644 --- a/src/nativescript-angular/renderer.ts +++ b/src/nativescript-angular/renderer.ts @@ -2,7 +2,8 @@ import {Inject, Injectable} from 'angular2/src/core/di'; import { Renderer, RootRenderer, - RenderComponentType + RenderComponentType, + RenderDebugInfo } from 'angular2/src/core/render/api'; import {isBlank} from 'angular2/src/facade/lang'; import {DOM} from 'angular2/src/platform/dom/dom_adapter'; @@ -121,6 +122,11 @@ export class NativeScriptRenderer extends Renderer { console.log('NativeScriptRenderer.setBindingDebugInfo: ' + renderElement + ', ' + propertyName + ' = ' + propertyValue); } + setElementDebugInfo(renderElement: any, info: RenderDebugInfo): void { + console.log('NativeScriptRenderer.setElementDebugInfo: ' + renderElement); + } + + /** * Calls a method on an element. */ diff --git a/src/nativescript-angular/zone.ts b/src/nativescript-angular/zone.ts deleted file mode 100644 index 350140a31..000000000 --- a/src/nativescript-angular/zone.ts +++ /dev/null @@ -1,10 +0,0 @@ -// Borrowed from the react-native-renderer project at: -// https://github.com/uber5001/react-native-renderer -import NativeScriptPatch from "./zone_patch" - -var core = require('zone.js/lib/core.js'); - -(global).Zone = core.Zone; -(global).zone = new core.Zone(); - -NativeScriptPatch.apply(); diff --git a/src/nativescript-angular/zone_patch.ts b/src/nativescript-angular/zone_patch.ts deleted file mode 100644 index a97cb4f2f..000000000 --- a/src/nativescript-angular/zone_patch.ts +++ /dev/null @@ -1,14 +0,0 @@ -var patchSetClearFunction = require('zone.js/lib/patch/functions').patchSetClearFunction; -var patchSetFunction = require('zone.js/lib/patch/functions').patchSetFunction; -var promisePatch = require('zone.js/lib/patch/promise'); - -function apply() { - patchSetClearFunction(global, ['timeout', 'interval', 'immediate']); - patchSetFunction(global, ['requestAnimationFrame']); - - promisePatch.apply(); -} - -export default { - apply: apply -} diff --git a/tests/package.json b/tests/package.json index 672aa3e41..9b7f810db 100644 --- a/tests/package.json +++ b/tests/package.json @@ -1,55 +1,55 @@ { - "nativescript": { - "id": "org.nativescript.helloworldng", - "tns-ios": { - "version": "1.5.2" - }, - "tns-android": { - "version": "1.5.1" - } - }, - "name": "nativescript-hello-world-ng", - "main": "app.js", - "version": "1.0.0", - "author": "Telerik ", - "description": "Nativescript Angular Hello World template", - "license": "BSD", - "keywords": [ - "telerik", - "mobile", - "angular", - "nativescript", - "{N}", - "tns", - "appbuilder", - "template" - ], - "repository": { - "type": "git", - "url": "git://github.com/NativeScript/template-hello-world-ng" - }, - "homepage": "http://nativescript.org", - "dependencies": { - "angular2": "2.0.0-beta.2", - "nativescript-unit-test-runner": "^0.2.8", - "parse5": "1.4.2", - "punycode": "1.3.2", - "querystring": "0.2.0", - "reflect-metadata": "0.1.2", - "rxjs": "5.0.0-beta.0", - "tns-core-modules": "1.6.0-angular-4", - "url": "0.10.3", - "zone.js": "0.5.10" - }, - "devDependencies": { - "chai": "^3.5.0", - "karma": "^0.13.19", - "karma-chai": "^0.1.0", - "karma-mocha": "^0.2.1", - "karma-nativescript-launcher": "^0.3.1", - "mocha": "^2.4.5", - "nativescript-dev-typescript": "^0.2.2", - "shelljs": "^0.5.3", - "typescript": "^1.7.5" - } + "nativescript": { + "id": "org.nativescript.helloworldng", + "tns-ios": { + "version": "1.5.2" + }, + "tns-android": { + "version": "1.5.1" + } + }, + "name": "nativescript-hello-world-ng", + "main": "app.js", + "version": "1.0.0", + "author": "Telerik ", + "description": "Nativescript Angular Hello World template", + "license": "BSD", + "keywords": [ + "telerik", + "mobile", + "angular", + "nativescript", + "{N}", + "tns", + "appbuilder", + "template" + ], + "repository": { + "type": "git", + "url": "git://github.com/NativeScript/template-hello-world-ng" + }, + "homepage": "http://nativescript.org", + "dependencies": { + "angular2": "2.0.0-beta.3", + "nativescript-unit-test-runner": "^0.2.8", + "parse5": "1.4.2", + "punycode": "1.3.2", + "querystring": "0.2.0", + "reflect-metadata": "0.1.2", + "rxjs": "5.0.0-beta.0", + "tns-core-modules": "1.6.0-angular-5", + "url": "0.10.3", + "zone.js": "0.5.11" + }, + "devDependencies": { + "chai": "^3.5.0", + "karma": "^0.13.19", + "karma-chai": "^0.1.0", + "karma-mocha": "^0.2.1", + "karma-nativescript-launcher": "^0.3.1", + "mocha": "^2.4.5", + "nativescript-dev-typescript": "^0.2.2", + "shelljs": "^0.5.3", + "typescript": "^1.7.5" + } } diff --git a/tests/tsconfig.json b/tests/tsconfig.json index c444a6986..b2b758895 100644 --- a/tests/tsconfig.json +++ b/tests/tsconfig.json @@ -28,4 +28,4 @@ "node_modules", "platforms" ] -} +} \ No newline at end of file