Skip to content

Commit

Permalink
future revert "migrate /examples/file-structure-domain-driven/ to V1 …
Browse files Browse the repository at this point in the history
…design"
  • Loading branch information
brillout committed May 20, 2023
1 parent b4da7e7 commit b868506
Show file tree
Hide file tree
Showing 14 changed files with 25 additions and 27 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
export default Page

import React from 'react'

export { Page }

function Page() {
return <>Login page</>
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
export default Page

import React from 'react'

export { Page }

function Page() {
return <>Signup page</>
}
3 changes: 0 additions & 3 deletions examples/file-structure-domain-driven-v1/marketing/+config.js

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export const filesystemRoutingRoot = '/'
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
export default Page

import React from 'react'

export { Page }

function Page() {
return <>About page</>
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
export default Page

import React from 'react'

export { Page }

function Page() {
return <>Welcome</>
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
export default Page

import React from 'react'

export { Page }

function Page({ routeParams }) {
return <>Product {routeParams.productId}</>
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
export default Page

import React from 'react'

export { Page }

function Page() {
return (
<>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export default onBeforePrerenderStart
export { prerender }

function onBeforePrerenderStart() {
function prerender() {
return [{ url: '/product/starship', url: '/product/mac-studio', url: '/product/แจ็คเก็ตเดนิม' }]
}
5 changes: 0 additions & 5 deletions examples/file-structure-domain-driven-v1/renderer/+config.js

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
export default onRenderClient
export { render }
export const clientRouting = true
export const hydrationCanBeAborted = true

import React from 'react'
import ReactDOM from 'react-dom/client'
import { PageLayout } from './PageLayout'

let root
async function onRenderClient(pageContext) {
async function render(pageContext) {
const { Page, routeParams } = pageContext

const page = (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
export default onRenderHtml

import ReactDOMServer from 'react-dom/server'
import React from 'react'
import { escapeInject, dangerouslySkipEscape } from 'vite-plugin-ssr/server'
import { PageLayout } from './PageLayout'

function onRenderHtml(pageContext) {
export { render }
export { passToClient }

const passToClient = ['routeParams']

function render(pageContext) {
const { Page, routeParams } = pageContext
const pageHtml = ReactDOMServer.renderToString(
<PageLayout>
Expand Down

0 comments on commit b868506

Please sign in to comment.