From bf7a2a5cd16435c54ddd685db9c8600e272ae7f6 Mon Sep 17 00:00:00 2001 From: "Anders D. Johnson" Date: Thu, 3 Nov 2022 20:04:17 -0500 Subject: [PATCH 1/2] fix(0227-server-module-conventions): typo boundary --- text/0227-server-module-conventions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/text/0227-server-module-conventions.md b/text/0227-server-module-conventions.md index ac9518e5..0b4eaef3 100644 --- a/text/0227-server-module-conventions.md +++ b/text/0227-server-module-conventions.md @@ -128,7 +128,7 @@ The nice thing about this convention is that it works outside of Server Componen # TypeScript Convention -Types between the Server and Client boundary mostly just work because they behave the same as if there was no boundaray. One limitation is that if those types includes a non-serializable type - according to the React Server Components specification, you get an error. +Types between the Server and Client boundary mostly just work because they behave the same as if there was no boundary. One limitation is that if those types includes a non-serializable type - according to the React Server Components specification, you get an error. The correct way to model this is to model Client References for exports at the boundaries and then have the callsite of JSX accept a Client Reference as a component and enforce the serialization at the callsite. This ensures that you can still pass client references from server to client in other forms than JSX. In fact, this is how Flow already implements it and it could be implemented in TypeScript too. However, this requires a bit more involved type checking from the TypeScript side. From 9e404ed82f3ca8d1d7d34fc64e0cc56e987b3667 Mon Sep 17 00:00:00 2001 From: "Anders D. Johnson" Date: Thu, 3 Nov 2022 20:07:16 -0500 Subject: [PATCH 2/2] fix(0227-server-module-conventions): more typos --- text/0227-server-module-conventions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/text/0227-server-module-conventions.md b/text/0227-server-module-conventions.md index 0b4eaef3..d5349658 100644 --- a/text/0227-server-module-conventions.md +++ b/text/0227-server-module-conventions.md @@ -128,7 +128,7 @@ The nice thing about this convention is that it works outside of Server Componen # TypeScript Convention -Types between the Server and Client boundary mostly just work because they behave the same as if there was no boundary. One limitation is that if those types includes a non-serializable type - according to the React Server Components specification, you get an error. +Types between the Server and Client boundary mostly just work because they behave the same as if there was no boundary. One limitation is that if those types include a non-serializable type, according to the React Server Components specification, you get an error. The correct way to model this is to model Client References for exports at the boundaries and then have the callsite of JSX accept a Client Reference as a component and enforce the serialization at the callsite. This ensures that you can still pass client references from server to client in other forms than JSX. In fact, this is how Flow already implements it and it could be implemented in TypeScript too. However, this requires a bit more involved type checking from the TypeScript side.