Skip to content

Commit

Permalink
RSC: chore(test): Update RSC test fixture project (#9990)
Browse files Browse the repository at this point in the history
  • Loading branch information
Tobbe committed Feb 12, 2024
1 parent 45e6ce7 commit 44a980b
Show file tree
Hide file tree
Showing 9 changed files with 30 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"files.trimTrailingWhitespace": true,
"editor.formatOnSave": false,
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
"source.fixAll.eslint": "explicit"
},
"[prisma]": {
"editor.formatOnSave": true
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
RW smoke-test fixture project for an app that uses RSC and imports external npm
packages
RW smoke-test fixture project for an app that tests two RSC related features
1. imports external npm packages
2. Uses client cells to do client-side gql data fetching

Mainly these things are tested:
* Importing a package with company scope (@ and / in its name)
* Importing a package that uses the 'use client' directive
* Using the 'client-only' package
* Using the 'server-only' package
* Imports a traditional RW Cell into a page (that's, like all pages, a server
component) to verify that we can still do client side GQL data fetching
like we've always been able to do

Used by `.github/actions/set-up-rsc-from-fixture`
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "0.0.0",
"private": true,
"dependencies": {
"@redwoodjs/api": "7.0.0-canary.966",
"@redwoodjs/graphql-server": "7.0.0-canary.966"
"@redwoodjs/api": "7.0.0-canary.981",
"@redwoodjs/graphql-server": "7.0.0-canary.981"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
]
},
"devDependencies": {
"@redwoodjs/core": "7.0.0-canary.966"
"@redwoodjs/core": "7.0.0-canary.981"
},
"eslintConfig": {
"extends": "@redwoodjs/eslint-config",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,17 @@
]
},
"dependencies": {
"@redwoodjs/forms": "7.0.0-canary.966",
"@redwoodjs/router": "7.0.0-canary.966",
"@redwoodjs/web": "7.0.0-canary.966",
"@redwoodjs/forms": "7.0.0-canary.981",
"@redwoodjs/router": "7.0.0-canary.981",
"@redwoodjs/web": "7.0.0-canary.981",
"@tobbe.dev/rsc-test": "0.0.3",
"client-only": "0.0.1",
"react": "0.0.0-experimental-e5205658f-20230913",
"react-dom": "0.0.0-experimental-e5205658f-20230913",
"server-only": "0.0.1"
},
"devDependencies": {
"@redwoodjs/vite": "7.0.0-canary.966",
"@redwoodjs/vite": "7.0.0-canary.981",
"@types/react": "^18.2.55",
"@types/react-dom": "^18.2.19"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,14 @@ import NotFoundPage from './pages/NotFoundPage/NotFoundPage'
const AboutPage = serve('AboutPage')
const HomePage = serve('HomePage')
const UserExampleUserExamplesPage = serve('UserExampleUserExamplesPage')
const UserExampleNewUserExamplePage = serve('UserExampleNewUserExamplePage')

const Routes = () => {
return (
<Router>
<Set wrap={ScaffoldLayout} title="UserExamples" titleTo="userExamples" buttonLabel="New UserExample" buttonTo="newUserExample">
{/* <Route path="/user-examples/new" page={UserExampleNewUserExamplePage} name="newUserExample" />
<Route path="/user-examples/{id:Int}/edit" page={UserExampleEditUserExamplePage} name="editUserExample" />
<Route path="/user-examples/new" page={UserExampleNewUserExamplePage} name="newUserExample" />
{/* <Route path="/user-examples/{id:Int}/edit" page={UserExampleEditUserExamplePage} name="editUserExample" />
<Route path="/user-examples/{id:Int}" page={UserExampleUserExamplePage} name="userExample" /> */}
<Route path="/user-examples" page={UserExampleUserExamplesPage} name="userExamples" />
</Set>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client'

import { navigate, routes } from '@redwoodjs/router'
import { useMutation } from '@redwoodjs/web'
import { toast } from '@redwoodjs/web/toast'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
"use client"
'use client'

import type { FindUserExamples } from 'types/graphql'

// import { Link, routes } from '@redwoodjs/router'
import { Link, routes } from '@redwoodjs/router'
import type { CellSuccessProps, CellFailureProps } from '@redwoodjs/web'

import UserExamples from '../UserExamples/UserExamples'
Expand All @@ -22,10 +22,10 @@ export const Loading = () => <div>Loading...</div>
export const Empty = () => {
return (
<div className="rw-text-center">
{'No userExamples yet. '}
{/* <Link to={routes.newUserExample()} className="rw-link"> */}
{'Create one?'}
{/* </Link> */}
No userExamples yet.{' '}
<Link to={routes.newUserExample()} className="rw-link">
Create one?
</Link>
</div>
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,18 @@ import { defineEntries } from '@redwoodjs/vite/entries'

export default defineEntries(
// getEntry
async (id) => {
async (id: string) => {
switch (id) {
case 'AboutPage':
return import('./pages/AboutPage/AboutPage')
case 'HomePage':
return import('./pages/HomePage/HomePage')
case 'UserExampleUserExamplesPage':
return import('./pages/UserExample/UserExamplesPage/UserExamplesPage')
case 'UserExampleNewUserExamplePage':
return import(
'./pages/UserExample/NewUserExamplePage/NewUserExamplePage'
)
default:
return null
}
Expand Down

0 comments on commit 44a980b

Please sign in to comment.