Skip to content

Commit

Permalink
fix a bunch of things
Browse files Browse the repository at this point in the history
  • Loading branch information
kentcdodds committed May 20, 2024
1 parent f1edf0a commit 0cc0c3a
Show file tree
Hide file tree
Showing 26 changed files with 57 additions and 28 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ reference registrations.
registration.

```sh nonumber nolang
node --watch --import ./server/register-rsc-loader.js --conditions=react-server server/app.js
node --import ./server/register-rsc-loader.js --conditions=react-server --watch server/app.js
```

Now update the <InlineFile file="ui/edit-text.js" /> to add `'use client'` to
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,27 @@
import { createElement as h } from 'react'
import { getShip } from '../db/ship-api.js'
import { shipDataStorage } from '../server/async-storage.js'
// 🐨 import the EditText component from the client module
// import { EditText } from './error-boundary.js'
// 🐨 import the EditableText component from the client module
// import { EditableText } from './edit-text.js'
import { getImageUrlForShip } from './img-utils.js'

// 🐨 log the EditText to the console so you can see what the server sees
// 💰 console.log(EditText.toString())
// 🐨 log the EditableText to the console so you can see what the server sees
// 💰 This will log the value itself as well as all the properties
// const properties = {}
// for (const [key, descriptor] of Object.entries(
// Object.getOwnPropertyDescriptors(EditableText),
// )) {
// properties[key] = descriptor.value
// }

// console.log(EditableText.toString())
// console.log(
// JSON.stringify(
// properties,
// (key, value) => (typeof value === 'object' ? value : String(value)),
// 2,
// ),
// )

