Update dependency @rtk-query/codegen-openapi to v1.2.0 #20
No reviewers
Labels
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: procyon/seedling#20
Loading…
Add table
Reference in a new issue
No description provided.
Delete branch "renovate/rtk-query-codegen-openapi-1.x"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This PR contains the following updates:
1.0.0
->1.2.0
Release Notes
reduxjs/redux-toolkit (@rtk-query/codegen-openapi)
v1.2.0
Compare Source
This release rewrites the
createAction
andcreateSlice
types to enable better user readability and reusability, and fixes an issue with the bundling and publishing of the immutable state invariant middleware.(Note: this release was broken due to a missing TS type definition file. Please use v1.2.1 instead.)
Changes
Type Inference Readability Improvements
The type definitions for
createAction
andcreateSlice
were primarily written using the TStype
keyword. The TS compiler and inference engine tries to "unwrap" those types, which meant that the inferred type for a variable likeconst test = createAction<number, 'test'>('test')
would be shown in an IDE tooltip like this:That unwrapped type declaration is hard to read, and not very informative for app developers.
We've rewritten most of our types to use the
interface
keyword instead. Now, that same variable's inferred type would be displayed as:This is more informative and easier to read.
Type Export Improvements
Several users had noted that the complexity of the type definitions for
createSlice
made it impossible to write a higher-order or wrapper function in TypeScript that calledcreateSlice
internally ( #276, #286). As part of the typings update, we've refactored the type declarations to expose some public types that can be used to correctly define the arguments that will be passed tocreateSlice
, and documented how to wrapcreateSlice
in the "Usage with TypeScript" docs page. We've also documented all of the types in the codebase.Thanks to @phryneas for all the hard work on these type improvements!
Module Bundling Fixes
The build tooling setup for RTK tries to deal with several different use cases (dev vs prod, CJS vs ESM vs UMD modules, etc). There were problems with the build config that resulted in a
require()
statement being included in the ESM build, and the UMD dev build was actually missing the immutable invariant middleware. The build tooling has been updated to fix those issues.Changelog
type
tointerface
(@phryneas - #273)v1.1.3
Compare Source
v1.1.2
Compare Source
v1.1.1
Compare Source
v1.1.0
Compare Source
This release adds a utility function for better type safety with reducer object parameters, and fixes an issue with error message in the serializability check middleware.
Changes
Type-Safe Reducer Object Builder API
createReducer
accepts a plain object full of reducer functions as a parameter, where the keys are the action types that should be handled. While this works fine with plain JS, TypeScript is unable to infer the correct type for the action parameters in each reducer.As an alternative, you may now pass a callback function to
createReducer
that will be given a "builder" object that allows you to add reducers in a type-safe way based on the provided action types:While this API is usable from plain JS, it has no real benefit there, and is primarily intended for use with TS.
The same API is also available for the
extraReducers
argument ofcreateSlice
. It is not necessary for thereducers
argument, as the action types are already being defined there.Serialization Error Fixes
Error messages for the serialization check middleware were not correctly displaying the value. This has been fixed.
Docs Updates
Docusaurus v2
Our documentation site at https://redux-toolkit.js.org has been upgraded to use Docusaurus v2! This comes with a shiny new look and feel, and page loads are now even more Blazing Fast (TM).
Thanks to @endiliey, @yangshunz, @wgao19, and @ashakkk for all their hard work on the migration!
New "Usage with TypeScript" Page
We now have a new "Usage with TypeScript" docs page that has examples on how to correctly write and type usage of RTK.
Changelog
Code
Docs
This PR has been generated by Renovate Bot.