-
Notifications
You must be signed in to change notification settings - Fork 2
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
DO NOT MERGE: Changed from React 17 to 19, React-router from 5 to 7, AppObservableStore to a useContext() / ConnectAppContext #12
Open
SailingSteve
wants to merge
14
commits into
wevote:develop
Choose a base branch
from
SailingSteve:steveStaffClientDec28-11am
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…tore to a useContext() / WeAppContext This PR does not fully work -- The configuration Stores and Actions still use AppObservableStore which is not connected to the new WeAppContext.jsx Store-- Most of the functional components have been switched to the new useContext() ~ WeAppContext.jsx improvement/rough equivalent. The Teams and FAQ pages display, Login works, none of the actions/stores work yet, but they do not block compilation. All the breaking changes from react-router 6 and 7 are resolved, this eliminates the need for react-router-dom-v5 compat. This router upgrade has big changes (nice simplifications) for App.jsx. Some class functions needed to upgraded to functional components to work with useContext(), and more still need upgrading. As a first demo of using useContext -- replaced AppObservableStore with WeAppContext.jsx, which eliminates all the subscriptions than needed to be created and destroyed for each component that used it. So many onAppObservableStoreChange() instances were replaced with useEffect(). WeAppContext.jsx is just a "modern" global key value store without specific setters/getters. For all files that I touched, I cleared most of the lint errors. To simplify this migration, lots of "not yet needed" code is commented out. Not yet used "useState()" pairs were commented out, partially implemented useState() had the errors that resulted "suppressed" with eslint no-unused-vars disables. Unused styled components were commented out. Removed Storybook (until we actually need it), it had lots of unresolved version dependencies.
…tore to a useContext() / WeAppContext This PR does not fully work -- The configuration Stores and Actions still use AppObservableStore which is not connected to the new WeAppContext.jsx Store-- Most of the functional components have been switched to the new useContext() ~ WeAppContext.jsx improvement/rough equivalent. The Teams and FAQ pages display, Login works, none of the actions/stores work yet, but they do not block compilation. All the breaking changes from react-router 6 and 7 are resolved, this eliminates the need for react-router-dom-v5 compat. This router upgrade has big changes (nice simplifications) for App.jsx. Some class functions needed to upgraded to functional components to work with useContext(), and more still need upgrading. As a first demo of using useContext -- replaced AppObservableStore with WeAppContext.jsx, which eliminates all the subscriptions than needed to be created and destroyed for each component that used it. So many onAppObservableStoreChange() instances were replaced with useEffect(). WeAppContext.jsx is just a "modern" global key value store without specific setters/getters. For all files that I touched, I cleared most of the lint errors. To simplify this migration, lots of "not yet needed" code is commented out. Not yet used "useState()" pairs were commented out, partially implemented useState() had the errors that resulted "suppressed" with eslint no-unused-vars disables. Unused styled components were commented out. Removed Storybook (until we actually need it), it had lots of unresolved version dependencies.
…tore to a useContext() / WeAppContext This PR does not fully work -- The configuration Stores and Actions still use AppObservableStore which is not connected to the new WeAppContext.jsx Store-- Most of the functional components have been switched to the new useContext() ~ WeAppContext.jsx improvement/rough equivalent. The Teams and FAQ pages display, Login works, none of the actions/stores work yet, but they do not block compilation. All the breaking changes from react-router 6 and 7 are resolved, this eliminates the need for react-router-dom-v5 compat. This router upgrade has big changes (nice simplifications) for App.jsx. Some class functions needed to upgraded to functional components to work with useContext(), and more still need upgrading. As a first demo of using useContext -- replaced AppObservableStore with WeAppContext.jsx, which eliminates all the subscriptions than needed to be created and destroyed for each component that used it. So many onAppObservableStoreChange() instances were replaced with useEffect(). WeAppContext.jsx is just a "modern" global key value store without specific setters/getters. For all files that I touched, I cleared most of the lint errors. To simplify this migration, lots of "not yet needed" code is commented out. Not yet used "useState()" pairs were commented out, partially implemented useState() had the errors that resulted "suppressed" with eslint no-unused-vars disables. Unused styled components were commented out. Removed Storybook (until we actually need it), it had lots of unresolved version dependencies.
… but many existing features do not fully work -- The existing flux based configuration Stores and Actions are not functional components and still use AppObservableStore which is not logically connected to the new replacement ConnectAppContext.jsx Store -- Most of the functional components have been switched to the new useContext() ~ ConnectAppContext.jsx. The Teams and FAQ pages display, and Login works. Throughout the app the flux actions/stores need to be replaced with the much simpler react-query, but the lack of these changes do not block compilation. Team and Person Store/Actions have been replaced enough for the Teams page to display. All the code in Stores meant to manage cache is no longer needed -- react-cache does that automatically. I found that apiCalming() is no longer needed, react-cache does that automatically too. You make the api request as often as you want on a page, and get served with cached data. There is a way to force a cache update if needed. All the breaking changes from react-router 6 and 7 are resolved, this eliminates the need for the 'react-router-dom-v5 compat' library. This router upgrade has big changes (nice simplifications) for App.jsx. Some class functions needed to upgraded to functional components to work with useContext(), and more still need upgrading. As a first step in switching over to useContext -- I replaced AppObservableStore with ConnectAppContext..jsx, which eliminates all the subscriptions that were needed to be created and destroyed for each component. So, many onAppObservableStoreChange() instances were replaced with useEffect(). ConnectAppContext.jsx is just a "modern" global key value store without specific setters/getters. For all files that I touched, I cleared most of the lint errors. To simplify this migration, lots of "not yet needed" code is commented out, since I relied heavily on lint errors. Not yet used "useState()" pairs were commented out, partially implemented useState() had the resulting errors "suppressed" with eslint no-unused-vars disables. Unused styled components were commented out. Removed Storybook (until we actually need it), it had lots of unresolved version dependencies. Boolean props to StyledComponents now need a $ in front of the variable like $largeFont, due to the React upgrade.
SailingSteve
changed the title
DO NOT MERGE: Changed from React 17 to 19, React-router from 5 to 7, AppObservableStore to a useContext() / WeAppContext
DO NOT MERGE: Changed from React 17 to 19, React-router from 5 to 7, AppObservableStore to a useContext() / ConnectAppContext
Jan 3, 2025
… but many existing features do not fully work -- The existing flux based configuration Stores and Actions are not functional components and still use AppObservableStore which is not logically connected to the new replacement ConnectAppContext.jsx Store -- Most of the functional components have been switched to the new useContext() ~ ConnectAppContext.jsx. The Teams and FAQ pages display, and Login works. Throughout the app the flux actions/stores need to be replaced with the much simpler react-query, but the lack of these changes do not block compilation. Team and Person Store/Actions have been replaced enough for the Teams page to display. All the code in Stores meant to manage cache is no longer needed -- react-cache does that automatically. I found that apiCalming() is no longer needed, react-cache does that automatically too. You make the api request as often as you want on a page, and get served with cached data. There is a way to force a cache update if needed. All the breaking changes from react-router 6 and 7 are resolved, this eliminates the need for the 'react-router-dom-v5 compat' library. This router upgrade has big changes (nice simplifications) for App.jsx. Some class functions needed to upgraded to functional components to work with useContext(), and more still need upgrading. As a first step in switching over to useContext -- I replaced AppObservableStore with ConnectAppContext..jsx, which eliminates all the subscriptions that were needed to be created and destroyed for each component. So, many onAppObservableStoreChange() instances were replaced with useEffect(). ConnectAppContext.jsx is just a "modern" global key value store without specific setters/getters. For all files that I touched, I cleared most of the lint errors. To simplify this migration, lots of "not yet needed" code is commented out, since I relied heavily on lint errors. Not yet used "useState()" pairs were commented out, partially implemented useState() had the resulting errors "suppressed" with eslint no-unused-vars disables. Unused styled components were commented out. Removed Storybook (until we actually need it), it had lots of unresolved version dependencies. Boolean props to StyledComponents now need a $ in front of the variable like $largeFont, due to the React upgrade.
… like it will be much simpler to use and maintain. This PR is not a full replacement for all the flux stores. This PR compiles, but many existing features do not fully work -- The existing flux based configuration Stores and Actions are not functional components so they have to still use AppObservableStore which is not logically connected to the new replacement ConnectAppContext.jsx Store -- Most of the functional components have been switched to the new useContext() ~ ConnectAppContext.jsx. The Teams and FAQ pages display, and Login works. You can delete a team member. The Team and Person Store/Actions have been replaced enough for the Teams page to display. All the code in Stores meant to manage cache is no longer needed -- react-cache does that automatically. I also found that apiCalming() is no longer needed, react-cache 'calms' api queries automatically too. You make the api request as often as you want on a page, and the request get served with cached data. There is a way to force a cache update if needed. All the breaking changes from react-router 6 and 7 are resolved, this eliminates the need for the 'react-router-dom-v5 compat' library. This router upgrade also nicely simplifies App.jsx. Some class functions need to be upgraded to functional components to work with useContext(), and more still need upgrading. As a first step in switching over to useContext -- I replaced AppObservableStore with ConnectAppContext..jsx, which eliminates all the subscriptions that were needed to be created and destroyed for each component. So, many onAppObservableStoreChange() instances were replaced with useEffect(). ConnectAppContext.jsx is just a "modern" global key value store without specific setters/getters. For all files that I touched, I cleared most of the lint errors. To simplify this migration, lots of "not yet needed" code is commented out, since I rely heavily on lint errors. Not yet used "useState()" pairs were commented out, partially implemented useState() had the resulting errors "suppressed" with eslint no-unused-vars disables. Unused styled components were commented out. Removed Storybook (until we actually need it), it had lots of unresolved version dependencies. Minor note: Boolean props to StyledComponents now need a $ in front of the variable like $largeFont, due to the React upgrade.
… like it will be much simpler to use and maintain. This PR is not a full replacement for all the flux stores. This PR compiles, but many existing features do not fully work -- The existing flux based configuration Stores and Actions are not functional components so they have to still use AppObservableStore which is not logically connected to the new replacement ConnectAppContext.jsx Store -- Most of the functional components have been switched to the new useContext() ~ ConnectAppContext.jsx. The Teams and FAQ pages display, and Login works. You can delete a team member. The Team and Person Store/Actions have been replaced enough for the Teams page to display. All the code in Stores meant to manage cache is no longer needed -- react-cache does that automatically. I also found that apiCalming() is no longer needed, react-cache 'calms' api queries automatically too. You make the api request as often as you want on a page, and the request get served with cached data. There is a way to force a cache update if needed. All the breaking changes from react-router 6 and 7 are resolved, this eliminates the need for the 'react-router-dom-v5 compat' library. This router upgrade also nicely simplifies App.jsx. Some class functions need to be upgraded to functional components to work with useContext(), and more still need upgrading. As a first step in switching over to useContext -- I replaced AppObservableStore with ConnectAppContext..jsx, which eliminates all the subscriptions that were needed to be created and destroyed for each component. So, many onAppObservableStoreChange() instances were replaced with useEffect(). ConnectAppContext.jsx is just a "modern" global key value store without specific setters/getters. For all files that I touched, I cleared most of the lint errors. To simplify this migration, lots of "not yet needed" code is commented out, since I rely heavily on lint errors. Not yet used "useState()" pairs were commented out, partially implemented useState() had the resulting errors "suppressed" with eslint no-unused-vars disables. Unused styled components were commented out. Removed Storybook (until we actually need it), it had lots of unresolved version dependencies. Minor note: Boolean props to StyledComponents now need a $ in front of the variable like $largeFont, due to the React upgrade.
…modifies the list, the underlying TeamMemberList on the "page" is now updated. ------------- Pre Jan 8, 2025 First steps toward replacing flux with react-query. react-query looks like it will be much simpler to use and maintain. This PR is not a full replacement for all the flux stores. This PR compiles, but many existing features do not fully work -- The existing flux based configuration Stores and Actions are not functional components so they have to still use AppObservableStore which is not logically connected to the new replacement ConnectAppContext.jsx Store -- Most of the functional components have been switched to the new useContext() ~ ConnectAppContext.jsx. The Teams and FAQ pages display, and Login works. You can delete a team member. The Team and Person Store/Actions have been replaced enough for the Teams page to display. All the code in Stores meant to manage cache is no longer needed -- react-cache does that automatically. I also found that apiCalming() is no longer needed, react-cache 'calms' api queries automatically too. You make the api request as often as you want on a page, and the request get served with cached data. There is a way to force a cache update if needed. All the breaking changes from react-router 6 and 7 are resolved, this eliminates the need for the 'react-router-dom-v5 compat' library. This router upgrade also nicely simplifies App.jsx. Some class functions need to be upgraded to functional components to work with useContext(), and more still need upgrading. As a first step in switching over to useContext -- I replaced AppObservableStore with ConnectAppContext..jsx, which eliminates all the subscriptions that were needed to be created and destroyed for each component. So, many onAppObservableStoreChange() instances were replaced with useEffect(). ConnectAppContext.jsx is just a "modern" global key value store without specific setters/getters. For all files that I touched, I cleared most of the lint errors. To simplify this migration, lots of "not yet needed" code is commented out, since I rely heavily on lint errors. Not yet used "useState()" pairs were commented out, partially implemented useState() had the resulting errors "suppressed" with eslint no-unused-vars disables. Unused styled components were commented out. Removed Storybook (until we actually need it), it had lots of unresolved version dependencies. Minor note: Boolean props to StyledComponents now need a $ in front of the variable like $largeFont, due to the React upgrade.
… or edit a team member's info, modifies the list, the underlying TeamMemberList on the "page" is now updated. ------------- Pre Jan 8, 2025 First steps toward replacing flux with react-query. react-query looks like it will be much simpler to use and maintain. This PR is not a full replacement for all the flux stores. This PR compiles, but many existing features do not fully work -- The existing flux based configuration Stores and Actions are not functional components so they have to still use AppObservableStore which is not logically connected to the new replacement ConnectAppContext.jsx Store -- Most of the functional components have been switched to the new useContext() ~ ConnectAppContext.jsx. The Teams and FAQ pages display, and Login works. You can delete a team member. The Team and Person Store/Actions have been replaced enough for the Teams page to display. All the code in Stores meant to manage cache is no longer needed -- react-cache does that automatically. I also found that apiCalming() is no longer needed, react-cache 'calms' api queries automatically too. You make the api request as often as you want on a page, and the request get served with cached data. There is a way to force a cache update if needed. All the breaking changes from react-router 6 and 7 are resolved, this eliminates the need for the 'react-router-dom-v5 compat' library. This router upgrade also nicely simplifies App.jsx. Some class functions need to be upgraded to functional components to work with useContext(), and more still need upgrading. As a first step in switching over to useContext -- I replaced AppObservableStore with ConnectAppContext..jsx, which eliminates all the subscriptions that were needed to be created and destroyed for each component. So, many onAppObservableStoreChange() instances were replaced with useEffect(). ConnectAppContext.jsx is just a "modern" global key value store without specific setters/getters. For all files that I touched, I cleared most of the lint errors. To simplify this migration, lots of "not yet needed" code is commented out, since I rely heavily on lint errors. Not yet used "useState()" pairs were commented out, partially implemented useState() had the resulting errors "suppressed" with eslint no-unused-vars disables. Unused styled components were commented out. Removed Storybook (until we actually need it), it had lots of unresolved version dependencies. Minor note: Boolean props to StyledComponents now need a $ in front of the variable like $largeFont, due to the React upgrade.
… or edit a team member's info, modifies the list, the underlying TeamMemberList on the "page" is now updated. ------------- Pre Jan 8, 2025 First steps toward replacing flux with react-query. react-query looks like it will be much simpler to use and maintain. This PR is not a full replacement for all the flux stores. This PR compiles, but many existing features do not fully work -- The existing flux based configuration Stores and Actions are not functional components so they have to still use AppObservableStore which is not logically connected to the new replacement ConnectAppContext.jsx Store -- Most of the functional components have been switched to the new useContext() ~ ConnectAppContext.jsx. The Teams and FAQ pages display, and Login works. You can delete a team member. The Team and Person Store/Actions have been replaced enough for the Teams page to display. All the code in Stores meant to manage cache is no longer needed -- react-cache does that automatically. I also found that apiCalming() is no longer needed, react-cache 'calms' api queries automatically too. You make the api request as often as you want on a page, and the request get served with cached data. There is a way to force a cache update if needed. All the breaking changes from react-router 6 and 7 are resolved, this eliminates the need for the 'react-router-dom-v5 compat' library. This router upgrade also nicely simplifies App.jsx. Some class functions need to be upgraded to functional components to work with useContext(), and more still need upgrading. As a first step in switching over to useContext -- I replaced AppObservableStore with ConnectAppContext..jsx, which eliminates all the subscriptions that were needed to be created and destroyed for each component. So, many onAppObservableStoreChange() instances were replaced with useEffect(). ConnectAppContext.jsx is just a "modern" global key value store without specific setters/getters. For all files that I touched, I cleared most of the lint errors. To simplify this migration, lots of "not yet needed" code is commented out, since I rely heavily on lint errors. Not yet used "useState()" pairs were commented out, partially implemented useState() had the resulting errors "suppressed" with eslint no-unused-vars disables. Unused styled components were commented out. Removed Storybook (until we actually need it), it had lots of unresolved version dependencies. Minor note: Boolean props to StyledComponents now need a $ in front of the variable like $largeFont, due to the React upgrade.
… or edit a team member's info, modifies the list, the underlying TeamMemberList on the "page" is now updated. ------------- Pre Jan 8, 2025 First steps toward replacing flux with react-query. react-query looks like it will be much simpler to use and maintain. This PR is not a full replacement for all the flux stores. This PR compiles, but many existing features do not fully work -- The existing flux based configuration Stores and Actions are not functional components so they have to still use AppObservableStore which is not logically connected to the new replacement ConnectAppContext.jsx Store -- Most of the functional components have been switched to the new useContext() ~ ConnectAppContext.jsx. The Teams and FAQ pages display, and Login works. You can delete a team member. The Team and Person Store/Actions have been replaced enough for the Teams page to display. All the code in Stores meant to manage cache is no longer needed -- react-cache does that automatically. I also found that apiCalming() is no longer needed, react-cache 'calms' api queries automatically too. You make the api request as often as you want on a page, and the request get served with cached data. There is a way to force a cache update if needed. All the breaking changes from react-router 6 and 7 are resolved, this eliminates the need for the 'react-router-dom-v5 compat' library. This router upgrade also nicely simplifies App.jsx. Some class functions need to be upgraded to functional components to work with useContext(), and more still need upgrading. As a first step in switching over to useContext -- I replaced AppObservableStore with ConnectAppContext..jsx, which eliminates all the subscriptions that were needed to be created and destroyed for each component. So, many onAppObservableStoreChange() instances were replaced with useEffect(). ConnectAppContext.jsx is just a "modern" global key value store without specific setters/getters. For all files that I touched, I cleared most of the lint errors. To simplify this migration, lots of "not yet needed" code is commented out, since I rely heavily on lint errors. Not yet used "useState()" pairs were commented out, partially implemented useState() had the resulting errors "suppressed" with eslint no-unused-vars disables. Unused styled components were commented out. Removed Storybook (until we actually need it), it had lots of unresolved version dependencies. Minor note: Boolean props to StyledComponents now need a $ in front of the variable like $largeFont, due to the React upgrade.
…is pressed in a drawer to add/create/delete staff. ------------- Pre Jan 8, 2025 First steps toward replacing flux with react-query. react-query looks like it will be much simpler to use and maintain. This PR is not a full replacement for all the flux stores. This PR compiles, but many existing features do not fully work -- The existing flux based configuration Stores and Actions are not functional components so they have to still use AppObservableStore which is not logically connected to the new replacement ConnectAppContext.jsx Store -- Most of the functional components have been switched to the new useContext() ~ ConnectAppContext.jsx. The Teams and FAQ pages display, and Login works. You can delete a team member. The Team and Person Store/Actions have been replaced enough for the Teams page to display. All the code in Stores meant to manage cache is no longer needed -- react-cache does that automatically. I also found that apiCalming() is no longer needed, react-cache 'calms' api queries automatically too. You make the api request as often as you want on a page, and the request get served with cached data. There is a way to force a cache update if needed. All the breaking changes from react-router 6 and 7 are resolved, this eliminates the need for the 'react-router-dom-v5 compat' library. This router upgrade also nicely simplifies App.jsx. Some class functions need to be upgraded to functional components to work with useContext(), and more still need upgrading. As a first step in switching over to useContext -- I replaced AppObservableStore with ConnectAppContext..jsx, which eliminates all the subscriptions that were needed to be created and destroyed for each component. So, many onAppObservableStoreChange() instances were replaced with useEffect(). ConnectAppContext.jsx is just a "modern" global key value store without specific setters/getters. For all files that I touched, I cleared most of the lint errors. To simplify this migration, lots of "not yet needed" code is commented out, since I rely heavily on lint errors. Not yet used "useState()" pairs were commented out, partially implemented useState() had the resulting errors "suppressed" with eslint no-unused-vars disables. Unused styled components were commented out. Removed Storybook (until we actually need it), it had lots of unresolved version dependencies. Minor note: Boolean props to StyledComponents now need a $ in front of the variable like $largeFont, due to the React upgrade.
…is pressed in a drawer to add/create/delete staff. ------------- Pre Jan 8, 2025 First steps toward replacing flux with react-query. react-query looks like it will be much simpler to use and maintain. This PR is not a full replacement for all the flux stores. This PR compiles, but many existing features do not fully work -- The existing flux based configuration Stores and Actions are not functional components so they have to still use AppObservableStore which is not logically connected to the new replacement ConnectAppContext.jsx Store -- Most of the functional components have been switched to the new useContext() ~ ConnectAppContext.jsx. The Teams and FAQ pages display, and Login works. You can delete a team member. The Team and Person Store/Actions have been replaced enough for the Teams page to display. All the code in Stores meant to manage cache is no longer needed -- react-cache does that automatically. I also found that apiCalming() is no longer needed, react-cache 'calms' api queries automatically too. You make the api request as often as you want on a page, and the request get served with cached data. There is a way to force a cache update if needed. All the breaking changes from react-router 6 and 7 are resolved, this eliminates the need for the 'react-router-dom-v5 compat' library. This router upgrade also nicely simplifies App.jsx. Some class functions need to be upgraded to functional components to work with useContext(), and more still need upgrading. As a first step in switching over to useContext -- I replaced AppObservableStore with ConnectAppContext..jsx, which eliminates all the subscriptions that were needed to be created and destroyed for each component. So, many onAppObservableStoreChange() instances were replaced with useEffect(). ConnectAppContext.jsx is just a "modern" global key value store without specific setters/getters. For all files that I touched, I cleared most of the lint errors. To simplify this migration, lots of "not yet needed" code is commented out, since I rely heavily on lint errors. Not yet used "useState()" pairs were commented out, partially implemented useState() had the resulting errors "suppressed" with eslint no-unused-vars disables. Unused styled components were commented out. Removed Storybook (until we actually need it), it had lots of unresolved version dependencies. Minor note: Boolean props to StyledComponents now need a $ in front of the variable like $largeFont, due to the React upgrade.
…is pressed in a drawer to add/create/delete staff. ------------- Pre Jan 8, 2025 First steps toward replacing flux with react-query. react-query looks like it will be much simpler to use and maintain. This PR is not a full replacement for all the flux stores. This PR compiles, but many existing features do not fully work -- The existing flux based configuration Stores and Actions are not functional components so they have to still use AppObservableStore which is not logically connected to the new replacement ConnectAppContext.jsx Store -- Most of the functional components have been switched to the new useContext() ~ ConnectAppContext.jsx. The Teams and FAQ pages display, and Login works. You can delete a team member. The Team and Person Store/Actions have been replaced enough for the Teams page to display. All the code in Stores meant to manage cache is no longer needed -- react-cache does that automatically. I also found that apiCalming() is no longer needed, react-cache 'calms' api queries automatically too. You make the api request as often as you want on a page, and the request get served with cached data. There is a way to force a cache update if needed. All the breaking changes from react-router 6 and 7 are resolved, this eliminates the need for the 'react-router-dom-v5 compat' library. This router upgrade also nicely simplifies App.jsx. Some class functions need to be upgraded to functional components to work with useContext(), and more still need upgrading. As a first step in switching over to useContext -- I replaced AppObservableStore with ConnectAppContext..jsx, which eliminates all the subscriptions that were needed to be created and destroyed for each component. So, many onAppObservableStoreChange() instances were replaced with useEffect(). ConnectAppContext.jsx is just a "modern" global key value store without specific setters/getters. For all files that I touched, I cleared most of the lint errors. To simplify this migration, lots of "not yet needed" code is commented out, since I rely heavily on lint errors. Not yet used "useState()" pairs were commented out, partially implemented useState() had the resulting errors "suppressed" with eslint no-unused-vars disables. Unused styled components were commented out. Removed Storybook (until we actually need it), it had lots of unresolved version dependencies. Minor note: Boolean props to StyledComponents now need a $ in front of the variable like $largeFont, due to the React upgrade.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Updates the underlying TeamMemberList on the "page", when the button is pressed in a drawer to add/create/delete staff.
------------- Pre Jan 8, 2025 comments -----------
First steps toward replacing flux with react-query. react-query looks like it will be much simpler to use and maintain.
This PR is not a full replacement for all the flux stores. This PR compiles, but many existing features do not fully work -- The existing flux based configuration Stores and Actions are not functional components so they have to still use AppObservableStore which is not logically connected to the new replacement ConnectAppContext.jsx Store -- Most of the functional components have been switched to the new useContext() ~ ConnectAppContext.jsx.
The Teams and FAQ pages display, and Login works. You can delete a team member. The Team and Person Store/Actions have been replaced enough for the Teams page to display.
All the code in Stores meant to manage cache is no longer needed -- react-cache does that automatically. I also found that apiCalming() is no longer needed, react-cache 'calms' api queries automatically too. You make the api request as often as you want on a page, and the request get served with cached data. There is a way to force a cache update if needed.
All the breaking changes from react-router 6 and 7 are resolved, this eliminates the need for the 'react-router-dom-v5 compat' library. This router upgrade also nicely simplifies App.jsx.
Some class functions need to be upgraded to functional components to work with useContext(), and more still need upgrading.
As a first step in switching over to useContext -- I replaced AppObservableStore with ConnectAppContext..jsx, which eliminates all the subscriptions that were needed to be created and destroyed for each component. So, many onAppObservableStoreChange() instances were replaced with useEffect(). ConnectAppContext.jsx is just a "modern" global key value store without specific setters/getters.
For all files that I touched, I cleared most of the lint errors.
To simplify this migration, lots of "not yet needed" code is commented out, since I rely heavily on lint errors. Not yet used "useState()" pairs were commented out, partially implemented useState() had the resulting errors "suppressed" with eslint no-unused-vars disables. Unused styled components were commented out.
Removed Storybook (until we actually need it), it had lots of unresolved version dependencies.
Minor note: Boolean props to StyledComponents now need a $ in front of the variable like $largeFont, due to the React upgrade.