Make local graph execution optional across composed packages
This commit is contained in:
+16
-14
@@ -15,7 +15,7 @@ const factory = compileCapabilityResourceSource(
|
||||
`external atom Entry id "atom:entry";
|
||||
interface EntryFactory id "interface:entry-factory" revision "interface:entry-factory@1" {
|
||||
static operation create id "entry:create" : unit -> atom-ref<Entry> {
|
||||
call id "entry:create:call" execution transaction targets [server];
|
||||
call id "entry:create:call" execution transaction;
|
||||
}
|
||||
}`,
|
||||
{ source },
|
||||
@@ -23,12 +23,12 @@ interface EntryFactory id "interface:entry-factory" revision "interface:entry-fa
|
||||
assert.ok(factory.ok && factory.resource.kind === "interface", JSON.stringify(factory.diagnostics));
|
||||
const data = compileCapabilityResourceSource(
|
||||
`interface Data id "interface:data" revision "interface:data@1" {
|
||||
queryable value body id "body" : string { get id "body:get" execution snapshot targets [browser, server]; edit id "body:edit" execution transaction targets [browser, server]; }
|
||||
queryable value notes id "notes" : string { get id "notes:get" execution snapshot targets [browser, server]; edit id "notes:edit" execution transaction targets [browser, server]; }
|
||||
operation revise id "revise" : record {body:change<string>; notes:change<string>; reject:bool;} -> unit {call id "revise:call" execution transaction targets [browser, server];}
|
||||
queryable value body id "body" : string { get id "body:get" execution snapshot; edit id "body:edit" execution transaction; }
|
||||
queryable value notes id "notes" : string { get id "notes:get" execution snapshot; edit id "notes:edit" execution transaction; }
|
||||
operation revise id "revise" : record {body:change<string>; notes:change<string>; reject:bool;} -> unit {call id "revise:call" execution transaction;}
|
||||
queryable value label id "label" : string {
|
||||
get id "label:get" execution snapshot targets [browser, server];
|
||||
set id "label:set" execution transaction targets [browser, server];
|
||||
get id "label:get" execution snapshot;
|
||||
set id "label:set" execution transaction;
|
||||
}
|
||||
}`,
|
||||
{ source },
|
||||
@@ -36,8 +36,8 @@ const data = compileCapabilityResourceSource(
|
||||
const constructors = compileCapabilityResourceSource(
|
||||
`external atom Entry id "atom:entry"; external atom Independent id "atom:independent";
|
||||
interface Factories id "interface:factories" revision "interface:factories@1" {
|
||||
static operation createOne id "create-one" : string -> atom-ref<Entry> { call id "create-one:call" execution transaction targets [browser, server]; }
|
||||
static operation createTwo id "create-two" : unit -> atom-ref<Independent> { call id "create-two:call" execution transaction targets [browser, server]; }
|
||||
static operation createOne id "create-one" : string -> atom-ref<Entry> { call id "create-one:call" execution transaction; }
|
||||
static operation createTwo id "create-two" : unit -> atom-ref<Independent> { call id "create-two:call" execution transaction; }
|
||||
}`,
|
||||
{ source },
|
||||
);
|
||||
@@ -70,7 +70,8 @@ for (const variant of ["base", "added", "gateway", "gateway-next", "session"]) {
|
||||
gateway = session || variant.startsWith("gateway"),
|
||||
commit = { base: "a", added: "b", gateway: "c", "gateway-next": "d", session: "e" }[variant]!.repeat(40);
|
||||
const pkg = compileCapabilityResourceSource(
|
||||
`${gateway ? 'external atom Entry id "atom:entry";' : ""}
|
||||
`symbol JavaScript id "target:org.quixos.execution.javascript@1";
|
||||
${gateway ? 'external atom Entry id "atom:entry";' : ""}
|
||||
${session ? 'external atom Independent id "atom:independent"; import interface Data; import interface View;' : ""}
|
||||
package Owner id "package:owner" revision "package:owner@1" {
|
||||
function identity id "identity" : int32 -> record { pid: int32; child: int32; } execution remote;
|
||||
@@ -78,9 +79,9 @@ package Owner id "package:owner" revision "package:owner@1" {
|
||||
${
|
||||
session
|
||||
? `module Editor id "component:owner-editor" implements View.render;
|
||||
function createOne id "create-one" : string -> atom-ref<Entry> execution transaction targets [browser, server] requires { creation entry id "one:birth" : Entry input unit; };
|
||||
function createTwo id "create-two" : unit -> atom-ref<Independent> execution transaction targets [browser, server] requires { creation entry id "two:birth" : Independent input unit; };
|
||||
operation revise id "revise" : record {body:change<string>; notes:change<string>; reject:bool;} -> unit mode call execution transaction targets [browser, server] receiver any requires {
|
||||
function createOne id "create-one" : string -> atom-ref<Entry> execution transaction targets [JavaScript, server] requires { creation entry id "one:birth" : Entry input unit; };
|
||||
function createTwo id "create-two" : unit -> atom-ref<Independent> execution transaction targets [JavaScript, server] requires { creation entry id "two:birth" : Independent input unit; };
|
||||
operation revise id "revise" : record {body:change<string>; notes:change<string>; reject:bool;} -> unit mode call execution transaction targets [JavaScript, server] receiver any requires {
|
||||
state body id "revise:body" : string [edit]; state notes id "revise:notes" : string [edit];
|
||||
};
|
||||
query Inputs id "inputs" root workspace Data document "inputs.graphql" operation "Inputs" { replica; }
|
||||
@@ -202,9 +203,10 @@ await import("./emit-controllers.js");
|
||||
// Standalone public builder roots must work without opting into the other modes.
|
||||
for (const kind of ["portable", "service"]) {
|
||||
const pkg = compileCapabilityResourceSource(
|
||||
`package Owner id "package:owner" revision "package:owner@1" {
|
||||
`symbol JavaScript id "target:org.quixos.execution.javascript@1";
|
||||
package Owner id "package:owner" revision "package:owner@1" {
|
||||
function identity id "identity" : int32 -> record {pid:int32;child:int32;}
|
||||
execution ${kind === "portable" ? "snapshot targets [browser,server]" : "remote"};
|
||||
execution ${kind === "portable" ? "snapshot targets [JavaScript,server]" : "remote"};
|
||||
}`,
|
||||
{ source },
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user