Skip to content

Commit

Permalink
Revert v7.0.0 and RSC changes
Browse files Browse the repository at this point in the history
Revert "feat(streaming-ssr): Fix build and server html injection (#8978)"

This reverts commit 58a2421.

Revert "fix: Improve GraphQL Schema Validation to allow Subscription types when not using Realtime and ensure schema does not use reserved names (#9005)"

This reverts commit 0167be7.

Revert "RSC: Use experimental node loader (#8979)"

This reverts commit 2add568.

Revert "RSC: Fix noExternal rule for server build (#8961)"

This reverts commit 9ac5ab2.

Revert "@rwjs/vite: Pin acorn-loose version (#8944)"

This reverts commit 6f33914.

Revert "RSC: react-server condition. Poisoned imports (#8948)"

This reverts commit e941365.

Revert "RSC fix typo in example code (#8949)"

This reverts commit 3588ec0.

Revert "fix(ssr): Get experimental ssr setup working properly (#8922)"

This reverts commit abf229b.

Revert "RSC fix: setup description (#8906)"

This reverts commit b11bd72.

Revert "RSC: Add css files to the example (#8905)"

This reverts commit fcd7c39.

Revert "RSC build without user config (#8896)"

This reverts commit 37692a4.

Revert "Refactor cli serve command (#8958)"

This reverts commit f24016a.

Revert "RSC: Use rw serve (#8897)"

This reverts commit 921c9cb.

Revert "RSC: Build using rw build (#8893)"

This reverts commit f1d0dcb.

Revert "RSC: Fix experimental setup (#8894)"

This reverts commit c44a260.

Revert "RSC: Include entries.ts in paths (#8888)"

This reverts commit db271db.

Revert "RSC: Initial css support (#8887)"

This reverts commit 8610d58.

Revert "RSC: Use exported defineEntries() (#8886)"

This reverts commit f5fc2e2.

Revert "Include standard vite config in RSC build (#8882)"

This reverts commit c1e62c2.

Revert "Update entry.client and disable vite legacy mode (#8851)"

This reverts commit 8917ad6.

Revert "experimental feature flag for rsc (#8837)"

This reverts commit c7a5b13.

Revert "React Server Components (RSC) (#8451)"

This reverts commit f22dfbe.

Revert "Use "import type" for all types (#8827)"

This reverts commit 7a6aea7.

Revert "React 18.3.0-canary-035a41c4e-20230704 (#8826)"

This reverts commit d261819.

Revert "ViteBuildManifest and note about import-attributes (#8818)"

This reverts commit 8b85ad6.

Revert "Streaming SSR: Fix build, serve and dev (#8811)"

This reverts commit 4c51cae.

Revert "Add files needed for React Streaming SSR (#8810)"

This reverts commit 6da5aae.

Revert "entry.server and entry.client (#8808)"

This reverts commit 7cc5564.

Revert "Use existing rw-vite-build bin for SSR as well (#8806)"

This reverts commit 8b2a566.

Revert "Disable prerender when streamingSsr is enabled (#8775)"

This reverts commit e7d5361.

Revert "vite utils.ts: fix source format (#8796)"

This reverts commit e191071.

Revert "Server Rendering & Streaming (#8561)"

This reverts commit 2557bf8.

Revert "React Streaming and SSR feature flag (#8764)"

This reverts commit 565f620.
  • Loading branch information
