Skip to content

Releases: vigetlabs/microcosm

Version 7.1.0

30 Apr 12:51

Choose a tag to compare

Noticeable changes

  • Microcosm::start will return itself

Internal improvements

  • Replaced all uses of ES6 modules with CommonJS. This was causing
    issues in non-ES6 module projects.
  • Microcosm publishes as separate modules now. Ideally, this will make
    internal pieces easier to reuse and help with debugging.

Version 6.2.0

07 Apr 14:06

Choose a tag to compare

  • Microcosm's event system has been replaced with Diode. The APIs are the same. This should not lead to any breaking changes.

Version 6.1.0

02 Apr 19:30

Choose a tag to compare

Microcosm::pull can now accept an array of keys for the first argument. This will traverse the nested keys of state to calculate value. For example:

// assuming a data structure of { users: { slug: { name: 'fizbuzz' } }
app.pull(['users', 'slug', 'name'], i => i.toUpperCase()) // => FIZBUZZ

Version 6.0.0

02 Apr 18:22

Choose a tag to compare

6.0.0 is the second effort to reduce the surface area of the Microcosm API.

  • Removed Upstream and Downstream mixins. They used the undocumented context API and introduced some complexity in testing
  • Microcosm::send is now Microcosm::push
  • Microcosm::push is now Microcosm::replace
  • Microcosm::dispatch and Microcosm::commit are now private. These are important methods that should not be overridden

Version 5.2.0

01 Apr 15:11

Choose a tag to compare

  • Microcosm::pull accepts a callback that allows you to modify the result. This should help to make data queries more terse.
  • Removed Microcosm::clone, the functionality is not gone, but it has been internalized to mitigate the cost of future changes
  • Removed mixins from main payload to improve size

Version 5.1.1

31 Mar 23:43

Choose a tag to compare

  • Fix build process mistake :-/

Version 5.1.0

31 Mar 23:42

Choose a tag to compare

  • Removed fallback from Microcosm::pull which returns all state
  • Added an Upstream and Downstream mixin, however it is experimental. More details will come as the feature develops.
  • Microcosm::send will throw an error if given an undefined action parameter

Version 5.0.0

31 Mar 23:42

Choose a tag to compare

Version 5 represents an attempt to address some growth pains from rapidly adding new features to Microcosm. Names have been changed to improve consistency and internal APIs have been refactored. The overall surface area of the app has been reduced and more opinions have been made.

  • Renamed Microcosm::seed to Microcosm::push
  • Renamed Microcosm::get to Microcosm::pull
  • Removed Microcosm::has
  • Removed Microcosm::getInitialState. the Store API still provides this function, however it is the expectation of the system that value of state is a primitive object. This is so that Microcosm always knows how to smartly clone its state, regardless of if another data library is used for its values.
  • Removed Microcosm::swap, this was an internal API that is no longer required
  • Renamed Microcosm::reset to `Microcosm::commit
  • Removed Microcosm::shouldUpdate. If no stores respond to an action, a change event will not fire anyway. Placing this concern in the view layer keeps React's shouldComponentUpdate as the single responsibility for this task.
  • Added Microcosm::toObject
  • Internal function mapBy has been renamed to remap. It now operates primarily upon objects.
  • Microcosm::pump is now Microcosm::emit, this is to better match existing event emitter libraries (including the one in Node's standard library)

As an additional illustration, the Microcosm API has been logistically sorted within ./cheatsheet.md

Version 4.0.0

30 Mar 15:19

Choose a tag to compare

  • Added concept of plugins. Plugins provide a way to layer on additional functionality. This has specifically been added so that environment specific behavior may be added to an app.
  • Added Microcosm::start. Calling start() will bootstrap initial state, run all plugins, then execute a callback.

Version 3.3.0

30 Mar 12:54

Choose a tag to compare

This release tweaks the way transactions occur when an action is dispatched. Instead of non-destructively merging a change-set into the old state, it is now cloned. This should pave the way for future updates that provide undo behavior.

  • mapBy internal function now accepts an initial value
  • Changed Microcosm::dispatch copy strategy. Instead of merging a change set, it now directly modifies a clone of the previous state.
  • Added Microcosm::clone. This method defines how state is copied before dispatching an action.