From e9399bfdcea7c0580ae6e24ec5cef372af4d6086 Mon Sep 17 00:00:00 2001 From: Robert Jackson Date: Fri, 8 Sep 2017 15:37:10 -0400 Subject: [PATCH] Update router_js to 2.0.0. The diff of the changes is pretty noisey (due to lots of general cleanup work that was done), but for the most part the changes are: * Drop support for non ES5 browsers (use `Array.isArray`, `Object.create`, etc directly) * Refactor the dist output to emit `module` entry point. * Update to use classes throughout the repo. * Ensure `Route.prototype.serialize` is called bound to the route instance. --- broccoli/packages.js | 18 ++---------------- package.json | 2 +- yarn.lock | 6 +++--- 3 files changed, 6 insertions(+), 20 deletions(-) diff --git a/broccoli/packages.js b/broccoli/packages.js index 055a0ab6301..6803db57e4b 100644 --- a/broccoli/packages.js +++ b/broccoli/packages.js @@ -16,24 +16,10 @@ const { stripIndent } = require('common-tags'); const toES5 = require('./to-es5'); module.exports.routerES = function _routerES() { - return new Rollup(findLib('router_js', 'lib'), { + return new Rollup(findLib('router_js'), { rollup: { external: ['route-recognizer', 'rsvp'], - entry: 'router.js', - plugins: [{ - transform(code, id) { - if (/[^t][^e][^r]\/router\.js$/.test(id)) { - code += 'export { Transition } from \'./router/transition\';\n' - } else if (/\/router\/handler-info\/[^\/]+\.js$/.test(id)) { - code = code.replace(/\'router\//g, '\'../'); - } - code = code.replace(/import\ Promise\ from \'rsvp\/promise\'/g, 'import { Promise } from \'rsvp\'') - return { - code: code, - map: { mappings: '' } - }; - } - }], + entry: 'index.js', targets: [{ dest: 'router.js', format: 'es' diff --git a/package.json b/package.json index 627ad999967..13d7bf28d68 100644 --- a/package.json +++ b/package.json @@ -112,7 +112,7 @@ "qunit-phantomjs-runner": "^2.2.0", "qunitjs": "^1.22.0", "route-recognizer": "^0.3.3", - "router_js": "^1.2.8", + "router_js": "^2.0.0-beta.1", "semver": "^5.3.0", "serve-static": "^1.12.2", "simple-dom": "^0.3.0", diff --git a/yarn.lock b/yarn.lock index c21c9c9c87b..80f4b73a822 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5322,9 +5322,9 @@ route-recognizer@^0.3.3: version "0.3.3" resolved "https://registry.yarnpkg.com/route-recognizer/-/route-recognizer-0.3.3.tgz#1d365e27fa6995e091675f7dc940a8c00353bd29" -router_js@^1.2.8: - version "1.2.8" - resolved "https://registry.yarnpkg.com/router_js/-/router_js-1.2.8.tgz#d2ea5d00726e1fd6494d20ae3ebeb99ce86cf0b3" +router_js@^2.0.0-beta.1: + version "2.0.0-beta.1" + resolved "https://registry.yarnpkg.com/router_js/-/router_js-2.0.0-beta.1.tgz#6f267b5171bbe1e92729db3e8be447e6a9d63f5a" rsvp@3.0.14: version "3.0.14"