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 #765

Closed
wants to merge 1 commit into from

Conversation

renovate[bot]
Copy link
Contributor

@renovate renovate bot commented Sep 4, 2019

WhiteSource Renovate

This PR contains the following updates:

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

Release Notes

reduxjs/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

v0.7.0

Compare Source

This release introduces some noticeable breaking changes as we begin working our way towards 1.0.

Breaking Changes
Removal of Selectorator

RSK previously exported the createSelector function from https://github.com/planttheidea/selectorator . Selectorator wraps around Reselect, and the main selling point was that its createSelector wrapper accepted string keypath "input selectors".

However, this capability made usage with TypeScript almost useless, as the string keypaths couldn't be translated into the actual types for the values that were being extracted. Ultimately, there wasn't enough real benefit for keeping this around, and so we are removing Selectorator.

We now simply export createSelector directly from https://github.com/reduxjs/reselect instead.

Migration

Replace any string keypath usages with actual selector functions:

// before
const selectAB = createSelector(
  ["a", "b"],
  (a, b) => a + b
);

// after
const selectA = state => state.a;
const selectB = state => state.b;

const selectAB = createSelector(
    [selectA, selectB],
    (a, b) => a + b
);
Removal of "slice selectors"

createSlice tried to generate a "slice selector" function based on the provided slice name. This was basically useless, because there was no guarantee that the reducer function was being combined under that name. The dynamic name of the generated function also made it hard to use.

Migration

Remove any uses of slice.selectors (such as slice.selectors.getTodos). If necessary, replace them with separate hand-written calls to createSelector instead.

Other Changes
Customization of Default Middleware

The default middleware array generated by getDefaultMiddleware() has so far been a black box. If you needed to customize one of the middleware, or leave one out, you were forced to hand-initialize the middleware yourself.

