- Publish ES2015 code in the ESM bundle rather than compiling down to ES5. This should not be a breaking change since builds would need to be ES2015-compatible to understand
import
/export
statements already, but publishing as a minor version to be safe.
- Fix bug where
connect
threw errors when wrapping arrow function components.
- Fix bug where useStoreDependency could return stale data, prevent expensive derefs from being called multiple times.
- Revert
connect
to a class component to let React handle diffing the internal state
- Attempt another equality fix for infinite re-render cases
- Implement deeper equality check and test suite for array-based dependencies.
- Fix dependency map values not being passed as second argument to
deref
when usingconnect
.
- Fix missing falsy check in new
shallowCompare
function
- Fixed a regression in the 4.x release channel that would cause
connect
ed components with dependencies returning plain JS arrays (Immutable.jsList
s were unaffected) to create an infinite update loop. (#88)
- Publish useful TS and Flow types. Previously the TS types weren't very useful - all output was typed as
any
. Now, General Store can follow and infer types from your dependencies all the way through to their output, either as props or in hooks, and properly type their return values! connect
is now a thin wrapper arounduseStoreDependency
and was rewritten as a functional component. This allowed us to reduce bundle size by nearly 50% while also increasing the runtime performance ofconnect
. This also implicitly removes all usages of unsafe React lifecycles, ensuring forward compatibility and safety within concurrent mode.connect
now hasforwardRef
support, so passing aref
to aconnect
ed component properly passes the ref onto the inner component. Functional components can now be connected withforwardRef
with more predictable behavior. This is potentially a breaking change.- The library's entry module is now an ESModule rather than a CommonJS module to enable better treeshaking. This is potentially a breaking change.
- Fix significant performance bottleneck in
shallowCompare
(#84 / #86)
- Fix shallowCompare function when one or both inputs is falsy.
- Fix potential infinite loop with Immutable dependency values (#74)
- Use
UNSAFE_
prefix forcomponentWillMount
,componentWillReceiveProps
usages inconnect
HOC.
- Externalize
hoist-non-react-statics
from CJS and ESM bundles.
- Removes the following APIs
StoreDependencyMixin
connectWithState
- Adds a
useStoreDependency
hook for use withreact@^16.8.0
. prop-types
added as a peer dependency as it has been removed from the main React package- Migrated from Flow to TypeScript
- Support React 16.x by using hoist-non-react-statics@2.5.0 (without
ForwardRef
support)
- Stores created with
GeneralStore.define()
supportdefineName
- Fixes the function as the latest version of the extension uses
unsubscribe
instead ofdisconnect
.
- Adds the ability to use the Redux Devtools Extension to inspect the state of stores.
- fixes the name that developer tools show for wrapped components that don't have displayName attributes (eg
Connected(undefined)
is nowConnected(BaseComponent)
)
connectWithState
no longer exports invalid propTypes
connectWithState
wraps a normalconnect
in a state container to fill theStoreDependencyMixin
use case #55
- connect adds a
focus
method that calls through toBaseComponent.focus
- connect adds a static
dependencies
field to the connected component - connect adds a static
WrappedComponent
field mirroring react-redux
- Fix a potential bug in connect/StoreDependencyMixin that could cause an exeption in
componentWillUnmount
- Component generated by
connect
inherits propTypes unrelated to the store dependencies from the BaseComponent
- exports
connectCallback
from the index module
- adds
InspectStore.isStore
- adds
connectCallback
for subscribing to dependencies outside of React - consolidate some invariant checks into shared functions
- adds
StoreFactory#defineName
- adds
Store#toString
- adds
GeneralStore.InspectStore
for examining internal state of a store - removes
Store#getActionTypes
- removes
Store#getDispatcher
- removes
Store#getDispatchToken
- removes
Store#getFactory
- removes
Store#getID
defineGetInitialState
allows redefinition for your testing convenience
connect
transfers static properties/methods from theBaseComponent
to theConnectedComponent
- upgrade to
flow-bin@0.28.0
and accompanying type fixes
- FIX: resolves a bug in
StoreDependencyMixin
where state wasn't passed through incomponentWillReceiveProps
#46
- FIX: throw if more than one
StoreDependencyMixin
is detected on a component #45
- FIX: make sure
connect
is actually exported!
- FIX: throw if no dispatcher is specified
- BUILD: rearrange the dist/lib folders to match other HubSpot projects
- FIX: #26 by making each dependency a dispatch handler
- NEW: higher order component decorator for store dependencies
- PERF: optimizes derefs according to the arity of the deref function
- PERF: optimizes updates by only recalculating if the actionType affects them
- REMOVE: internal "shouldComponentUpdate" type filters
- REMOVE: support for multiple StoreDependencyMixins in the same component
- NEW: support flux standard actions #43
- NEW: compound fields can specify propTypes
- NEW: GeneralStore.defineFactory() allows for more composable/testable stores
- added StoreFactory
- StoreDefinition -> StoreSingleton
- StoreSingleton is based on StoreFactory
- StoreFacade -> Store
- dependency updates (flow 0.16)
- fix "define" function conflict with ES6 modules and GeneralStore.define
- disable the eslint "indent" rule because its breaking the build
- immutable-is: pull in a copy of Immutable.is() instead of trying to sideload immutable itself
- transpile with babel
- build with webpack
- Dont throw from
DispatcherInstance.get()
(still throws fromStoreFacade.register()
)
- remove a duplicate argument name breaks babel
- BREAKING (for non-FB-disapatcher users): adds calls to
dispatcher.waitFor()
anddispatcher.isDispatching()
- BREAKING:
deref
no longer receives a default object forstate
if the actual state is falsey - dedups
setState
for fields with dependencies on multiple stores - dedups
setState
across mixin instances - dedups
setState
for stores with common action responses
- StoreDependencyMixin: fix a bug when using multiple mixins on one component
- StoreDependencyMixin: update fields based on props in
componentWillReceiveProps
- StoreDependencyMixin: update fields based on state in
componentWillUpdate
and be sure to merge withnextState
- compound fields: the
store
property is nowstores
and requires anArray<StoreFacade>
- compound fields: the
deref
property is required - compound fields: the
deref
function now receives anArray<StoreFacade>
as its thrid argument instead of a singleStoreFacade
- invariant exceptions are thrown in the production build
- more verbose errors with helpful links
- strip verbose errors in the production build
- allow succint registering of one response to multiple actions
- first usable alpha