Skip to content

Commit 3e2042d

Browse files
committed
Merge branch 'feat/rsc-build' of github.com:dac09/redwood into feat/consolidate-vite-settings-rsc-builds
* 'feat/rsc-build' of github.com:dac09/redwood: (34 commits) Add support for additional env var files (redwoodjs#9961) Revert startsWith change Remove outdated todo comment. And other comment formatting no more 'as string', and startsWith instead of includes innerText Update studio.md (redwoodjs#10062) doc comment formatting node-loader should look in distRsc now, not distServer Remove `serve` from test fixture Code comment tweaks/fixes Update some more comments Remove duplicated file Lint Another rename of build functions Fix paths test with new paths Rename build functions Tobbe review changes Apply suggestions from code review chore(rename): Be consistent with 'for' prefix for babel plugin option (redwoodjs#10059) RSC: Remove commented code from worker (redwoodjs#10058) ...
2 parents c26b0c8 + a000c38 commit 3e2042d

File tree

60 files changed

+744
-464
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+744
-464
lines changed

CHANGELOG.md

+51
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,57 @@
22

33
## Unreleased
44

5+
- Add support for additional env var files (#9961)
6+
7+
Fixes #9877. This PR adds a new middleware step to the CLI that looks for an `--include-env-files` flag and includes `.env.[file]` to the list of dotfiles to load. This PR also introduces functionality so that `.env.[file]` files are loaded based on `NODE_ENV`.
8+
9+
Using the `--include-env-files` flag:
10+
11+
```bash
12+
yarn rw exec myScript --include-env-files prod stripe-prod
13+
# Alternatively you can specify the flag twice:
14+
yarn rw exec myScript --include-env-files prod --include-env-files stripe-prod
15+
```
16+
17+
Using `NODE_ENV`:
18+
19+
```
20+
# loads .env.production
21+
NODE_ENV=production yarn rw exec myScript
22+
```
23+
24+
These files are loaded in addition to `.env` and `.env.defaults` and more generally are additive. Subsequent dotfiles won't overwrite environment variables defined previous ones. As such, files loaded via NODE_ENV have lower priority than those loaded specifically via `--include-env-files`.
25+
26+
Note that this feature is mainly for local scripting. Most deploy providers don't let you upload dotfiles and usually have their own way of determining environments.
27+
28+
- fix(render): reduce memory and handle server file
29+
30+
This PR improves Render deploys by reducing memory consumption and fixing it so that it uses the server file if it's present.
31+
32+
Render deploys seems to consistently run out of memory during the data migration step. This step is configurable and its doubtful that every deploy has data migrations to apply, but it's enabled by default so it runs every time. The main issue is that the data migrate functionality is a plugin so a yarn install kicks off in Render's deploy container which must be more memory-constrained than the build container. (Assuming there are two different containers, which seems to be the case.)
33+
34+
Instead of running data migrations, this PR issues a warning that if you want to run data migrations, you need to first add the `@redwoodjs/cli-data-migrate` package as a devDependency:
35+
36+
```
37+
yarn add -D @redwoodjs/cli-data-migrate
38+
```
39+
40+
That way a `yarn install` won't be necessary to run data migrations.
41+
42+
Although this PR fixes Render deploy so that it uses the server file if present, realtime features still don't seem to work. We're still investigating; in the meantime, consider using another provider like Coherence if you're just getting started and want to try out realtime features.
43+
44+
- Update MetaTags to be Metadata in Docs (#10053)
45+
46+
The tutorial still used the `MetaTags` component instead of the newer `Metadata` component that the generator templates use. This PR updates all instances of `MetaTags` with `Metadata`.
47+
48+
## v7.0.2
49+
50+
- See https://github.com/redwoodjs/redwood/releases/tag/v7.0.2
51+
52+
## v7.0.1
53+
54+
- See https://github.com/redwoodjs/redwood/releases/tag/v7.0.1
55+
556
## v7.0.0
657

758
- See https://github.com/redwoodjs/redwood/releases/tag/v7.0.0 for the release notes and https://community.redwoodjs.com/t/redwood-v7-0-0-upgrade-guide/5713 for the upgrade guide

__fixtures__/fragment-test-project/.gitignore

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
.idea
22
.DS_Store
3-
.env
3+
.env*
4+
!.env.example
5+
!.env.defaults
46
.netlify
57
.redwood/*
68
!.redwood/README.md

__fixtures__/test-project-rsa/.gitignore

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
.idea
22
.DS_Store
3-
.env
3+
.env*
4+
!.env.example
5+
!.env.defaults
46
.netlify
57
.redwood/*
68
!.redwood/README.md

__fixtures__/test-project-rsa/api/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"version": "0.0.0",
44
"private": true,
55
"dependencies": {
6-
"@redwoodjs/api": "7.0.0-canary.717",
7-
"@redwoodjs/graphql-server": "7.0.0-canary.717"
6+
"@redwoodjs/api": "8.0.0-canary.144",
7+
"@redwoodjs/graphql-server": "8.0.0-canary.144"
88
}
99
}

__fixtures__/test-project-rsa/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
]
88
},
99
"devDependencies": {
10-
"@redwoodjs/core": "7.0.0-canary.717"
10+
"@redwoodjs/core": "8.0.0-canary.144"
1111
},
1212
"eslintConfig": {
1313
"extends": "@redwoodjs/eslint-config",

__fixtures__/test-project-rsa/web/package.json

+6-4
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,15 @@
1212
},
1313
"dependencies": {
1414
"@apollo/experimental-nextjs-app-support": "0.0.0-commit-b8a73fe",
15-
"@redwoodjs/forms": "7.0.0-canary.717",
16-
"@redwoodjs/router": "7.0.0-canary.717",
17-
"@redwoodjs/web": "7.0.0-canary.717",
15+
"@redwoodjs/forms": "8.0.0-canary.144",
16+
"@redwoodjs/router": "8.0.0-canary.144",
17+
"@redwoodjs/web": "8.0.0-canary.144",
1818
"react": "0.0.0-experimental-e5205658f-20230913",
1919
"react-dom": "0.0.0-experimental-e5205658f-20230913"
2020
},
2121
"devDependencies": {
22-
"@redwoodjs/vite": "7.0.0-canary.717"
22+
"@redwoodjs/vite": "8.0.0-canary.144",
23+
"@types/react": "^18.2.55",
24+
"@types/react-dom": "^18.2.19"
2325
}
2426
}

__fixtures__/test-project-rsc-external-packages-and-cells/.gitignore

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
.idea
22
.DS_Store
3-
.env
3+
.env*
4+
!.env.example
5+
!.env.defaults
46
.netlify
57
.redwood/*
68
!.redwood/README.md

__fixtures__/test-project-rsc-external-packages-and-cells/web/src/Routes.tsx

-10
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,11 @@
88
// 'src/pages/Admin/BooksPage/BooksPage.js' -> AdminBooksPage
99

1010
import { Router, Route, Set } from '@redwoodjs/router'
11-
import { serve } from '@redwoodjs/vite/client'
1211

1312
import NavigationLayout from './layouts/NavigationLayout/NavigationLayout'
1413
import ScaffoldLayout from './layouts/ScaffoldLayout/ScaffoldLayout'
1514
import NotFoundPage from './pages/NotFoundPage/NotFoundPage'
1615

17-
const AboutPage = serve('AboutPage')
18-
const HomePage = serve('HomePage')
19-
const UserExampleUserExamplesPage = serve('UserExampleUserExamplesPage')
20-
const UserExampleUserExamplePage = serve('UserExampleUserExamplePage')
21-
const UserExampleNewUserExamplePage = serve('UserExampleNewUserExamplePage')
22-
const EmptyUserEmptyUsersPage = serve('EmptyUserEmptyUsersPage')
23-
const EmptyUserNewEmptyUserPage = serve('EmptyUserNewEmptyUserPage')
24-
const MultiCellPage = serve('MultiCellPage')
25-
2616
const Routes = () => {
2717
return (
2818
<Router>

__fixtures__/test-project/.gitignore

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
.idea
22
.DS_Store
3-
.env
3+
.env*
4+
!.env.example
5+
!.env.defaults
46
.netlify
57
.redwood/*
68
!.redwood/README.md

docs/docs/studio.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ RedwoodJS Studio is a package used during development to gain runtime insights i
1010

1111
Redwood provides tools that lets developers "get to work on what makes your application special, instead of wasting cycles choosing and re-choosing various technologies and configurations."[1](https://github.com/redwoodjs/redwood/blob/main/README.md).
1212

13-
Much happens while your app processes a request: Invoke a function; handle a GraphQL request; resolve the request with a service; build and execute a SQL statement; connect to the database; handle the query response; further resolve the response so in contains all the data needed; return the result ... and more.
13+
Much happens while your app processes a request: Invoke a function; handle a GraphQL request; resolve the request with a service; build and execute a SQL statement; connect to the database; handle the query response; further resolve the response so it contains all the data needed; return the result ... and more.
1414

1515
While [logging](https://redwoodjs.com/docs/logger) can show you some of these steps, there is no easy way to see how they relate to each other, compare, or break down individual timings. Observability needed to debug, iterate, try out, and refactor your code is lacking.
1616

docs/docs/tutorial/chapter1/layouts.md

+12-12
Original file line numberDiff line numberDiff line change
@@ -94,12 +94,12 @@ export default BlogLayout
9494

9595
```jsx title="web/src/pages/AboutPage/AboutPage.jsx"
9696
import { Link, routes } from '@redwoodjs/router'
97-
import { MetaTags } from '@redwoodjs/web'
97+
import { Metadata } from '@redwoodjs/web'
9898

9999
const AboutPage = () => {
100100
return (
101101
<>
102-
<MetaTags title="About" description="About page" />
102+
<Metadata title="About" description="About page" />
103103

104104
<p>
105105
This site was created to demonstrate my mastery of Redwood: Look on my
@@ -118,12 +118,12 @@ export default AboutPage
118118

119119
```jsx title="web/src/pages/AboutPage/AboutPage.tsx"
120120
import { Link, routes } from '@redwoodjs/router'
121-
import { MetaTags } from '@redwoodjs/web'
121+
import { Metadata } from '@redwoodjs/web'
122122

123123
const AboutPage = () => {
124124
return (
125125
<>
126-
<MetaTags title="About" description="About page" />
126+
<Metadata title="About" description="About page" />
127127

128128
<p>
129129
This site was created to demonstrate my mastery of Redwood: Look on my
@@ -144,12 +144,12 @@ export default AboutPage
144144
<TabItem value="js" label="JavaScript">
145145

146146
```jsx title="web/src/pages/HomePage/HomePage.jsx"
147-
import { MetaTags } from '@redwoodjs/web'
147+
import { Metadata } from '@redwoodjs/web'
148148

149149
const HomePage = () => {
150150
return (
151151
<>
152-
<MetaTags title="Home" description="Home page" />
152+
<Metadata title="Home" description="Home page" />
153153
Home
154154
</>
155155
)
@@ -162,12 +162,12 @@ export default HomePage
162162
<TabItem value="ts" label="TypeScript">
163163

164164
```jsx title="web/src/pages/HomePage/HomePage.tsx"
165-
import { MetaTags } from '@redwoodjs/web'
165+
import { Metadata } from '@redwoodjs/web'
166166

167167
const HomePage = () => {
168168
return (
169169
<>
170-
<MetaTags title="Home" description="Home page" />
170+
<Metadata title="Home" description="Home page" />
171171
Home
172172
</>
173173
)
@@ -347,12 +347,12 @@ And then we can remove the extra "Return to Home" link (and Link/routes import)
347347
<TabItem value="js" label="JavaScript">
348348

349349
```jsx title="web/src/pages/AboutPage/AboutPage.jsx"
350-
import { MetaTags } from '@redwoodjs/web'
350+
import { Metadata } from '@redwoodjs/web'
351351

352352
const AboutPage = () => {
353353
return (
354354
<>
355-
<MetaTags title="About" description="About page" />
355+
<Metadata title="About" description="About page" />
356356

357357
<p>
358358
This site was created to demonstrate my mastery of Redwood: Look on my
@@ -369,12 +369,12 @@ export default AboutPage
369369
<TabItem value="ts" label="TypeScript">
370370

371371
```jsx title="web/src/pages/AboutPage/AboutPage.tsx"
372-
import { MetaTags } from '@redwoodjs/web'
372+
import { Metadata } from '@redwoodjs/web'
373373

374374
const AboutPage = () => {
375375
return (
376376
<>
377-
<MetaTags title="About" description="About page" />
377+
<Metadata title="About" description="About page" />
378378

379379
<p>
380380
This site was created to demonstrate my mastery of Redwood: Look on my

docs/docs/tutorial/chapter1/second-page.md

+8-8
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,12 @@ But no one's going to find it by manually changing the URL so let's add a link f
2525

2626
```jsx title="web/src/pages/HomePage/HomePage.jsx"
2727
import { Link, routes } from '@redwoodjs/router'
28-
import { MetaTags } from '@redwoodjs/web'
28+
import { Metadata } from '@redwoodjs/web'
2929

3030
const HomePage = () => {
3131
return (
3232
<>
33-
<MetaTags title="Home" description="Home page" />
33+
<Metadata title="Home" description="Home page" />
3434

3535
// highlight-start
3636
<header>
@@ -57,12 +57,12 @@ export default HomePage
5757

5858
```jsx title="web/src/pages/HomePage/HomePage.tsx"
5959
import { Link, routes } from '@redwoodjs/router'
60-
import { MetaTags } from '@redwoodjs/web'
60+
import { Metadata } from '@redwoodjs/web'
6161

6262
const HomePage = () => {
6363
return (
6464
<>
65-
<MetaTags title="Home" description="Home page" />
65+
<Metadata title="Home" description="Home page" />
6666

6767
// highlight-start
6868
<header>
@@ -105,12 +105,12 @@ Once we get to the About page we don't have any way to get back so let's add a l
105105

106106
```jsx title="web/src/pages/AboutPage/AboutPage.jsx"
107107
import { Link, routes } from '@redwoodjs/router'
108-
import { MetaTags } from '@redwoodjs/web'
108+
import { Metadata } from '@redwoodjs/web'
109109

110110
const AboutPage = () => {
111111
return (
112112
<>
113-
<MetaTags title="About" description="About page" />
113+
<Metadata title="About" description="About page" />
114114

115115
// highlight-start
116116
<header>
@@ -143,12 +143,12 @@ export default AboutPage
143143

144144
```jsx title="web/src/pages/AboutPage/AboutPage.tsx"
145145
import { Link, routes } from '@redwoodjs/router'
146-
import { MetaTags } from '@redwoodjs/web'
146+
import { Metadata } from '@redwoodjs/web'
147147

148148
const AboutPage = () => {
149149
return (
150150
<>
151-
<MetaTags title="About" description="About page" />
151+
<Metadata title="About" description="About page" />
152152

153153
// highlight-start
154154
<header>

docs/docs/tutorial/chapter2/cells.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -342,15 +342,15 @@ Let's plug this cell into our `HomePage` and see what happens:
342342
<TabItem value="js" label="JavaScript">
343343

344344
```jsx title="web/src/pages/HomePage/HomePage.jsx"
345-
import { MetaTags } from '@redwoodjs/web'
345+
import { Metadata } from '@redwoodjs/web'
346346

347347
// highlight-next-line
348348
import ArticlesCell from 'src/components/ArticlesCell'
349349

350350
const HomePage = () => {
351351
return (
352352
<>
353-
<MetaTags title="Home" description="Home page" />
353+
<Metadata title="Home" description="Home page" />
354354
// highlight-next-line
355355
<ArticlesCell />
356356
</>
@@ -364,15 +364,15 @@ export default HomePage
364364
<TabItem value="ts" label="TypeScript">
365365

366366
```jsx title="web/src/pages/HomePage/HomePage.tsx"
367-
import { MetaTags } from '@redwoodjs/web'
367+
import { Metadata } from '@redwoodjs/web'
368368

369369
// highlight-next-line
370370
import ArticlesCell from 'src/components/ArticlesCell'
371371

372372
const HomePage = () => {
373373
return (
374374
<>
375-
<MetaTags title="Home" description="Home page" />
375+
<Metadata title="Home" description="Home page" />
376376
// highlight-next-line
377377
<ArticlesCell />
378378
</>

0 commit comments

Comments
 (0)