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

Ensure updating the remix router also updates the navigation data #4273

Merged
merged 3 commits into from
Oct 2, 2023

Conversation

Rheeseyb
Copy link
Contributor

Problem:
When working on a Remix project, it is possible to get "stuck" on a 404 route (the navigation toolbars stop working) if a change is made to the project whilst one is showing

Fix:
The problem here is that a change to the project's routes will replace the router with a new one, but we weren't updating the navigationData when this happened, meaning the navigation functions would still be using the previous router until the new one had triggered any form of navigation. This meant that hitting the "back" button would still call the loader function for the correct route, but then that route would never be rendered since this was happening via a router that wasn't being used as the actual RouterProvider for the remix app.

@github-actions
Copy link
Contributor

github-actions bot commented Sep 29, 2023

Try me

@relativeci
Copy link

relativeci bot commented Sep 29, 2023

Job #8337: Bundle Size — 62.7MiB (~+0.01%).

c631888(current) vs 5957b21 master#8329(baseline)

Warning

Bundle contains 64 duplicate packages - View duplicate packages

Bundle metrics (2 changes)
                 Current
Job #8337
     Baseline
Job #8329
Initial JS 34.97MiB(+0.01%) 34.96MiB
Initial CSS 0B 0B
Cache Invalidation 19.36% 18.37%
Chunks 27 27
Assets 31 31
Modules 3970 3970
Duplicate Modules 422 422
Duplicate Code 30.83% 30.83%
Packages 409 409
Duplicate Packages 64 64
Bundle size by type (1 change)
                 Current
Job #8337
     Baseline
Job #8329
CSS 0B 0B
Fonts 0B 0B
HTML 11.43KiB 11.43KiB
IMG 0B 0B
JS 62.69MiB (~+0.01%) 62.69MiB
Media 0B 0B
Other 0B 0B

View job #8337 reportView fix/remix-404-sticking-bug branch activity

@github-actions
Copy link
Contributor

github-actions bot commented Sep 29, 2023

Performance test results:
(Chart1)
(Chart2)

(
innerRouter: RouterType,
location: Location,
updateEntries: 'update-entries' | 'do-not-update-entries',
Copy link
Contributor

@balazsbajorics balazsbajorics Sep 29, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nitpick, but append-to-entries | replace-entries would be much clearer form e

Copy link
Contributor

@balazsbajorics balazsbajorics left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I left a nit to pick

@Rheeseyb Rheeseyb merged commit 4fb3ca0 into master Oct 2, 2023
9 checks passed
@Rheeseyb Rheeseyb deleted the fix/remix-404-sticking-bug branch October 2, 2023 10:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants