Implement main-thread Camino sessions and synchronous CRDT editing
This commit is contained in:
@@ -15,6 +15,8 @@ export function generateReactBindings(
|
||||
const declarations: string[] = [];
|
||||
const type = (value: ValueType): string => {
|
||||
switch (value.kind) {
|
||||
case "variant":
|
||||
throw new Error("Variants require the Camino portable value runtime; legacy RPC bindings are unsupported");
|
||||
case "builtin":
|
||||
if (value.name !== "unit") throw new Error(`Unsupported React props builtin ${value.name}`);
|
||||
return "null";
|
||||
@@ -85,6 +87,7 @@ export function generateReactBindings(
|
||||
const browserValue = (value: ValueType, seen: Set<string>): boolean => {
|
||||
if (value.kind === "message") return false;
|
||||
if (value.kind === "builtin") return value.name === "unit";
|
||||
if (value.kind === "variant") return false;
|
||||
if (value.kind === "record") return Object.values(value.fields).every((field) => browserValue(field, seen));
|
||||
if (value.kind === "list" || value.kind === "optional") return browserValue(value.value, seen);
|
||||
if (value.kind === "object-ref" && value.expectation.kind === "interface") {
|
||||
|
||||
Reference in New Issue
Block a user