Skip to content

Commit

Permalink
chore(rsc): Rename renderRoutesFromDist to renderRoutesSsr (#11647)
Browse files Browse the repository at this point in the history
  • Loading branch information
Tobbe authored Oct 3, 2024
1 parent bf55845 commit 20c670e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
5 changes: 2 additions & 3 deletions packages/router/src/rsc/SsrRouter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { LocationProvider, useLocation } from '../location.js'
import { namedRoutes } from '../namedRoutes.js'
import type { RouterProps } from '../router.js'

import { renderRoutesFromDist } from './clientSsr.js'
import { renderRoutesSsr } from './clientSsr.js'

export const Router = ({ paramTypes, children }: RouterProps) => {
return (
Expand All @@ -31,6 +31,5 @@ const LocationAwareRouter = ({ paramTypes, children }: RouterProps) => {
// Note that the value changes at runtime
Object.assign(namedRoutes, namedRoutesMap)

// @TODO(RSC): TS doesn't like that we're returning a promise, but in RSC it's ok!
return renderRoutesFromDist(pathname) as unknown as React.ReactNode
return renderRoutesSsr(pathname)
}
4 changes: 2 additions & 2 deletions packages/router/src/rsc/clientSsr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,10 @@ function resolveClientEntryForProd(

const rscCache = new Map<string, Thenable<React.ReactElement>>()

export async function renderRoutesFromDist<TProps extends Record<string, any>>(
export async function renderRoutesSsr<TProps extends Record<string, any>>(
pathname: string,
) {
console.log('renderRoutesFromDist pathname', pathname)
console.log('renderRoutesSsr pathname', pathname)

const cached = rscCache.get(pathname)
if (cached) {
Expand Down

0 comments on commit 20c670e

Please sign in to comment.