Releases: vigetlabs/microcosm
Version 7.1.0
Noticeable changes
Microcosm::startwill 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
- 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
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()) // => FIZBUZZVersion 6.0.0
6.0.0 is the second effort to reduce the surface area of the Microcosm API.
- Removed
UpstreamandDownstreammixins. They used the undocumented context API and introduced some complexity in testing Microcosm::sendis nowMicrocosm::pushMicrocosm::pushis nowMicrocosm::replaceMicrocosm::dispatchandMicrocosm::commitare now private. These are important methods that should not be overridden
Version 5.2.0
Microcosm::pullaccepts 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
- Fix build process mistake :-/
Version 5.1.0
- Removed fallback from
Microcosm::pullwhich returns all state - Added an
UpstreamandDownstreammixin, however it is experimental. More details will come as the feature develops. Microcosm::sendwill throw an error if given an undefined action parameter
Version 5.0.0
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::seedtoMicrocosm::push - Renamed
Microcosm::gettoMicrocosm::pull - Removed
Microcosm::has - Removed
Microcosm::getInitialState. theStoreAPI 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::resetto `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'sshouldComponentUpdateas the single responsibility for this task. - Added
Microcosm::toObject - Internal function
mapByhas been renamed toremap. It now operates primarily upon objects. Microcosm::pumpis nowMicrocosm::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
- 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. Callingstart()will bootstrap initial state, run all plugins, then execute a callback.
Version 3.3.0
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.
mapByinternal function now accepts an initial value- Changed
Microcosm::dispatchcopy 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.