getDefaultMiddleware now accepts an options object that allows selectively disabling specific middleware, as well as passing options to each of the middleware (such as redux-thunk's extraArgument option).

New Tutorials!

We've added a set of new tutorial pages that walk you through how to use RSK:

  • Basic Tutorial: introduces the RSK APIs in a vanilla JS page
  • Intermediate Tutorial: shows how to use RSK in a CRA app, by converting the standard Redux "todos" example to use RSK
  • Advanced Tutorial: shows how to use RSK with TypeScript, thunks for async and data fetching, and React-Redux hooks, by converting a plain React app to use RSK
Changelog

v0.6.3

Compare Source

One of the major limitations of RSK thus far is that the generated action creators only accept a single argument, which becomes the payload of the action. There's been no way to do things like:

  • add a field like meta, which is commonly used as part of the "Flux Standard Action" convention
  • pass in multiple function parameters to the action creator, and process them to set up the payload
  • Encapsulate setup work like generating unique IDs before returning the action object

That also means that the code dispatching the action has been entirely responsible for determining the correct shape of the payload.

This release adds the ability to pass in a "prepare" callback to createAction. The prepare callback must return an object containing a payload field, and may include a meta field as well. All arguments that were passed to the action creator will be passed into the prepare callback:

const testAction = createAction(
    "TEST_ACTION",
    (a: string, b: string, c: string) => ({
        payload: a + b + c,
        meta: "d"
    })
)

console.log(testAction("1", "2", "3"))
// {type: "TEST_ACTION", payload: "123", meta: "d"}

createSlice has also been updated to enable customizing the auto-generated action creators as well. Instead of passing a reducer function directly as the value inside the reducers object, pass an object containing {reducer, prepare}:

const counterSlice = createSlice({
	slice: 'counter',
	initialState: 0,
	reducers: {
	    setValue: {
		  reducer: (state, action: PayloadAction<number>) => {
		      return state + action.payload
		  },
		  prepare: (amount: number) => {
		      if(amount < 0) {
		          throw new Error("Must be a positive number!");
		      }
		      return {payload: amount}
		  }
	  }
	}
})

This resolves the related issues of #​146 and #​148 .

Changes

v0.6.2

Compare Source

v0.6.1

Compare Source

Our UMD build (redux-starter-kit.umd.js) has actually been broken for a while, because it still tried to reference process, which doesn't exist in a web environment.

We've updated our build process to ensure that the UMD build is fixed up to correctly handle that "is dev" check.

In addition, we only had an unminified UMD dev build so far. We now include a properly minified production-mode UMD build as well, redux-starter-kit.umd.min.js.

Note that our configureStore() function defaults to different behavior in dev and prod by including extra runtime check middleware in development. The dev and prod UMD builds should match the dev/prod behavior for configureStore(), so if you are using a UMD build and want the runtime checks, make sure you link to the dev build.

Finally, note that when used as a plain script tag, the UMD builds now create a global variable named window.RSK, rather than window["redux-starter-kit"]. This is theoretically a breaking change, but given that the UMD builds have never worked right, I'm fine with calling this a "patch" instead :)

Changes

v0.6.0

Compare Source

This release includes a couple improvements to our serializable-state-invariant-middleware to enable more flexibility in defining what values are and are not serializable, as well as some additional typing tweaks to improve inference of PayloadAction types and ensure that action creators generated by createSlice() are recognized as PayloadActionCreators that have a type field.

Changes

Configuration

📅 Schedule: "on Saturday every month" in timezone Europe/Paris.

🚦 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, click this checkbox.

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

@renovate renovate bot changed the title fix(deps): update dependency redux-starter-kit to v0.6.3 Update dependency redux-starter-kit to v0.6.3 Sep 5, 2019
@renovate renovate bot changed the title Update dependency redux-starter-kit to v0.6.3 fix(deps): update dependency redux-starter-kit to v0.6.3 Sep 5, 2019
@renovate renovate bot changed the title fix(deps): update dependency redux-starter-kit to v0.6.3 Update dependency redux-starter-kit to v0.6.3 Sep 5, 2019
@renovate renovate bot force-pushed the renovate/redux-starter-kit-0.x branch from 659c353 to 0370522 Compare September 8, 2019 23:03
@renovate renovate bot changed the title Update dependency redux-starter-kit to v0.6.3 Update dependency redux-starter-kit to v0.7.0 Sep 8, 2019
@edas
Copy link
Contributor

edas commented Sep 13, 2019

May not be safe because of reduxjs/redux-toolkit#191

@renovate renovate bot force-pushed the renovate/redux-starter-kit-0.x branch from 0370522 to bc3d6ae Compare October 31, 2019 23:37
@renovate renovate bot changed the title Update dependency redux-starter-kit to v0.7.0 Update dependency redux-starter-kit to v0.9.1 Oct 31, 2019
@renovate renovate bot force-pushed the renovate/redux-starter-kit-0.x branch from bc3d6ae to eb87998 Compare December 31, 2019 23:23
@renovate renovate bot force-pushed the renovate/redux-starter-kit-0.x branch from eb87998 to 0f95749 Compare January 31, 2020 23:41
@renovate renovate bot force-pushed the renovate/redux-starter-kit-0.x branch from 0f95749 to f943458 Compare July 31, 2020 23:22
@renovate renovate bot force-pushed the renovate/redux-starter-kit-0.x branch from f943458 to 1107a62 Compare November 30, 2020 23:45
@renovate renovate bot changed the title Update dependency redux-starter-kit to v0.9.1 fix(deps): update dependency redux-starter-kit to ^0.9.0 Nov 30, 2020
@renovate renovate bot force-pushed the renovate/redux-starter-kit-0.x branch from 1107a62 to d091cc1 Compare December 31, 2020 23:43
@renovate renovate bot changed the title fix(deps): update dependency redux-starter-kit to ^0.9.0 Update dependency redux-starter-kit to ^0.9.0 Dec 31, 2020
@renovate renovate bot changed the title Update dependency redux-starter-kit to ^0.9.0 fix(deps): update dependency redux-starter-kit to ^0.9.0 Jan 31, 2021
@renovate renovate bot force-pushed the renovate/redux-starter-kit-0.x branch from d091cc1 to 90562b4 Compare March 31, 2021 22:30
@renovate renovate bot changed the title fix(deps): update dependency redux-starter-kit to ^0.9.0 Update dependency redux-starter-kit to ^0.9.0 Mar 31, 2021
@renovate renovate bot changed the title Update dependency redux-starter-kit to ^0.9.0 fix(deps): update dependency redux-starter-kit to ^0.9.0 May 31, 2021
@renovate renovate bot force-pushed the renovate/redux-starter-kit-0.x branch from 90562b4 to 5594f91 Compare September 30, 2021 23:23
@renovate renovate bot force-pushed the renovate/redux-starter-kit-0.x branch from 5594f91 to 641caec Compare November 30, 2021 23:54
@renovate renovate bot force-pushed the renovate/redux-starter-kit-0.x branch from 641caec to 33ce237 Compare January 1, 2022 00:35
@renovate renovate bot force-pushed the renovate/redux-starter-kit-0.x branch from 33ce237 to 47a92b9 Compare February 11, 2022 16:50
@trollepierre
Copy link
Contributor

let's ignore this PR until we want to work again in cozy-procedure

@trollepierre trollepierre deleted the renovate/redux-starter-kit-0.x branch February 15, 2022 16:44
@renovate
Copy link
Contributor Author

renovate bot commented Feb 15, 2022

Renovate Ignore Notification

Because you closed this PR without merging, Renovate will ignore this update (^0.9.0). You will get a PR once a newer version is released. To ignore this dependency forever, add it to the ignoreDeps array of your Renovate config.

If you accidentally closed this PR, or if you changed your mind: rename this PR to get a fresh replacement PR.

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.

3 participants