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

fix(deps): update all major dependencies (major) #21

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

Conversation

renovate[bot]
Copy link

@renovate renovate bot commented Mar 7, 2022

This PR contains the following updates:

Package Change Age Adoption Passing Confidence Type Update
@reduxjs/toolkit (source) ^1.2.3 -> ^2.0.0 age adoption passing confidence dependencies major
@types/node (source) 12.12.25 -> 22.9.0 age adoption passing confidence devDependencies major
@types/styled-components (source) 4.4.3 -> 5.1.34 age adoption passing confidence devDependencies major
canvg ^3.0.4 -> ^4.0.0 age adoption passing confidence dependencies major
clean-webpack-plugin 3.0.0 -> 4.0.0 age adoption passing confidence devDependencies major
css-loader 3.4.2 -> 7.1.2 age adoption passing confidence devDependencies major
file-loader 5.0.2 -> 6.2.0 age adoption passing confidence devDependencies major
fork-ts-checker-webpack-plugin 4.0.1 -> 9.0.2 age adoption passing confidence devDependencies major
html-webpack-plugin 3.2.0 -> 5.6.3 age adoption passing confidence devDependencies major
node 12 -> 22 age adoption passing confidence docker major
prettier (source) 1.19.1 -> 3.3.3 age adoption passing confidence devDependencies major
react-redux ^7.1.3 -> ^9.0.0 age adoption passing confidence dependencies major
style-loader 1.1.3 -> 4.0.0 age adoption passing confidence devDependencies major
styled-components (source) ^5.0.0 -> ^6.0.0 age adoption passing confidence dependencies major
ts-loader 6.2.2 -> 9.5.1 age adoption passing confidence devDependencies major
tslint (source) 5.20.1 -> 6.1.3 age adoption passing confidence devDependencies major
typescript (source) 3.7.5 -> 5.6.3 age adoption passing confidence devDependencies major
url-loader 3.0.0 -> 4.1.1 age adoption passing confidence devDependencies major
webpack 4.41.5 -> 5.96.1 age adoption passing confidence devDependencies major
webpack-cli (source) 3.3.12 -> 5.1.4 age adoption passing confidence devDependencies major
webpack-dev-server 3.10.1 -> 5.1.0 age adoption passing confidence devDependencies major
webpack-manifest-plugin 2.2.0 -> 5.0.0 age adoption passing confidence devDependencies major
webpack-merge 4.2.2 -> 6.0.1 age adoption passing confidence devDependencies major

Release Notes

reduxjs/redux-toolkit (@​reduxjs/toolkit)

v2.3.0

Compare Source

This feature release adds a new RTK Query upsertQueryEntries util to batch-upsert cache entries more efficiently, passes through additional values for use in prepareHeaders, and exports additional TS types around query options and selectors.

Changelog

upsertQueryEntries

RTK Query already had an upsertQueryData thunk that would upsert a single cache entry. However, some users wanted to upsert many cache entries (potentially hundreds or thousands), and found that upsertQueryData had poor performance in those cases. This is because upsertQueryData runs the full async request handling sequence, including dispatching both pending and fulfilled actions, each of which run the main reducer and update store subscribers. That means there's 2N store / UI updates per item, so upserting hundreds of items becomes extremely perf-intensive.

RTK Query now includes an api.util.upsertQueryEntries action that is meant to handle the batched upsert use case more efficiently. It's a single synchronous action that accepts an array of many {endpointName, arg, value} entries to upsert. This results in a single store update, making this vastly better for performance vs many individual upsertQueryData calls.

