Skip to content

Commit

Permalink
Merge branch 'main' of github.com:redwoodjs/redwood into feat/dc-rc-o…
Browse files Browse the repository at this point in the history
…g-gen-mw-p2

* 'main' of github.com:redwoodjs/redwood:
  RSC: Add RSC+SSR smoke test to CI (#10477)
  fix(dbauth-mw): Use response passed in to middleware (#10516)
  Add redwood.toml to `yarn rw info` (#10518)
  chore(tests): Fix packages/web tests (#10517)
  fix(dbauth-mw): Unset cookie instead of clearing (#10502)
  chore(deps): Upgrade to React canary 20240424 (#10513)
  chore(deps): Upgrade to React Testing Library 14.3.1 (#10514)
  feat(upgrade): Use GitHub token if available when downloading patches (#10515)
  • Loading branch information
dac09 committed Apr 26, 2024
2 parents 8f2de47 + ebb3475 commit b9dd681
Show file tree
Hide file tree
Showing 47 changed files with 601 additions and 133 deletions.
2 changes: 2 additions & 0 deletions .changesets/10502.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- fix(dbauth-mw): Unset cookie instead of clearing (#10502) by @dac09
Updates dbAuth middleware implementation to _unset_ the cookies, instead of clearing them.
8 changes: 8 additions & 0 deletions .changesets/10515.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
- feat(upgrade): Use GitHub token if available when downloading patches (#10515) by @Tobbe

If a GitHub token is available in the environment we use that when fetching the
git tree from GitHub. That way we're less likely to be rate limited. For most
users the token shouldn't be needed. The free allowance/usage of the GitHub API
should be enough.

We support `GH_TOKEN`, `GITHUB_TOKEN` and `REDWOOD_GITHUB_TOKEN` as the env var names
3 changes: 3 additions & 0 deletions .changesets/10516.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
- fix(dbauth-mw): Use response passed in to middleware (#10516) by @dac09

Middleware can be chained - which means if auth middleware is not the first one on the list of middleware being registered, we need to use the `MiddlewareResponse` that gets passed to the middleware, instead of creating a new one.
48 changes: 48 additions & 0 deletions .changesets/10518.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
- Add redwood.toml to `yarn rw info` (#10518) by @Tobbe

The project `redwood.toml` file is now included in the `yarn rw info` output to
make it easier and faster to help with issue reports


## Before
```
System:
OS: macOS 14.1.1
Shell: 5.9 - /bin/zsh
Binaries:
Node: 20.11.0 - /usr/local/bin/node
Yarn: 4.1.1 - /usr/local/bin/yarn
Databases:
SQLite: 3.39.5 - /usr/bin/sqlite3
Browsers:
Safari: 17.1
```

## After
```
System:
OS: macOS 14.1.1
Shell: 5.9 - /bin/zsh
Binaries:
Node: 20.11.0 - /usr/local/bin/node
Yarn: 4.1.1 - /usr/local/bin/yarn
Databases:
SQLite: 3.39.5 - /usr/bin/sqlite3
Browsers:
Safari: 17.1
redwood.toml:
[web]
title = "Redwood App"
port = 8910
apiUrl = "/.redwood/functions" # You can customize graphql and dbauth urls individually too: see https://redwoodjs.com/docs/app-configuration-redwood-toml#api-paths
includeEnvironmentVariables = [
# Add any ENV vars that should be available to the web side to this array
# See https://redwoodjs.com/docs/environment-variables#web
]
[api]
port = 8911
[browser]
open = true
[notifications]
versionUpdates = ["latest"]
```
1 change: 1 addition & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
"autoplay",
"bazinga",
"corepack",
"envinfo",
"execa",
"Fastify",
"Flightcontrol",
Expand Down
4 changes: 2 additions & 2 deletions __fixtures__/fragment-test-project/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
"@redwoodjs/router": "7.0.0",
"@redwoodjs/web": "7.0.0",
"humanize-string": "2.1.0",
"react": "19.0.0-canary-36e62c603-20240418",
"react-dom": "19.0.0-canary-36e62c603-20240418"
"react": "19.0.0-canary-cb151849e1-20240424",
"react-dom": "19.0.0-canary-cb151849e1-20240424"
},
"devDependencies": {
"@redwoodjs/vite": "7.0.0",
Expand Down
3 changes: 2 additions & 1 deletion __fixtures__/test-project-rsa/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"packageManager": "yarn@4.1.1",
"resolutions": {
"@apollo/client-react-streaming/superjson": "^1.12.2",
"@apollo/client/rehackt": "0.0.0-pr.10.0"
"@apollo/client/rehackt": "0.0.0-pr.10.0",
"react-is": "19.0.0-canary-cb151849e1-20240424"
}
}
4 changes: 2 additions & 2 deletions __fixtures__/test-project-rsa/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
"@redwoodjs/forms": "8.0.0-canary.144",
"@redwoodjs/router": "8.0.0-canary.144",
"@redwoodjs/web": "8.0.0-canary.144",
"react": "19.0.0-canary-36e62c603-20240418",
"react-dom": "19.0.0-canary-36e62c603-20240418"
"react": "19.0.0-canary-cb151849e1-20240424",
"react-dom": "19.0.0-canary-cb151849e1-20240424"
},
"devDependencies": {
"@redwoodjs/vite": "8.0.0-canary.144",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
"packageManager": "yarn@4.1.1",
"resolutions": {
"@apollo/client-react-streaming/superjson": "^1.12.2",
"@apollo/client/rehackt": "0.0.0-pr.10.0"
"@apollo/client/rehackt": "0.0.0-pr.10.0",
"react-is": "19.0.0-canary-cb151849e1-20240424"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
"@redwoodjs/web": "7.0.0-canary.1011",
"@tobbe.dev/rsc-test": "0.0.5",
"client-only": "0.0.1",
"react": "19.0.0-canary-36e62c603-20240418",
"react-dom": "19.0.0-canary-36e62c603-20240418"
"react": "19.0.0-canary-cb151849e1-20240424",
"react-dom": "19.0.0-canary-cb151849e1-20240424"
},
"devDependencies": {
"@redwoodjs/vite": "7.0.0-canary.1011",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
// In this file, all Page components from 'src/pages` are auto-imported. Nested
// directories are supported, and should be uppercase. Each subdirectory will be
// prepended onto the component name.
//
// Examples:
//
// 'src/pages/HomePage/HomePage.js' -> HomePage
// 'src/pages/Admin/BooksPage/BooksPage.js' -> AdminBooksPage

import { Route } from '@redwoodjs/router/dist/Route'
import { Router } from '@redwoodjs/router/dist/server-router'
import { Set } from '@redwoodjs/router/dist/Set'

import NavigationLayout from './layouts/NavigationLayout/NavigationLayout'
import ScaffoldLayout from './layouts/ScaffoldLayout/ScaffoldLayout'
import AboutPage from './pages/AboutPage/AboutPage'
import EmptyUserEmptyUsersPage from './pages/EmptyUser/EmptyUsersPage/EmptyUsersPage'
import EmptyUserNewEmptyUserPage from './pages/EmptyUser/NewEmptyUserPage/NewEmptyUserPage'
import HomePage from './pages/HomePage/HomePage'
import MultiCellPage from './pages/MultiCellPage/MultiCellPage'
import UserExampleNewUserExamplePage from './pages/UserExample/NewUserExamplePage/NewUserExamplePage'
import UserExampleUserExamplePage from './pages/UserExample/UserExamplePage/UserExamplePage'
import UserExampleUserExamplesPage from './pages/UserExample/UserExamplesPage/UserExamplesPage'

const NotFoundPage = () => {
return <div>Not Found</div>
}

const Routes = ({ location }) => {
return (
<Router location={location}>
<Set wrap={NavigationLayout} rnd={Math.random()}>
<Route path="/" page={HomePage} name="home" />
<Route path="/about" page={AboutPage} name="about" />
<Route path="/multi-cell" page={MultiCellPage} name="multiCell" />

<Set
wrap={ScaffoldLayout}
title="EmptyUsers"
titleTo="emptyUsers"
buttonLabel="New EmptyUser"
buttonTo="newEmptyUser"
>
<Route
path="/empty-users/new"
page={EmptyUserNewEmptyUserPage}
name="newEmptyUser"
/>
<Route
path="/empty-users"
page={EmptyUserEmptyUsersPage}
name="emptyUsers"
/>
</Set>

<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}"
page={UserExampleUserExamplePage}
name="userExample"
/>
<Route
path="/user-examples"
page={UserExampleUserExamplesPage}
name="userExamples"
/>
</Set>
</Set>
<Route notfound page={NotFoundPage} />
</Router>
)
}

export default Routes
Original file line number Diff line number Diff line change
@@ -1,16 +1,22 @@
import type { TagDescriptor } from '@redwoodjs/web/dist/components/htmlTags'

import { Document } from './Document'
import ServerRoutes from './ServerRoutes'

interface Props {
css: string[]
meta?: TagDescriptor[]
location: {
pathname: string
hash?: string
search?: string
}
}

export const ServerEntry: React.FC<Props> = ({ css, meta }) => {
export const ServerEntry: React.FC<Props> = ({ css, meta, location }) => {
return (
<Document css={css} meta={meta}>
<div>App</div>
<ServerRoutes location={location} />
</Document>
)
}
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
import { Link, routes } from '@redwoodjs/router'
import { namedRoutes as routes } from '@redwoodjs/router/dist/namedRoutes'

import './NavigationLayout.css'

type NavigationLayoutProps = {
children?: React.ReactNode
rnd?: number
}

const NavigationLayout = ({ children }: NavigationLayoutProps) => {
const Link = (props: any) => {
return <a href={props.to}>{props.children}</a>
}

const NavigationLayout = ({ children, rnd }: NavigationLayoutProps) => {
return (
<div className="navigation-layout">
<nav>
Expand All @@ -28,6 +33,7 @@ const NavigationLayout = ({ children }: NavigationLayoutProps) => {
</li>
</ul>
</nav>
<div id="rnd">{Math.round(rnd * 100)}</div>
<main>{children}</main>
</div>
)
Expand Down
3 changes: 2 additions & 1 deletion __fixtures__/test-project/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
"packageManager": "yarn@4.1.1",
"resolutions": {
"@storybook/react-dom-shim@npm:7.6.17": "https://verdaccio.tobbe.dev/@storybook/react-dom-shim/-/react-dom-shim-8.0.8.tgz",
"@apollo/client/rehackt": "0.0.0-pr.10.0"
"@apollo/client/rehackt": "0.0.0-pr.10.0",
"react-is": "19.0.0-canary-cb151849e1-20240424"
}
}
4 changes: 2 additions & 2 deletions __fixtures__/test-project/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
"@redwoodjs/router": "7.0.0",
"@redwoodjs/web": "7.0.0",
"humanize-string": "2.1.0",
"react": "19.0.0-canary-36e62c603-20240418",
"react-dom": "19.0.0-canary-36e62c603-20240418"
"react": "19.0.0-canary-cb151849e1-20240424",
"react-dom": "19.0.0-canary-cb151849e1-20240424"
},
"devDependencies": {
"@redwoodjs/vite": "7.0.0",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
"@npmcli/arborist": "7.4.0",
"@playwright/test": "1.42.1",
"@testing-library/jest-dom": "6.4.2",
"@testing-library/react": "14.2.2",
"@testing-library/react": "14.3.1",
"@testing-library/user-event": "14.5.2",
"@types/babel__generator": "7.6.8",
"@types/fs-extra": "11.0.4",
Expand Down
2 changes: 1 addition & 1 deletion packages/auth-providers/auth0/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"@babel/cli": "7.24.1",
"@babel/core": "^7.22.20",
"@types/react": "^18.2.55",
"react": "19.0.0-canary-36e62c603-20240418",
"react": "19.0.0-canary-cb151849e1-20240424",
"typescript": "5.4.5",
"vitest": "1.4.0"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"@babel/core": "^7.22.20",
"@types/netlify-identity-widget": "1.9.6",
"@types/react": "^18.2.55",
"react": "19.0.0-canary-36e62c603-20240418",
"react": "19.0.0-canary-cb151849e1-20240424",
"typescript": "5.4.5",
"vitest": "1.4.0"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/auth-providers/clerk/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"@clerk/clerk-react": "4.30.7",
"@clerk/types": "3.62.1",
"@types/react": "^18.2.55",
"react": "19.0.0-canary-36e62c603-20240418",
"react": "19.0.0-canary-cb151849e1-20240424",
"typescript": "5.4.5",
"vitest": "1.4.0"
},
Expand Down
Loading

0 comments on commit b9dd681

Please sign in to comment.