export async function ShipDetails() {
const { shipId } = shipDataStorage.getStore()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"description": "Super simple implementation of RSCs with minimal deps",
"main": "index.js",
"scripts": {
"dev": "node --watch --import ./server/register-rsc-loader.js --conditions=react-server server/app.js"
"dev": "node --import ./server/register-rsc-loader.js --conditions=react-server --watch server/app.js"
},
"keywords": [],
"author": "Kent C. Dodds <[email protected]> (https://kentcdodds.com/)",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,21 @@ import { shipDataStorage } from '../server/async-storage.js'
import { EditableText } from './edit-text.js'
import { getImageUrlForShip } from './img-utils.js'

const properties = {}
for (const [key, descriptor] of Object.entries(
Object.getOwnPropertyDescriptors(EditableText),
)) {
properties[key] = descriptor.value
}

console.log(EditableText.toString())
console.log(
JSON.stringify(
properties,
(key, value) => (typeof value === 'object' ? value : String(value)),
2,
),
)

export async function ShipDetails() {
const { shipId } = shipDataStorage.getStore()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"description": "Super simple implementation of RSCs with minimal deps",
"main": "index.js",
"scripts": {
"dev": "node --watch --import ./server/register-rsc-loader.js --conditions=react-server server/app.js"
"dev": "node --import ./server/register-rsc-loader.js --conditions=react-server --watch server/app.js"
},
"keywords": [],
"author": "Kent C. Dodds <[email protected]> (https://kentcdodds.com/)",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"description": "Super simple implementation of RSCs with minimal deps",
"main": "index.js",
"scripts": {
"dev": "node --watch --import ./server/register-rsc-loader.js --conditions=react-server server/app.js"
"dev": "node --import ./server/register-rsc-loader.js --conditions=react-server --watch server/app.js"
},
"keywords": [],
"author": "Kent C. Dodds <[email protected]> (https://kentcdodds.com/)",
Expand Down
2 changes: 1 addition & 1 deletion exercises/04.router/01.problem.router/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"description": "Super simple implementation of RSCs with minimal deps",
"main": "index.js",
"scripts": {
"dev": "node --watch --import ./server/register-rsc-loader.js --conditions=react-server server/app.js"
"dev": "node --import ./server/register-rsc-loader.js --conditions=react-server --watch server/app.js"
},
"keywords": [],
"author": "Kent C. Dodds <[email protected]> (https://kentcdodds.com/)",
Expand Down
2 changes: 1 addition & 1 deletion exercises/04.router/01.solution.router/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"description": "Super simple implementation of RSCs with minimal deps",
"main": "index.js",
"scripts": {
"dev": "node --watch --import ./server/register-rsc-loader.js --conditions=react-server server/app.js"
"dev": "node --import ./server/register-rsc-loader.js --conditions=react-server --watch server/app.js"
},
"keywords": [],
"author": "Kent C. Dodds <[email protected]> (https://kentcdodds.com/)",
Expand Down
2 changes: 1 addition & 1 deletion exercises/04.router/02.problem.pending-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"description": "Super simple implementation of RSCs with minimal deps",
"main": "index.js",
"scripts": {
"dev": "node --watch --import ./server/register-rsc-loader.js --conditions=react-server server/app.js"
"dev": "node --import ./server/register-rsc-loader.js --conditions=react-server --watch server/app.js"
},
"keywords": [],
"author": "Kent C. Dodds <[email protected]> (https://kentcdodds.com/)",
Expand Down
2 changes: 1 addition & 1 deletion exercises/04.router/02.solution.pending-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"description": "Super simple implementation of RSCs with minimal deps",
"main": "index.js",
"scripts": {
"dev": "node --watch --import ./server/register-rsc-loader.js --conditions=react-server server/app.js"
"dev": "node --import ./server/register-rsc-loader.js --conditions=react-server --watch server/app.js"
},
"keywords": [],
"author": "Kent C. Dodds <[email protected]> (https://kentcdodds.com/)",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"description": "Super simple implementation of RSCs with minimal deps",
"main": "index.js",
"scripts": {
"dev": "node --watch --import ./server/register-rsc-loader.js --conditions=react-server server/app.js"
"dev": "node --import ./server/register-rsc-loader.js --conditions=react-server --watch server/app.js"
},
"keywords": [],
"author": "Kent C. Dodds <[email protected]> (https://kentcdodds.com/)",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"description": "Super simple implementation of RSCs with minimal deps",
"main": "index.js",
"scripts": {
"dev": "node --watch --import ./server/register-rsc-loader.js --conditions=react-server server/app.js"
"dev": "node --import ./server/register-rsc-loader.js --conditions=react-server --watch server/app.js"
},
"keywords": [],
"author": "Kent C. Dodds <[email protected]> (https://kentcdodds.com/)",
Expand Down
2 changes: 1 addition & 1 deletion exercises/04.router/04.problem.history/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"description": "Super simple implementation of RSCs with minimal deps",
"main": "index.js",
"scripts": {
"dev": "node --watch --import ./server/register-rsc-loader.js --conditions=react-server server/app.js"
"dev": "node --import ./server/register-rsc-loader.js --conditions=react-server --watch server/app.js"
},
"keywords": [],
"author": "Kent C. Dodds <[email protected]> (https://kentcdodds.com/)",
Expand Down
2 changes: 1 addition & 1 deletion exercises/04.router/04.solution.history/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"description": "Super simple implementation of RSCs with minimal deps",
"main": "index.js",
"scripts": {
"dev": "node --watch --import ./server/register-rsc-loader.js --conditions=react-server server/app.js"
"dev": "node --import ./server/register-rsc-loader.js --conditions=react-server --watch server/app.js"
},
"keywords": [],
"author": "Kent C. Dodds <[email protected]> (https://kentcdodds.com/)",
Expand Down
2 changes: 1 addition & 1 deletion exercises/04.router/05.problem.cache/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"description": "Super simple implementation of RSCs with minimal deps",
"main": "index.js",
"scripts": {
"dev": "node --watch --import ./server/register-rsc-loader.js --conditions=react-server server/app.js"
"dev": "node --import ./server/register-rsc-loader.js --conditions=react-server --watch server/app.js"
},
"keywords": [],
"author": "Kent C. Dodds <[email protected]> (https://kentcdodds.com/)",
Expand Down
2 changes: 1 addition & 1 deletion exercises/04.router/05.solution.cache/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"description": "Super simple implementation of RSCs with minimal deps",
"main": "index.js",
"scripts": {
"dev": "node --watch --import ./server/register-rsc-loader.js --conditions=react-server server/app.js"
"dev": "node --import ./server/register-rsc-loader.js --conditions=react-server --watch server/app.js"
},
"keywords": [],
"author": "Kent C. Dodds <[email protected]> (https://kentcdodds.com/)",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"description": "Super simple implementation of RSCs with minimal deps",
"main": "index.js",
"scripts": {
"dev": "node --watch --import ./server/register-rsc-loader.js --conditions=react-server server/app.js"
"dev": "node --import ./server/register-rsc-loader.js --conditions=react-server --watch server/app.js"
},
"keywords": [],
"author": "Kent C. Dodds <[email protected]> (https://kentcdodds.com/)",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"description": "Super simple implementation of RSCs with minimal deps",
"main": "index.js",
"scripts": {
"dev": "node --watch --import ./server/register-rsc-loader.js --conditions=react-server server/app.js"
"dev": "node --import ./server/register-rsc-loader.js --conditions=react-server --watch server/app.js"
},
"keywords": [],
"author": "Kent C. Dodds <[email protected]> (https://kentcdodds.com/)",
Expand Down
2 changes: 1 addition & 1 deletion exercises/05.actions/02.problem.client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"description": "Super simple implementation of RSCs with minimal deps",
"main": "index.js",
"scripts": {
"dev": "node --watch --import ./server/register-rsc-loader.js --conditions=react-server server/app.js"
"dev": "node --import ./server/register-rsc-loader.js --conditions=react-server --watch server/app.js"
},
"keywords": [],
"author": "Kent C. Dodds <[email protected]> (https://kentcdodds.com/)",
Expand Down
2 changes: 1 addition & 1 deletion exercises/05.actions/02.solution.client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"description": "Super simple implementation of RSCs with minimal deps",
"main": "index.js",
"scripts": {
"dev": "node --watch --import ./server/register-rsc-loader.js --conditions=react-server server/app.js"
"dev": "node --import ./server/register-rsc-loader.js --conditions=react-server --watch server/app.js"
},
"keywords": [],
"author": "Kent C. Dodds <[email protected]> (https://kentcdodds.com/)",
Expand Down
2 changes: 1 addition & 1 deletion exercises/05.actions/03.problem.server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"description": "Super simple implementation of RSCs with minimal deps",
"main": "index.js",
"scripts": {
"dev": "node --watch --import ./server/register-rsc-loader.js --conditions=react-server server/app.js"
"dev": "node --import ./server/register-rsc-loader.js --conditions=react-server --watch server/app.js"
},
"keywords": [],
"author": "Kent C. Dodds <[email protected]> (https://kentcdodds.com/)",
Expand Down
2 changes: 1 addition & 1 deletion exercises/05.actions/03.solution.server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"description": "Super simple implementation of RSCs with minimal deps",
"main": "index.js",
"scripts": {
"dev": "node --watch --import ./server/register-rsc-loader.js --conditions=react-server server/app.js"
"dev": "node --import ./server/register-rsc-loader.js --conditions=react-server --watch server/app.js"
},
"keywords": [],
"author": "Kent C. Dodds <[email protected]> (https://kentcdodds.com/)",
Expand Down
2 changes: 1 addition & 1 deletion exercises/05.actions/04.problem.revalidation/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"description": "Super simple implementation of RSCs with minimal deps",
"main": "index.js",
"scripts": {
"dev": "node --watch --import ./server/register-rsc-loader.js --conditions=react-server server/app.js"
"dev": "node --import ./server/register-rsc-loader.js --conditions=react-server --watch server/app.js"
},
"keywords": [],
"author": "Kent C. Dodds <[email protected]> (https://kentcdodds.com/)",
Expand Down
2 changes: 1 addition & 1 deletion exercises/05.actions/04.solution.revalidation/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"description": "Super simple implementation of RSCs with minimal deps",
"main": "index.js",
"scripts": {
"dev": "node --watch --import ./server/register-rsc-loader.js --conditions=react-server server/app.js"
"dev": "node --import ./server/register-rsc-loader.js --conditions=react-server --watch server/app.js"
},
"keywords": [],
"author": "Kent C. Dodds <[email protected]> (https://kentcdodds.com/)",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"description": "Super simple implementation of RSCs with minimal deps",
"main": "index.js",
"scripts": {
"dev": "node --watch --import ./server/register-rsc-loader.js --conditions=react-server server/app.js"
"dev": "node --import ./server/register-rsc-loader.js --conditions=react-server --watch server/app.js"
},
"keywords": [],
"author": "Kent C. Dodds <[email protected]> (https://kentcdodds.com/)",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"description": "Super simple implementation of RSCs with minimal deps",
"main": "index.js",
"scripts": {
"dev": "node --watch --import ./server/register-rsc-loader.js --conditions=react-server server/app.js"
"dev": "node --import ./server/register-rsc-loader.js --conditions=react-server --watch server/app.js"
},
"keywords": [],
"author": "Kent C. Dodds <[email protected]> (https://kentcdodds.com/)",
Expand Down

0 comments on commit 0cc0c3a

Please sign in to comment.