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

chore(deps): update react ecosystem #5328

Merged
merged 1 commit into from
Mar 11, 2024
Merged

Conversation

renovate[bot]
Copy link
Contributor

@renovate renovate bot commented Mar 4, 2024

Mend Renovate

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
@types/react (source) 18.2.45 -> 18.2.64 age adoption passing confidence
@types/react (source) 18.2.14 -> 18.2.64 age adoption passing confidence
@types/react-dom (source) 18.2.7 -> 18.2.21 age adoption passing confidence
@types/react-dom (source) 18.2.17 -> 18.2.21 age adoption passing confidence
@types/react-portal (source) 4.0.4 -> 4.0.7 age adoption passing confidence
@types/react-redux (source) 7.1.25 -> 7.1.33 age adoption passing confidence
react-router-dom-v5-compat (source) 6.8.1 -> 6.22.3 age adoption passing confidence
react-useportal (source) 1.0.18 -> 1.0.19 age adoption passing confidence

Release Notes

remix-run/react-router (react-router-dom-v5-compat)

v6.22.3

Compare Source

Patch Changes
  • Updated dependencies:
    • react-router@6.22.3
    • react-router-dom@6.22.3

v6.22.2

Compare Source

Patch Changes
  • Updated dependencies:
    • react-router@6.22.2
    • react-router-dom@6.22.2

v6.22.1

Compare Source

Patch Changes
  • Updated dependencies:
    • react-router@6.22.1
    • react-router-dom@6.22.1

v6.22.0

Compare Source

