@isograph/react 0.0.0-main-a706b60f → 0.0.0-main-dc615175
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.
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
|
|
2
|
-
> @isograph/react@0.0.0-main-
|
|
2
|
+
> @isograph/react@0.0.0-main-dc615175 compile-typescript /Users/runner/work/isograph/isograph/libs/isograph-react
|
|
3
3
|
> rm -rf dist/* && tsc -p tsconfig.pkg.json
|
|
4
4
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"componentCache.d.ts","sourceRoot":"","sources":["../../src/core/componentCache.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAG5D,OAAO,EAAE,2BAA2B,EAAE,MAAM,QAAQ,CAAC;AAGrD,wBAAgB,0BAA0B,CACxC,WAAW,EAAE,mBAAmB,EAChC,aAAa,EAAE,MAAM,EACrB,iBAAiB,EAAE,iBAAiB,CAAC,GAAG,EAAE,GAAG,CAAC,EAC9C,qBAAqB,EAAE,2BAA2B,GACjD,KAAK,CAAC,EAAE,CAAC,GAAG,CAAC,
|
|
1
|
+
{"version":3,"file":"componentCache.d.ts","sourceRoot":"","sources":["../../src/core/componentCache.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAG5D,OAAO,EAAE,2BAA2B,EAAE,MAAM,QAAQ,CAAC;AAGrD,wBAAgB,0BAA0B,CACxC,WAAW,EAAE,mBAAmB,EAChC,aAAa,EAAE,MAAM,EACrB,iBAAiB,EAAE,iBAAiB,CAAC,GAAG,EAAE,GAAG,CAAC,EAC9C,qBAAqB,EAAE,2BAA2B,GACjD,KAAK,CAAC,EAAE,CAAC,GAAG,CAAC,CA+Cf"}
|
|
@@ -14,29 +14,26 @@ function getOrCreateCachedComponent(environment, componentName, fragmentReferenc
|
|
|
14
14
|
const cachedComponentsById = environment.componentCache;
|
|
15
15
|
const recordLink = fragmentReference.root.__link;
|
|
16
16
|
const componentsByName = ((_a = cachedComponentsById[recordLink]) !== null && _a !== void 0 ? _a : (cachedComponentsById[recordLink] = {}));
|
|
17
|
-
|
|
18
|
-
const byArgs = componentsByName[componentName];
|
|
17
|
+
const byArgs = ((_b = componentsByName[componentName]) !== null && _b !== void 0 ? _b : (componentsByName[componentName] = {}));
|
|
19
18
|
const stringifiedArgs = JSON.stringify((0, cache_1.stableCopy)(fragmentReference.variables));
|
|
20
|
-
byArgs[stringifiedArgs] =
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
startUpdate
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
})();
|
|
41
|
-
return byArgs[stringifiedArgs];
|
|
19
|
+
return ((_c = byArgs[stringifiedArgs]) !== null && _c !== void 0 ? _c : (byArgs[stringifiedArgs] = (() => {
|
|
20
|
+
function Component(additionalRuntimeProps) {
|
|
21
|
+
const readerWithRefetchQueries = (0, PromiseWrapper_1.readPromise)(fragmentReference.readerWithRefetchQueries);
|
|
22
|
+
const data = (0, useReadAndSubscribe_1.useReadAndSubscribe)(fragmentReference, networkRequestOptions, readerWithRefetchQueries.readerArtifact.readerAst);
|
|
23
|
+
(0, logging_1.logMessage)(environment, {
|
|
24
|
+
kind: 'ComponentRerendered',
|
|
25
|
+
componentName,
|
|
26
|
+
rootLink: fragmentReference.root,
|
|
27
|
+
});
|
|
28
|
+
return readerWithRefetchQueries.readerArtifact.resolver({
|
|
29
|
+
data,
|
|
30
|
+
parameters: fragmentReference.variables,
|
|
31
|
+
startUpdate: readerWithRefetchQueries.readerArtifact.hasUpdatable
|
|
32
|
+
? (0, startUpdate_1.startUpdate)(environment, data)
|
|
33
|
+
: undefined,
|
|
34
|
+
}, additionalRuntimeProps);
|
|
35
|
+
}
|
|
36
|
+
Component.displayName = `${componentName} (id: ${fragmentReference.root}) @component`;
|
|
37
|
+
return Component;
|
|
38
|
+
})()));
|
|
42
39
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@isograph/react",
|
|
3
|
-
"version": "0.0.0-main-
|
|
3
|
+
"version": "0.0.0-main-dc615175",
|
|
4
4
|
"description": "Use Isograph with React",
|
|
5
5
|
"homepage": "https://isograph.dev",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -20,9 +20,9 @@
|
|
|
20
20
|
"iso-watch": "cross-env ../../target/debug/isograph_cli --config ./isograph.config.json --watch"
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@isograph/disposable-types": "0.0.0-main-
|
|
24
|
-
"@isograph/react-disposable-state": "0.0.0-main-
|
|
25
|
-
"@isograph/reference-counted-pointer": "0.0.0-main-
|
|
23
|
+
"@isograph/disposable-types": "0.0.0-main-dc615175",
|
|
24
|
+
"@isograph/react-disposable-state": "0.0.0-main-dc615175",
|
|
25
|
+
"@isograph/reference-counted-pointer": "0.0.0-main-dc615175"
|
|
26
26
|
},
|
|
27
27
|
"peerDependencies": {
|
|
28
28
|
"react": "^18.0.0 || ^19.0.0"
|
|
@@ -22,45 +22,41 @@ export function getOrCreateCachedComponent(
|
|
|
22
22
|
|
|
23
23
|
const componentsByName = (cachedComponentsById[recordLink] ??= {});
|
|
24
24
|
|
|
25
|
-
|
|
26
|
-
const byArgs = componentsByName[componentName];
|
|
25
|
+
const byArgs = (componentsByName[componentName] ??= {});
|
|
27
26
|
|
|
28
27
|
const stringifiedArgs = JSON.stringify(
|
|
29
28
|
stableCopy(fragmentReference.variables),
|
|
30
29
|
);
|
|
31
|
-
byArgs[stringifiedArgs]
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
return Component;
|
|
64
|
-
})();
|
|
65
|
-
return byArgs[stringifiedArgs];
|
|
30
|
+
return (byArgs[stringifiedArgs] ??= (() => {
|
|
31
|
+
function Component(additionalRuntimeProps: { [key: string]: any }) {
|
|
32
|
+
const readerWithRefetchQueries = readPromise(
|
|
33
|
+
fragmentReference.readerWithRefetchQueries,
|
|
34
|
+
);
|
|
35
|
+
|
|
36
|
+
const data = useReadAndSubscribe(
|
|
37
|
+
fragmentReference,
|
|
38
|
+
networkRequestOptions,
|
|
39
|
+
readerWithRefetchQueries.readerArtifact.readerAst,
|
|
40
|
+
);
|
|
41
|
+
|
|
42
|
+
logMessage(environment, {
|
|
43
|
+
kind: 'ComponentRerendered',
|
|
44
|
+
componentName,
|
|
45
|
+
rootLink: fragmentReference.root,
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
return readerWithRefetchQueries.readerArtifact.resolver(
|
|
49
|
+
{
|
|
50
|
+
data,
|
|
51
|
+
parameters: fragmentReference.variables,
|
|
52
|
+
startUpdate: readerWithRefetchQueries.readerArtifact.hasUpdatable
|
|
53
|
+
? startUpdate(environment, data)
|
|
54
|
+
: undefined,
|
|
55
|
+
},
|
|
56
|
+
additionalRuntimeProps,
|
|
57
|
+
);
|
|
58
|
+
}
|
|
59
|
+
Component.displayName = `${componentName} (id: ${fragmentReference.root}) @component`;
|
|
60
|
+
return Component;
|
|
61
|
+
})());
|
|
66
62
|
}
|