diff --git a/CHANGELOG.md b/CHANGELOG.md index 7e38be7c..a3ae8bb2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,13 @@ +## 6.0.4 (2020-01-06) +[Compare `@uirouter/core` versions 6.0.3 and 6.0.4](https://github.com/ui-router/core/compare/6.0.3...6.0.4) + +### Bug Fixes + +* **safeConsole:** check if document is defined to avoid issues in node environments ([da29d88](https://github.com/ui-router/core/commit/da29d88)) + + + + ## 6.0.3 (2019-12-30) [Compare `@uirouter/core` versions 6.0.2 and 6.0.3](https://github.com/ui-router/core/compare/6.0.2...6.0.3) diff --git a/package.json b/package.json index f1a2ce6c..a124abd8 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@uirouter/core", "description": "UI-Router Core: Framework agnostic, State-based routing for JavaScript Single Page Apps", - "version": "6.0.3", + "version": "6.0.4", "scripts": { "clean": "shx rm -rf lib lib-esm _bundles .cache _doc", "compile": "npm run clean && tsc && tsc -m es6 --outDir lib-esm && shx cp src/*.json lib", diff --git a/src/common/safeConsole.ts b/src/common/safeConsole.ts index 3b0b0dc1..7d46ec89 100644 --- a/src/common/safeConsole.ts +++ b/src/common/safeConsole.ts @@ -22,7 +22,7 @@ function fallbackConsole(console) { function getSafeConsole() { // @ts-ignore - const isIE9 = document && document.documentMode && document.documentMode === 9; + const isIE9 = typeof document !== 'undefined' && document.documentMode && document.documentMode === 9; if (isIE9) { return window && window.console ? ie9Console(window.console) : noopConsoleStub; } else if (!console.table || !console.error) { diff --git a/src/hooks/lazyLoad.ts b/src/hooks/lazyLoad.ts index ab5a88c7..ef48fb7e 100644 --- a/src/hooks/lazyLoad.ts +++ b/src/hooks/lazyLoad.ts @@ -24,7 +24,7 @@ import { StateRule } from '../url/interface'; * ``` * .state('abc', { * component: 'fooComponent', - * lazyLoad: () => System.import('./fooComponent') + * lazyLoad: () => import('./fooComponent') * }); * ``` * diff --git a/src/state/interface.ts b/src/state/interface.ts index 0cc0bf38..ba86465c 100644 --- a/src/state/interface.ts +++ b/src/state/interface.ts @@ -563,7 +563,7 @@ export interface StateDeclaration { * * ``` * .state('abc', { - * lazyLoad: (transition, state) => System.import('./abcService') + * lazyLoad: (transition, state) => import('./abcService') * } * ``` * @@ -621,7 +621,7 @@ export interface StateDeclaration { * { * name: 'parent.**', * url: '/parent', - * lazyLoad: () => System.import('./lazy.states.js') + * lazyLoad: () => import('./lazy.states.js') * } * ``` * diff --git a/yarn.lock b/yarn.lock index 16c85a0a..caaaed3e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4033,9 +4033,9 @@ rollup-pluginutils@^2.0.1, rollup-pluginutils@^2.8.1: estree-walker "^0.6.1" rollup@^1.15.5: - version "1.27.14" - resolved "https://registry.yarnpkg.com/rollup/-/rollup-1.27.14.tgz#940718d5eec1a6887e399aa0089944bae5c4f377" - integrity sha512-DuDjEyn8Y79ALYXMt+nH/EI58L5pEw5HU9K38xXdRnxQhvzUTI/nxAawhkAHUQeudANQ//8iyrhVRHJBuR6DSQ== + version "1.28.0" + resolved "https://registry.yarnpkg.com/rollup/-/rollup-1.28.0.tgz#d576a6a0fd7490b2e1f531ef8b411795fb80da87" + integrity sha512-v2J/DmQi9+Nf6frGqzwZRvbiuTTrqH0yzoUF4Eybf8sONT4UpLZzJYnYzW96Zm9X1+4SJmijfnFBWCzHDAXYnQ== dependencies: "@types/estree" "*" "@types/node" "*"