rescript-relay 0.0.0-cli-61b2cdf6 → 0.0.0-connection-id-maker-fix-b63bb519
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +247 -0
- package/README.md +7 -11
- package/bsconfig.json +1 -1
- package/cli/cli.js +30 -35
- package/compiler.js +11 -0
- package/package.json +25 -25
- package/postinstall.js +66 -16
- package/ppx-linux +0 -0
- package/ppx-macos-latest +0 -0
- package/{ppx-darwin → ppx-windows-latest} +0 -0
- package/relay-compiler-linux-musl/relay +0 -0
- package/relay-compiler-linux-x64/relay +0 -0
- package/relay-compiler-macos-arm64/relay +0 -0
- package/relay-compiler-macos-x64/relay +0 -0
- package/relay-compiler-win-x64/relay.exe +0 -0
- package/src/ReactDOMExperimental.bs.js +19 -1
- package/src/ReactDOMExperimental.res +16 -4
- package/src/ReactExperimental.bs.js +14 -16
- package/src/ReactExperimental.res +11 -22
- package/src/ReactExperimental.resi +18 -0
- package/src/RescriptRelay.bs.js +40 -28
- package/src/RescriptRelay.res +98 -39
- package/src/RescriptRelay.resi +78 -44
- package/src/RescriptRelay_Internal.bs.js +47 -13
- package/src/RescriptRelay_Internal.res +27 -18
- package/src/RescriptRelay_Internal.resi +2 -0
- package/src/experimental-router/RescriptRelayRouter.bs.js +16 -4
- package/src/experimental-router/RescriptRelayRouter.res +11 -2
- package/src/experimental-router/RescriptRelayRouter.resi +2 -0
- package/src/utils.js +207 -173
- package/src/utils.mjs +381 -0
- package/bin-darwin +0 -0
- package/bin-linux +0 -0
- package/compiler/compiler-cli.js +0 -54
- package/language-plugin/dist/index.js +0 -1
package/compiler.js
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
|
|
4
|
+
var spawn = require("child_process").spawn;
|
|
5
|
+
var path = require("path");
|
|
6
|
+
|
|
7
|
+
var input = process.argv.slice(2);
|
|
8
|
+
|
|
9
|
+
spawn(path.join(__dirname, "rescript-relay-compiler.exe"), input, {
|
|
10
|
+
stdio: "inherit",
|
|
11
|
+
}).on("exit", process.exit);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rescript-relay",
|
|
3
|
-
"version": "0.0.0-
|
|
3
|
+
"version": "0.0.0-connection-id-maker-fix-b63bb519",
|
|
4
4
|
"main": "src/RescriptRelay.res",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Gabriel Nordeborn",
|
|
@@ -19,51 +19,51 @@
|
|
|
19
19
|
"reasonml",
|
|
20
20
|
"rescript"
|
|
21
21
|
],
|
|
22
|
+
"exports": {
|
|
23
|
+
"./src/utils": {
|
|
24
|
+
"require": "./src/utils.js",
|
|
25
|
+
"import": "./src/utils.mjs"
|
|
26
|
+
},
|
|
27
|
+
"./src/*": "./src/*",
|
|
28
|
+
"./package.json": "./package.json"
|
|
29
|
+
},
|
|
22
30
|
"bin": {
|
|
23
|
-
"rescript-relay-compiler": "compiler
|
|
31
|
+
"rescript-relay-compiler": "compiler.js",
|
|
24
32
|
"rescript-relay-cli": "cli/cli.js"
|
|
25
33
|
},
|
|
26
34
|
"scripts": {
|
|
27
35
|
"build": "rescript build -with-deps",
|
|
28
|
-
"build:test": "compiler
|
|
36
|
+
"build:test": "./build-compiler-dev.sh && ./rescript-relay-compiler",
|
|
29
37
|
"postinstall": "node postinstall.js",
|
|
30
38
|
"test": "jest",
|
|
31
39
|
"test:ci": "jest --ci --runInBand"
|
|
32
40
|
},
|
|
33
41
|
"devDependencies": {
|
|
42
|
+
"rescript": "^9.1.2",
|
|
34
43
|
"@rescript/react": "0.10.3",
|
|
35
|
-
"@testing-library/jest-dom": "^
|
|
36
|
-
"@testing-library/react": "^
|
|
44
|
+
"@testing-library/jest-dom": "^5.16.3",
|
|
45
|
+
"@testing-library/react": "^13.0.0-alpha.6",
|
|
37
46
|
"bs-fetch": "^0.5.0",
|
|
38
|
-
"graphql": "14.5.0",
|
|
39
47
|
"graphql-query-test-mock": "^0.12.1",
|
|
40
|
-
"jest": "^
|
|
48
|
+
"jest": "^27.2.4",
|
|
41
49
|
"nock": "^11.7.0",
|
|
42
50
|
"node-fetch": "^2.6.0",
|
|
43
|
-
"react": "
|
|
44
|
-
"react-dom": "
|
|
45
|
-
"react-relay": "
|
|
46
|
-
"
|
|
47
|
-
"relay-compiler": "^11.0.0",
|
|
48
|
-
"relay-config": "^11.0.0",
|
|
49
|
-
"relay-runtime": "^11.0.0"
|
|
51
|
+
"react": "18.0.0",
|
|
52
|
+
"react-dom": "18.0.0",
|
|
53
|
+
"react-relay": "14.1.0",
|
|
54
|
+
"relay-runtime": "14.1.0"
|
|
50
55
|
},
|
|
51
56
|
"peerDependencies": {
|
|
52
57
|
"@rescript/react": "*",
|
|
53
|
-
"
|
|
54
|
-
"
|
|
55
|
-
"rescript": "^9.1.2"
|
|
56
|
-
"reason-promise": "^1.0.2",
|
|
57
|
-
"relay-compiler": "*",
|
|
58
|
-
"relay-config": "*",
|
|
59
|
-
"relay-runtime": "*"
|
|
58
|
+
"react-relay": ">=11.0.0",
|
|
59
|
+
"relay-runtime": "*",
|
|
60
|
+
"rescript": "^9.1.2"
|
|
60
61
|
},
|
|
61
62
|
"dependencies": {
|
|
62
|
-
"
|
|
63
|
-
"rescript": "^9.1.2"
|
|
63
|
+
"detect-libc": "^2.0.1"
|
|
64
64
|
},
|
|
65
65
|
"resolutions": {
|
|
66
|
-
"react": "
|
|
67
|
-
"react-dom": "
|
|
66
|
+
"react": "18.0.0",
|
|
67
|
+
"react-dom": "18.0.0"
|
|
68
68
|
}
|
|
69
69
|
}
|
package/postinstall.js
CHANGED
|
@@ -10,16 +10,32 @@
|
|
|
10
10
|
var path = require("path");
|
|
11
11
|
var cp = require("child_process");
|
|
12
12
|
var fs = require("fs");
|
|
13
|
-
var
|
|
13
|
+
var { isNonGlibcLinux } = require("detect-libc");
|
|
14
14
|
var platform = process.platform;
|
|
15
15
|
|
|
16
|
+
function getRelayCompilerPlatformSuffix() {
|
|
17
|
+
if (process.platform === "win32") {
|
|
18
|
+
return "win-x64";
|
|
19
|
+
} else if (process.platform === "darwin" && process.arch === "x64") {
|
|
20
|
+
return "macos-x64";
|
|
21
|
+
} else if (process.platform === "darwin" && process.arch === "arm64") {
|
|
22
|
+
return "macos-arm64";
|
|
23
|
+
} else if (process.platform === "linux" && isNonGlibcLinux) {
|
|
24
|
+
return "linux-musl";
|
|
25
|
+
} else if (process.platform === "linux" && process.arch === "x64") {
|
|
26
|
+
return "linux-x64";
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
return "linux-x64";
|
|
30
|
+
}
|
|
31
|
+
|
|
16
32
|
/**
|
|
17
33
|
* Since os.arch returns node binary's target arch, not
|
|
18
34
|
* the system arch.
|
|
19
35
|
* Credits: https://github.com/feross/arch/blob/af080ff61346315559451715c5393d8e86a6d33c/index.js#L10-L58
|
|
20
36
|
*/
|
|
21
37
|
|
|
22
|
-
function
|
|
38
|
+
function ppxArch() {
|
|
23
39
|
/**
|
|
24
40
|
* Use Rosetta for ARM on macOS
|
|
25
41
|
*/
|
|
@@ -80,44 +96,78 @@ function arch() {
|
|
|
80
96
|
}
|
|
81
97
|
|
|
82
98
|
function copyPlatformBinaries(platform) {
|
|
99
|
+
/**
|
|
100
|
+
* Copy the PPX
|
|
101
|
+
*/
|
|
83
102
|
fs.copyFileSync(
|
|
84
103
|
path.join(__dirname, "ppx-" + platform),
|
|
85
104
|
path.join(__dirname, "ppx")
|
|
86
105
|
);
|
|
87
106
|
fs.chmodSync(path.join(__dirname, "ppx"), 0777);
|
|
88
107
|
|
|
108
|
+
// Windows seems to need an .exe file as well.
|
|
109
|
+
if (platform === "windows-latest") {
|
|
110
|
+
fs.copyFileSync(
|
|
111
|
+
path.join(__dirname, "ppx-" + platform),
|
|
112
|
+
path.join(__dirname, "ppx.exe")
|
|
113
|
+
);
|
|
114
|
+
fs.chmodSync(path.join(__dirname, "ppx.exe"), 0777);
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* Copy the Relay compiler
|
|
119
|
+
*/
|
|
120
|
+
|
|
121
|
+
var platformSuffix = getRelayCompilerPlatformSuffix();
|
|
122
|
+
|
|
89
123
|
fs.copyFileSync(
|
|
90
|
-
path.join(
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
124
|
+
path.join(
|
|
125
|
+
__dirname,
|
|
126
|
+
"relay-compiler-" + platformSuffix,
|
|
127
|
+
platformSuffix === "win-x64" ? "relay.exe" : "relay"
|
|
128
|
+
),
|
|
129
|
+
path.join(__dirname, "rescript-relay-compiler.exe")
|
|
96
130
|
);
|
|
131
|
+
fs.chmodSync(path.join(__dirname, "rescript-relay-compiler.exe"), 0777);
|
|
97
132
|
}
|
|
98
133
|
|
|
99
134
|
function removeInitialBinaries() {
|
|
100
|
-
fs.unlinkSync(path.join(__dirname, "ppx-
|
|
135
|
+
fs.unlinkSync(path.join(__dirname, "ppx-macos-latest"));
|
|
136
|
+
fs.unlinkSync(path.join(__dirname, "ppx-windows-latest"));
|
|
101
137
|
fs.unlinkSync(path.join(__dirname, "ppx-linux"));
|
|
102
|
-
fs.
|
|
103
|
-
|
|
138
|
+
fs.rmSync(path.join(__dirname, "relay-compiler-linux-x64"), {
|
|
139
|
+
recursive: true,
|
|
140
|
+
force: true,
|
|
141
|
+
});
|
|
142
|
+
fs.rmSync(path.join(__dirname, "relay-compiler-macos-x64"), {
|
|
143
|
+
recursive: true,
|
|
144
|
+
force: true,
|
|
145
|
+
});
|
|
146
|
+
fs.rmSync(path.join(__dirname, "relay-compiler-macos-arm64"), {
|
|
147
|
+
recursive: true,
|
|
148
|
+
force: true,
|
|
149
|
+
});
|
|
150
|
+
fs.rmSync(path.join(__dirname, "relay-compiler-linux-musl"), {
|
|
151
|
+
recursive: true,
|
|
152
|
+
force: true,
|
|
153
|
+
});
|
|
104
154
|
}
|
|
105
155
|
|
|
106
156
|
switch (platform) {
|
|
107
157
|
case "win32": {
|
|
108
|
-
if (
|
|
158
|
+
if (ppxArch() !== "x64") {
|
|
109
159
|
console.warn("error: x86 is currently not supported on Windows");
|
|
110
160
|
process.exit(1);
|
|
111
161
|
}
|
|
112
|
-
|
|
113
|
-
throw new Error("Windows currently not supported.");
|
|
114
|
-
copyPlatformBinaries("windows");
|
|
162
|
+
copyPlatformBinaries("windows-latest");
|
|
115
163
|
break;
|
|
116
164
|
}
|
|
117
165
|
case "linux":
|
|
118
|
-
case "darwin":
|
|
119
166
|
copyPlatformBinaries(platform);
|
|
120
167
|
break;
|
|
168
|
+
case "darwin":
|
|
169
|
+
copyPlatformBinaries("macos-latest");
|
|
170
|
+
break;
|
|
121
171
|
default:
|
|
122
172
|
console.warn("error: no release built for the " + platform + " platform");
|
|
123
173
|
process.exit(1);
|
package/ppx-linux
CHANGED
|
Binary file
|
package/ppx-macos-latest
ADDED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1,2 +1,20 @@
|
|
|
1
1
|
// Generated by ReScript, PLEASE EDIT WITH CARE
|
|
2
|
-
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
var Client = require("react-dom/client");
|
|
5
|
+
|
|
6
|
+
function renderConcurrentRootAtElementWithId(content, id) {
|
|
7
|
+
var element = document.getElementById(id);
|
|
8
|
+
if (element == null) {
|
|
9
|
+
throw {
|
|
10
|
+
RE_EXN_ID: "Invalid_argument",
|
|
11
|
+
_1: "ReactExperimental.renderConcurrentRootAtElementWithId : no element of id " + id + " found in the HTML.",
|
|
12
|
+
Error: new Error()
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
Client.createRoot(element).render(content);
|
|
16
|
+
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
exports.renderConcurrentRootAtElementWithId = renderConcurrentRootAtElementWithId;
|
|
20
|
+
/* react-dom/client Not a pure module */
|
|
@@ -1,7 +1,19 @@
|
|
|
1
1
|
include ReactDOM.Experimental
|
|
2
2
|
|
|
3
|
-
@module("react-dom")
|
|
4
|
-
external
|
|
3
|
+
@module("react-dom/client")
|
|
4
|
+
external createRoot: Dom.element => root = "createRoot"
|
|
5
5
|
|
|
6
|
-
@
|
|
7
|
-
external
|
|
6
|
+
@val @return(nullable)
|
|
7
|
+
external getElementById: string => option<Dom.element> = "document.getElementById"
|
|
8
|
+
|
|
9
|
+
let renderConcurrentRootAtElementWithId: (React.element, string) => unit = (content, id) =>
|
|
10
|
+
switch getElementById(id) {
|
|
11
|
+
| None =>
|
|
12
|
+
raise(
|
|
13
|
+
Invalid_argument(
|
|
14
|
+
"ReactExperimental.renderConcurrentRootAtElementWithId : no element of id " ++
|
|
15
|
+
id ++ " found in the HTML.",
|
|
16
|
+
),
|
|
17
|
+
)
|
|
18
|
+
| Some(element) => createRoot(element)->render(content)
|
|
19
|
+
}
|
|
@@ -1,23 +1,21 @@
|
|
|
1
1
|
// Generated by ReScript, PLEASE EDIT WITH CARE
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var React = require("react");
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
};
|
|
16
|
-
}
|
|
17
|
-
ReactDom.unstable_createRoot(element).render(content);
|
|
18
|
-
|
|
6
|
+
function useTransition(param) {
|
|
7
|
+
var match = React.useTransition();
|
|
8
|
+
var startTransition = match[1];
|
|
9
|
+
return [
|
|
10
|
+
match[0],
|
|
11
|
+
React.useCallback((function (cb) {
|
|
12
|
+
return startTransition(cb, undefined);
|
|
13
|
+
}), [startTransition])
|
|
14
|
+
];
|
|
19
15
|
}
|
|
20
16
|
|
|
17
|
+
var SuspenseList = {};
|
|
18
|
+
|
|
19
|
+
exports.useTransition = useTransition;
|
|
21
20
|
exports.SuspenseList = SuspenseList;
|
|
22
|
-
|
|
23
|
-
/* react-dom Not a pure module */
|
|
21
|
+
/* react Not a pure module */
|
|
@@ -1,32 +1,21 @@
|
|
|
1
|
-
type callback<'input, 'output> = 'input => 'output
|
|
2
|
-
|
|
3
1
|
@module("react")
|
|
4
|
-
external
|
|
2
|
+
external useDeferredValue: 'value => 'value = "useDeferredValue"
|
|
5
3
|
|
|
6
4
|
@module("react")
|
|
7
|
-
external
|
|
8
|
-
|
|
5
|
+
external useTransitionWithOptions: unit => (
|
|
6
|
+
bool,
|
|
7
|
+
(. unit => unit, option<{"name": option<string>}>) => unit,
|
|
8
|
+
) = "useTransition"
|
|
9
|
+
|
|
10
|
+
let useTransition = () => {
|
|
11
|
+
let (isPending, startTransition) = useTransitionWithOptions()
|
|
12
|
+
(isPending, React.useCallback1(cb => startTransition(. cb, None), [startTransition]))
|
|
13
|
+
}
|
|
9
14
|
|
|
10
15
|
module SuspenseList = {
|
|
11
16
|
@module("react") @react.component
|
|
12
17
|
external make: (
|
|
13
18
|
~children: React.element,
|
|
14
19
|
~revealOrder: [#forwards | #backwards | #together]=?,
|
|
15
|
-
) => React.element = "
|
|
20
|
+
) => React.element = "SuspenseList"
|
|
16
21
|
}
|
|
17
|
-
|
|
18
|
-
@val @return(nullable)
|
|
19
|
-
external getElementById: string => option<Dom.element> = "document.getElementById"
|
|
20
|
-
|
|
21
|
-
let renderConcurrentRootAtElementWithId: (React.element, string) => unit = (content, id) =>
|
|
22
|
-
switch getElementById(id) {
|
|
23
|
-
| None =>
|
|
24
|
-
raise(
|
|
25
|
-
Invalid_argument(
|
|
26
|
-
"ReactExperimental.renderConcurrentRootAtElementWithId : no element of id " ++
|
|
27
|
-
id ++ " found in the HTML.",
|
|
28
|
-
),
|
|
29
|
-
)
|
|
30
|
-
| Some(element) =>
|
|
31
|
-
ReactDOMExperimental.unstable_createRoot(element)->ReactDOMExperimental.render(content)
|
|
32
|
-
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
@module("react")
|
|
2
|
+
external useDeferredValue: 'value => 'value = "useDeferredValue"
|
|
3
|
+
|
|
4
|
+
@module("react")
|
|
5
|
+
external useTransitionWithOptions: unit => (
|
|
6
|
+
bool,
|
|
7
|
+
(. unit => unit, option<{"name": option<string>}>) => unit,
|
|
8
|
+
) = "useTransition"
|
|
9
|
+
|
|
10
|
+
let useTransition: unit => (bool, React.callback<unit => unit, unit>)
|
|
11
|
+
|
|
12
|
+
module SuspenseList: {
|
|
13
|
+
@module("react") @react.component
|
|
14
|
+
external make: (
|
|
15
|
+
~children: React.element,
|
|
16
|
+
~revealOrder: [#forwards | #backwards | #together]=?,
|
|
17
|
+
) => React.element = "SuspenseList"
|
|
18
|
+
}
|
package/src/RescriptRelay.bs.js
CHANGED
|
@@ -4,13 +4,12 @@
|
|
|
4
4
|
var Curry = require("rescript/lib/js/curry.js");
|
|
5
5
|
var React = require("react");
|
|
6
6
|
var Utils = require("./utils");
|
|
7
|
-
var $$Promise = require("reason-promise/src/js/promise.bs.js");
|
|
8
7
|
var Belt_Array = require("rescript/lib/js/belt_Array.js");
|
|
8
|
+
var Belt_Option = require("rescript/lib/js/belt_Option.js");
|
|
9
9
|
var Caml_option = require("rescript/lib/js/caml_option.js");
|
|
10
10
|
var ReactRelay = require("react-relay");
|
|
11
11
|
var RelayRuntime = require("relay-runtime");
|
|
12
12
|
var Caml_exceptions = require("rescript/lib/js/caml_exceptions.js");
|
|
13
|
-
var Hooks = require("react-relay/hooks");
|
|
14
13
|
|
|
15
14
|
function convertObj(prim0, prim1, prim2, prim3) {
|
|
16
15
|
return Utils.traverser(prim0, prim1, prim2, prim3);
|
|
@@ -131,7 +130,11 @@ var Store = {
|
|
|
131
130
|
make: make
|
|
132
131
|
};
|
|
133
132
|
|
|
134
|
-
function
|
|
133
|
+
function toJs(f, arg) {
|
|
134
|
+
return Curry._3(f, arg.kind, arg.owner, arg.fieldPath);
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
function make$1(network, store, getDataID, treatMissingFieldsAsNull, missingFieldHandlers, requiredFieldLogger, isServer, param) {
|
|
135
138
|
var tmp = {
|
|
136
139
|
network: network,
|
|
137
140
|
store: store,
|
|
@@ -143,6 +146,13 @@ function make$1(network, store, getDataID, treatMissingFieldsAsNull, missingFiel
|
|
|
143
146
|
if (treatMissingFieldsAsNull !== undefined) {
|
|
144
147
|
tmp.treatMissingFieldsAsNull = Caml_option.valFromOption(treatMissingFieldsAsNull);
|
|
145
148
|
}
|
|
149
|
+
var tmp$1 = Belt_Option.map(requiredFieldLogger, toJs);
|
|
150
|
+
if (tmp$1 !== undefined) {
|
|
151
|
+
tmp.requiredFieldLogger = Caml_option.valFromOption(tmp$1);
|
|
152
|
+
}
|
|
153
|
+
if (isServer !== undefined) {
|
|
154
|
+
tmp.isServer = Caml_option.valFromOption(isServer);
|
|
155
|
+
}
|
|
146
156
|
return new RelayRuntime.Environment(tmp);
|
|
147
157
|
}
|
|
148
158
|
|
|
@@ -150,11 +160,10 @@ var Environment = {
|
|
|
150
160
|
make: make$1
|
|
151
161
|
};
|
|
152
162
|
|
|
153
|
-
var provider = ReactRelay.ReactRelayContext.Provider;
|
|
154
|
-
|
|
155
163
|
function RescriptRelay$Context$Provider(Props) {
|
|
156
164
|
var environment = Props.environment;
|
|
157
165
|
var children = Props.children;
|
|
166
|
+
var provider = ReactRelay.ReactRelayContext.Provider;
|
|
158
167
|
return React.createElement(provider, {
|
|
159
168
|
value: {
|
|
160
169
|
environment: environment
|
|
@@ -167,6 +176,10 @@ var Provider = {
|
|
|
167
176
|
make: RescriptRelay$Context$Provider
|
|
168
177
|
};
|
|
169
178
|
|
|
179
|
+
var Context = {
|
|
180
|
+
Provider: Provider
|
|
181
|
+
};
|
|
182
|
+
|
|
170
183
|
var EnvironmentNotFoundInContext = /* @__PURE__ */Caml_exceptions.create("RescriptRelay.EnvironmentNotFoundInContext");
|
|
171
184
|
|
|
172
185
|
function useEnvironmentFromContext(param) {
|
|
@@ -210,7 +223,7 @@ function mapFetchQueryFetchPolicy(x) {
|
|
|
210
223
|
|
|
211
224
|
function MakeLoadQuery(C) {
|
|
212
225
|
var load = function (environment, variables, fetchPolicy, fetchKey, networkCacheConfig, param) {
|
|
213
|
-
return
|
|
226
|
+
return ReactRelay.loadQuery(environment, C.query, Curry._1(C.convertVariables, variables), {
|
|
214
227
|
fetchKey: fetchKey,
|
|
215
228
|
fetchPolicy: mapFetchPolicy(fetchPolicy),
|
|
216
229
|
networkCacheConfig: networkCacheConfig
|
|
@@ -220,25 +233,25 @@ function MakeLoadQuery(C) {
|
|
|
220
233
|
return Caml_option.nullable_to_opt(token.source);
|
|
221
234
|
};
|
|
222
235
|
var queryRefToPromise = function (token) {
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
236
|
+
return new Promise((function (resolve, param) {
|
|
237
|
+
var o = queryRefToObservable(token);
|
|
238
|
+
if (o !== undefined) {
|
|
239
|
+
Caml_option.valFromOption(o).subscribe({
|
|
240
|
+
complete: (function (param) {
|
|
241
|
+
return resolve({
|
|
242
|
+
TAG: /* Ok */0,
|
|
243
|
+
_0: undefined
|
|
244
|
+
});
|
|
245
|
+
})
|
|
246
|
+
});
|
|
247
|
+
return ;
|
|
248
|
+
} else {
|
|
249
|
+
return resolve({
|
|
250
|
+
TAG: /* Error */1,
|
|
251
|
+
_0: undefined
|
|
252
|
+
});
|
|
253
|
+
}
|
|
254
|
+
}));
|
|
242
255
|
};
|
|
243
256
|
return {
|
|
244
257
|
load: load,
|
|
@@ -249,9 +262,7 @@ function MakeLoadQuery(C) {
|
|
|
249
262
|
|
|
250
263
|
var Mutation_failed = /* @__PURE__ */Caml_exceptions.create("RescriptRelay.Mutation_failed");
|
|
251
264
|
|
|
252
|
-
var
|
|
253
|
-
Provider: Provider
|
|
254
|
-
};
|
|
265
|
+
var RequiredFieldLogger = {};
|
|
255
266
|
|
|
256
267
|
exports.convertObj = convertObj;
|
|
257
268
|
exports.RecordProxy = RecordProxy;
|
|
@@ -264,6 +275,7 @@ exports.Network = Network;
|
|
|
264
275
|
exports.RecordSource = RecordSource;
|
|
265
276
|
exports.Store = Store;
|
|
266
277
|
exports.Disposable = Disposable;
|
|
278
|
+
exports.RequiredFieldLogger = RequiredFieldLogger;
|
|
267
279
|
exports.Environment = Environment;
|
|
268
280
|
exports.mapFetchPolicy = mapFetchPolicy;
|
|
269
281
|
exports.mapFetchQueryFetchPolicy = mapFetchQueryFetchPolicy;
|