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

enhance: Remove legacy actions #2690

Merged
merged 1 commit into from Jul 3, 2023
Merged

enhance: Remove legacy actions #2690

merged 1 commit into from Jul 3, 2023

Conversation

ntucker
Copy link
Collaborator

@ntucker ntucker commented Jul 3, 2023

BREAKING CHANGE: Middlewares may need updating.

Motivation

Consolidation around simplified actions based on endpoint

Solution

Remove:

  • Endpoint.optimisticUpdate -> Endpoint.getOptimisticResponse

core:

  • legacyActions; import the new actions directly
  • resetAction without a date
  • reducer -> createReducer(new Controller)

react:

  • createFetch, createReceive, createReceiveError

Changed

  • state.lastReset must be number
  • NetworkManager interface changed to only support new actions
  • SubscriptionManager/PollingSubscription interfaces simplified based on new actions

Deprecate(core):

  • controller.receive, controller.receiveError
  • RECEIVE_TYPE
  • MiddlewareAPI.controller (MiddlewareAPI is just controller itself)
    • ({controller}) => {} -> (controller) => {}

@changeset-bot
Copy link

changeset-bot bot commented Jul 3, 2023

🦋 Changeset detected

Latest commit: 2811212

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 25 packages
Name Type
@data-client/endpoint Minor
@data-client/react Minor
@data-client/core Minor
@data-client/graphql Minor
@data-client/rest Minor
@data-client/normalizr Minor
@rest-hooks/core Major
@rest-hooks/endpoint Major
@rest-hooks/graphql Minor
@rest-hooks/react Major
@rest-hooks/rest Major
@rest-hooks/normalizr Minor
@data-client/img Major
example-benchmark Patch
normalizr-github-example Patch
normalizr-redux-example Patch
normalizr-relationships Patch
todo-app Patch
@data-client/redux Major
@data-client/ssr Major
@data-client/test Major
github-app Patch
next-app Patch
@data-client/hooks Patch
@rest-hooks/legacy Major

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel
Copy link

vercel bot commented Jul 3, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
rest-hooks ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 3, 2023 9:37pm

@codecov
Copy link

codecov bot commented Jul 3, 2023

Codecov Report

Patch coverage: 100.00% and project coverage change: +0.57 🎉

Comparison is base (a6ae2b3) 97.63% compared to head (f6314f6) 98.20%.

❗ Current head f6314f6 differs from pull request most recent head 2811212. Consider uploading reports for the commit 2811212 to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2690      +/-   ##
==========================================
+ Coverage   97.63%   98.20%   +0.57%     
==========================================
  Files         118      114       -4     
  Lines        2068     2005      -63     
  Branches      329      302      -27     
==========================================
- Hits         2019     1969      -50     
+ Misses         24       15       -9     
+ Partials       25       21       -4     
Impacted Files Coverage Δ
packages/core/src/actionTypes.ts 100.00% <ø> (ø)
packages/core/src/controller/Controller.ts 100.00% <ø> (ø)
packages/core/src/controller/createInvalidate.ts 100.00% <ø> (ø)
...ackages/core/src/controller/createInvalidateAll.ts 100.00% <ø> (ø)
packages/core/src/controller/createReset.ts 100.00% <ø> (ø)
packages/core/src/controller/createSubscription.ts 100.00% <ø> (+16.66%) ⬆️
...ckages/core/src/state/reducer/invalidateReducer.ts 100.00% <ø> (ø)
packages/react/src/index.ts 100.00% <ø> (ø)
packages/core/src/controller/BaseController.ts 95.37% <100.00%> (ø)
packages/core/src/controller/createFetch.ts 100.00% <100.00%> (ø)
... and 12 more

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@ntucker ntucker merged commit bf141cb into master Jul 3, 2023
22 checks passed
@ntucker ntucker deleted the remove-legacy-action branch July 3, 2023 21:39
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

1 participant