-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(ssr): Get experimental ssr setup working properly (#8922)
As title, addresses the following issues: - fixes: no css styles - fixes: DevFatalErrorPage breaks with “window” not defined during ssr - fixes: ReferenceError: RWJS_DEBUG_ENV is not defined - sets up `yarn rw dev` to use fe server when streaming experimen enabled - Also removes server context, no longer needed. Note: Not needed for v6!
- Loading branch information
Showing
7 changed files
with
114 additions
and
50 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
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
21 changes: 6 additions & 15 deletions
21
packages/cli/src/commands/experimental/templates/streamingSsr/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 |
---|---|---|
@@ -1,29 +1,20 @@ | ||
import { LocationProvider } from '@redwoodjs/router' | ||
import { ServerContextProvider } from '@redwoodjs/web/dist/serverContext' | ||
|
||
import App from './App' | ||
import { Document } from './Document' | ||
|
||
interface Props { | ||
routeContext: any | ||
url: string | ||
css: string[] | ||
meta?: any[] | ||
} | ||
|
||
export const ServerEntry: React.FC<Props> = ({ | ||
routeContext, | ||
url, | ||
css, | ||
meta, | ||
}) => { | ||
export const ServerEntry: React.FC<Props> = ({ url, css, meta }) => { | ||
return ( | ||
<ServerContextProvider value={routeContext}> | ||
<LocationProvider location={{ pathname: url }}> | ||
<Document css={css} meta={meta}> | ||
<App /> | ||
</Document> | ||
</LocationProvider> | ||
</ServerContextProvider> | ||
<LocationProvider location={{ pathname: url }}> | ||
<Document css={css} meta={meta}> | ||
<App /> | ||
</Document> | ||
</LocationProvider> | ||
) | ||
} |
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 was deleted.
Oops, something went wrong.