- Run tests with jest's ESM support. Remove esbuild-jest transform
- Fix default exports when library is being consumed from CommonJS. More info at https://esbuild.github.io/content-types/#default-interop
- Bring back package.json exports field
- Pivot node: Do not reset expansions on pause mutations
- Revert package.json exports field
- Misc fixes and cleanup
- Format source with prettier
- Use yarn instead of npm
- ESM source
- Use esbuild instead of webpack/babel to build before publishing
- Pivot node: Do not remove root node when present in
selectedRows
when checking which selected rows should remain
- Pivot node: Do not reset expansions when the filters are changed (that only affects other nodes)
- Pivot node: Add new field
selectedRows
. Clear as neededselectedRows
when theexpansions
array and/or query results are changing
- Pivot node: fixing issues with sorting and result merging
- Pivot node: New
expansions
array forcolumns
androws
withdrilldown
andloaded
- Migrate tests to jest
- New feature: new per-node hook
onSerialize
allows users to customize tree nodes as the tree is being serialized
- Pivot node: new
pagination
logic withdrilldown
andskip
- Pivot node: renaming groups to rows and deprecating the flatten flag
- Pivot node: reset the drilldown on tree mutations
- Pivot node: removing subtotals flag as it was deprecated in ES
- Add
isStale
, sugar formarkedForUpdate || updating
- Node flags
isStale
,markedForUpdate
, andupdating
are now properly set at the group level as whether any of their children have them set - Deprecated undocumented internal
flat
tree, will remove in next version - Remove unused
default
type support watchNode
now supports nested paths (e.g.context.something
) and empty keys array- Actions now recieve a full
TreeInstance
instead of just action props
- Add
watchNode
- Pivot node: add missing reactors and defaults
- Pivot node: merging new response object format
- Fix: Pivot node: deep merging for groups and columns
- Fix: Pivot node: merging columns on drilldown response
- Pivot node: support for columns field
- Fix: Use
snapshot
ontypeDefaults
instead of_.deepClone
to fix regression from2.38.0
for real world apps that end up with observabletypeDefaults
- Better
pivot
mergeResponse
implementation that merges groups by key - Move from
futil-js
tofutil
- Pass
snapshot
intomergeResponse
to avoid a mobx bug
- Add node validation for
pivot
groups - Add self reactor for a
pivot
nodedrilldown
property
- Add support for type specifc
onDispatch
, called when an event is dispatched with a target node with the corresponding type - Add
pivot
onDispatch
which setsforceReplaceResponse
when certain keys are mutated. - Pivot response merge - calls
F.mergeAllArrays
on context, which may be a generic answer to response merges.
- Update pull-request workflow to better catch test failures
- Per type response merges via
shouldMergeResponse
andmergeResponse
- allows types to retain the response state between search calls to cleanly support things like inifinite scrolling and drilldowns. Will automatically always force response replacement when updated by others (since the query has likely changed, invalidating prior responses). This is tracked by a newforceReplaceResponse
internal state flag per node. - Leverages response merge feature to implement
infiniteScroll
forresults
(just setinfiniteScroll
to true andmutate
increments topage
!) - Fix: Always
_.deepClone
defaults on node init to prevent accidentally mutating type defaults - Cleanup: swap custom mutable mergeWith with extend
- Cleanup: remove references to results.context.response (since we no longer wrap results in response)
- Add
pivot
type
- Updated CI to use node16 and npm7
- Updated package-lock.json to version 2
- Fix: debouncing updates with path independently
- Debounce for immediate updates is set to 1 ms
- Fixing logic filterOnly flag for serialized tree
- Subquery: making whole targetTree to await for sourceNode
- Immediate updates are now debounced 10ms (which happens on self affecting reactors when disableAutoUpdate is true)
- Silencing updates from changes with no value
- This removes unnecessary tree update when switching from exact to rolling
- Changed over CI from CircleCI to Github Actions
- Self affecting dispatches updating only themselves when disabling auto update
- This is achieved by making
triggerUpdate
optionally take apath
- Provides a significant performance improvement as large tree no longer need to be updated entirely when small parts of them change in isolation.
- This is achieved by making
- This has no breaking api changes
- Refactoring to simplify code (preparing for larger updates)
- Also fixes a bug when the
standardChange
reactor should returnall
, but wouldn't have
- set default date.range to 'exact'
- set default context.results to [] for
tagsQuery
- Update
tagsQuery
reactors toall
to support showing counts on tags
- Update subquery node reactors to
all
- Update savedSearch node reactors to
all
- Remove logic that marks and deletes a
filterOnly
node with no value
- When
disableAutoUpdate
istrue
triggering updates immediately instead of debouncing them
- Add the dateRangeFacet type.
- Support changes to
date
type.
- Fix exampleTypes validateValueExistence to be an actual function
- Add a fallback in the unlikely chance a tagsQuery tags property isn't an array or doesn't exist
- Add the basic validate values function on some example types which didn't previously have a validate function
- Fix a typo "udpated" in a node resolve catch block log
- Fix an issue updating the target search from a subquery
- Add
processResponseNode
to support intermediate partial results from the server
- Add
debugInfo.dispatchHistory
to the tree - Add
metaHistory
to individual nodes - Add ability to override the debug log function (needed for tests)
- Add
clear
tree action tests
- Call
initObject
onTreeInstance
. In the mobx case, this should allow observing tree instance properties likedisableAutoUpdate
- Handle better empty values in sourceTree with subQuery
- Add custom autoKey function for terms_stats type (uses
key_field
andvalue_field
instead offield
)
- Expose additional properties on tree instance:
flat
,snapshot
,extend
,types
,initNode
,initObject
- Add automatic generation and deduplication of default node keys during tree init and
add
action - Add support for
autoKey
type property to specify type-specific autokey functions
- Await
processResponse
to normalize the tree post service exception
- Update
replace
action to support taking a transform function as an argument
- Add
onError
event to be triggered on service exception
- Add
_.toArray
to actions to handle ObservableArray paths
- Set defaults for geo location and radius
- Fix bug with replace not inserting at the right index with mobx
- Add nested pause actions (pauseNested, unpauseNested, isPausedNested)
- Add move action
- Add wrapInGroup action
- Add replace action
- Support nested add, nested remove, add at index
- Add
initObject
config support - Entire test suite is now run against both the native JS and mobx client
- Serialize a node's
paused
field
- Add
clear
action to reset a node's value to its defaults
- Add
value
reactor formongoId
example type
- Add missing defaults for
subquery
andsavedSearch
example types.
- Add
subquery
andsavedSearch
example types.
- Fixed deep bug: afterSearch should be called at the moment we receive new values. This would cause nodes previously marked for update to not call afterSearch because these nodes weren't marked by the current dispatch.
- Added validate function to
geo
example type
- Added defaults and reactors for
text
'soperator
. - Added
tagsText
, which is just like text but supports an array of values. - Added default and reactor for
tagsQuery
'sexact
flag.
- Added a default
filter
property in theterms_stats
type.
- Added a
self
reactor toterms_stats
's filter property.
- Added self reactor for
findBestRange
onnumber
type
- Facet should have mode 'include' by default.
- Make sure that afterSearch hook is called after triggerUpdate has executed.
- Add defaults and more reactors for geo type.
- Add subQuery/getValues support for terms_stats type.
- Duti upgrade.
- Add twoLevelMatch/matchStats reactor of self for key_value field.
- Fixed an issue when mutating groups would return an observable array that we wouldn't be able to parse.
- Republish 2.13.5 which was published manually without building.
- Fix bug preventing nodes without contexts from being marked as no longer updating.
- Fix error with mobx 4 usage where event path itself is an observable.
- Fix error when the entire tree is a mobx 4 observable by using snapshot in affectsSelf check
- exampleType's subquery option has to be lowercase.
- Added subquery.useValues to the mongoId type.
- Small fix for MobX 4. Just making sure that observables are not used for comparing paths.
- Add tagsQuery example type
- Catch case where unsolicited node responses from the service for nodes that have never been updated explode because of missing upatingPromise (but still log in debug mode)
- Update mobx tests to use mobx 5
- Added
onUpdateByOthers
hook and update results example type to use it
- Added
disableAutoUpdate
andtriggerUpdate
action
- Added
subquery
for piping search results from one node into the input of another - Added
subquery.getValues
andsubquery.useValues
support for client types - Allow
onChange
andonResult
to be changed at runtime on the tree instance (before, it was only settable in initial config) - Added
onMarkForUpdate
andafterSearch
hooks - Fixed bug on
markForUpdate
that replaced promises before fulfillment
- Fix bug that incorrectly marked siblings for update if they were in nested groups.
- Add
updatingPromise
to nodes which can be used to await nodes being updated (planned for subquery/cascade use case)
- Added more example types.
- Make sure type has a default (undefined) and field has a default in relevant example types.
- Add missing example type terms_stats
- Add missing example type defaults
- Expose
mockService
as a top level export
- Ensure
mockService
is accessible fromsrc
- Expose
addActions
to enable extending the client with new actions that have the same access levels as first party ones. - Expose
addReactors
which allows extending the client with new reactors. - Expose
Tree
,encode
,decode
,hasValue
, andhasContext
utils.
- Fix defaults for facet and results
- Add more reactors across many example types
- Stamp
type
on example-types
- Account for core returning an empty data object
- Deprecate wrapping responses in
data
, will be removed in 3.0
- Added more example types (
bool
,exists
,date
,geo
,dateHistogram
) - Add support for default properties on node types
- Add default contexts for
facet
andresults
- Added lens
- Made the mutate action to be curried
- Defined a default debounce time
- Added a comment about onChange on the readme.
- Initializing all the custom properties as null when creting a new client.
- Using extend on all the custom properties that are added on the tree and not at the serialize level.
- Removed allowBlank.
- Allowing types to have init functions that can extend each node.
- Added an optional onChange function that gets called as soon as the extend function gets excecuted. It gets called with the node's path, the node and the changes received.
- Removed defaultHasValue and added a validate function to each of the example types.
- Cleaned up the code after the changes to have a single initialize function for each and every node, and also removed data even from the tests.
- Fix facet reactor for
optionsFilter
(was incorrectly namedfilter
)
- Implemented a refresh action.
- Exposed exampleTypes
- Removed the default group reactor that listened to children changes.
- Added some example types
- Fixed bug with nested custom reactors.
- Fixdd bug with the mergeOn used by processResponse that was causing mobx arrays to mix old and new values instead of replacing them.
- Rename
only
reactor toself
- Small internal tweaks and documentation updates
- First pass at some real documentation
- Add decoded
path
to each node - Breaking change Simplified initial api from
(tree, service, types, config)
to moving service and types into config as the first param and currying.
Replace every call like this: ContextTree(tree, service, types, {...config})
with a call like this: ContextTree({service, types, ...config}, tree)
- Add support for custom type specific reactors, eliminating the need for data/config (which the server flattens anyway)
- Fix serialization to never include contexts
- Fix onResult not to be called if there was no context response
- Default validation function is now stubTrue
- Added internal mocks utility
- Drop stale updates
- Add
onResult
api (mainly for use in test above)
- Remove unused subscribe API Note Normally this would be a breaking change, but it was undocumented.
- Made mutate a first class dispatchable event to avoid multiple dispatches
- Separated
defaultTypes
out toexampleTypes.js
Note Since the public API did not change, this is not a major version release - but these changes should result in substantially improved performance.
A big theme was realizing that the edge case of async validation messing up in-progress dispatches is not actually possible in JS since it is single threaded - and even if it was, we don't snapshot the actual data/config values anyway.
- Removed almost all internal snapshotting (except serialization) by ignoring non-existant race conditions
- Validation now runs only 1 time per dispatch and stamps on group nodes (simplifying the API)
- All reactor processing and search blocking is now synchronous and have had their APIs radically simplified
- Removed all explicit knowledge of path encoding, instead using a single function
- Removed tons of custom code in favor of generic flat tree methods (originally extracted from this repo)
- Paths are no longer stamped on nodes (side effect of using a more generic method)
- Encoded path delimiter changed from
->
to/
- flattenTree fix for nodes that already have a path.
- package.json description and formatting thanks to Duti.
- Added babel-plugin-transform-runtime.
- MobX support and tests.
- Add CI stuff
- Initial release