-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
pr05 Typescript Migration #15: Redux base files & migrate user preferences redux system #3683
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
base: develop
Are you sure you want to change the base?
pr05 Typescript Migration #15: Redux base files & migrate user preferences redux system #3683
Conversation
…e, and resolve type errors
…tePreferences, no-verify
…eferences to /userPreferences & add response and request types
…teCookiePreferences & move to /userPreferences
…e to /authmanagement and add request and response types
…formParams, getState, and setter params
export interface PreferencesState | ||
extends Omit<Preferences, 'indentationAmount' | 'isTabIndent'> { | ||
tabIndex: number; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (!stored) return null; // handle null before parsing | ||
return JSON.parse(stored) as RootState; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
to handle type-error from getItem
potentially returnning undefined
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
deleted as this file isn't called anywhere else
additionally the below lines are called in client/index.jsx
here
Should be reviewed after #3681
Migration of the
preferences
(user preferences) redux reducer & migration of base redux reducer filesUserPreferences
type to define thePreferencesState
PreferencesState['somefield']
to get the type forsomefield
(which is defined byUserPreferences['somefield']
UserPreferences
as the source of truth, and creates a link that can be traced from client to server.Changes:
client
defined inserver
tocommon
client/custom.d.ts
Window
type to have redux devtoolsNodeModules
type to have hot reloadingclient/persistState
client/reducers
-- defineRootReducer
client/store
client/storeInstance
:client/index.jsx
here so it seems it may be outdatedclient/modules/IDE/reducers/preferences
:UserPreferences
type defined in server as basis forPreferencesState
client/modules/IDE/actions/preferences
:UpdatePreferencesRequestBody
fromcommon
typesactions
andvalues
in co-located filepreferences.types
PreferenceState
propertiesI have verified that this pull request:
npm run lint
)npm run test
)develop
branch.Fixes #123