New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WIP Release/strict swift #272
Open
dxinteractive
wants to merge
164
commits into
master
Choose a base branch
from
release/strict-swift
base: master
Could not load branches
Branch not found: {{ refName }}
Could not load tags
Nothing to show
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Replace keepValue with better solution for translating values
Because trying to assign to a property that has a getter has no effect, so the dev cant accidentally overwrite the getters, which was the main reason that these errors existed
Feature/api improvements
API improvements #2
Feature/action indexes
Previously the docs said parcelNode.update() would work with any updater type, but it was only working with straight values. Fixed this by using prepUpdater. Also moved out the logic to handle updating child nodes to the asChildNode file which should help keep bundle sizes lower
Feature/fix parcel node
Feature/clean up
Feature/modular types
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Contains #270, #273, #274, #276, #281, #282, #283, #284, #285, #287, #291, #292, #293, #295, #296, #298, #299, #300
Addresses #211, #264, #265, #266, #275, #277, #279, #280, #286, #289, #297
dataparcels
parcel.size()
is nowparcel.size
parcel.size
returns0
when called on parcels that aren't parents, instead of throwing an error likeparcel.size()
didparcel.isChild()
is nowparcel.isChild
parcel.isElement()
isremoveparcel.isIndexed()
is removedparcel.isParent()
is nowparcel.isParent
parcel.isTopLevel()
has been removed!parcel.isChild
if you need itparcel.isFirst()
is nowparcel.isFirstChild
parcel.isLast()
is nowparcel.isLastChild
parcel.spreadDOM()
is nowparcel.spreadInput()
parcel.spreadDOMCheckbox()
is nowparcel.spreadCheckbox()
parcel.onChange()
has been removedparcel.set()
insteadparcel.onChangeDOM()
has been removedvalue
andonChange
. But if you require this, you can useparcel.spreadInput().onChange
parcel. onChangeDOMCheckbox()
has been removedvalue
andonChange
. But if you require this, you can useparcel.spreadInput(). onChangeDOMCheckbox
parcel.map()
parcel.update(items => items.map(...))
insteadparcel.update()
,parcel.modifyUp
andparcel.modifyDown
now always pass entire parcel data (not justvalue
) and expect either undefined or an object optionally containingvalue
andmeta
. Themeta
is shallowly merged into existing meta.parcel.modifyUp()
now passes changeRequest key on first param, not as second paramparcel.modifyUp((value, changeRequest) => {})
becomesparcel.modifyUp(({value, changeRequest}) => {})
asRaw
, as this is now the default behaviour of all updatersasNode
, because normal updaters cover all its uses nowparcel.spy()
andparcel.spyChange()
parcel.modifyDown(({value}) => { /* side effect */ })
andparcel.modifyUp(({changeRequest}) => { /* side effect */ })
instead, returning nothingvalidation
, will replace with a better oneAction
, people shouldn't need to know this class existsParcelNode
is no longer exportedasChildNodes
is no longer exported#0
,#1
,#2
instead of#a
,#b
,#c
)parcel.update()
now rebases correctly, passing new data through the updater, instead of retaining the result of the first execution as it did before V2 - make update() perform an "update" and not a "setData" #285createUpdater()
to allow people to create and compose their own updater functionsparcel.isOnlyChild
Parcel.metaAsParcel()
to be passed the meta from the original parcel, and to pass changes to meta back to the original parceldataparcels/translate
to replace the functionality ofParcelBoundary
'skeepValue
prop but in a way that supports multiple input instances, keep co-dependent code logic together, and uses far less code.modifyUp()
can now return aneffect
that can be used to trigger one or more async changes in response to a change. They are called after the initial triggering change has taken place, similar to how React'suseEffect
is called after render. They can produce any number of changes by calling theupdate
function, which works just likeparcel.update()
. This makes them compatible with callbacks, promises and observables.promisify
to replaceasyncValue
andasyncChange
. The neweffect
/ async change reducer make this really easy.new Parcel({types: (defaultTypes) => newTypes})
to Parcel constructorparcel.type
, a string of"basic"|"object"|"unmutable"|"array"
by defaultparcel.parentType
, a string of"basic"|"object"|"unmutable"|"array"
by defaultmoveTo(newIndex)
to children of "array" type parcelsParcel.metaEquals(metaA, metaB)
for meta comparisonreact-dataparcels
This is almost completely new.
Action
, people shouldn't need to know this class existsuseParcelForm
(useuseParcel
instead)useParcelState
(useuseParcel
instead)useParcelBuffer
(useuseBuffer
instead)ParcelBoundary
(useBoundary
instead)asyncValue
(useParcel
andpromisify
can do this natively)asyncChange
(useParcel
andpromisify
can do this natively)ParcelDrag
toDrag
useParcel
to supersedeuseParcelState
anduseParcelForm
useBuffer
to supersedeuseParcelBuffer
Boundary
to supersedeParcelBoundary
parcel.meta.undo()
andparcel.meta.redo()
parcel.meta.canUndo
,parcel.meta.canRedo
&parcel.meta.synced
booleansDrag
as top level export:react-dataparcels/Drag
react-dataparcels-drag
To upgrade
isChild()
withisChild
isElement()
withparentType === 'array'
isIndexed()
withtype === 'array'
isParent()
withisParent
isTopLevel()
with! ... isChild
size()
withsize
isFirst()
withisFirstChild
isLast()
withisLastChild
keepValue
, remove, usetranslate
insteadspreadDOM()
withspreadInput()
spreadDOMCheckbox()
withspreadCheckbox()
.onChange
with.set(
.onChangeDOM
with.spreadInput().onChange
.onChangeDOMCheckbox
with.spreadCheckbox().onChange
react-dataparcels-drag
withreact-dataparcels/Drag
parcel.update()
,parcel.modifyUp()
,parcel.modifyDown()
,beforeChange
functions in hooks, andparcelNode.update()
, to see if they need to change to fit brand new APIspy(value => {...})
withmodifyDown(({value}) => {...})
whose updater returns nothingspyChange(changeRequest)
withmodifyUp(({changeRequest}) => {...})
whose updater returns nothing