-
Notifications
You must be signed in to change notification settings - Fork 1k
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
chore: Upgrade react-router-dom and use-query-params to latest in /ui #4764
Open
peruukki
wants to merge
3
commits into
feast-dev:master
Choose a base branch
from
peruukki:ui-up-react-router
base: master
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.
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
- hacks/RouteAdapter is no longer needed, the TypeScript types are nowadays correct - Pass `to` directly to `useHref` to avoid errors with search params (see feast-dev#3794) Signed-off-by: Harri Lehtola <[email protected]>
Updating query params when filtering table views somehow stopped working after upgrading react-router-dom, upgrading use-query-params too fixes that. Signed-off-by: Harri Lehtola <[email protected]>
react-router-dom was writing warning messages in the console about upcoming features in v7 and suggested opting in early. I tried turning them on, but couldn't get custom tabs navigation working properly with v7_relativeSplatPath enabled, so decided to keep it off for now. (Plus it might also break something in consuming apps.) v7_startTransition only needed an update in one place in a test where we need to await for the UI to update, so kept it on. It also shouldn't require any changes in consuming application code, though possibly something in tests like we needed here. Related docs: - https://reactrouter.com/en/6.28.0/upgrading/future#v7_relativesplatpath - https://reactrouter.com/en/6.28.0/upgrading/future#v7_starttransition Signed-off-by: Harri Lehtola <[email protected]>
peruukki
commented
Nov 16, 2024
@@ -39,7 +39,7 @@ export default function EuiCustomLink({ to, ...rest }) { | |||
} | |||
|
|||
// Generate the correct link href (with basename accounted for) | |||
const href = useHref({ pathname: to }); | |||
const href = useHref(to); |
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.
Copied from react-router-dom's Link component: https://github.com/remix-run/react-router/blob/dd323b6dec531811ce80595ac0521455b46f0bc2/packages/react-router-dom/index.tsx#L999.
peruukki
changed the title
chore: Upgrade react-router-dom and use-query-params to latest
chore: Upgrade react-router-dom and use-query-params to latest in /ui
Nov 16, 2024
franciscojavierarceo
approved these changes
Nov 16, 2024
Do we need a label from someone to run the last check, build-docker-image-java (feature-server-java)? |
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.
What this PR does / why we need it:
Upgrades react-router-dom and use-query-params to their latest versions; the latter is upgraded because its older version didn't work properly with the latest react-router-dom.
One small change in EuiCustomLink is done to avoid the error reported in #3794, I tried clicking everywhere in the UI and didn't see the error after the change.
Which issue(s) this PR fixes:
This allows to use the latest react-router-dom in a consuming app in case someone is using it, no longer being restricted to <6.4.0 due to #3794.
Misc
After the upgrade, react-router-dom writes a warning console message like this:
I tried enabling the flag but it caused issues with our current custom tab routes, and I couldn't sort it out with reasonable effort at this point. Also, since the feature can require non-trivial changes, enabling it might break something in consuming apps that use react-router-dom, so maybe better to leave it later anyway.
I enabled another future flag that I saw a similar console warning about,
v7_startTransition
, since that seems much safer, though I did need to add oneawait
in the tests after that.