diff --git a/exercises/03.client-components/01.problem.loader/README.mdx b/exercises/03.client-components/01.problem.loader/README.mdx index 1bc1357..f21dbe5 100644 --- a/exercises/03.client-components/01.problem.loader/README.mdx +++ b/exercises/03.client-components/01.problem.loader/README.mdx @@ -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 to add `'use client'` to diff --git a/exercises/03.client-components/01.problem.loader/ui/ship-details.js b/exercises/03.client-components/01.problem.loader/ui/ship-details.js index b462688..28ab2aa 100644 --- a/exercises/03.client-components/01.problem.loader/ui/ship-details.js +++ b/exercises/03.client-components/01.problem.loader/ui/ship-details.js @@ -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() diff --git a/exercises/03.client-components/01.solution.loader/package.json b/exercises/03.client-components/01.solution.loader/package.json index 2a145e5..e31f578 100644 --- a/exercises/03.client-components/01.solution.loader/package.json +++ b/exercises/03.client-components/01.solution.loader/package.json @@ -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 (https://kentcdodds.com/)", diff --git a/exercises/03.client-components/01.solution.loader/ui/ship-details.js b/exercises/03.client-components/01.solution.loader/ui/ship-details.js index 5e13c26..bb1c6d3 100644 --- a/exercises/03.client-components/01.solution.loader/ui/ship-details.js +++ b/exercises/03.client-components/01.solution.loader/ui/ship-details.js @@ -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() diff --git a/exercises/03.client-components/02.problem.module-resolution/package.json b/exercises/03.client-components/02.problem.module-resolution/package.json index 3521845..568f152 100644 --- a/exercises/03.client-components/02.problem.module-resolution/package.json +++ b/exercises/03.client-components/02.problem.module-resolution/package.json @@ -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 (https://kentcdodds.com/)", diff --git a/exercises/03.client-components/02.solution.module-resolution/package.json b/exercises/03.client-components/02.solution.module-resolution/package.json index 8398c23..499c36b 100644 --- a/exercises/03.client-components/02.solution.module-resolution/package.json +++ b/exercises/03.client-components/02.solution.module-resolution/package.json @@ -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 (https://kentcdodds.com/)", diff --git a/exercises/04.router/01.problem.router/package.json b/exercises/04.router/01.problem.router/package.json index 156cb98..d54c005 100644 --- a/exercises/04.router/01.problem.router/package.json +++ b/exercises/04.router/01.problem.router/package.json @@ -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 (https://kentcdodds.com/)", diff --git a/exercises/04.router/01.solution.router/package.json b/exercises/04.router/01.solution.router/package.json index cfc5761..bb0a964 100644 --- a/exercises/04.router/01.solution.router/package.json +++ b/exercises/04.router/01.solution.router/package.json @@ -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 (https://kentcdodds.com/)", diff --git a/exercises/04.router/02.problem.pending-ui/package.json b/exercises/04.router/02.problem.pending-ui/package.json index 9cbf47f..aa5e030 100644 --- a/exercises/04.router/02.problem.pending-ui/package.json +++ b/exercises/04.router/02.problem.pending-ui/package.json @@ -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 (https://kentcdodds.com/)", diff --git a/exercises/04.router/02.solution.pending-ui/package.json b/exercises/04.router/02.solution.pending-ui/package.json index 04d395c..fba30ae 100644 --- a/exercises/04.router/02.solution.pending-ui/package.json +++ b/exercises/04.router/02.solution.pending-ui/package.json @@ -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 (https://kentcdodds.com/)", diff --git a/exercises/04.router/03.problem.race-conditions/package.json b/exercises/04.router/03.problem.race-conditions/package.json index 42911fd..5c1eeeb 100644 --- a/exercises/04.router/03.problem.race-conditions/package.json +++ b/exercises/04.router/03.problem.race-conditions/package.json @@ -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 (https://kentcdodds.com/)", diff --git a/exercises/04.router/03.solution.race-conditions/package.json b/exercises/04.router/03.solution.race-conditions/package.json index a8dc6f1..8011ca7 100644 --- a/exercises/04.router/03.solution.race-conditions/package.json +++ b/exercises/04.router/03.solution.race-conditions/package.json @@ -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 (https://kentcdodds.com/)", diff --git a/exercises/04.router/04.problem.history/package.json b/exercises/04.router/04.problem.history/package.json index ea91e7e..3768b68 100644 --- a/exercises/04.router/04.problem.history/package.json +++ b/exercises/04.router/04.problem.history/package.json @@ -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 (https://kentcdodds.com/)", diff --git a/exercises/04.router/04.solution.history/package.json b/exercises/04.router/04.solution.history/package.json index d193a73..1fa6861 100644 --- a/exercises/04.router/04.solution.history/package.json +++ b/exercises/04.router/04.solution.history/package.json @@ -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 (https://kentcdodds.com/)", diff --git a/exercises/04.router/05.problem.cache/package.json b/exercises/04.router/05.problem.cache/package.json index 2e795e4..e92af75 100644 --- a/exercises/04.router/05.problem.cache/package.json +++ b/exercises/04.router/05.problem.cache/package.json @@ -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 (https://kentcdodds.com/)", diff --git a/exercises/04.router/05.solution.cache/package.json b/exercises/04.router/05.solution.cache/package.json index a2e4a29..131446c 100644 --- a/exercises/04.router/05.solution.cache/package.json +++ b/exercises/04.router/05.solution.cache/package.json @@ -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 (https://kentcdodds.com/)", diff --git a/exercises/05.actions/01.problem.action-reference/package.json b/exercises/05.actions/01.problem.action-reference/package.json index a8f1904..825e04a 100644 --- a/exercises/05.actions/01.problem.action-reference/package.json +++ b/exercises/05.actions/01.problem.action-reference/package.json @@ -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 (https://kentcdodds.com/)", diff --git a/exercises/05.actions/01.solution.action-reference/package.json b/exercises/05.actions/01.solution.action-reference/package.json index 3b19113..1e11575 100644 --- a/exercises/05.actions/01.solution.action-reference/package.json +++ b/exercises/05.actions/01.solution.action-reference/package.json @@ -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 (https://kentcdodds.com/)", diff --git a/exercises/05.actions/02.problem.client/package.json b/exercises/05.actions/02.problem.client/package.json index e92ab1c..1a7f1f5 100644 --- a/exercises/05.actions/02.problem.client/package.json +++ b/exercises/05.actions/02.problem.client/package.json @@ -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 (https://kentcdodds.com/)", diff --git a/exercises/05.actions/02.solution.client/package.json b/exercises/05.actions/02.solution.client/package.json index c365c52..83ad9ff 100644 --- a/exercises/05.actions/02.solution.client/package.json +++ b/exercises/05.actions/02.solution.client/package.json @@ -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 (https://kentcdodds.com/)", diff --git a/exercises/05.actions/03.problem.server/package.json b/exercises/05.actions/03.problem.server/package.json index 6a16f15..4876f18 100644 --- a/exercises/05.actions/03.problem.server/package.json +++ b/exercises/05.actions/03.problem.server/package.json @@ -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 (https://kentcdodds.com/)", diff --git a/exercises/05.actions/03.solution.server/package.json b/exercises/05.actions/03.solution.server/package.json index 2e83e4b..ac994f1 100644 --- a/exercises/05.actions/03.solution.server/package.json +++ b/exercises/05.actions/03.solution.server/package.json @@ -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 (https://kentcdodds.com/)", diff --git a/exercises/05.actions/04.problem.revalidation/package.json b/exercises/05.actions/04.problem.revalidation/package.json index e94fa7a..5388633 100644 --- a/exercises/05.actions/04.problem.revalidation/package.json +++ b/exercises/05.actions/04.problem.revalidation/package.json @@ -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 (https://kentcdodds.com/)", diff --git a/exercises/05.actions/04.solution.revalidation/package.json b/exercises/05.actions/04.solution.revalidation/package.json index 8df5343..ae43e15 100644 --- a/exercises/05.actions/04.solution.revalidation/package.json +++ b/exercises/05.actions/04.solution.revalidation/package.json @@ -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 (https://kentcdodds.com/)", diff --git a/exercises/05.actions/05.problem.history-revalidation/package.json b/exercises/05.actions/05.problem.history-revalidation/package.json index 4827cc0..448adb0 100644 --- a/exercises/05.actions/05.problem.history-revalidation/package.json +++ b/exercises/05.actions/05.problem.history-revalidation/package.json @@ -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 (https://kentcdodds.com/)", diff --git a/exercises/05.actions/05.solution.history-revalidation/package.json b/exercises/05.actions/05.solution.history-revalidation/package.json index 01e99f3..d9d6e25 100644 --- a/exercises/05.actions/05.solution.history-revalidation/package.json +++ b/exercises/05.actions/05.solution.history-revalidation/package.json @@ -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 (https://kentcdodds.com/)",