-
-
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
pr05 Typescript Migration #15: Redux base files & migrate user preferences redux system #3683
Conversation
…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
The merge-base changed after approval.
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.
This overall feels good to me! These changes will probably be out before the end of the week, so please feel free to follow up with anything else before then!


Should be reviewed after #3681
Migration of the
preferences(user preferences) redux reducer & migration of base redux reducer filesUserPreferencestype to define thePreferencesStatePreferencesState['somefield']to get the type forsomefield(which is defined byUserPreferences['somefield']UserPreferencesas the source of truth, and creates a link that can be traced from client to server.Changes:
clientdefined inservertocommonclient/custom.d.tsWindowtype to have redux devtoolsNodeModulestype to have hot reloadingclient/persistStateclient/reducers-- defineRootReducerclient/storeclient/storeInstance:client/index.jsxhere so it seems it may be outdatedclient/modules/IDE/reducers/preferences:UserPreferencestype defined in server as basis forPreferencesStateclient/modules/IDE/actions/preferences:UpdatePreferencesRequestBodyfromcommontypesactionsandvaluesin co-located filepreferences.typesPreferenceStatepropertiesI have verified that this pull request:
npm run lint)npm run test)developbranch.Fixes #123