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

✨replace react-router wildcard routes with their actual path name #3023

Merged
merged 2 commits into from
Sep 20, 2024

Conversation

BenoitZugmeyer
Copy link
Member

Motivation

React Router routes defined with a '*' as a path are often used to create custom routing logic. It doesn't bring much value within a View name, as it could lead to very different pages.

Changes

Replace the wildcards with the actual path they are matching. For example, with the following router:

router = ceateBrowserRouter(
  [
    {
      path: '/foo',
      children: [{ path: '*' }]
    }
  ]
)

Accessing /foo/bar will create the view name /foo/bar instead of /foo/*.

Testing

  • Local
  • Staging
  • Unit
  • End to end

I have gone over the contributing documentation.

Before this commit, when running the dev-server, the react plugin was
taken from the built files (packages/rum-react/esm/....), so modifying
a source file did not re-build the sandbox.

Now, source files (from packages/rum-react/src/...) are used instead,
and modifying them trigger a sandbox rebuild.
React Router routes defined with a '*' as a path are often used to
create custom routing logic. It doesn't bring much value within a View
name, as it could lead to very different pages. Replace them with the
actual path they are matching.
@BenoitZugmeyer BenoitZugmeyer requested a review from a team as a code owner September 19, 2024 16:26
@BenoitZugmeyer BenoitZugmeyer merged commit 365ee74 into main Sep 20, 2024
19 checks passed
@BenoitZugmeyer BenoitZugmeyer deleted the benoit/react-wildcard branch September 20, 2024 12:32
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.

3 participants