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

Modify methods and API cleanup #175

Merged
merged 18 commits into from Jan 29, 2019

Conversation

dxinteractive
Copy link
Collaborator

@dxinteractive dxinteractive commented Jan 28, 2019

Main points:

  • Move from named exports (import {Foo} from 'bar';) to slash exports (import Foo from 'bar/Foo';) to allow people to have smaller bundle sizes when they use less features. This convention will become more important as optional features like Add: rekey #123 and Add: utils/segment #124 are added
  • Don't include ParcelShape in builds by default. The usage of modifiers now promotes importing ParcelShape when it's required.
  • Remove parts of the API that only existed to cope with the underlying flaws with the old reducer. Now with the new ChangeRequestReducer, many of the problems solved by these methods disappear.
  • Clean up the modify methods API. This has been really confusing. Now we just have .modifyDown() and .modifyUp(). If shape editing / deep editing is required, then a parcel shape updater can be imported via import shape from 'dataparcels/shape and used like .modifyDown(shape(parcelShape => parcelShape))

dataparcels

  • BREAKING CHANGE removed all named exports in favour of slash exports, expect for type exports.

    • e.g. import {Action} from 'dataparcels'; becomes import Action from 'dataparcels/Action';
  • BREAKING CHANGE removed Parcel.batch(). Use Parcel.update() with shape updaters instead

  • BREAKING CHANGE removed Parcel.modifyChange(). Use Parcel.modifyUp() with shape updaters instead

  • BREAKING CHANGE removed Parcel.batchAndReturn().

  • BREAKING CHANGE removed Parcel.hasDispatched(). Nothing should ever rely on this information, no Parcel should ever ask questions of their children.

  • BREAKING CHANGE removed Parcel.setChangeRequestMeta(). Seldom used feature that doesn't fit now that Parcel.batch() is gone.

  • BREAKING CHANGE when a Parcel.modifyUp() cancels an action, a change has been made so the change request still propagates to its source. This is done so if data changes after the action is created, then that may mean that the action should no longer be cancelled, so propagating cancelled actions allows the reducer to know about the action to uncancel. Now the ChangeRequestReducer is able to bail on processing an action if anything throws a ReducerCancelAction. When an entire change request now consists of cancelled actions for its currently based data, ChangeRequest.nextData now returns undefined rather than ParcelData.

  • Removed all unreleased shape updater methods.

    • Parcel.updateShape(shapeUpdater)
    • Parcel.updateShapeIn(shapeUpdater)
    • Parcel.modifyShapeUp(shapeUpdater)
    • Parcel.modifyShapeDown(shapeUpdater)
    • These are now used like Parcel.update(shape(shapeUpdater))
  • Added ParcelShape.update() / shape() function, and ability for Parcel.update(), Parcel.modifyDown() and Parcel.modifyUp() to accept these as updaters.

react-dataparcels

  • BREAKING CHANGE removed all named exports in favour of slash exports, expect for type exports.

@dxinteractive dxinteractive changed the title Everything Modify methods and API cleanup Jan 28, 2019
@dxinteractive dxinteractive merged commit ddeb993 into release/absolute-anaconda Jan 29, 2019
@dxinteractive dxinteractive deleted the feature/no-batch branch February 3, 2019 23:32
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