jtoar committed Aug 12, 2023
1 parent a2fcc16 commit 3d4ee77
Show file tree
Hide file tree
Showing 118 changed files with 313 additions and 6,154 deletions.
4 changes: 2 additions & 2 deletions __fixtures__/test-project/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
"@redwoodjs/web": "6.0.6",
"humanize-string": "2.1.0",
"prop-types": "15.8.1",
"react": "18.3.0-canary-035a41c4e-20230704",
"react-dom": "18.3.0-canary-035a41c4e-20230704"
"react": "18.2.0",
"react-dom": "18.2.0"
},
"devDependencies": {
"@redwoodjs/vite": "6.0.6",
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/core": "7.22.9",
"@types/react": "18.2.14",
"jest": "29.6.1",
"react": "18.3.0-canary-035a41c4e-20230704",
"react": "18.2.0",
"typescript": "5.1.6"
},
"peerDependencies": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"@types/netlify-identity-widget": "1.9.3",
"@types/react": "18.2.14",
"jest": "29.6.1",
"react": "18.3.0-canary-035a41c4e-20230704",
"react": "18.2.0",
"typescript": "5.1.6"
},
"peerDependencies": {
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/types": "3.46.1",
"@types/react": "18.2.14",
"jest": "29.6.1",
"react": "18.3.0-canary-035a41c4e-20230704",
"react": "18.2.0",
"typescript": "5.1.6"
},
"peerDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/auth-providers/dbAuth/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"@simplewebauthn/typescript-types": "7.0.0",
"@types/react": "18.2.14",
"jest": "29.6.1",
"react": "18.3.0-canary-035a41c4e-20230704",
"react": "18.2.0",
"typescript": "5.1.6"
},
"gitHead": "3905ed045508b861b495f8d5630d76c7a157d8f1"
Expand Down
2 changes: 1 addition & 1 deletion packages/auth-providers/firebase/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"@types/react": "18.2.14",
"firebase": "10.1.0",
"jest": "29.6.1",
"react": "18.3.0-canary-035a41c4e-20230704",
"react": "18.2.0",
"typescript": "5.1.6"
},
"peerDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/auth-providers/netlify/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"@types/netlify-identity-widget": "1.9.3",
"@types/react": "18.2.14",
"jest": "29.6.1",
"react": "18.3.0-canary-035a41c4e-20230704",
"react": "18.2.0",
"typescript": "5.1.6"
},
"peerDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/auth-providers/supabase/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"@supabase/supabase-js": "2.26.0",
"@types/react": "18.2.14",
"jest": "29.6.1",
"react": "18.3.0-canary-035a41c4e-20230704",
"react": "18.2.0",
"typescript": "5.1.6"
},
"peerDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/auth-providers/supertokens/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"@babel/core": "7.22.9",
"@types/react": "18.2.14",
"jest": "29.6.1",
"react": "18.3.0-canary-035a41c4e-20230704",
"react": "18.2.0",
"supertokens-auth-react": "0.34.0",
"typescript": "5.1.6"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/auth/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"dependencies": {
"@babel/runtime-corejs3": "7.22.6",
"core-js": "3.31.1",
"react": "18.3.0-canary-035a41c4e-20230704"
"react": "18.2.0"
},
"devDependencies": {
"@babel/cli": "7.22.9",
Expand Down
59 changes: 0 additions & 59 deletions packages/cli/src/commands/__tests__/dev.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,6 @@ describe('yarn rw dev', () => {
port: 8911,
debugPort: 18911,
},
experimental: {
streamingSsr: {
enabled: false,
},
},
})

await handler({
Expand All @@ -111,45 +106,6 @@ describe('yarn rw dev', () => {
expect(generateCommand.command).toEqual('yarn rw-gen-watch')
})

it('Should run api and FE dev server, when streaming experimental flag enabled', async () => {
getConfig.mockReturnValue({
web: {
port: 8910,
},
api: {
port: 8911,
debugPort: 18911,
},
experimental: {
streamingSsr: {
enabled: true, // <-- enable SSR/Streaming
},
},
})

await handler({
side: ['api', 'web'],
})

expect(generatePrismaClient).toHaveBeenCalledTimes(1)
const concurrentlyArgs = concurrently.mock.lastCall[0]

const webCommand = find(concurrentlyArgs, { name: 'web' })
const apiCommand = find(concurrentlyArgs, { name: 'api' })
const generateCommand = find(concurrentlyArgs, { name: 'gen' })

// Uses absolute path, so not doing a snapshot
expect(webCommand.command).toContain(
'yarn cross-env NODE_ENV=development rw-dev-fe'
)

expect(apiCommand.command).toMatchInlineSnapshot(
`"yarn cross-env NODE_ENV=development NODE_OPTIONS=--enable-source-maps yarn nodemon --quiet --watch "/mocked/project/redwood.toml" --exec "yarn rw-api-server-watch --port 8911 --debug-port 18911 | rw-log-formatter""`
)

expect(generateCommand.command).toEqual('yarn rw-gen-watch')
})

it('Debug port passed in command line overrides TOML', async () => {
getConfig.mockReturnValue({
web: {
Expand All @@ -159,11 +115,6 @@ describe('yarn rw dev', () => {
port: 8911,
debugPort: 505050,
},
experimental: {
streamingSsr: {
enabled: false,
},
},
})

await handler({
Expand All @@ -189,11 +140,6 @@ describe('yarn rw dev', () => {
port: 8911,
debugPort: false,
},
experimental: {
streamingSsr: {
enabled: false,
},
},
})

await handler({
Expand All @@ -216,11 +162,6 @@ describe('yarn rw dev', () => {
api: {
port: 8911,
},
experimental: {
streamingSsr: {
enabled: false,
},
},
})

await handler({
Expand Down
12 changes: 3 additions & 9 deletions packages/cli/src/commands/__tests__/serve.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,10 @@ jest.mock('fs', () => {
}
})

jest.mock('../serveApiHandler', () => {
jest.mock('../serveHandler', () => {
return {
...jest.requireActual('../serveApiHandler'),
...jest.requireActual('../serveHandler'),
apiServerHandler: jest.fn(),
}
})
jest.mock('../serveBothHandler', () => {
return {
...jest.requireActual('../serveBothHandler'),
bothServerHandler: jest.fn(),
}
})
Expand All @@ -59,8 +54,7 @@ import execa from 'execa'
import yargs from 'yargs'

import { builder } from '../serve'
import { apiServerHandler } from '../serveApiHandler'
import { bothServerHandler } from '../serveBothHandler'
import { apiServerHandler, bothServerHandler } from '../serveHandler'

describe('yarn rw serve', () => {
afterEach(() => {
Expand Down
19 changes: 8 additions & 11 deletions packages/cli/src/commands/buildHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,17 +114,14 @@ export const handler = async ({
// it could affect other things that run in parallel while building.
// We don't have any parallel tasks right now, but someone might add
// one in the future as a performance optimization.
await execa(
`yarn rw-vite-build --webDir="${rwjsPaths.web.base}" --verbose=${verbose}`,
{
stdio: verbose ? 'inherit' : 'pipe',
shell: true,
// `cwd` is needed for yarn to find the rw-vite-build binary
// It won't change process.cwd for anything else here, in this
// process
cwd: rwjsPaths.web.base,
}
)
await execa(`yarn rw-vite-build --webDir="${rwjsPaths.web.base}"`, {
stdio: verbose ? 'inherit' : 'pipe',
shell: true,
// This is needed for yarn to find the rw-vite-build binary
// It won't change process.cwd for anything else here, in this
// process
cwd: rwjsPaths.web.base,
})
} else {
await execa(
`yarn cross-env NODE_ENV=production webpack --config ${require.resolve(
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/commands/deploy/flightcontrol.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { recordTelemetryAttributes } from '@redwoodjs/cli-helpers'
import { getConfig } from '@redwoodjs/project-config'

import { getPaths } from '../../lib'
import { apiServerHandler } from '../serveApiHandler'
import { apiServerHandler } from '../serveHandler'

export const command = 'flightcontrol <side>'
export const alias = 'fc'
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/commands/deploy/render.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { recordTelemetryAttributes } from '@redwoodjs/cli-helpers'
import { getConfig } from '@redwoodjs/project-config'

import { getPaths } from '../../lib'
import { apiServerHandler } from '../serveApiHandler'
import { apiServerHandler } from '../serveHandler'

export const command = 'render <side>'
export const description = 'Build, Migrate, and Serve command for Render deploy'
Expand Down
31 changes: 6 additions & 25 deletions packages/cli/src/commands/devHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -148,31 +148,12 @@ export const handler = async ({

const redwoodConfigPath = getConfigPath()

const streamingSsrEnabled = getConfig().experimental.streamingSsr?.enabled

// @TODO (Streaming) Lot of temporary feature flags for started dev server.
// Written this way to make it easier to read

// 1. default: Vite (SPA)
let webCommand = `yarn cross-env NODE_ENV=development rw-vite-dev ${forward}`

// 2. Vite with SSR
if (streamingSsrEnabled) {
webCommand = `yarn cross-env NODE_ENV=development rw-dev-fe ${forward}`
}

// 3. Webpack (SPA): we will remove this override after v7
if (getConfig().web.bundler === 'webpack') {
if (streamingSsrEnabled) {
throw new Error(
'Webpack does not support SSR. Please switch your bundler to Vite in redwood.toml first'
)
} else {
webCommand = `yarn cross-env NODE_ENV=development RWJS_WATCH_NODE_MODULES=${
watchNodeModules ? '1' : ''
} webpack serve --config "${webpackDevConfig}" ${forward}`
}
}
const webCommand =
getConfig().web.bundler !== 'webpack' // @NOTE: can't use enums, not TS
? `yarn cross-env NODE_ENV=development rw-vite-dev ${forward}`
: `yarn cross-env NODE_ENV=development RWJS_WATCH_NODE_MODULES=${
watchNodeModules ? '1' : ''
} webpack serve --config "${webpackDevConfig}" ${forward}`

/** @type {Record<string, import('concurrently').CommandObj>} */
const jobs = {
Expand Down
29 changes: 0 additions & 29 deletions packages/cli/src/commands/experimental/setupRsc.js

This file was deleted.

Loading

0 comments on commit 3d4ee77

Please sign in to comment.