-
Notifications
You must be signed in to change notification settings - Fork 982
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: Josh GM Walker <56300765+Josh-Walker-GM@users.noreply.github.com> Co-authored-by: Dominic Saadi <dominiceliassaadi@gmail.com>
- Loading branch information
1 parent
aaffa18
commit eaeb70e
Showing
26 changed files
with
827 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,6 +34,7 @@ | |
"pino", | ||
"Pistorius", | ||
"redwoodjs", | ||
"rsdw", | ||
"RWJS", | ||
"tailwindcss", | ||
"waku" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
__fixtures__/test-project-rsc-external-packages-and-cells/web/src/Document.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
packages/cli/src/commands/experimental/templates/rsc/Document.tsx.template
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import React from 'react' | ||
|
||
import { Css, Meta } from '@redwoodjs/web/dist/components/htmlTags' | ||
import type { TagDescriptor } from '@redwoodjs/web/dist/components/htmlTags' | ||
|
||
interface DocumentProps { | ||
children: React.ReactNode | ||
css: string[] // array of css import strings | ||
meta?: TagDescriptor[] | ||
} | ||
|
||
export const Document: React.FC<DocumentProps> = ({ children, css, meta }) => { | ||
return ( | ||
<html lang="en"> | ||
<head> | ||
<meta charSet="utf-8" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<link rel="icon" type="image/png" href="/favicon.png" /> | ||
<Css css={css} /> | ||
<Meta tags={meta} /> | ||
</head> | ||
<body> | ||
<div id="redwood-app">{children}</div> | ||
</body> | ||
</html> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
packages/cli/src/commands/experimental/templates/rsc/entry.server.tsx.template
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import type { TagDescriptor } from '@redwoodjs/web/dist/components/htmlTags' | ||
|
||
import { Document } from './Document' | ||
|
||
interface Props { | ||
css: string[] | ||
meta?: TagDescriptor[] | ||
} | ||
|
||
export const ServerEntry: React.FC<Props> = ({ css, meta }) => { | ||
return ( | ||
<Document css={css} meta={meta}> | ||
<div>App</div> | ||
</Document> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import React, { Suspense } from 'react' | ||
|
||
import type { Spec } from './page' | ||
|
||
interface Props { | ||
path: string | ||
spec: Spec | ||
params?: Record<string, string> | ||
whileLoadingPage?: () => React.ReactNode | null | ||
children?: React.ReactNode | ||
} | ||
|
||
export const ActiveRouteLoader = ({ spec, params }: Props) => { | ||
const LazyRouteComponent = spec.LazyComponent | ||
|
||
// Delete params ref & key so that they are not spread on to the component | ||
if (params) { | ||
delete params['ref'] | ||
delete params['key'] | ||
} | ||
|
||
return ( | ||
<Suspense fallback={<div>Loading...</div>}> | ||
<LazyRouteComponent {...params} /> | ||
<div | ||
id="redwood-announcer" | ||
style={{ | ||
position: 'absolute', | ||
top: 0, | ||
width: 1, | ||
height: 1, | ||
padding: 0, | ||
overflow: 'hidden', | ||
clip: 'rect(0, 0, 0, 0)', | ||
whiteSpace: 'nowrap', | ||
border: 0, | ||
}} | ||
role="alert" | ||
aria-live="assertive" | ||
aria-atomic="true" | ||
></div> | ||
</Suspense> | ||
) | ||
} |
Oops, something went wrong.