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 dependency redux-starter-kit to ^0.9.0 #362

Merged
merged 1 commit into from
Sep 17, 2023

Conversation

renovate[bot]
Copy link
Contributor

@renovate renovate bot commented Jun 16, 2023

Mend Renovate

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
redux-starter-kit ^0.7.0 -> ^0.9.0 age adoption passing confidence

Release Notes

reduxjs/redux-starter-kit (redux-starter-kit)

v0.9.1

Compare Source

The switch to TSDX accidentally dropped the re-export of types like Action from Redux.

Changelog

  • Fix broken re-export of Redux types d70dc31

v0.9.0

Compare Source

This release contains only build tooling changes and package updates. We've switched our build setup from a homegrown Rollup config to use TSDX instead. We're also running CI tests against multiple versions of TypeScript to try to prevent any future type changes that might affect older versions.

As part of the TSDX changes, the published package now contains the types in a single combined index.d.ts file instead of separate files, which may work better in certain build tooling setups.

In the process, we've also updated Immer from 2.1.5 to 4.0.1. This primarily adds auto-freezing of all state objects in development, but shouldn't have any actual changes for your code. See the Immer release notes for more details.

Barring any new issues, this will likely be the last point release before 1.0 release candidates in the next couple days.

Changelog

v0.8.1

Compare Source

This patch release fixes a couple small cross-version TypeScript issues that popped up in 0.8.0.

Changelog

v0.8.0

Compare Source

This release contains a couple breaking changes, including one that will affect almost all existing users. The plan is for these to be the final breaking changes before 1.0 is released, and that 1.0 will hopefully be out within the next couple weeks.

Breaking Changes

createSlice Now Requires a name Field

So far, createSlice has accepted an optional field called slice, which is used as the prefix for action types generated by that slice:

const counterSlice1 = createSlice({
    slice: "counter", // or could be left out entirely
    initialState: 0,
    reducers: {
        increment: state => state + 1,
    }
});

The slice field has been changed to name, and is now required to be a non-empty string.

const counterSlice1 = createSlice({
    name: "counter", // required!
    initialState: 0,
    reducers: {
        increment: state => state + 1,
    }
});

This removes cases where multiple slices could have accidentally generated identical action types by leaving out the slice name while having similar reducer names. The field name change from slice to name was made to clarify what the field means.

Migration: change all uses of slice to name, and add name to any createSlice() calls that didn't specify it already.

createAction Defaults to a void Payload Type

Previously, createAction("someType") would default to allowing a payload type of any when used with TypeScript. This has been changed to default to void instead. This means that you must specify the type of the payload, such as createAction<string>("someType").

Note that this is not necessary when using createSlice, as it already infers the correct payload types based on your reducer functions.

Migration: ensure that any calls to createAction() explicitly specify the payload type as a generic.

Other Changes

createSlice Exports the Case Reducer Functions

createSlice already returned an object containing the generated slice reducer function and the generated action creators. It now also includes all of the provided case reducers in a field called caseReducers.

const todosSlice = createSlice({
    name: "todos",
    initialState: [],
    reducers: {
        addTodo(state, action) {
            const {id, text} = action.payload;
            state.push({id, text});
        },
        toggleTodo(state, action) {
            const todo = state[action.payload.index];
            todo.completed = !todo.completed
        }
    },
    extraReducers: {
        ["app/logout"](state, action) {
            return []
        }
    }
});
console.log(todosSlice)
/*
{
    name: "todos",
    reducer: Function,
    actions: {
        addTodo: Function,
        toggleTodo: Function,
    },
    caseReducers: {
        addTodo: Function,
        toggleTodo: Function
    }
}
*/

Notes

Special thanks to @​phryneas for coaching me through finally starting to get a vague grasp on some very complicated TS types :)

Changelog


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.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR has been generated by Mend Renovate. View repository job log here.

@github-actions
Copy link

github-actions bot commented Jun 16, 2023

@renovate[bot] Image is available for testing. docker pull stakater/forecastle:SNAPSHOT-PR-362-05748a6a

@renovate renovate bot force-pushed the renovate/redux-starter-kit-0.x branch 2 times, most recently from b92c0d8 to 3e77a18 Compare June 28, 2023 11:46
@renovate renovate bot force-pushed the renovate/redux-starter-kit-0.x branch from 3e77a18 to 95e1a31 Compare August 30, 2023 08:10
@renovate renovate bot force-pushed the renovate/redux-starter-kit-0.x branch 8 times, most recently from fecca5c to bbbf165 Compare September 17, 2023 14:15
@renovate renovate bot force-pushed the renovate/redux-starter-kit-0.x branch from bbbf165 to 05748a6 Compare September 17, 2023 14:43
@davidkarlsen davidkarlsen enabled auto-merge (squash) September 17, 2023 16:45
@davidkarlsen davidkarlsen merged commit 19ea53a into master Sep 17, 2023
1 check passed
@davidkarlsen davidkarlsen deleted the renovate/redux-starter-kit-0.x branch September 17, 2023 16:46
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.

1 participant