Skip to content

Possible issues blocking upgrades to 2.0 #3921

Closed
@markerikson

Description

@markerikson

Playing with some real-world repos using RTK and TS, to see what happens if I try to upgrade to a local 2.0-rc+ build.

InvokeAI

Expected Issues

  • Extensive use of EntityState<T> errors because it needs the second <Type, Id> generic
  • use of memoizeOptions: {equalityCheck}

Unexpected Issues

  • Listener inferred type was UnknownAction, but worked okay when the isAnyOf() was moved outside This is actually expected behavior per TS Bug found while testing the 2.0.0-beta.4 #3862 - TS has done this for a while, we now just infer as UnknownAction instead of AnyAction:
// boardIdSelected.ts
export const addBoardIdSelectedListener = () => {
  startAppListening({
    matcher: isAnyOf(boardIdSelected, galleryViewChanged),
    effect: async (
      action,
      { getState, dispatch, condition, cancelActiveListeners }
    ) => {
export const store = configureStore({
  reducer: rememberedRootReducer,
  enhancers: (getDefaultEnhancers) => {
    // Edited - this was originally `existingEnhancers.concat`
    return getDefaultEnhancers()
      .concat(
        rememberEnhancer(window.localStorage, rememberedKeys, {
          persistDebounce: 300,
          serialize,
          unserialize,
          prefix: LOCALSTORAGE_PREFIX,
        })
      )
      .concat(autoBatchEnhancer());
  },
  middleware: (getDefaultMiddleware) =>
    getDefaultMiddleware({
      serializableCheck: false,
      immutableCheck: false,
    })
      .concat(api.middleware)
      .concat(dynamicMiddlewares)
      .prepend(listenerMiddleware.middleware),

image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions