Skip to content
Josh Duff edited this page Mar 2, 2018 · 12 revisions

Things I would like fixed in an eventual rewrite

  • all state structure passed in to state router once at construction - no addState method, no mutability
    • allow cycles in state dependencies - make child states not aware of their parents
    • throw errors at construction-time if a state doesn't have a parent
    • no data property on states
  • ability to lazy-load templates and activation functions
    • template/activate need to be able to be supplied by functions that return promises
  • more explicit transition hooks
  • route guards that fire when the user tries to navigate away from a state, and allow the code to stop the transition from happening
  • the ability to delegate to/call component methods instead of activate/guard/whatever methods passed in with the state object
  • server-side rendering: add optional "serverSideRender" function to renderer API
    • or... maybe just implement it in its own module that takes the same state array
  • support "not found" pages by just adding a * route
    • turn notFound event into a regular error
  • change the resolve function to take an arguments object instead of two ordered arguments before the callback
  • state transition events should always emit the full list of states being transitioned to (maybe even all the states being transitioned from) instead of just the leaf state. Essentially https://github.com/TehShrike/abstract-state-router/pull/113 but replace the first argument with the third argument.
  • require that a hash-brown-router location implementation always be passed in - don't include the hash one by default
    • don't force people to instantiate the hash-brown-router, just the location
  • stateIsActive should iterate over the full list of parameters that affect the state (its parameters and the parameters of its ancestors), instead of just the properties on the object that were passed in
  • drop the reset method of renderers
  • The ability to define placeholder components for states
    • maybe the ability to set a global placeholder component?

I'll add to this list as I think of stuff

Clone this wiki locally