You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
At a minimum switching to createBrowserRouter allows react-router support for any tsx pages.
If mdx transform would also include an aliased named export ie export const Component = MDXContent;
and accept named exports for loader, action , .... etc then mdx could have interactive forms, async loaders on the pages.
What does the proposed API look like?
I believe you can replace BrowserRouter here with RouterProvider
and StaticRouter here with StaticRouterProvider
I think there's some more refactoring on generating the routes but there's a lot of interesting potential there.
Happy to discuss and take a crack at a pull request for a possible solution but i wanted to put it out there to see if there was contributor interest especially on the mdx side. A simple initial step would be to just switch to the 6.4 methodology to enable tsx pages.
Please let me know if you're willing to entertain it. Cheers!
The text was updated successfully, but these errors were encountered:
As a static site generator, Rspress hasn't encountered any requirements that match this scenario. Do you want Rspress to switch to data router so that you can do some customization on it?
Because RSPress consumes and sets up routing within the rspress framework
it prevents anyone from using react-router's newer functionality.
I'm not sure the fact thats its a SSG has any bearing on the viability of the scenario.
I think it actually enhances it. dropping in a form action/data loader capability into any page could be useful.
If all you do is end up switching to the new api's then it might be possible to do the rest with a mdx transform plugin or using tsx pages.
Got it. We will design and develop Rspress V2 next year. One of our goals is to upgrade to React 19. I think the data router can be switched with correspnding mdx transformer at that time. Let's keep this issue here and pr is welcome from anyone who is interested.
This isn't tied to a major arch. change and its not tied to React 19 or the MDX transformer.
React Router is transitioning to the new api format/arch but its highly backward compatible.
If your open to the PR will test it out when i have a chance.
What problem does this feature solve?
If RSPress could switch to using v6.4 data api's from react-router createBrowserRouter/createStaticRouter
this would enable interesting features inside rspress eg:
actions
loaderdata
At a minimum switching to createBrowserRouter allows react-router support for any tsx pages.
If mdx transform would also include an aliased named export ie export const Component = MDXContent;
and accept named exports for loader, action , .... etc then mdx could have interactive forms, async loaders on the pages.
What does the proposed API look like?
I believe you can replace BrowserRouter here with RouterProvider
and StaticRouter here with StaticRouterProvider
I think there's some more refactoring on generating the routes but there's a lot of interesting potential there.
Happy to discuss and take a crack at a pull request for a possible solution but i wanted to put it out there to see if there was contributor interest especially on the mdx side. A simple initial step would be to just switch to the 6.4 methodology to enable tsx pages.
Please let me know if you're willing to entertain it. Cheers!
The text was updated successfully, but these errors were encountered: