File tree Expand file tree Collapse file tree
cli/src/commands/experimental/templates/rsc Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- export type GetEntry = (rscId: string) => Promise<
2- | React.FunctionComponent
3- | {
4- default: React.FunctionComponent
5- }
6- | null
7- >
8-
9- export function defineEntries(getEntry: GetEntry) {
10- return {
11- getEntry,
12- }
13- }
1+ import { defineEntries } from '@redwoodjs/vite/entries'
142
153export default defineEntries(
164 // getEntry
Original file line number Diff line number Diff line change 1818 "types" : " ./dist/index.d.ts" ,
1919 "default" : " ./dist/index.js"
2020 },
21+ "./entries" : {
22+ "types" : " ./dist/entries.d.ts" ,
23+ "default" : " ./dist/entries.js"
24+ },
2125 "./client" : {
2226 "types" : " ./dist/client.d.ts" ,
2327 "default" : " ./dist/client.js"
Original file line number Diff line number Diff line change @@ -5,7 +5,8 @@ export type GetEntry = (
55) => Promise < FunctionComponent | { default : FunctionComponent } | null >
66
77export type GetBuilder = (
8- // FIXME can we somehow avoid leaking internal implementation?
8+ // FIXME (from original waku code) can we somehow avoid leaking internal
9+ // implementation?
910 unstable_decodeId : ( encodedId : string ) => [ id : string , name : string ]
1011) => Promise < {
1112 [ pathStr : string ] : {
@@ -16,12 +17,10 @@ export type GetBuilder = (
1617 }
1718} >
1819
19- // This is for ignored dynamic imports
20- // XXX Are there any better ways?
21- export type unstable_GetCustomModules = ( ) => Promise < {
22- [ name : string ] : string
23- } >
24-
20+ /**
21+ * Used to look up the component to import when calling `serve('App')` in
22+ * entry.client.tsx
23+ */
2524export function defineEntries ( getEntry : GetEntry , getBuilder ?: GetBuilder ) {
2625 return { getEntry, getBuilder }
2726}
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ import { createServer } from 'vite'
1111
1212import { getPaths } from '@redwoodjs/project-config'
1313
14- import { defineEntries } from '../waku-server '
14+ import { defineEntries } from '../entries '
1515// import type { unstable_GetCustomModules } from '../waku-server'
1616
1717import { configFileConfig , resolveConfig } from './config'
You can’t perform that action at this time.
0 commit comments