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

Upgrades to react-router 6.4 #6

Merged
merged 5 commits into from
Mar 27, 2024
Merged

Upgrades to react-router 6.4 #6

merged 5 commits into from
Mar 27, 2024

Conversation

elliotBraem
Copy link
Contributor

This upgrades react-router-dom to 6.4 and migrates usage. Looks like this now:

  const router = createBrowserRouter([
    {
      path: "/",
      element: (
        <Viewer
          widgetSrc={props.src}
          code={props.code}
          initialProps={props.initialProps}
        />
      ),
    },
    { path: "/*", element: <Viewer /> },
  ]);

  return <RouterProvider router={router} />;

Is also solves an issue I realized from previous PR that provided paths were not being supported outside default widget. Now you can do something like this again: http://127.0.0.1:3000/efiz.near/widget/Tree; previously it would still only show default widget.

@petersalomonsen
Copy link
Collaborator

How can we test this @elliotBraem ?

Maybe the time has come to introduce Playwright, so that we also can generate videos for PR reviews? Would be great to easily show a video demo of the enhancement here, in addition to that everything works as before with the upgrade of react router.

@elliotBraem
Copy link
Contributor Author

elliotBraem commented Mar 21, 2024

I think that's a great idea -- but what do you mean by generating videos? Does playwright have this feature?

I'm actually getting testing started for potlock rn, just opened this PR: PotLock/bos-app#488

I'm glad you brought this up, because it highlights a few things I've been trying to understand.

Also, I've noticed that bos-workspace can replace the scripts/dev-gateway from devhub repo, we can also specify dist to use with -g flag.

@petersalomonsen
Copy link
Collaborator

I think that's a great idea -- but what do you mean by generating videos? Does playwright have this feature?

Yes it is a simple boolean flag in the playwright config. Just see the videos in here: NEAR-DevHub/neardevhub-bos#691 (comment)

I'm actually getting testing started for potlock rn, just opened this PR: PotLock/bos-app#488

That is awesome! Happy to see more testing for projects in the ecosystem. I think this makes it so much easier to demonstrate and document pull requests, and also reduce the fear of breaking things.

I'm glad you brought this up, because it highlights a few things I've been trying to understand.

Also, I've noticed that bos-workspace can replace the scripts/dev-gateway from devhub repo, we can also specify dist to use with -g flag.

That's nice ! Can you develop with this without having to use localstorage flags for the bos-loader? you maybe don't need the bos-loader at all when using bos-workspace?

@elliotBraem elliotBraem merged commit d2a31d0 into main Mar 27, 2024
@elliotBraem elliotBraem deleted the feat/routes branch March 27, 2024 18:48
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.

2 participants