Skip to content

Latest commit

 

History

History
174 lines (95 loc) · 11.8 KB

changelog.md

File metadata and controls

174 lines (95 loc) · 11.8 KB

Fix: only call canLeaveState on states that are going to be destroyed, not the ones that are going to get created.

Fix a bug that could cause canLeaveState to be called twice. #155

Add canLeaveState to addState, so you can implement route guards to prevent people from navigating away from a state if they e.g. have unsaved state. #154

Support passing in a null state name to stateIsActive.

Fixes an issue where when a state was destroyed and resolved during the same state change, the result of its resolve function would get tossed out.

Removes the concept of resetting states.

The concept of resetting breaks down if your component library doesn't support

  • slots
  • resetting the state of a component without resetting the contents of slots

For renderers that "reset" states by destroying the existing component and re-constructing it, stuff would break in any case where a parent and child state were both told to reset at once. Whenever the parent would reset and destroy its part of the DOM, the child would get wiped out.

Existing renderers don't need to change to work with this version of ASR, it's just that their reset function won't get called any more.

The beforeResetState and afterResetState should not be fired any more.

  • Coerce parameter values to strings for comparison in stateIsActive #151
  • Give an explicit/useful error message if you forget to add a ui-view element to a parent template #148
  • maintenance: update a bunch of dependencies #141
  • maintenance: autoformat the scripts to make myself feel better and reduce commit noise in the future #145
  • breaking: dropped ES5 support. If you're targeting ES5 you'll need to compile it in your own app's build.
  • feature: allow dynamic parameter defaults via functions #144
  • feature: added getActiveState method #121
  • maintenance: added a bunch of files to the .npmignore to reduce the package download size
  • bug fix: update the hash-brown-router dependency to fix an issue where calling evaluateCurrent('somestate') wouldn't do anything when somestate's route was / and the current url was also /. Issue #116 in abstract-state-router, commit #56c207f0 in hash-brown-router. If you're passing in your own hash-brown-router instance, make sure to update it to 3.3.1 to avoid the bug.
  • bug fix: point package.main at the ES5 bundle instead of the ES2015 code :-x 34ea0baa
  • bug fix: fixed a crash that would happen if you didn't pass an options object in 3b60669b
  • dependency update: changed hash-brown-router dependency from ~3.2.0 to ^3.3.0 a593408b
  • Promise and Object.assign polyfills are now required for older browsers
  • refactor: updated all the source code to ES2015 (though the published version is still compiled down to ES5)
  • functional: stateChangeStart and stateChangeEnd events now also emit the full array of states being transitioned to. #113
  • documentation: added a table of contents to the API section of the readme #111
  • drop dependencies on the process and events polyfills and bump hash-brown-router dependency, saving about 25KB
  • documentation: fixed a requre/require typo #103
  • documentation: added "inherit" to the documented go() options #104
  • documentation: in the rendered docs, fixed the link to the ractive example source code 8511b651
  • updated hash-brown-router to 3.1.0, making the / route equivalent to an empty route string #102
  • updated hash-brown-router #93
  • compatibility: switched from require('events').EventEmitter to require('events') for better Rollup compatibility. c861f5ab
  • functional: renderers may now return a new DOM API from the reset function. c07a45fb
  • bug fix: empty strings in default parameters would cause the state router to stop cold without any error message #2abf9361
  • functional: replaced the defaultQuerystringParameters property on states with defaultParameters, which applies to both querystring and route parameters. If you don't specify defaultParameters, defaultQuerystringParameters will be checked too (though it will now apply to route parameters as well). #91
  • functional: made stateName optional for go/replace/makePath #83
  • dependency update: require page-path-builder 1.0.3, fixing a path-building bug #650af6af
  • bug fix: stateIsActive was doing an extremely naive check #71
  • bug fix: makePath(stateName, params, { inherit: true }) now properly inherits route parameters during the render/activate phases #7617d74b
  • bug fix: fixed Webpack build by changing a JSON file to CommonJS #65
  • bug fix: states that had child states without routes weren't necessarily loading the correct child state when you browsed to them #85112c79
  • functional: added emitting events before and after calling every dom rendering function #54
  • functional: changed parameters objects passed to the DOM rendering functions to be mutable copies instead of being frozen