diff --git a/gulpfile.js b/gulpfile.js index de112a2730..5e3aa9da38 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -91,19 +91,18 @@ var treatTestErrorsAsFatal = true; function runJasmineTests(globs, done) { var args = ['--'].concat(globs); - fork('./tools/traceur-jasmine', args, { - stdio: 'inherit' - }).on('close', function jasmineCloseHandler(exitCode) { - if (exitCode && treatTestErrorsAsFatal) { - var err = new Error('Jasmine tests failed'); - // Mark the error for gulp similar to how gulp-utils.PluginError does it. - // The stack is not useful in this context. - err.showStack = false; - done(err); - } else { - done(); - } - }); + fork('./tools/cjs-jasmine', args, {stdio: 'inherit'}) + .on('close', function jasmineCloseHandler(exitCode) { + if (exitCode && treatTestErrorsAsFatal) { + var err = new Error('Jasmine tests failed'); + // Mark the error for gulp similar to how gulp-utils.PluginError does it. + // The stack is not useful in this context. + err.showStack = false; + done(err); + } else { + done(); + } + }); } // Note: when DART_SDK is not found, all gulp tasks ending with `.dart` will be skipped. @@ -141,11 +140,8 @@ var BENCHPRESS_BUNDLE_CONFIG = { 'angular2' ], excludes: [ - 'traceur', - 'traceur/bin/traceur-runtime', 'reflect-metadata', 'selenium-webdriver', - 'rtts_assert', 'zone.js' ], ignore: [ @@ -837,47 +833,46 @@ gulp.task('build/pure-packages.dart', function() { ]) .pipe(gulp.dest(path.join(CONFIG.dest.dart, 'angular2'))); - var moveStream = gulp - .src([ - 'modules_dart/**/*.dart', - 'modules_dart/**/pubspec.yaml', - '!modules_dart/transform/**' - ]) - .pipe(through2.obj(function(file, enc, done) { - if (file.path.endsWith('pubspec.yaml')) { - // Pure packages specify dependency_overrides relative to - // `modules_dart`, so they have to walk up and into `dist`. - // - // Example: - // - // dependency_overrides: - // angular2: - // path: ../../dist/dart/angular2 - // - // When we copy a pure package into `dist` the relative path - // must be updated. The code below replaces paths accordingly. - // So the example above is turned into: - // - // dependency_overrides: - // angular2: - // path: ../angular2 - // - var pubspec = yaml.safeLoad(file.contents.toString()); - var overrides = pubspec.dependency_overrides; - if (overrides) { - Object.keys(overrides).forEach(function(pkg) { - var overridePath = overrides[pkg].path; - if (overridePath.startsWith(originalPrefix)) { - overrides[pkg].path = overridePath.replace(originalPrefix, '../'); - } - }); - file.contents = new Buffer(yaml.safeDump(pubspec)); - } - } - this.push(file); - done(); - })) - .pipe(gulp.dest(CONFIG.dest.dart)); + var moveStream = gulp.src([ + 'modules_dart/**/*.dart', + 'modules_dart/**/pubspec.yaml', + '!modules_dart/transform/**' + ]) + .pipe(through2.obj(function(file, enc, done) { + if (/pubspec.yaml$/.test(file.path)) { + // Pure packages specify dependency_overrides relative to + // `modules_dart`, so they have to walk up and into `dist`. + // + // Example: + // + // dependency_overrides: + // angular2: + // path: ../../dist/dart/angular2 + // + // When we copy a pure package into `dist` the relative path + // must be updated. The code below replaces paths accordingly. + // So the example above is turned into: + // + // dependency_overrides: + // angular2: + // path: ../angular2 + // + var pubspec = yaml.safeLoad(file.contents.toString()); + var overrides = pubspec.dependency_overrides; + if (overrides) { + Object.keys(overrides).forEach(function(pkg) { + var overridePath = overrides[pkg].path; + if ((new RegExp('^' + originalPrefix)).test(overridePath)) { + overrides[pkg].path = overridePath.replace(originalPrefix, '../'); + } + }); + file.contents = new Buffer(yaml.safeDump(pubspec)); + } + } + this.push(file); + done(); + })) + .pipe(gulp.dest(CONFIG.dest.dart)); return merge2(transformStream, moveStream); @@ -1145,13 +1140,11 @@ gulp.task('!bundle.js.min.deps', ['!bundle.js.min'], function() { }); var JS_DEV_DEPS = [ - licenseWrap('node_modules/zone.js/LICENSE', true), - 'node_modules/zone.js/dist/zone-microtask.js', - 'node_modules/zone.js/dist/long-stack-trace-zone.js', - licenseWrap('node_modules/reflect-metadata/LICENSE', true), - 'node_modules/reflect-metadata/Reflect.js', - // traceur-runtime is always first in the bundle - licenseWrap('node_modules/traceur/LICENSE', true) + licenseWrap('node_modules/zone.js/LICENSE', true), + 'node_modules/zone.js/dist/zone-microtask.js', + 'node_modules/zone.js/dist/long-stack-trace-zone.js', + licenseWrap('node_modules/reflect-metadata/LICENSE', true), + 'node_modules/reflect-metadata/Reflect.js' ]; // Splice in RX license if rx is in the bundle. diff --git a/karma-js.conf.js b/karma-js.conf.js index 1e97d2219e..e8d5add617 100644 --- a/karma-js.conf.js +++ b/karma-js.conf.js @@ -17,7 +17,7 @@ module.exports = function(config) { 'node_modules/zone.js/dist/long-stack-trace-zone.js', 'node_modules/zone.js/dist/jasmine-patch.js', - 'node_modules/traceur/bin/traceur-runtime.js', + 'node_modules/es6-shim/es6-shim.js', // Including systemjs because it defines `__eval`, which produces correct stack traces. 'modules/angular2/src/test_lib/shims_for_IE.js', 'node_modules/systemjs/dist/system.src.js', @@ -28,10 +28,7 @@ module.exports = function(config) { {pattern: 'modules/**/test/**/static_assets/**', included: false, watched: false} ], - exclude: [ - 'dist/js/dev/es5/**/e2e_test/**', - 'dist/angular1_router.js' - ], + exclude: ['dist/js/dev/es5/**/e2e_test/**', 'dist/angular1_router.js'], customLaunchers: sauceConf.customLaunchers, diff --git a/modules/angular1_router/build.js b/modules/angular1_router/build.js index ba8f3d3447..35877a5f3a 100644 --- a/modules/angular1_router/build.js +++ b/modules/angular1_router/build.js @@ -21,8 +21,8 @@ var files = [ var PRELUDE = '(function(){\n'; var POSTLUDE = '\n}());\n'; var FACADES = fs.readFileSync(__dirname + '/lib/facades.es5', 'utf8'); -var TRACEUR_RUNTIME = fs.readFileSync(__dirname + '/../../node_modules/traceur/bin/traceur-runtime.js', 'utf8'); var DIRECTIVES = fs.readFileSync(__dirname + '/src/ng_outlet.js', 'utf8'); +var ES6_SHIM = fs.readFileSync(__dirname + '/../../node_modules/es6-shim/es6-shim.js', 'utf8'); function main() { var dir = __dirname + '/../angular2/src/router/'; @@ -85,7 +85,7 @@ function main() { "return router;" ].join('\n')); - return PRELUDE + TRACEUR_RUNTIME + DIRECTIVES + out + POSTLUDE; + return PRELUDE + ES6_SHIM + DIRECTIVES + out + POSTLUDE; } diff --git a/modules/angular1_router/lib/facades.es5 b/modules/angular1_router/lib/facades.es5 index d65f3667e3..cdac8bfa52 100644 --- a/modules/angular1_router/lib/facades.es5 +++ b/modules/angular1_router/lib/facades.es5 @@ -128,7 +128,7 @@ var StringMapWrapper = { }, forEach: function (m, fn) { - for (prop in m) { + for (var prop in m) { if (m.hasOwnProperty(prop)) { fn(m[prop], prop); } diff --git a/modules/angular2/docs/web_workers/web_workers.md b/modules/angular2/docs/web_workers/web_workers.md index 0104d5cbac..82acf99a41 100644 --- a/modules/angular2/docs/web_workers/web_workers.md +++ b/modules/angular2/docs/web_workers/web_workers.md @@ -27,7 +27,7 @@ To bootstrap Hello World in a WebWorker we do the following in TypeScript ```HTML - + @@ -44,7 +44,7 @@ bootstrap("loader.js"); ``` ```JavaScript // loader.js -importScripts("https://github.jspm.io/jmcriffey/bower-traceur-runtime@0.0.87/traceur-runtime.js", "https://jspm.io/system@0.16.js", "angular2/web_worker/worker.js"); +importScripts("https://cdnjs.cloudflare.com/ajax/libs/es6-shim/0.33.3/es6-shim.js", "https://jspm.io/system@0.16.js", "angular2/web_worker/worker.js"); System.import("app"); ``` ```TypeScript diff --git a/modules/angular2/manual_typings/traceur-runtime.d.ts b/modules/angular2/manual_typings/traceur-runtime.d.ts index cac659bb15..f7dbd00436 100644 --- a/modules/angular2/manual_typings/traceur-runtime.d.ts +++ b/modules/angular2/manual_typings/traceur-runtime.d.ts @@ -15,7 +15,7 @@ interface PromiseLike extends Thenable {} // Extend the ES5 standard library with some ES6 features we polyfill at runtime -// by loading traceur-runtime.js +// by loading es6-shim.js // These are mostly copied from lib.es6.d.ts diff --git a/modules/angular2/src/http/index.ts b/modules/angular2/src/http/index.ts index 49b8314cc8..0459c4656d 100644 --- a/modules/angular2/src/http/index.ts +++ b/modules/angular2/src/http/index.ts @@ -1,6 +1,6 @@ // Index to be used if Http is ever configured as a standalone npm package. // require('reflect-metadata'); -// require('traceur-runtime'); +// require('es6-shim'); // import {HTTP_BINDINGS, JSONP_BINDINGS, Http, Jsonp} from './http'; // import {Injector} from 'angular2/angular2'; // export * from './http'; diff --git a/modules/benchpress/index.ts b/modules/benchpress/index.ts index 32a97be9b6..7f90292ffc 100644 --- a/modules/benchpress/index.ts +++ b/modules/benchpress/index.ts @@ -1,5 +1,5 @@ require('reflect-metadata'); -require('traceur/bin/traceur-runtime'); +require('es6-shim'); module.exports = require('./benchpress.js'); // when bundling benchpress to one file, this is used // for getting exports out of browserify's scope. diff --git a/modules/benchpress/package.json b/modules/benchpress/package.json index 37bd719d92..5869cac75a 100644 --- a/modules/benchpress/package.json +++ b/modules/benchpress/package.json @@ -10,7 +10,6 @@ "repository": <%= JSON.stringify(packageJson.repository) %>, "dependencies": { "angular2": "<%= packageJson.version %>", - "traceur": "<%= packageJson.dependencies.traceur %>", "selenium-webdriver": "<%= packageJson.dependencies['selenium-webdriver'] %>", "reflect-metadata": "<%= packageJson.dependencies['reflect-metadata'] %>" }, diff --git a/modules/benchpress/test/firefox_extension/conf.ts b/modules/benchpress/test/firefox_extension/conf.ts index eb2a914fa7..354dd46417 100644 --- a/modules/benchpress/test/firefox_extension/conf.ts +++ b/modules/benchpress/test/firefox_extension/conf.ts @@ -1,5 +1,5 @@ /// -require('traceur/bin/traceur-runtime.js'); +require('es6-shim/es6-shim.js'); require('reflect-metadata'); var testHelper = require('../../src/firefox_extension/lib/test_helper.js'); diff --git a/npm-shrinkwrap.clean.json b/npm-shrinkwrap.clean.json index 49ee9d5b36..4ed6c86346 100644 --- a/npm-shrinkwrap.clean.json +++ b/npm-shrinkwrap.clean.json @@ -2999,6 +2999,9 @@ } } }, + "es6-shim": { + "version": "0.33.3" + }, "event-stream": { "version": "3.3.1", "dependencies": { @@ -9776,57 +9779,6 @@ } } }, - "traceur": { - "version": "0.0.87", - "dependencies": { - "commander": { - "version": "2.6.0" - }, - "glob": { - "version": "4.3.5", - "dependencies": { - "inflight": { - "version": "1.0.4", - "dependencies": { - "wrappy": { - "version": "1.0.1" - } - } - }, - "inherits": { - "version": "2.0.1" - }, - "once": { - "version": "1.3.2", - "dependencies": { - "wrappy": { - "version": "1.0.1" - } - } - } - } - }, - "rsvp": { - "version": "3.0.18" - }, - "semver": { - "version": "2.3.2" - }, - "source-map-support": { - "version": "0.2.10", - "dependencies": { - "source-map": { - "version": "0.1.32", - "dependencies": { - "amdefine": { - "version": "0.1.0" - } - } - } - } - } - } - }, "ts2dart": { "version": "0.7.4", "dependencies": { @@ -10509,5 +10461,5 @@ } }, "name": "angular", - "version": "2.0.0-alpha.36" + "version": "2.0.0-alpha.37" } diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 7c1232ed95..6e00dfffd4 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -1,6 +1,6 @@ { "name": "angular", - "version": "2.0.0-alpha.36", + "version": "2.0.0-alpha.37", "dependencies": { "angular": { "version": "1.3.5", @@ -4633,6 +4633,11 @@ } } }, + "es6-shim": { + "version": "0.33.3", + "from": "es6-shim@*", + "resolved": "https://registry.npmjs.org/es6-shim/-/es6-shim-0.33.3.tgz" + }, "event-stream": { "version": "3.3.1", "from": "https://registry.npmjs.org/event-stream/-/event-stream-3.3.1.tgz", @@ -15112,83 +15117,6 @@ } } }, - "traceur": { - "version": "0.0.87", - "from": "https://registry.npmjs.org/traceur/-/traceur-0.0.87.tgz", - "resolved": "https://registry.npmjs.org/traceur/-/traceur-0.0.87.tgz", - "dependencies": { - "commander": { - "version": "2.6.0", - "from": "https://registry.npmjs.org/commander/-/commander-2.6.0.tgz", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.6.0.tgz" - }, - "glob": { - "version": "4.3.5", - "from": "https://registry.npmjs.org/glob/-/glob-4.3.5.tgz", - "resolved": "https://registry.npmjs.org/glob/-/glob-4.3.5.tgz", - "dependencies": { - "inflight": { - "version": "1.0.4", - "from": "https://registry.npmjs.org/inflight/-/inflight-1.0.4.tgz", - "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.4.tgz", - "dependencies": { - "wrappy": { - "version": "1.0.1", - "from": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.1.tgz", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.1.tgz" - } - } - }, - "inherits": { - "version": "2.0.1", - "from": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz" - }, - "once": { - "version": "1.3.2", - "from": "https://registry.npmjs.org/once/-/once-1.3.2.tgz", - "resolved": "https://registry.npmjs.org/once/-/once-1.3.2.tgz", - "dependencies": { - "wrappy": { - "version": "1.0.1", - "from": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.1.tgz", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.1.tgz" - } - } - } - } - }, - "rsvp": { - "version": "3.0.18", - "from": "https://registry.npmjs.org/rsvp/-/rsvp-3.0.18.tgz", - "resolved": "https://registry.npmjs.org/rsvp/-/rsvp-3.0.18.tgz" - }, - "semver": { - "version": "2.3.2", - "from": "https://registry.npmjs.org/semver/-/semver-2.3.2.tgz", - "resolved": "https://registry.npmjs.org/semver/-/semver-2.3.2.tgz" - }, - "source-map-support": { - "version": "0.2.10", - "from": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.2.10.tgz", - "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.2.10.tgz", - "dependencies": { - "source-map": { - "version": "0.1.32", - "from": "https://registry.npmjs.org/source-map/-/source-map-0.1.32.tgz", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.1.32.tgz", - "dependencies": { - "amdefine": { - "version": "0.1.0", - "from": "https://registry.npmjs.org/amdefine/-/amdefine-0.1.0.tgz", - "resolved": "https://registry.npmjs.org/amdefine/-/amdefine-0.1.0.tgz" - } - } - } - } - } - } - }, "ts2dart": { "version": "0.7.4", "from": "https://registry.npmjs.org/ts2dart/-/ts2dart-0.7.4.tgz", diff --git a/package.json b/package.json index 8eae176b54..f23a152352 100644 --- a/package.json +++ b/package.json @@ -30,7 +30,6 @@ "dependencies": { "reflect-metadata": "0.1.1", "rx": "2.5.1", - "traceur": "0.0.87", "zone.js": "0.5.4" }, "devDependencies": { @@ -57,6 +56,7 @@ "del": "~1", "dgeni": "^0.4.1", "dgeni-packages": "^0.10.11", + "es6-shim": "^0.33.3", "event-stream": "^3.1.5", "firefox-profile": "^0.3.4", "fs-extra": "^0.18.0", diff --git a/tools/broccoli/html-replace/SCRIPTS.html b/tools/broccoli/html-replace/SCRIPTS.html index 3f9367def6..1da2708dc0 100644 --- a/tools/broccoli/html-replace/SCRIPTS.html +++ b/tools/broccoli/html-replace/SCRIPTS.html @@ -1,6 +1,6 @@ - + - + - +