Skip to content
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

Release/scientific salamander #231

Merged
merged 17 commits into from Jul 16, 2019
Merged

Conversation

dxinteractive
Copy link
Collaborator

@dxinteractive dxinteractive commented Jul 15, 2019

Contains #229 #230

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 generic frameMeta
    • 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 now useParcelForm onSubmit
    • useParcelForm onChangeUseResult is now useParcelForm onSubmitUseResult
    • useParcelForm's returned onChangeStatus is now submitStatus
    • 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 therefore useParcelForm) to rebase changes when frameMeta.mergeMode === "rebase"
    • This will be used by rekey to rebase changerequests onto values that have updated
    • Not part of public API yet

Also onChangeUseResult > onSubmitUseResult
and onChangeStatus > submitStatus

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 according to
the internal useParcelState hook it is just a change, but the
name should really reflect how its used
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
replacing the inner parcel from props is intended to be a complete reset,
so the buffer should also be emptied
when no rebasing and new data is received from props, buffer is wiped and buffers state is replaced with data from props
when rebasing and new data is received from props, buffers state is replaced with data from props with buffer applied to it
also fixed a wrong test that was relying on incorrect cachebehaviour in a change request
Refactor lastOriginId and add mergeMode
@dxinteractive dxinteractive merged commit 1cf6ca3 into master Jul 16, 2019
@dxinteractive dxinteractive deleted the release/scientific-salamander branch August 15, 2019 13:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants