Skip to content

Releases: vigetlabs/microcosm

v12.10.0

24 Aug 13:36
Compare
Choose a tag to compare
  • Microcosm ships with ES6 and UMD bundles
  • Domains and Effects can implement a defaults static object to
    provide default setup options.
  • Do not return undefined when using get to retrieve a null value
    without a fallback.
  • repo.append(action, state) should reconcile history

Version 12.9.0

25 Jul 18:12
Compare
Choose a tag to compare
  • Added new repo.parallel method. This returns an action that represents a group of actions processing in parallel.
  • The action generator form may now yeild an array. This produces the same behavior as repo.parallel
  • Presenter::getModel assignments accept Observables.
  • Do not warn in strict mode when attempting to change a complete action. This allows for use cases like, "Cancel this action, but only if it hasn't finished yet."
  • History and Action now serialize to JSON. This supports a new debugger.
  • Presenter:send now pushes to the instance of Microcosm for the Presenter that first sent the action. This prevents repo.state from being wrong for a subsection of an application with an action that needs to reference state.
  • Microcosm uses Flow. Flow definitions ship with the npm module.

v12.9.0-beta4: 12.9.0 Beta 4

13 Jul 22:29
Compare
Choose a tag to compare
Pre-release
Fixes an issue where multiple domain handler dispatches would
incorrectly apply new state.

v12.9.0-beta3: 12.9.0 Beta 3

13 Jul 22:30
Compare
Choose a tag to compare
Pre-release
- Add debug mode for devtools integration
- Fix case where nested presenters were called with the wrong scope

v12.9.0-beta2: 12.9.0 Beta 2

10 Jul 20:18
Compare
Choose a tag to compare
Pre-release
- Correctly invoke Presenter intercept handler with the Presenter as
  context.

v12.9.0-beta: 12.9.0 (beta)

10 Jul 16:37
Compare
Choose a tag to compare
Pre-release
- Added new `repo.parallel` method. This returns an action that
  represents a group of actions processing in parallel.
- The action generator form may now `yeild` an array. This produces
  the same behavior as `repo.parallel`
- `Presenter::getModel` assignments
  accept [Observables](https://github.com/tc39/proposal-observable).
- Do not warn in strict mode when attempting to change a complete
  action. This allows for use cases like, "Cancel this action, but
  only if it hasn't finished yet."
- History and Action now serialize to JSON. This supports a new
  [debugger](https://github.com/vigetlabs/microcosm-devtools).
- `Presenter:send` now pushes to the instance of Microcosm for the
  Presenter that first sent the action. This prevents `repo.state`
  from being wrong for a subsection of an application with an action
  that needs to reference state.
- Microcosm uses [Flow](flowtype.org). Flow definitions ship with the
  npm module.

v12.9.0-alpha: 12.9.0 Alpha

13 Jul 22:30
Compare
Choose a tag to compare
Pre-release
- Added new `repo.parallel` method. This returns an action that
  represents a group of actions processing in parallel.
- The action generator form may now `yeild` an array. This produces
  the same behavior as `repo.parallel`
- `Presenter::getModel` assignments
  accept [Observables](https://github.com/tc39/proposal-observable).
- Do not warn in strict mode when attempting to change a complete
  action. This allows for use cases like, "Cancel this action, but
  only if it hasn't finished yet."
- History and Action now serialize to JSON. This supports a new
  [debugger](https://github.com/vigetlabs/microcosm-devtools).

v12.8.0

16 Jun 16:49
Compare
Choose a tag to compare
  • The current repo is passed as the second argument of Presenter::getModel state key callbacks

Version 12.7.0

19 Apr 11:44
Compare
Choose a tag to compare
  • Remove PropType usage from addons to prevent React 15.5.x deprecation warnings.
  • Added configurable teardown method to the Microcosm prototype. This behaves similarly to teardown methods on other Microcosm classes.
  • Fixed a bug where the first action dispatched would always fire a change event, even if state didn't change.
  • The first argument of repo.push is passed into the open state of actions that return promises.
  • Action status changing methods are auto-bound, and will warn when a completed action attempts to move into a new state (strict mode only)
  • Added batch as an option when instantiating Microcosm. When set to true, high frequency change events will be batched together using requestIdleCallback. When not available, it falls back to setTimeout.

Auto-bound action status methods

Action status methods like action.resolve() and action.reject() are auto-bound. They can be passed directly into a callback without needing to wrap them in an anonymous function.

This is particularly useful when working with AJAX libraries. For example, when working with superagent:

Instead of:

import superagent from 'superagent'

function getPlanets () {
  return action => {
    let request = superagent.get('/planets')

    request.on('request', (data) => action.open(data))
    request.on('progress', (data) => action.update(data))
    request.on('abort', (data) => action.cancel(data))

    request.then((data) => action.resolve(data), (error) => action.reject(error))
  }
}

You can do:

import superagent from 'superagent'

function getPlanets () {
  return action => {
    let request = superagent.get('/planets')

    request.on('request', action.open)
    request.on('progress', action.update)
    request.on('abort', action.cancel)

    request.then(action.resolve, action.reject)
  }
}

12.7.0 Beta

17 Apr 12:29
Compare
Choose a tag to compare
12.7.0 Beta Pre-release
Pre-release

12.7.0-beta

  • Remove PropType usage from addons to prevent React 15.5.x deprecation warnings.
  • Added configurable teardown method to the Microcosm prototype. This behaves similarly to teardown methods on other Microcosm classes.
  • Fixed a bug where the first action dispatched would always fire a change event, even if state didn't change.
  • The first argument of repo.push is passed into the open state of actions that return promises.
  • Action status changing methods are auto-bound, and will warn when a completed action attempts to move into a new state (strict mode only)
  • Added batch as an option when instantiating Microcosm. When set to true, high frequency change events will be batched together using requestIdleCallback. When not available, it falls back to setTimeout.