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

React Router Future Flag warning #20527

Closed
Tracked by #7057
mshabarov opened this issue Nov 21, 2024 · 2 comments
Closed
Tracked by #7057

React Router Future Flag warning #20527

mshabarov opened this issue Nov 21, 2024 · 2 comments

Comments

@mshabarov
Copy link
Contributor

Description of the bug

There's a number of warnings triggered by React Router when using the latest Vaadin Flow snapshot/pre-release (24.6):
⚠️ React Router Future Flag Warning: React Router will begin wrapping state updates in React.startTransition in v7. You can use the v7_startTransition future flag to opt-in early. For more information, see https://reactrouter.com/v6/upgrading/future#v7_starttransition. indexhtml-CdhAQHz9.js:51:6661
⚠️ React Router Future Flag Warning: Relative route resolution within Splat routes is changing in v7. You can use the v7_relativeSplatPath future flag to opt-in early. For more information, see https://reactrouter.com/v6/upgrading/future#v7_relativesplatpath. indexhtml-CdhAQHz9.js:51:6661
⚠️ React Router Future Flag Warning: The persistence behavior of fetchers is changing in v7. You can use the v7_fetcherPersist future flag to opt-in early. For more information, see https://reactrouter.com/v6/upgrading/future#v7_fetcherpersist. indexhtml-CdhAQHz9.js:51:6661
⚠️ React Router Future Flag Warning: Casing of formMethod fields is being normalized to uppercase in v7. You can use the v7_normalizeFormMethod future flag to opt-in early. For more information, see https://reactrouter.com/v6/upgrading/future#v7_normalizeformmethod. indexhtml-CdhAQHz9.js:51:6661
⚠️ React Router Future Flag Warning: RouterProvider hydration behavior is changing in v7. You can use the v7_partialHydration future flag to opt-in early. For more information, see https://reactrouter.com/v6/upgrading/future#v7_partialhydration. indexhtml-CdhAQHz9.js:51:6661
⚠️ React Router Future Flag Warning: The revalidation behavior after 4xx/5xx action responses is changing in v7. You can use the v7_skipActionErrorRevalidation future flag to opt-in early. For more information, see https://reactrouter.com/v6/upgrading/future#v7_skipactionerrorrevalidation.

Options:

  • to opt-in these features, fix the behaviour that fails after that
  • to opt-out from these features for now, this though will come back later.

Expected behavior

No warnings

Minimal reproducible example

Any Vaadin 24.6 and 24.5 application that uses React Router (by default).

Versions

  • Vaadin / Flow version: 24.6 pre and 24.5.
@caalador
Copy link
Contributor

There is an open proposal to have the possibility to silence the warning without opting in.
remix-run/react-router#12321

@mshabarov
Copy link
Contributor Author

Adding all of these feature flags to the Flow-Hilla hybrid example looks promising, I couldn't spot any warning or unexpected behaviour:

// index.tsx:
function App() {
    return <AuthProvider>
        <RouterProvider router={router} future={{ v7_startTransition: true }} />
    </AuthProvider>;
}

// routes.tsx:
.build({
    future: {
        v7_fetcherPersist: true,
        v7_normalizeFormMethod: true,
        v7_partialHydration: true,
        v7_relativeSplatPath: true,
        v7_skipActionErrorRevalidation: true
    }
 });

mshabarov added a commit that referenced this issue Nov 27, 2024
Preparations for React Router v7, opts-in a new feature to avoid warnings in console.

Related-to #20527
mshabarov added a commit to vaadin/hilla that referenced this issue Nov 27, 2024
Preparations for React Router v7, opts-in the new features to avoid warnings in console.

Related-to vaadin/flow#20527
@mshabarov mshabarov moved this from 🟢Ready to Go to 🔎Iteration reviews in Vaadin Flow ongoing work (Vaadin 10+) Nov 27, 2024
mshabarov added a commit that referenced this issue Nov 27, 2024
Preparations for React Router v7, opts-in a new feature to avoid warnings in console.

Related-to #20527
vaadin-bot pushed a commit that referenced this issue Nov 27, 2024
Preparations for React Router v7, opts-in a new feature to avoid warnings in console.

Related-to #20527
vaadin-bot added a commit that referenced this issue Nov 27, 2024
Preparations for React Router v7, opts-in a new feature to avoid warnings in console.

Related-to #20527

Co-authored-by: Mikhail Shabarov <61410877+mshabarov@users.noreply.github.com>
Lodin added a commit to vaadin/hilla that referenced this issue Nov 27, 2024
* chore: Opt-in React Router v7 features

Preparations for React Router v7, opts-in the new features to avoid warnings in console.

Related-to vaadin/flow#20527

* fix test

---------

Co-authored-by: Vlad Rindevich <vladrin@vaadin.com>
cromoteca pushed a commit to vaadin/hilla that referenced this issue Nov 27, 2024
* chore: Opt-in React Router v7 features

Preparations for React Router v7, opts-in the new features to avoid warnings in console.

Related-to vaadin/flow#20527

* fix test

---------

Co-authored-by: Vlad Rindevich <vladrin@vaadin.com>
@github-project-automation github-project-automation bot moved this from 🔎Iteration reviews to Done in Vaadin Flow ongoing work (Vaadin 10+) Nov 28, 2024
@github-project-automation github-project-automation bot moved this from 🔖 High Priority (P1) to ✅ Closed in Vaadin Flow bugs & maintenance (Vaadin 10+) Nov 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

No branches or pull requests

2 participants