Minor Changes
  • Include a window__reactRouterVersion tag for CWV Report detection (#​11222)
Patch Changes
  • Updated dependencies:
    • react-router-dom@6.22.0
    • react-router@6.22.0

v6.21.3

Compare Source

Patch Changes
  • Remove leftover unstable_ prefix from Blocker/BlockerFunction types (#​11187)
  • Updated dependencies:
    • react-router-dom@6.21.3
    • react-router@6.21.3

v6.21.2

Compare Source

Patch Changes
  • Updated dependencies:
    • react-router-dom@6.21.2
    • react-router@6.21.2

v6.21.1

Compare Source

Patch Changes
  • Updated dependencies:
    • react-router@6.21.1
    • react-router-dom@6.21.1

v6.21.0

Compare Source

Minor Changes
  • Add a new future.v7_relativeSplatPath flag to implement a breaking bug fix to relative routing when inside a splat route. (#​11087)

    This fix was originally added in #​10983 and was later reverted in #​11078 because it was determined that a large number of existing applications were relying on the buggy behavior (see #​11052)

    The Bug
    The buggy behavior is that without this flag, the default behavior when resolving relative paths is to ignore any splat (*) portion of the current route path.

    The Background
    This decision was originally made thinking that it would make the concept of nested different sections of your apps in <Routes> easier if relative routing would replace the current splat:

    <BrowserRouter>
      <Routes>
        <Route path="/" element={<Home />} />
        <Route path="dashboard/*" element={<Dashboard />} />
      </Routes>
    </BrowserRouter>

    Any paths like /dashboard, /dashboard/team, /dashboard/projects will match the Dashboard route. The dashboard component itself can then render nested <Routes>:

    function Dashboard() {
      return (
        <div>
          <h2>Dashboard</h2>
          <nav>
            <Link to="/">Dashboard Home</Link>
            <Link to="team">Team</Link>
            <Link to="projects">Projects</Link>
          </nav>
    
          <Routes>
            <Route path="/" element={<DashboardHome />} />
            <Route path="team" element={<DashboardTeam />} />
            <Route path="projects" element={<DashboardProjects />} />
          </Routes>
        </div>
      );
    }

    Now, all links and route paths are relative to the router above them. This makes code splitting and compartmentalizing your app really easy. You could render the Dashboard as its own independent app, or embed it into your large app without making any changes to it.

    The Problem

    The problem is that this concept of ignoring part of a path breaks a lot of other assumptions in React Router - namely that "." always means the current location pathname for that route. When we ignore the splat portion, we start getting invalid paths when using ".":

    // If we are on URL /dashboard/team, and we want to link to /dashboard/team:
    function DashboardTeam() {
      // ❌ This is broken and results in <a href="/dashboard">
      return <Link to=".">A broken link to the Current URL</Link>;
    
      // ✅ This is fixed but super unintuitive since we're already at /dashboard/team!
      return <Link to="./team">A broken link to the Current URL</Link>;
    }

    We've also introduced an issue that we can no longer move our DashboardTeam component around our route hierarchy easily - since it behaves differently if we're underneath a non-splat route, such as /dashboard/:widget. Now, our "." links will, properly point to ourself inclusive of the dynamic param value so behavior will break from it's corresponding usage in a /dashboard/* route.

    Even worse, consider a nested splat route configuration:

    <BrowserRouter>
      <Routes>
        <Route path="dashboard">
          <Route path="*" element={<Dashboard />} />
        </Route>
      </Routes>
    </BrowserRouter>

    Now, a <Link to="."> and a <Link to=".."> inside the Dashboard component go to the same place! That is definitely not correct!

    Another common issue arose in Data Routers (and Remix) where any <Form> should post to it's own route action if you the user doesn't specify a form action:

    let router = createBrowserRouter({
      path: "/dashboard",
      children: [
        {
          path: "*",
          action: dashboardAction,
          Component() {
            // ❌ This form is broken!  It throws a 405 error when it submits because
            // it tries to submit to /dashboard (without the splat value) and the parent
            // `/dashboard` route doesn't have an action
            return <Form method="post">...</Form>;
          },
        },
      ],
    });

    This is just a compounded issue from the above because the default location for a Form to submit to is itself (".") - and if we ignore the splat portion, that now resolves to the parent route.

    The Solution
    If you are leveraging this behavior, it's recommended to enable the future flag, move your splat to it's own route, and leverage ../ for any links to "sibling" pages:

    <BrowserRouter>
      <Routes>
        <Route path="dashboard">
          <Route index path="*" element={<Dashboard />} />
        </Route>
      </Routes>
    </BrowserRouter>
    
    function Dashboard() {
      return (
        <div>
          <h2>Dashboard</h2>
          <nav>
            <Link to="..">Dashboard Home</Link>
            <Link to="../team">Team</Link>
            <Link to="../projects">Projects</Link>
          </nav>
    
          <Routes>
            <Route path="/" element={<DashboardHome />} />
            <Route path="team" element={<DashboardTeam />} />
            <Route path="projects" element={<DashboardProjects />} />
          </Router>
        </div>
      );
    }

    This way, . means "the full current pathname for my route" in all cases (including static, dynamic, and splat routes) and .. always means "my parents pathname".

Patch Changes
  • Updated dependencies:
    • react-router-dom@6.21.0
    • react-router@6.21.0

v6.20.1

Compare Source

Patch Changes
  • Updated dependencies:
    • react-router-dom@6.20.1
    • react-router@6.20.1

v6.20.0

Compare Source

Minor Changes
  • Export the PathParam type from the public API (#​10719)
Patch Changes
  • Updated dependencies:
    • react-router-dom@6.20.0
    • react-router@6.20.0

v6.19.0

Compare Source

Patch Changes
  • Updated dependencies:
    • react-router-dom@6.19.0
    • react-router@6.19.0

v6.18.0

Compare Source

Patch Changes
  • Updated dependencies:
    • react-router-dom@6.18.0
    • react-router@6.18.0

v6.17.0

Compare Source

Patch Changes
  • Updated dependencies:
    • react-router-dom@6.17.0
    • react-router@6.17.0

v6.16.0

Compare Source

Minor Changes
  • Updated dependencies:
    • react-router-dom@6.16.0
    • react-router@6.16.0

v6.15.0

Compare Source

Minor Changes
  • Add's a new redirectDocument() function which allows users to specify that a redirect from a loader/action should trigger a document reload (via window.location) instead of attempting to navigate to the redirected location via React Router (#​10705)
Patch Changes
  • Updated dependencies:
    • react-router-dom@6.15.0
    • react-router@6.15.0

v6.14.2

Compare Source

Patch Changes
  • Updated dependencies:
    • react-router-dom@6.14.2
    • react-router@6.14.2

v6.14.1

Compare Source

Patch Changes
  • Updated dependencies:
    • react-router@6.14.1
    • react-router-dom@6.14.1

v6.14.0

Compare Source

Patch Changes
  • Upgrade typescript to 5.1 (#​10581)
  • Updated dependencies:
    • react-router@6.14.0
    • react-router-dom@6.14.0

v6.13.0

Compare Source

Patch Changes
  • Updated dependencies:
    • react-router@6.13.0
    • react-router-dom@6.13.0

v6.12.1

Compare Source

Patch Changes
  • Updated dependencies:
    • react-router@6.12.1
    • react-router-dom@6.12.1

v6.12.0

Compare Source

Patch Changes
  • Updated dependencies:
    • react-router-dom@6.12.0
    • react-router@6.12.0

v6.11.2

Compare Source

Patch Changes
  • Updated dependencies:
    • react-router@6.11.2
    • react-router-dom@6.11.2

v6.11.1

Compare Source

Patch Changes
  • Updated dependencies:
    • react-router@6.11.1
    • react-router-dom@6.11.1

v6.11.0

Compare Source

Patch Changes
  • Updated dependencies:
    • react-router@6.11.0
    • react-router-dom@6.11.0

v6.10.0

Compare Source

Patch Changes
  • Updated dependencies:
    • react-router@6.10.0
    • react-router-dom@6.10.0

v6.9.0

Compare Source

Minor Changes
  • Updated dependencies:
    • react-router@6.9.0
    • react-router-dom@6.9.0
Patch Changes
  • Add missed data router API re-exports (#​10171)

v6.8.2

Compare Source

Patch Changes
  • Updated dependencies:
    • react-router-dom@6.8.2
    • react-router@6.8.2

Configuration

📅 Schedule: Branch creation - "before 5am on monday" in timezone Europe/London, Automerge - At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

👻 Immortal: This PR will be recreated if closed unmerged. Get config help if that's undesired.


  • If you want to rebase/retry this PR, check this box

This PR has been generated by Mend Renovate. View repository job log here.

@webteam-app
Copy link

Demo starting at https://maas-ui-5328.demos.haus

@renovate renovate bot force-pushed the renovate/react-ecosystem branch 5 times, most recently from f496d61 to b1d12a5 Compare March 6, 2024 23:32
@renovate renovate bot force-pushed the renovate/react-ecosystem branch from b1d12a5 to bba05b3 Compare March 7, 2024 16:21
@petermakowski petermakowski merged commit 935c528 into main Mar 11, 2024
8 checks passed
@renovate renovate bot deleted the renovate/react-ecosystem branch March 11, 2024 13:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants