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

[Snyk] Upgrade @reduxjs/toolkit from 1.8.2 to 1.9.0 #89

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

ibr5500
Copy link
Owner

@ibr5500 ibr5500 commented Nov 25, 2022

This PR was automatically created by Snyk using the credentials of a real user.


Snyk has created this PR to upgrade @reduxjs/toolkit from 1.8.2 to 1.9.0.

ℹ️ Keep your dependencies up-to-date. This makes it easier to fix existing vulnerabilities and to more quickly identify and fix newly disclosed vulnerabilities when they affect your project.


  • The recommended version is 11 versions ahead of your current version.
  • The recommended version was released 21 days ago, on 2022-11-04.
Release notes
Package name: @reduxjs/toolkit
  • 1.9.0 - 2022-11-04
    Read more
  • 1.9.0-rc.1 - 2022-11-02

    This release candidate updates the auto-batching enhancer to accept additional options for queuing subscriber notifications, and improves RTKQ perf by removing some unnecessary internal memoized selectors.

    Please try this out and give us feedback (even if it's just "tried updating and everything's fine")! If no further issues come up we intend to publish 1.9 in the next few days.

    https://deploy-preview-2401--redux-starter-kit-docs.netlify.app/

    Changelog

    Autobatch Enhancer Options

    The initial implementation of the autoBatchEnhancer() always queued delayed subscriber notifications using queueMicrotask. We've updated it to accept alternate options that queue with setTimeout, requestAnimationFrame, or bring-your-own-callback (more similar to redux-batched-subscribe).

    The variation in JS event loop timing behavior (microtasks, macrotasks, and frames) means having these options may be useful in different situations.

    What's Changed

    Full Changelog: v1.9.0-rc.0...v1.9.0-rc.1

  • 1.9.0-rc.0 - 2022-10-30

    This release candidate includes a new "auto-batching" store enhancer, support for passing some global options to fetchBaseQuery, a fix for forceRefetch behavior, and internal tweaks to checks for missing RTKQ middleware setup.

    Please try this out and give us feedback (even if it's just "tried updating and everything's fine")! If no further issues come up we intend to publish 1.9 in the next few days.

    https://deploy-preview-2401--redux-starter-kit-docs.netlify.app/

    Changelog

    New Auto-Batching Store Enhancer

    There are several different ways to "batch actions" with Redux stores, ranging from reducers to debounced subscriber notifications.

    RTK now includes a new autoBatchEnhancer() store enhancer that uses a variation on the "debounced notification" approach, inspired by React's technique of batching renders and determining if an update is low-priority or high-priority.

    The enhancer looks for any actions tagged with an action.meta[SHOULD_AUTOBATCH] = true flag, and delays notifying subscribers until the end of the event loop tick. This means that if multiple "auto-batched" actions are dispatched in a row, there will be only one subscriber notification. However, if any "normal-priority" action without that flag is dispatched in the same tick, the enhancer will notify subscribers immediately.

    This allows Redux users to selectively tag certain actions for effective batching behavior, making this purely opt-in on a per-action basis, while retaining normal notification behavior for all other actions.

    RTK Query's internals have been updated to mark several key actions as batchable. While the enhancer is purely opt-in, benchmarks indicate that it can help speed up UI performance with RTK Query, especially when rendering many components with query hooks. We recommend adding it to your store setup:

      const store = configureStore({
      reducer,
      enhancers: (existingEnhancers) => {
        // Add the autobatch enhancer to the store setup
        return existingEnhancers.concat(autoBatchEnhancer())
      },
    })

    Additionally, there's a prepareAutoBatched util that can be used to help add the SHOULD_AUTOBATCH flag to actions, designed for use with createSlice:

    const counterSlice = createSlice({
      name: 'counter',
      initialState: { value: 0 } as CounterState,
      reducers: {
        incrementBatched: {
          // Batched, low-priority
          reducer(state) {
            state.value += 1
          },
          // Use the `prepareAutoBatched` utility to automatically
          // add the `action.meta[SHOULD_AUTOBATCH]` field the enhancer needs
          prepare: prepareAutoBatched<void>(),
        },
        // Not batched, normal priority
        decrementUnbatched(state) {
          state.value -= 1
        },
      },
    })

    fetchBaseQuery Global Options

    fetchBaseQuery now supports passing the responseHandler, validateStatus, and timeout options directly to fetchBaseQuery itself, in addition to accepting it as part of specific endpoints. If provided, these options will be applied as defaults to all requests for that API, which simplifies using them on many endpoints.

    Other Changes

    Providing serializeQueryArgs and forceRefetch options for an endpoint now works correctly when you pass an object as the cache key argument to a query hook.

    The defaultSerializeQueryArgs util is now exported.

    The endpoint-specific serializeQueryArgs option now allows returning an object or a number instead of just a string. If a string is returned, it will be used as-is for the serialized cache key. If an object or number is returned, that value will be passed to defaultSerializeQueryArgs. This simplifies the common case of wanting to remove a couple fields from the cache key, without needing to call defaultSerializeQueryArgs yourself.

    Internal tweaks to the RTKQ middleware behavior for detecting cases where the middleware has not been added to the store.

    The API docs for the 1.9 preview are fully updated.

    What's Changed

    • Fill out v1.9 remaining docs by @ markerikson in #2804
    • Rework endpoint serializeQueryArgs to allow object/number returns by @ markerikson in #2835
    • allow for global responseHandler and validateStatus configuration by @ phryneas in #2823
    • Fix refetches when sQA returns same value and queryArgs are object by @ markerikson in #2844
    • Add an auto-batching enhancer that delays low-pri notifications and use with RTKQ by @ markerikson in #2846
    • Check middleware registration directly to avoid persistence issues by @ markerikson in #2850

    Full Changelog: v1.9.0-beta.0...v1.9.0-rc.0

  • 1.9.0-beta.0 - 2022-10-19
    Read more
  • 1.9.0-alpha.2 - 2022-10-09
    Read more
  • 1.9.0-alpha.1 - 2022-08-28
    Read more
  • 1.9.0-alpha.0 - 2022-08-19
    Read more
  • 1.8.6 - 2022-10-09

    This bugfix release fixes a couple of issues with RTKQ endpoint tags not invalidating correctly, and tweaks the dispatch type inference to handle more variations of arrays.

    What's Changed

    Full Changelog: v1.8.5...v1.8.6

  • 1.8.5 - 2022-08-19
  • 1.8.4 - 2022-08-11
  • 1.8.3 - 2022-06-30
  • 1.8.2 - 2022-05-25
from @reduxjs/toolkit GitHub release notes
Commit messages
Package name: @reduxjs/toolkit
  • 2425f02 Merge pull request #2401 from reduxjs/v1.9-integration
  • ed75be0 Merge pull request #2859 from reduxjs/feature/final-v1.9-tweaks
  • 5e4ad31 Bump dependencies
  • 8f30d43 Add TS 4.9 RC to the test matrix
  • 35f7e6d Switch autobatch default method to 'raf'
  • 48fe9e1 Release 1.9.0-rc.1
  • fdc1c50 Merge pull request #2857 from reduxjs/feature/autobatch-timing
  • f178b94 Make autobatching notification queueing configurable
  • b12b22c Merge branch 'master' into v1.9-integration
  • 38d65c0 Merge pull request #2856 from reduxjs/feature/1.9-rc-tweaks
  • e672cd8 Remove unnecessary memoized selectors
  • 23292c5 Fix "running thunks" types from returning undefined
  • 4c32e29 Release 1.9.0-rc.0
  • ec05907 Merge pull request #2850 from reduxjs/feature/middleware-registration-hooks
  • 150a93e Check middleware registration directly to avoid persistence issues
  • b367946 Merge pull request #2846 from reduxjs/feature/auto-batch-enhancer-again
  • cca9779 Add autoBatchEnhancer docs
  • ac01d3d Apply SHOULD_AUTOBATCH to RTKQ thunks for opt-in perf boost
  • 0de2441 Add an auto-batching enhancer that delays low-pri notifications
  • d934fad Merge pull request #2844 from reduxjs/bugfix/forceRefetch-obj-args
  • db3ed1e Fix refetches when sQA returns same value and queryArgs are object
  • 270a14f Merge pull request #2823 from reduxjs/draft/inspiring-currying
  • a2fec02 Add tests for global fetchBaseQuery args
  • d4717b1 allow for global `responseHandler` and `validateStatus` configuration

Compare


Note: You are seeing this because you or someone else with access to this repository has authorized Snyk to open upgrade PRs.

For more information:

🧐 View latest project report

🛠 Adjust upgrade PR settings

🔕 Ignore this dependency or unsubscribe from future upgrade PRs

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.

2 participants