Releases: 92green/dataparcels
Releases · 92green/dataparcels
Version 1.0.0 🎉
Contains #233 #245 #248 #249 #251 #256
Addresses #235 #236 #239 #241, #246, part of #242, #254 #255
dataparcels
Size of default import was 13.1KB
, now 10.3KB
(21% decrease)
- BREAKING CHANGES
- Removed
parentParcel.toObject()
- Removed
parentParcel.set(key, value)
(parcel.set(value)
still exists) - Removed
parentParcel.update(key, updater)
(parcel.update(updater)
still exists) - Removed
parentParcel.delete(key)
(childParcel.delete()
still exists) - Removed
parentParcel.setIn()
completely - Removed
parentParcel.updateIn()
completely - Removed
parentParcel.deleteIn()
completely - Removed
parentParcel.insertAfter(key, value)
(childParcel.insertAfter(value)
still exists) - Removed
parentParcel.insertBefore(key, value)
(childParcel.insertBefore(value)
still exists) - Removed
move()
completely - Removed
elementParcel.swap(otherKey)
(parentParcel.swap(keyA, keyB)
still exists) - Removed
parentParcel.swapNext(otherKey)
(elementParcel.swapNext()
still exists) - Removed
parentParcel.swapPrev(otherKey)
(elementParcel.swapPrev()
still exists) - Removed
shape.toObject()
- Removed
shape.move()
completely - Removed
swap()
completely - Removed
swapNext()
completely - Removed
swapPrev()
completely - Removed
changeRequest.toJS()
- Removed
action.toJS()
- Removed
- BREAKING CHANGE remove
ParcelShape
andasShape
- Use
asNode
andasChildNodes
instead
- Use
- Added
dataparcels/asNode
for changing meta easily in an updater - Added
dataparcels/asChildNodes
- Added
dataparcels/ParcelNode
- Added
ChangeRequest.hasDataChanged(keyPath)
- Temporarily disabled runtime type checking
- Stopped showing warning about not changing shape in a value updater
react-dataparcels
- fix: issue where debounced buffer hooks didnt rebase properly
- fix: upgrade unmutable to fix useParcelBuffer infinite rerender NaN bug
- Add
asyncValue
for loading an initial value intouseParcelState
anduseParcelForm
using promises - Add
asyncChange
for saving data asynchronously from calls touseParcelState.onChange
- Add
onChangeUseResult
option touseParcelState
- Add
react-dataparcels/asNode
- Add
react-dataparcels/asChildNodes
- Add
react-dataparcels/ParcelNode
- Added ability for
useParcelState
anduseParcelForm
to accept parcel updaters as their values. This allows previous values to be accessed, and allows meta to be set from props or set based upon previous data. - add:
rebase
option onuseParcelState
anduseParcelForm
- this will allow changes from props to slide in underneath changes in useParcelBuffer hooks and ParcelBoundaries, so data can change without losing unsaved changes.
- add: post-sideeffecthook changes now rebase underneath buffered changes
- almost more of a fix than a feature... this allows changes made after a
submit()
to not get replaced once a promise returned byonSubmit
resolves. Only affects cases whereonSubmitUseResult
is not used. IfonSubmitUseResult
then replacing the value is the right behaviour.
- almost more of a fix than a feature... this allows changes made after a
Fix for useParcelForm beforeChange
Non-arrays can now be passed
Fixes for ParcelBoundary debounce and ParcelDrag input focus
react-dataparcels
- fix:
useParcelBuffer
should debounce even whenbuffer
param is explicitly set tofalse
. - No breaking changes
react-dataparcels-drag
- fix:
react-dataparcels-drag
should never have hocked in a render method. Fixes bug where hoc remounts ever render, which throws focus off of inputs as you type. - No breaking changes
useParcelForm.onSubmit()
Addresses the first half of #123
dataparcels
- Fix issue where change requests's cache wasn't being reset by
dispatch()
when it should - Refactor to remove
_lastOriginId
, replace with more genericframeMeta
- frameMetas job is to hold data that should only exist until the next change occurs (the current parcel frame). lastOriginId requires that same data lifespan.
- lastOriginId was a concept that only react-dataparcels was interested in, and probably shouldnt have been put in plain dataparcels
- No breaking changes
react-dataparcels
- BREAKING CHANGE useParcelForm's API has had some renaming
useParcelForm onChange
is nowuseParcelForm onSubmit
useParcelForm onChangeUseResult
is nowuseParcelForm onSubmitUseResult
useParcelForm
's returnedonChangeStatus
is nowsubmitStatus
- The reason is because the action is being referred to as submit everywhere else. Even the function that triggers the submit is called "submit". This was called onChange, because from the point of view of the internal useParcelState hook it is just a "change", and that variable name just flew out the window but the name should really reflect how its used
- refactor to use frameMeta to set and get lastOriginId
- refactor that added ability for
useParcelBuffer
(and thereforeuseParcelForm
) to rebase changes whenframeMeta.mergeMode === "rebase"
- This will be used by rekey to rebase changerequests onto values that have updated
- Not part of public API yet
useParcelForm Request state
Addresses a missing piece of #181
react-dataparcels
- BREAKING CHANGE
ParcelBufferControl
class removed.useParcelBuffer
,ParcelBoundary
anduseParcelForm
all now return an identically shaped object in its place. This requires no code changes if you are not using theParcelBufferControl
named export. - Added request state info to
useParcelForm
#181useParcelForm.onChange
can already deal with promises and can handle what happens when they resolve and reject. Not passing the current state of the promise out of the hook would lead to people having to wrap their promises in something that can keep state based off of each promise,
so much better to include that functionality natively and have it test covered and standardised.- You probably wouldnt bother using it if you have some other thing like enty or async data stored in redux
useParcelForm with promises, revertable changes, drag with render props
react-dataparcels
- BREAKING CHANGE
useParcelBuffer
now submits when buffer is empty- before, calling submit on an empty buffer did nothing, but this makes it very difficult to resubmit, and considering how easy it is to cancel a change based on whats in it (i.e.
changeRequest.hasValueChanged()
) then changing this behaviour makes it easier to use in general
- before, calling submit on an empty buffer did nothing, but this makes it very difficult to resubmit, and considering how easy it is to cancel a change based on whats in it (i.e.
- Add ability for
useParcelForm()
onChange
to return promise, and changes are halted until resolve- subsequent submits are queued behind pending
onChange
- rejected
onChange
s are retried if other changes are submitted before allonChange
s complete - if final
onChange
rejects, the ChangeRequest is pushed back down into the parcel buffer so editing can continue seamlessly - added an internal
useParcelSideEffect()
hook to do all the above
- subsequent submits are queued behind pending
- Add
useParcelForm()
onChangeUseResult
option, so that the result ofonChange
can set the value inuseParcelForm()
state
react-dataparcels-drag
- BREAKING CHANGE
react-dataparcels-drag
is used as a render props component rather than as a hoc. See docs for details on how to upgrade.
Hooks, validation finalisation, new docs
Addresses #196 #204 #215 #205 #213
Hooks are finally here!
dataparcels
- BREAKING CHANGE Validation
Validation
renamed tovalidation
to match all other function exports- now exports a ParcelValueUpdater function rather than
{modifyBeforeUpdate: Function}
- now sets top level
meta.invalidList
- now doesnt validate until first attempted submit like most forms do
- now blocks submit when used with
useParcelForm
anduseParcelBuffer
- Boundary splits are temporarily disabled, see dfcbd89
- add
Parcel.onChangeDOMCheckbox()
#196 - add
Parcel.spreadDOMCheckbox()
#196 - use
Object.is()
inChangeRequest.hasValueChanged()
soNaN
s are accurately tested for equality
react-dataparcels
- add
useParcelState
hook (similar to ParcelHoc) - add
useParcelBuffer
hook (similar to ParcelBoundaryHoc) - add
useParcelForm
hook (new hook to provide pre-build form-like behaviours) - BREAKING CHANGE ParcelBoundary is now made out of
useParcelBuffer
debugBuffer
is gonedebugParcel
is goneonCancel
is goneonRelease
is gonemodifyBeforeUpdate
is deprecated, superseded bybeforeChange
, now accepts non-array functions- 2nd argument of childRenderer now gives a
ParcelBufferControl
, not aParcelBoundaryControl
ParcelHoc
andParcelBoundaryHoc
are deprecated- You're better off making an ad-hoc hoc out of the hooks you want
dataparcels-docs
Validator rule function receives topLevelValue
- Give validators on fields at any depth access to the top level value
- No breaking changes
Fix bug with modifyDown()
Originally done to be safe, modifyDown() was removing child data
so that the value returned from modifyDown()s updater and the existing
child data would be guaranteed to fit together. But given that
modifyDown() makes the end user (dev) promise not to change the shape,
then retaining child data is actually safe, as is more expected behaviour
Validator, modifyBeforeUpdate, ParcelBoundaryControl
Addresses #95, #100, #153, #183, #187, #188, #189, #198, #199
dataparcels
Validation
- add
dataparcels/Validation
#183
Updater arguments
- BREAKING CHANGE
modifyDown()
,update()
andmodifyUp()
updaters are no longer passed Parcel as second argument. - add:
modifyUp()
updater is now passed ChangeRequest as second argument - add:
modifyUp(shape())
updater is now passed ChangeRequest as second argument
Parcel and ParcelShape methods
- BREAKING CHANGE:
Parcel.toConsole()
is removed - add
Parcel.map()
#199 - add
Parcel.metaAsParcel()
#198 - add
ParcelShape.map()
#199
Shape updater API alignment
- BREAKING CHANGE:
ParcelShape.updateShape()
has been removed- use
ParcelShape.update(shape(updater))
orParcelShape.update(key, shape(updater))
instead
- use
- BREAKING CHANGE:
ParcelShape.updateShapeIn()
has been removed- use
ParcelShape.updateIn(keyPath, shape(updater))
instead
- use
ChangeRequest and Action API refinement
- BREAKING CHANGE:
ChangeRequest.updateActions()
is removed #189 - BREAKING CHANGE:
ChangeRequest.changeRequestMeta
is removed #189 - BREAKING CHANGE:
ChangeRequest.setChangeRequestMeta()
is removed #189 - BREAKING CHANGE:
ChangeRequest.actions()
is nowChangeRequest.actions
#189 - BREAKING CHANGE:
ChangeRequest.toConsole()
is removed #189 - BREAKING CHANGE:
Action.isValueAction()
is removed #189 - BREAKING CHANGE:
Action.isMetaAction()
is removed #189
ParcelBoundaryControl
- BREAKING CHANGE:
ParcelBoundary childRenderer
3rd argument "buffered" is moved to 2nd argument under a key ofbuffered
#187 - BREAKING CHANGE:
ParcelBoundaryHoc childProps ${name}Actions
is renamed toParcelBoundaryHoc childProps ${name}Control
#187 - BREAKING CHANGE:
ParcelBoundaryHoc childProps ${name}Buffered
is removed- Can be found on
ParcelBoundaryHoc childProps ${name}Control.buffered
#187
- Can be found on
Flow types
- Fix flow types for
ParcelShapeUpdater
/ParcelShapeUpdateFunction
Logging
- add: logging only works on production builds
Perf
react-dataparcels
- BREAKING CHANGE Remove
ParcelBoundaryHoc.originalParcelProp
- Use
${childProp}Control.originalParcel
instead
- Use
- BREAKING CHANGE rename
keepState
tokeepValue
and amend its behaviour - Add
ParcelHoc.config.modifyBeforeUpdate
- Add
ParcelBoundary.props.modifyBeforeUpdate
- Add
ParcelBoundaryHoc.config.modifyBeforeUpdate
- more work will be done to bring bundle size down. If you have dead code elimination in your build process then you should not receive any logging code.
- add
ParcelBoundary.props.onRelease
andParcelBoundary.props.onCancel
- add
ParcelBoundaryHoc.config.onRelease
andParcelBoundaryHoc.config.onCancel
dataparcels-docs
- Add Validation, shape, CancelActionMarker to API docs
- Add all examples and info necessary to finish the UI Behaviour page