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

Splitting up the route definitions from the router config and creation #11044

Merged
merged 1 commit into from
May 20, 2024

Conversation

codyrancher
Copy link
Contributor

@codyrancher codyrancher commented May 16, 2024

Summary

Splitting up the route definitions from the router config and creation for clarity

Occurred changes and/or fixed issues

Moved and removed code

Areas or cases that should be tested

Routing, if a page doesn't load it would almost certainly be caused by this change. The e2e tests should show whether this is a problem or not.

Checklist

  • The PR is linked to an issue and the linked issue has a Milestone, or no issue is needed
  • The PR has a Milestone
  • The PR template has been filled out
  • The PR has been self reviewed
  • The PR has a reviewer assigned
  • The PR has automated tests or clear instructions for manual tests and the linked issue has appropriate QA labels, or tests are not needed
  • The PR has reviewed with UX and tested in light and dark mode, or there are no UX changes

Comment on lines -488 to -493
// TODO: remove in Nuxt 3
const originalPush = router.push;

router.push = function push(location, onComplete = emptyFn, onAbort) {
return originalPush.call(this, location, onComplete, onAbort);
};
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We only used push with an empty second argument in one place. I updated that location so we can remove this code.

Comment on lines -495 to -503
const resolve = router.resolve.bind(router);

router.resolve = (to, current, append) => {
if (typeof to === 'string') {
to = normalizeURL(to);
}

return resolve(to, current, append);
};
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I removed this code. It's possible this may cause a regression but I think it's unlikely. I didn't find any obvious places where normalizeURL would make a difference.

@@ -322,7 +322,7 @@ async function mountApp(__app) {
});

// Push the path and let route to be resolved
router.push(path, undefined, (err) => {
router.push(path, () => {}, (err) => {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I explained this above. This allowed us to remove the router.push override that nuxt did.

@codyrancher codyrancher added this to the v2.9.0 milestone May 16, 2024
@codyrancher codyrancher marked this pull request as ready for review May 16, 2024 20:48
Copy link
Member

@rak-phillip rak-phillip left a comment

Choose a reason for hiding this comment

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

The change looks good to me, but I noticed a loading overlay while manually testing some routes

loading-overlay.mp4

In the first tab, I'm testing these change in my local development environment and a loading indicator is present before rendering local node details.

The second tab is my Rancher Instance that's hosted on DO, no loading indicator is present before rendering local node details.

Can this difference in behavior be related to this change?

@codyrancher
Copy link
Contributor Author

The change looks good to me, but I noticed a loading overlay while manually testing some routes
loading-overlay.mp4

In the first tab, I'm testing these change in my local development environment and a loading indicator is present before rendering local node details.

The second tab is my Rancher Instance that's hosted on DO, no loading indicator is present before rendering local node details.

Can this difference in behavior be related to this change?

I'm not sure. I'll try to reproduce.

@codyrancher
Copy link
Contributor Author

@rak-phillip I've attempted to reproduce but I haven't been able to. Do you have any other changes or unique about your environment?

router.mp4

@rak-phillip
Copy link
Member

@codyrancher nothing special that I can find. As a matter of fact, I'm taking not of this behavior again today while testing a separate branch. I don't think there's a change in behavior related to this PR.

@codyrancher codyrancher merged commit 3d3ba1b into rancher:master May 20, 2024
35 checks passed
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.

None yet

2 participants