We see this as having two main use cases. The first is prefilling the cache with data retrieved from storage on app startup (and it's worth noting that upsertQueryEntries can accept entries for many different endpoints as part of the same array).

The second is to act as a "pseudo-normalization" tool. RTK Query is not a "normalized" cache. However, there are times when you may want to prefill other cache entries with the contents of another endpoint, such as taking the results of a getPosts list endpoint response and prefilling the individual getPost(id) endpoint cache entries, so that components that reference an individual item endpoint already have that data available.

Currently, you can implement the "pseudo-normalization" approach by dispatching upsertQueryEntries in an endpoint lifecycle, like this:

const api = createApi({
  endpoints: (build) => ({
    getPosts: build.query<Post[], void>({
      query: () => '/posts',
      async onQueryStarted(_, { dispatch, queryFulfilled }) {
        const res = await queryFulfilled
        const posts = res.data

        // Pre-fill the individual post entries with the results
        // from the list endpoint query
        dispatch(
          api.util.upsertQueryEntries(
            posts.map((post) => ({
              endpointName: 'getPost',
              arg: { id: post.id },
              value: post,
            })),
          ),
        )
      },
    }),
    getPost: build.query<Post, Pick<Post, 'id'>>({
      query: (post) => `post/${post.id}`,
    }),
  }),
})

Down the road we may add a new option to query endpoints that would let you provide the mapping function and have it automatically update the corresponding entries.

For additional comparisons between upsertQueryData and upsertQueryEntries, see the upsertQueryEntries API reference.

prepareHeaders Options

The prepareHeaders callback for fetchBaseQuery now receives two additional values in the api argument:

  • arg: the URL string or FetchArgs object that was passed in to fetchBaseQuery for this endpoint
  • extraOptions: any extra options that were provided to the base query
Additional TS Types

We've added a TypedQueryStateSelector type that can be used to pre-type selectors for use with selectFromResult:

const typedSelectFromResult: TypedQueryStateSelector<
  PostsApiResponse,
  QueryArgument,
  BaseQueryFunction,
  SelectedResult
> = (state) => ({ posts: state.data?.posts ?? EMPTY_ARRAY })

function PostsList() {
  const { posts } = useGetPostsQuery(undefined, {
    selectFromResult: typedSelectFromResult,
  })
}

We've also exported several additional TS types around base queries and tag definitions.

What's Changed

Full Changelog: reduxjs/redux-toolkit@v2.2.8...v2.3.0

v2.2.8

Compare Source

This bugfix release fixes a long-standing issue with RTK Query lazy query triggers returning stale data in some cases, fixes an error handling issue in RTK Query, and exports additional TS types.

Changelog

Lazy Query Trigger Handling

We'd had a couple long-standing issues reporting that const result = await someLazyQueryTrigger() sometimes returned stale data, especially if a mutation had just invalidated that query's tag.

We finally got a good repro of this issue and identified it as a mis-written call inside of the middleware that skipped past the necessary handling to activate the correct query status tracking in that scenario. This should now be fixed.

Other Changes

Timeout handling in RTKQ endpoints should now correctly throw a timeout-related error instead of an AbortError.

Base queries now have access to the current queryCacheKey value so it can be used in deciding query logic.

We've exported several more TS types related to query options, as some users have been depending on those even though they previously weren't part of the public API.

What's Changed

Full Changelog: reduxjs/redux-toolkit@v2.2.7...v2.2.8

v2.2.7

Compare Source

This bugfix release fixes issues with "TS type portability" errors, improves build artifact tree shaking behavior, and exports some additional TS types.

Changelog

TS Type Portability

We've had a slew of issues reported around "TS type portability" errors, such as:

The error messages are typically along the lines of:

Type error: The inferred type of 'configureStore' cannot be named without a reference to '@&#8203;reduxjs/toolkit/node_modules/redux'. This is likely not portable. A type annotation is necessary.

@​aryaemami59 did some deep investigation and concluded these were due to a mixture of using interface instead of type in most places, not pre-bundling our TS typedefs, and not exporting some of the unique symbols we use internally.

Arya put together a highly detailed writeup and set of fixes in #​4467: Fix: TypeScript Type Portability Issues, and that appears to resolve all of those issues we've seen. Thank you!

Other Changes

Arya also did significant work to improve RTK's treeshaking, tweaking internal definitions to let bundlers better separate out unused code.

We've exported additional types like UpdateDefinitions and RetryOptions, per request.

listenerMiddleware.withTypes() methods now allow passing in an ExtraArgument generic.

What's Changed

Full Changelog: reduxjs/redux-toolkit@v2.2.6...v2.2.7

v2.2.6

Compare Source

v2.2.5

Compare Source

This bugfix release fixes an issue in the recent createEntityAdapter sorting perf improvements that could (in specific cases) cause Immer to throw an error when trying to read a plain JS value instead of a proxy-wrapped value.

What's Changed

Full Changelog: reduxjs/redux-toolkit@v2.2.4...v2.2.5

v2.2.4

Compare Source

v2.2.3

Compare Source

This minor release fixes the types for functions that accept a React Context instance to match the changes in React Redux v9.

What's Changed

Full Changelog: reduxjs/redux-toolkit@v2.2.2...v2.2.3

v2.2.2

Compare Source

This patch release fixes an incorrect build setting for the legacy-esm artifacts, and fixes an issue with RTKQ query hooks didn't always remove the cache entries if arguments were changed rapidly.

Changes

legacy-esm Artifact Transpilation

The legacy-esm build artifacts are intended for use by Webpack 4. Those were supposed to be transpiled to target "es2017", but were in fact still set to target "esnext" - an oversight during the 2.0 development cycle. This release fixes that setting, so those artifacts are now correctly transpiled.

Other Fixes

RTKQ query hooks now handle additional actions around argument changes that should result in cache entries being removed.

Additionally, 2.2.1 contained a fix to an incorrectly named type: TypedUseMutationTrigger is now TypedMutationTrigger.

What's Changed

Full Changelog: reduxjs/redux-toolkit@v2.2.0...v2.2.2

v2.2.1

Compare Source

v2.2.0

Compare Source

This minor release:

  • Adds a second parameter to entityAdapter.getInitialState(additionalProps, entities) to allow prefilling state
    • Equivalent to entityAdapter.setAll(entityAdapter.getInitialState(additionalProps), entities)
    • First parameter can be undefined if no additional properties are desired
  • Allows initialising combineSlices with no static reducers
    • Previously const combinedReducer = combineSlices().withLazyLoadedSlices<LazyLoadedSlices>() would have thrown an error
    • Now returns a "no-op" reducer that just returns an empty object until first reducer injected
  • Allows a new 'throw' value for overrideExisting in injectEndpoints, which throws an error if a definition is injected with a name which is already used
  • Exports more type helpers for RTKQ hook and trigger types
  • Exports types related to overriding result types in enhanceEndpoints
  • Fixes state inference for injected slices when undeclared (i.e. not in LazyLoadedSlices)
  • Adds a action.meta.arg.isPrefetch value to query thunk actions when prefetched

What's Changed

New Contributors

Full Changelog: reduxjs/redux-toolkit@v2.1.0...v2.2.0

v2.1.0

Compare Source

This minor release:

  • adds withTypes methods to listenerMiddleware and createDraftSafeSelector
  • adds a skipPollingIfUnfocused option to RTK Query
  • adds the ability to customise the createSelector instance used by RTK Query
  • reworks slice selector logic to avoid depending on this value
  • fixes the order and inference of create.asyncThunk type parameters
  • fixes requirements for meta fields returned from queryFns
  • marks promises that will never reject as safe, in preparation for https://github.com/typescript-eslint/typescript-eslint/issues/7008

What's Changed

New Contributors

Full Changelog: reduxjs/redux-toolkit@v2.0.1...v2.1.0

v2.0.1

Compare Source

v2.0.0

Compare Source

This major release :

  • Removes the deprecated object syntax from createSlice and createReducer
  • Removes other deprecated options
  • Updates the middleware and enhancers options of configureStore to require callbacks
  • Updates the packaging for better ESM/CJS compatibility and modernizes the build output
  • Includes all changes to Redux core 5.0, Reselect 5.0, and Redux Thunk 3.0
  • Updates RTKQ default subscription behavior
  • Adds a new combineSlices method with support for lazy-loading slice reducers
  • Adds a new "dynamic middleware" middleware with support for adding middleware at runtime
  • Adds a new callback syntax to createSlice.reducers, with optional support for defining thunks inside of createSlice
  • Adds the autoBatchEnhancer to configureStore by default
  • Has many additional TS tweaks and improvements

This release has breaking changes. (Note: v2.0.1 was released with a couple hotfixes for Reselect and Redux Thunk right as this was being finalized.)

This release is part of a wave of major versions of all the Redux packages: Redux Toolkit 2.0, Redux core 5.0, React-Redux 9.0, Reselect 5.0, and Redux Thunk 3.0.

For full details on all of the breaking changes and other significant changes to all of those packages, see the "Migrating to RTK 2.0 and Redux 5.0" migration guide in the Redux docs.

[!NOTE]
The Redux core, Reselect, and Redux Thunk packages are included as part of Redux Toolkit, and RTK users do not need to manually upgrade them - you'll get them as part of the upgrade to RTK 2.0. (If you're not using Redux Toolkit yet, please start migrating your existing legacy Redux code to use Redux Toolkit today!)

##### RTK
npm install @&#8203;reduxjs/toolkit
yarn add @&#8203;reduxjs/toolkit
Changelog
Object syntax for createSlice.extraReducers and createReducer removed

RTK's createReducer API was originally designed to accept a lookup table of action type strings to case reducers, like { "ADD_TODO": (state, action) => {} }. We later added the "builder callback" form to allow more flexibility in adding "matchers" and a default handler, and did the same for createSlice.extraReducers.

We have removed the "object" form for both createReducer and createSlice.extraReducers in RTK 2.0, as the builder callback form is effectively the same number of lines of code, and works much better with TypeScript.

As an example, this:

const todoAdded = createAction('todos/todoAdded')

createReducer(initialState, {
  [todoAdded]: (state, action) => {},
})

createSlice({
  name,
  initialState,
  reducers: {
    /* case reducers here */
  },
  extraReducers: {
    [todoAdded]: (state, action) => {},
  },
})

should be migrated to:

createReducer(initialState, (builder) => {
  builder.addCase(todoAdded, (state, action) => {})
}

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

 **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

👻 **Immortal**: This PR will be recreated if closed unmerged. Get [config help](https://github.com/renovatebot/renovate/discussions) if that's undesired.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR was generated by [Mend Renovate](https://mend.io/renovate/). View the [repository job log](https://developer.mend.io/github/kobakazu0429/react-svg-drawer).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzMi4yMDIuNCIsInVwZGF0ZWRJblZlciI6IjM4LjE0Mi43IiwidGFyZ2V0QnJhbmNoIjoiZmVhdHVyZS9kZXYifQ==-->

@renovate renovate bot added the renovate label Mar 7, 2022
@renovate renovate bot force-pushed the renovate/major-all-major-dependencies branch 2 times, most recently from a43df82 to 9c2a690 Compare April 1, 2022 16:45
@renovate renovate bot force-pushed the renovate/major-all-major-dependencies branch 7 times, most recently from 4e4fb3b to 468c292 Compare April 7, 2022 20:01
@renovate renovate bot force-pushed the renovate/major-all-major-dependencies branch 10 times, most recently from 8507093 to 52d0197 Compare April 16, 2022 18:04
@renovate renovate bot force-pushed the renovate/major-all-major-dependencies branch 10 times, most recently from e551461 to 46348ad Compare April 26, 2022 22:49
@renovate renovate bot force-pushed the renovate/major-all-major-dependencies branch 6 times, most recently from 28b9423 to 2d2c321 Compare September 27, 2024 18:58
@renovate renovate bot force-pushed the renovate/major-all-major-dependencies branch 2 times, most recently from 1d3a1b8 to c9609af Compare October 8, 2024 22:14
@renovate renovate bot force-pushed the renovate/major-all-major-dependencies branch 7 times, most recently from 6764be9 to b4c10d9 Compare October 23, 2024 17:42
@renovate renovate bot force-pushed the renovate/major-all-major-dependencies branch 8 times, most recently from fad9f10 to 4d2bd35 Compare November 1, 2024 13:05
@renovate renovate bot force-pushed the renovate/major-all-major-dependencies branch 2 times, most recently from 1e8eca0 to b6e345d Compare November 5, 2024 02:05
@renovate renovate bot force-pushed the renovate/major-all-major-dependencies branch 3 times, most recently from d146fd0 to f92beec Compare November 23, 2024 00:20
@renovate renovate bot force-pushed the renovate/major-all-major-dependencies branch from f92beec to 0235145 Compare November 23, 2024 07:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

0 participants