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

Split AppRouter routes to multiple sub-routers based on top-level routes #6288

Closed
rithviknishad opened this issue Sep 14, 2023 · 1 comment · Fixed by #6363
Closed

Split AppRouter routes to multiple sub-routers based on top-level routes #6288

rithviknishad opened this issue Sep 14, 2023 · 1 comment · Fixed by #6363
Assignees

Comments

@rithviknishad
Copy link
Member

rithviknishad commented Sep 14, 2023

Advantages:

  • Cleaner codebase
  • Reudce API calls to fetch parent route datas
  • Improve codeclimate score

For example:

For every facility page we visit (/facility/{id}, /facility/{id}/configure, /facility/{id}/beds) we keep fetching the facility record for the breadcrubms and other things to work on every page visit.

However, with this approach, we can have a FacilityRouter which will wrap all facility routes under a ContextProvider that'll pass the current facility's data, and hence the facility read API is dispatched only once every time we enter a facility specific route.

<FacilityProvider>
  <FacilityConfigurePage> // or any other facility route page
</FacilityProvider>
@rithviknishad
Copy link
Member Author

To skip the caching and provider concept and just to split the app router

@rithviknishad rithviknishad changed the title (Draft) Split AppRouter routes to multiple sub-routers based on top-level routes Split AppRouter routes to multiple sub-routers based on top-level routes Sep 26, 2023
@rithviknishad rithviknishad moved this from Up Next to In Progress in Care Sep 27, 2023
@rithviknishad rithviknishad moved this from In Progress to Review required in Care Sep 28, 2023
@github-project-automation github-project-automation bot moved this from Review required to Done in Care Oct 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

1 participant