houdini-react 2.0.0-go.0 → 2.0.0-go.2
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/package.json +89 -73
- package/{build/houdini-react/shim.cjs → shim.cjs} +0 -0
- package/LICENSE +0 -21
- package/README.md +0 -36
- package/build/houdini-react/package.json +0 -92
- package/build/houdini-react/postInstall.js +0 -117
- package/build/houdini-react/runtime/client.ts +0 -5
- package/build/houdini-react/runtime/clientPlugin.ts +0 -17
- package/build/houdini-react/runtime/componentFields.ts +0 -79
- package/build/houdini-react/runtime/hooks/index.ts +0 -9
- package/build/houdini-react/runtime/hooks/useDeepCompareEffect.ts +0 -89
- package/build/houdini-react/runtime/hooks/useDocumentHandle.ts +0 -224
- package/build/houdini-react/runtime/hooks/useDocumentStore.ts +0 -76
- package/build/houdini-react/runtime/hooks/useDocumentSubscription.ts +0 -62
- package/build/houdini-react/runtime/hooks/useFragment.ts +0 -102
- package/build/houdini-react/runtime/hooks/useFragmentHandle.ts +0 -47
- package/build/houdini-react/runtime/hooks/useIsMounted.ts +0 -14
- package/build/houdini-react/runtime/hooks/useMutation.ts +0 -54
- package/build/houdini-react/runtime/hooks/useQuery.ts +0 -17
- package/build/houdini-react/runtime/hooks/useQueryHandle.ts +0 -184
- package/build/houdini-react/runtime/hooks/useSubscription.ts +0 -12
- package/build/houdini-react/runtime/hooks/useSubscriptionHandle.ts +0 -33
- package/build/houdini-react/runtime/index.tsx +0 -49
- package/build/houdini-react/runtime/manifest.ts +0 -6
- package/build/houdini-react/runtime/package.json +0 -1
- package/build/houdini-react/runtime/routing/Router.tsx +0 -887
- package/build/houdini-react/runtime/routing/cache.ts +0 -52
- package/build/houdini-react/runtime/routing/index.ts +0 -2
- package/build/houdini-react/server/index.d.ts +0 -1
- package/build/houdini-react/server/index.js +0 -4
- package/build/houdini-react/server/package.json +0 -1
- package/build/houdini-react/vite/index.d.ts +0 -3
- package/build/houdini-react/vite/index.js +0 -11
- package/build/houdini-react/vite/package.json +0 -1
- package/build/houdini-react-darwin-arm64/bin/houdini-react +0 -0
- package/build/houdini-react-darwin-arm64/package.json +0 -11
- package/build/houdini-react-darwin-x64/bin/houdini-react +0 -0
- package/build/houdini-react-darwin-x64/package.json +0 -11
- package/build/houdini-react-linux-arm64/bin/houdini-react +0 -0
- package/build/houdini-react-linux-arm64/package.json +0 -11
- package/build/houdini-react-linux-x64/bin/houdini-react +0 -0
- package/build/houdini-react-linux-x64/package.json +0 -11
- package/build/houdini-react-windows-arm64/bin/houdini-react.exe +0 -0
- package/build/houdini-react-windows-arm64/package.json +0 -11
- package/build/houdini-react-windows-x64/bin/houdini-react.exe +0 -0
- package/build/houdini-react-windows-x64/package.json +0 -11
- package/build/package.json +0 -91
package/package.json
CHANGED
|
@@ -1,76 +1,92 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
},
|
|
17
|
-
"license": "MIT",
|
|
18
|
-
"devDependencies": {
|
|
19
|
-
"@types/cookie-parser": "^1.4.3",
|
|
20
|
-
"@types/cookie-session": "^2.0.44",
|
|
21
|
-
"@types/cookies": "^0.7.7",
|
|
22
|
-
"@types/estraverse": "^5.1.2",
|
|
23
|
-
"@types/express": "^4.17.17",
|
|
24
|
-
"@types/react": "^19.0.7",
|
|
25
|
-
"@types/react-dom": "^19.0.3",
|
|
26
|
-
"scripts": "^2.0.0-go.0"
|
|
27
|
-
},
|
|
28
|
-
"dependencies": {
|
|
29
|
-
"@babel/parser": "^7.24.6",
|
|
30
|
-
"@babel/types": "^7.24.6",
|
|
31
|
-
"@whatwg-node/server": "^0.9.14",
|
|
32
|
-
"cookie-parser": "^1.4.6",
|
|
33
|
-
"cookie-session": "^2.0.0",
|
|
34
|
-
"cookies": "^0.8.0",
|
|
35
|
-
"estraverse": "^5.3.0",
|
|
36
|
-
"express": "^4.18.2",
|
|
37
|
-
"graphql": "^15.8.0",
|
|
38
|
-
"graphql-yoga": "^4.0.4",
|
|
39
|
-
"react": "^19.0.0",
|
|
40
|
-
"react-dom": "^19.0.0",
|
|
41
|
-
"react-streaming-compat": "^0.3.18",
|
|
42
|
-
"recast": "^0.23.1",
|
|
43
|
-
"rollup": "^4.28.1",
|
|
44
|
-
"use-deep-compare-effect": "^1.8.1",
|
|
45
|
-
"houdini": "^2.0.0-go.0"
|
|
46
|
-
},
|
|
47
|
-
"files": [
|
|
48
|
-
"build"
|
|
49
|
-
],
|
|
50
|
-
"exports": {
|
|
51
|
-
"./package.json": "./package.json",
|
|
52
|
-
".": {
|
|
53
|
-
"types": "./build/plugin/index.d.ts",
|
|
54
|
-
"import": "./build/plugin-esm/index.js",
|
|
55
|
-
"require": "./build/plugin-cjs/index.js"
|
|
2
|
+
"name": "houdini-react",
|
|
3
|
+
"version": "2.0.0-go.2",
|
|
4
|
+
"description": "The React plugin for houdini",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"typescript",
|
|
7
|
+
"react",
|
|
8
|
+
"graphql",
|
|
9
|
+
"graphql-client"
|
|
10
|
+
],
|
|
11
|
+
"homepage": "https://github.com/HoudiniGraphql/houdini",
|
|
12
|
+
"funding": "https://github.com/sponsors/HoudiniGraphql",
|
|
13
|
+
"repository": {
|
|
14
|
+
"type": "git",
|
|
15
|
+
"url": "https://github.com/HoudiniGraphql/houdini.git"
|
|
56
16
|
},
|
|
57
|
-
"
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
"
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
17
|
+
"license": "MIT",
|
|
18
|
+
"scripts": {
|
|
19
|
+
"compile": "scripts build-go",
|
|
20
|
+
"typedefs": "scripts typedefs --plugin --go-package",
|
|
21
|
+
"postinstall": "node postInstall.js"
|
|
22
|
+
},
|
|
23
|
+
"devDependencies": {
|
|
24
|
+
"@types/cookie-parser": "^1.4.3",
|
|
25
|
+
"@types/cookie-session": "^2.0.44",
|
|
26
|
+
"@types/cookies": "^0.7.7",
|
|
27
|
+
"@types/estraverse": "^5.1.2",
|
|
28
|
+
"@types/express": "^4.17.17",
|
|
29
|
+
"@types/react": "^19.0.7",
|
|
30
|
+
"@types/react-dom": "^19.0.3"
|
|
31
|
+
},
|
|
32
|
+
"dependencies": {
|
|
33
|
+
"@babel/parser": "^7.24.6",
|
|
34
|
+
"@babel/types": "^7.24.6",
|
|
35
|
+
"@whatwg-node/server": "^0.9.14",
|
|
36
|
+
"cookie-parser": "^1.4.6",
|
|
37
|
+
"cookie-session": "^2.0.0",
|
|
38
|
+
"cookies": "^0.8.0",
|
|
39
|
+
"estraverse": "^5.3.0",
|
|
40
|
+
"express": "^4.18.2",
|
|
41
|
+
"graphql": "^15.8.0",
|
|
42
|
+
"graphql-yoga": "^4.0.4",
|
|
43
|
+
"houdini": "workspace:^",
|
|
44
|
+
"react": "^19.0.0",
|
|
45
|
+
"react-dom": "^19.0.0",
|
|
46
|
+
"react-streaming-compat": "^0.3.18",
|
|
47
|
+
"recast": "^0.23.1",
|
|
48
|
+
"rollup": "^4.28.1",
|
|
49
|
+
"use-deep-compare-effect": "^1.8.1"
|
|
50
|
+
},
|
|
51
|
+
"files": [
|
|
52
|
+
"build"
|
|
53
|
+
],
|
|
54
|
+
"exports": {
|
|
55
|
+
"./package.json": "./package.json",
|
|
56
|
+
"./server": {
|
|
57
|
+
"types": "./server/index.d.ts",
|
|
58
|
+
"import": "./server/index.js"
|
|
59
|
+
},
|
|
60
|
+
"./server/*": {
|
|
61
|
+
"types": "./server/*",
|
|
62
|
+
"import": "./server/*"
|
|
63
|
+
},
|
|
64
|
+
"./vite": {
|
|
65
|
+
"types": "./vite/index.d.ts",
|
|
66
|
+
"import": "./vite/index.js"
|
|
67
|
+
},
|
|
68
|
+
"./vite/*": {
|
|
69
|
+
"types": "./vite/*",
|
|
70
|
+
"import": "./vite/*"
|
|
71
|
+
}
|
|
72
|
+
},
|
|
73
|
+
"typesVersions": {
|
|
74
|
+
"*": {
|
|
75
|
+
"server": [
|
|
76
|
+
"./server/index.d.ts"
|
|
77
|
+
],
|
|
78
|
+
"vite": [
|
|
79
|
+
"./vite/index.d.ts"
|
|
80
|
+
]
|
|
81
|
+
}
|
|
82
|
+
},
|
|
83
|
+
"optionalDependencies": {
|
|
84
|
+
"houdini-react-darwin-amd64": "2.0.0-go.2",
|
|
85
|
+
"houdini-react-darwin-arm64": "2.0.0-go.2",
|
|
86
|
+
"houdini-react-linux-amd64": "2.0.0-go.2",
|
|
87
|
+
"houdini-react-linux-arm64": "2.0.0-go.2",
|
|
88
|
+
"houdini-react-windows-amd64": "2.0.0-go.2",
|
|
89
|
+
"houdini-react-windows-arm64": "2.0.0-go.2"
|
|
90
|
+
},
|
|
91
|
+
"bin": "./shim.cjs"
|
|
76
92
|
}
|
|
File without changes
|
package/LICENSE
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2021 Alec Aivazis
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
package/README.md
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
<div align="center">
|
|
2
|
-
<picture>
|
|
3
|
-
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/HoudiniGraphql/houdini/main/.github/assets/logo_l.svg">
|
|
4
|
-
<img height="140" alt="Houdini's logo (dark or light)" src="https://raw.githubusercontent.com/HoudiniGraphql/houdini/main/.github/assets/logo_d.svg">
|
|
5
|
-
</picture>
|
|
6
|
-
<br />
|
|
7
|
-
<br />
|
|
8
|
-
<strong>
|
|
9
|
-
The disappearing GraphQL clients.
|
|
10
|
-
</strong>
|
|
11
|
-
<br />
|
|
12
|
-
<br />
|
|
13
|
-
<a href="https://npmjs.org/package/houdini">
|
|
14
|
-
<img src="https://img.shields.io/npm/v/houdini.svg" alt="version" />
|
|
15
|
-
</a>
|
|
16
|
-
<a href="https://github.com/HoudiniGraphql/houdini/actions">
|
|
17
|
-
<img src="https://github.com/HoudiniGraphql/houdini/actions/workflows/tests.yml/badge.svg" alt="CI Tests" />
|
|
18
|
-
</a>
|
|
19
|
-
<a href="https://github.com/HoudiniGraphql/houdini">
|
|
20
|
-
<img src="https://img.shields.io/github/stars/HoudiniGraphql/houdini.svg?label=stars" alt="github stars" />
|
|
21
|
-
</a>
|
|
22
|
-
<a href="https://npmjs.org/package/houdini">
|
|
23
|
-
<img src="https://img.shields.io/npm/dm/houdini.svg" alt="downloads" />
|
|
24
|
-
</a>
|
|
25
|
-
<a href="https://github.com/HoudiniGraphql/houdini/blob/main/LICENSE">
|
|
26
|
-
<img src="https://img.shields.io/github/license/HoudiniGraphql/houdini.svg?maxAge=2592000" alt="license" />
|
|
27
|
-
</a>
|
|
28
|
-
</div>
|
|
29
|
-
|
|
30
|
-
----
|
|
31
|
-
|
|
32
|
-
At its core, houdini seeks to enable a high quality developer experience
|
|
33
|
-
without compromising bundle size. Like Svelte, houdini shifts what is
|
|
34
|
-
traditionally handled by a bloated runtime into a compile step that allows
|
|
35
|
-
for the generation of an incredibly lean GraphQL abstraction for your application.
|
|
36
|
-
See more at <a href="https://www.houdinigraphql.com">HoudiniGraphQL.com</a> 🚀
|
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "houdini-react",
|
|
3
|
-
"version": "2.0.0-go.0",
|
|
4
|
-
"description": "The React plugin for houdini",
|
|
5
|
-
"keywords": [
|
|
6
|
-
"typescript",
|
|
7
|
-
"react",
|
|
8
|
-
"graphql",
|
|
9
|
-
"graphql-client"
|
|
10
|
-
],
|
|
11
|
-
"homepage": "https://github.com/HoudiniGraphql/houdini",
|
|
12
|
-
"funding": "https://github.com/sponsors/HoudiniGraphql",
|
|
13
|
-
"repository": {
|
|
14
|
-
"type": "git",
|
|
15
|
-
"url": "https://github.com/HoudiniGraphql/houdini.git"
|
|
16
|
-
},
|
|
17
|
-
"license": "MIT",
|
|
18
|
-
"scripts": {
|
|
19
|
-
"compile": "scripts build-go",
|
|
20
|
-
"typedefs": "scripts typedefs --plugin --go-package",
|
|
21
|
-
"postinstall": "node postInstall.js"
|
|
22
|
-
},
|
|
23
|
-
"devDependencies": {
|
|
24
|
-
"@types/cookie-parser": "^1.4.3",
|
|
25
|
-
"@types/cookie-session": "^2.0.44",
|
|
26
|
-
"@types/cookies": "^0.7.7",
|
|
27
|
-
"@types/estraverse": "^5.1.2",
|
|
28
|
-
"@types/express": "^4.17.17",
|
|
29
|
-
"@types/react": "^19.0.7",
|
|
30
|
-
"@types/react-dom": "^19.0.3"
|
|
31
|
-
},
|
|
32
|
-
"dependencies": {
|
|
33
|
-
"@babel/parser": "^7.24.6",
|
|
34
|
-
"@babel/types": "^7.24.6",
|
|
35
|
-
"@whatwg-node/server": "^0.9.14",
|
|
36
|
-
"cookie-parser": "^1.4.6",
|
|
37
|
-
"cookie-session": "^2.0.0",
|
|
38
|
-
"cookies": "^0.8.0",
|
|
39
|
-
"estraverse": "^5.3.0",
|
|
40
|
-
"express": "^4.18.2",
|
|
41
|
-
"graphql": "^15.8.0",
|
|
42
|
-
"graphql-yoga": "^4.0.4",
|
|
43
|
-
"houdini": "workspace:^",
|
|
44
|
-
"react": "^19.0.0",
|
|
45
|
-
"react-dom": "^19.0.0",
|
|
46
|
-
"react-streaming-compat": "^0.3.18",
|
|
47
|
-
"recast": "^0.23.1",
|
|
48
|
-
"rollup": "^4.28.1",
|
|
49
|
-
"use-deep-compare-effect": "^1.8.1"
|
|
50
|
-
},
|
|
51
|
-
"files": [
|
|
52
|
-
"build"
|
|
53
|
-
],
|
|
54
|
-
"exports": {
|
|
55
|
-
"./package.json": "./package.json",
|
|
56
|
-
"./server": {
|
|
57
|
-
"types": "./server/index.d.ts",
|
|
58
|
-
"import": "./server/index.js"
|
|
59
|
-
},
|
|
60
|
-
"./server/*": {
|
|
61
|
-
"types": "./server/*",
|
|
62
|
-
"import": "./server/*"
|
|
63
|
-
},
|
|
64
|
-
"./vite": {
|
|
65
|
-
"types": "./vite/index.d.ts",
|
|
66
|
-
"import": "./vite/index.js"
|
|
67
|
-
},
|
|
68
|
-
"./vite/*": {
|
|
69
|
-
"types": "./vite/*",
|
|
70
|
-
"import": "./vite/*"
|
|
71
|
-
}
|
|
72
|
-
},
|
|
73
|
-
"typesVersions": {
|
|
74
|
-
"*": {
|
|
75
|
-
"server": [
|
|
76
|
-
"./server/index.d.ts"
|
|
77
|
-
],
|
|
78
|
-
"vite": [
|
|
79
|
-
"./vite/index.d.ts"
|
|
80
|
-
]
|
|
81
|
-
}
|
|
82
|
-
},
|
|
83
|
-
"optionalDependencies": {
|
|
84
|
-
"houdini-react-darwin-amd64": "2.0.0-go.0",
|
|
85
|
-
"houdini-react-darwin-arm64": "2.0.0-go.0",
|
|
86
|
-
"houdini-react-linux-amd64": "2.0.0-go.0",
|
|
87
|
-
"houdini-react-linux-arm64": "2.0.0-go.0",
|
|
88
|
-
"houdini-react-windows-amd64": "2.0.0-go.0",
|
|
89
|
-
"houdini-react-windows-arm64": "2.0.0-go.0"
|
|
90
|
-
},
|
|
91
|
-
"bin": "./shim.cjs"
|
|
92
|
-
}
|
|
@@ -1,117 +0,0 @@
|
|
|
1
|
-
const fs = require('fs')
|
|
2
|
-
const path = require('path')
|
|
3
|
-
const zlib = require('zlib')
|
|
4
|
-
const https = require('https')
|
|
5
|
-
|
|
6
|
-
// Adjust the version you want to install. You can also make this dynamic.
|
|
7
|
-
const BINARY_DISTRIBUTION_VERSION = '2.0.0-go.0'
|
|
8
|
-
|
|
9
|
-
// Windows binaries end with .exe so we need to special case them.
|
|
10
|
-
const binaryName = process.platform === 'win32' ? 'houdini-react.exe' : 'houdini-react'
|
|
11
|
-
|
|
12
|
-
// Determine package name for this platform
|
|
13
|
-
const platformSpecificPackageName = `houdini-react-${process.platform}-${process.arch}`
|
|
14
|
-
|
|
15
|
-
// Compute the path we want to emit the fallback binary to
|
|
16
|
-
const fallbackBinaryPath = path.join(__dirname, binaryName)
|
|
17
|
-
|
|
18
|
-
function makeRequest(url) {
|
|
19
|
-
return new Promise((resolve, reject) => {
|
|
20
|
-
https
|
|
21
|
-
.get(url, (response) => {
|
|
22
|
-
if (response.statusCode >= 200 && response.statusCode < 300) {
|
|
23
|
-
const chunks = []
|
|
24
|
-
response.on('data', (chunk) => chunks.push(chunk))
|
|
25
|
-
response.on('end', () => {
|
|
26
|
-
resolve(Buffer.concat(chunks))
|
|
27
|
-
})
|
|
28
|
-
} else if (
|
|
29
|
-
response.statusCode >= 300 &&
|
|
30
|
-
response.statusCode < 400 &&
|
|
31
|
-
response.headers.location
|
|
32
|
-
) {
|
|
33
|
-
// Follow redirects
|
|
34
|
-
makeRequest(response.headers.location).then(resolve, reject)
|
|
35
|
-
} else {
|
|
36
|
-
reject(
|
|
37
|
-
new Error(
|
|
38
|
-
`npm responded with status code ${response.statusCode} when downloading the package!`
|
|
39
|
-
)
|
|
40
|
-
)
|
|
41
|
-
}
|
|
42
|
-
})
|
|
43
|
-
.on('error', (error) => {
|
|
44
|
-
reject(error)
|
|
45
|
-
})
|
|
46
|
-
})
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
function extractFileFromTarball(tarballBuffer, filepath) {
|
|
50
|
-
// Tar archives are organized in 512 byte blocks.
|
|
51
|
-
// Blocks can either be header blocks or data blocks.
|
|
52
|
-
// Header blocks contain file names of the archive in the first 100 bytes, terminated by a null byte.
|
|
53
|
-
// The size of a file is contained in bytes 124-135 of a header block and in octal format.
|
|
54
|
-
// The following blocks will be data blocks containing the file.
|
|
55
|
-
let offset = 0
|
|
56
|
-
while (offset < tarballBuffer.length) {
|
|
57
|
-
const header = tarballBuffer.subarray(offset, offset + 512)
|
|
58
|
-
offset += 512
|
|
59
|
-
|
|
60
|
-
const fileName = header.toString('utf-8', 0, 100).replace(/\0.*/g, '')
|
|
61
|
-
const fileSize = parseInt(header.toString('utf-8', 124, 136).replace(/\0.*/g, ''), 8)
|
|
62
|
-
|
|
63
|
-
if (fileName === filepath) {
|
|
64
|
-
return tarballBuffer.subarray(offset, offset + fileSize)
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
// Clamp offset to the uppoer multiple of 512
|
|
68
|
-
offset = (offset + fileSize + 511) & ~511
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
async function downloadBinaryFromNpm() {
|
|
73
|
-
// Download the tarball of the right binary distribution package
|
|
74
|
-
const tarballDownloadBuffer = await makeRequest(
|
|
75
|
-
`https://registry.npmjs.org/${platformSpecificPackageName}/-/${platformSpecificPackageName}-${BINARY_DISTRIBUTION_VERSION}.tgz`
|
|
76
|
-
)
|
|
77
|
-
|
|
78
|
-
const tarballBuffer = zlib.unzipSync(tarballDownloadBuffer)
|
|
79
|
-
|
|
80
|
-
// Extract binary from package and write to disk
|
|
81
|
-
fs.writeFileSync(
|
|
82
|
-
fallbackBinaryPath,
|
|
83
|
-
extractFileFromTarball(tarballBuffer, `package/bin/${binaryName}`),
|
|
84
|
-
{ mode: 0o755 } // Make binary file executable
|
|
85
|
-
)
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
function isPlatformSpecificPackageInstalled() {
|
|
89
|
-
try {
|
|
90
|
-
// Resolving will fail if the optionalDependency was not installed
|
|
91
|
-
require.resolve(`${platformSpecificPackageName}/bin/${binaryName}`)
|
|
92
|
-
return true
|
|
93
|
-
} catch (e) {
|
|
94
|
-
return false
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
if (!platformSpecificPackageName) {
|
|
99
|
-
throw new Error('Platform not supported!')
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
// once we've confirmed the required package is installed we want to overwrite the bin entry of our package.json
|
|
103
|
-
// to point to the correct binary
|
|
104
|
-
function overwriteBinary() {
|
|
105
|
-
const packageJsonPath = path.join(__dirname, 'package.json')
|
|
106
|
-
const packageJson = require(packageJsonPath)
|
|
107
|
-
packageJson.bin = path.join('..', platformSpecificPackageName, 'bin', binaryName)
|
|
108
|
-
fs.writeFileSync(packageJsonPath, JSON.stringify(packageJson, null, 2))
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
// Skip downloading the binary if it was already installed via optionalDependencies
|
|
112
|
-
if (!isPlatformSpecificPackageInstalled()) {
|
|
113
|
-
console.log('Platform specific package not found. Will manually download binary.')
|
|
114
|
-
downloadBinaryFromNpm().then(overwriteBinary)
|
|
115
|
-
} else {
|
|
116
|
-
overwriteBinary()
|
|
117
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import type { ClientPlugin } from 'houdini/runtime/client'
|
|
2
|
-
|
|
3
|
-
const plugin: () => ClientPlugin = () => () => {
|
|
4
|
-
return {
|
|
5
|
-
start(ctx, { next }) {
|
|
6
|
-
next({
|
|
7
|
-
...ctx,
|
|
8
|
-
cacheParams: {
|
|
9
|
-
...ctx.cacheParams,
|
|
10
|
-
serverSideFallback: false,
|
|
11
|
-
},
|
|
12
|
-
})
|
|
13
|
-
},
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
export default plugin
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
import { getFieldsForType } from 'houdini/runtime'
|
|
2
|
-
import type { DocumentArtifact, GraphQLObject, GraphQLValue } from 'houdini/runtime'
|
|
3
|
-
import { defaultComponentField, type Cache } from 'houdini/runtime/cache'
|
|
4
|
-
|
|
5
|
-
export function injectComponents({
|
|
6
|
-
cache,
|
|
7
|
-
selection,
|
|
8
|
-
data,
|
|
9
|
-
variables,
|
|
10
|
-
parentType = 'Query',
|
|
11
|
-
}: {
|
|
12
|
-
cache: Cache
|
|
13
|
-
selection: DocumentArtifact['selection']
|
|
14
|
-
data: GraphQLValue | null
|
|
15
|
-
variables: Record<string, GraphQLValue> | undefined | null
|
|
16
|
-
parentType?: string
|
|
17
|
-
}) {
|
|
18
|
-
// if the value is null, we're done
|
|
19
|
-
if (data === null) {
|
|
20
|
-
return
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
// if the value is not an object (ie its a scalar) we're done
|
|
24
|
-
if (typeof data !== 'object') {
|
|
25
|
-
return
|
|
26
|
-
}
|
|
27
|
-
data = data as GraphQLObject
|
|
28
|
-
|
|
29
|
-
// if the value is an array we need to instantiate each item
|
|
30
|
-
if (Array.isArray(data)) {
|
|
31
|
-
data.forEach((item) =>
|
|
32
|
-
injectComponents({
|
|
33
|
-
cache,
|
|
34
|
-
selection,
|
|
35
|
-
data: item,
|
|
36
|
-
variables,
|
|
37
|
-
parentType,
|
|
38
|
-
})
|
|
39
|
-
)
|
|
40
|
-
return
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
// if the object has a subselection we need to walk down
|
|
44
|
-
const typename = '__typename' in data ? (data['__typename'] as string) : ''
|
|
45
|
-
const fields = getFieldsForType(selection, typename, false)
|
|
46
|
-
if (!fields) {
|
|
47
|
-
return
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
// walk down each field
|
|
51
|
-
for (const [field, subSelection] of Object.entries(fields)) {
|
|
52
|
-
// if the field is a component then we need to assign the value to the target
|
|
53
|
-
if (subSelection.component) {
|
|
54
|
-
// if the component is already in the cache, we're done
|
|
55
|
-
if (!cache._internal_unstable.componentCache[subSelection.component.key]) {
|
|
56
|
-
continue
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
data[field] = defaultComponentField({
|
|
60
|
-
variables,
|
|
61
|
-
parent: cache._internal_unstable.id(parentType, data) ?? '',
|
|
62
|
-
cache,
|
|
63
|
-
component: subSelection.component,
|
|
64
|
-
}) as any as GraphQLValue
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
// if there is a selection, we need to walk down
|
|
68
|
-
const dataValue = data[field]
|
|
69
|
-
if (subSelection.selection) {
|
|
70
|
-
injectComponents({
|
|
71
|
-
cache,
|
|
72
|
-
selection: subSelection.selection,
|
|
73
|
-
data: dataValue,
|
|
74
|
-
variables,
|
|
75
|
-
parentType: subSelection.type,
|
|
76
|
-
})
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export { useQuery } from './useQuery'
|
|
2
|
-
export { useQueryHandle } from './useQueryHandle'
|
|
3
|
-
export { useFragment } from './useFragment'
|
|
4
|
-
export { useFragmentHandle } from './useFragmentHandle'
|
|
5
|
-
export { useMutation } from './useMutation'
|
|
6
|
-
export { useSubscription } from './useSubscription'
|
|
7
|
-
|
|
8
|
-
export { type DocumentHandle } from './useDocumentHandle'
|
|
9
|
-
export { type UseQueryConfig } from './useQueryHandle'
|
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
import { deepEquals } from 'houdini/runtime'
|
|
2
|
-
import * as React from 'react'
|
|
3
|
-
|
|
4
|
-
// This file is largely a copy and paste from Kent C. Dodd's use-deep-compare-effect (appropriate license at the bottom).
|
|
5
|
-
// It has been copied locally in order to avoid any awkward third party peer dependencies
|
|
6
|
-
// on generated files (which would make the install annoying). The deep equals library has
|
|
7
|
-
// also been changed to use one that was already included in the runtime (avoiding the extra bundle size)
|
|
8
|
-
|
|
9
|
-
type UseEffectParams = Parameters<typeof React.useEffect>
|
|
10
|
-
type EffectCallback = UseEffectParams[0]
|
|
11
|
-
type DependencyList = UseEffectParams[1]
|
|
12
|
-
// yes, I know it's void, but I like what this communicates about
|
|
13
|
-
// the intent of these functions: It's just like useEffect
|
|
14
|
-
type UseEffectReturn = ReturnType<typeof React.useEffect>
|
|
15
|
-
|
|
16
|
-
function checkDeps(deps: DependencyList) {
|
|
17
|
-
if (!deps || !deps.length) {
|
|
18
|
-
throw new Error(
|
|
19
|
-
'useDeepCompareEffect should not be used with no dependencies. Use React.useEffect instead.'
|
|
20
|
-
)
|
|
21
|
-
}
|
|
22
|
-
if (deps.every(isPrimitive)) {
|
|
23
|
-
throw new Error(
|
|
24
|
-
'useDeepCompareEffect should not be used with dependencies that are all primitive values. Use React.useEffect instead.'
|
|
25
|
-
)
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
function isPrimitive(val: unknown) {
|
|
30
|
-
return val == null || /^[sbn]/.test(typeof val)
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
/**
|
|
34
|
-
* @param value the value to be memoized (usually a dependency list)
|
|
35
|
-
* @returns a memoized version of the value as long as it remains deeply equal
|
|
36
|
-
*/
|
|
37
|
-
export function useDeepCompareMemoize<T>(value: T) {
|
|
38
|
-
const ref = React.useRef<T>(value)
|
|
39
|
-
const signalRef = React.useRef<number>(0)
|
|
40
|
-
|
|
41
|
-
if (!deepEquals(value, ref.current)) {
|
|
42
|
-
ref.current = value
|
|
43
|
-
signalRef.current += 1
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
return React.useMemo(() => ref.current, [signalRef.current])
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
function useDeepCompareEffect(
|
|
50
|
-
callback: EffectCallback,
|
|
51
|
-
dependencies: DependencyList
|
|
52
|
-
): UseEffectReturn {
|
|
53
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
54
|
-
checkDeps(dependencies)
|
|
55
|
-
}
|
|
56
|
-
return React.useEffect(callback, useDeepCompareMemoize(dependencies))
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
export function useDeepCompareEffectNoCheck(
|
|
60
|
-
callback: EffectCallback,
|
|
61
|
-
dependencies: DependencyList
|
|
62
|
-
): UseEffectReturn {
|
|
63
|
-
return React.useEffect(callback, useDeepCompareMemoize(dependencies))
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
export default useDeepCompareEffect
|
|
67
|
-
|
|
68
|
-
/**
|
|
69
|
-
The MIT License (MIT)
|
|
70
|
-
Copyright (c) 2020 Kent C. Dodds
|
|
71
|
-
|
|
72
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
73
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
74
|
-
in the Software without restriction, including without limitation the rights
|
|
75
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
76
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
77
|
-
furnished to do so, subject to the following conditions:
|
|
78
|
-
|
|
79
|
-
The above copyright notice and this permission notice shall be included in all
|
|
80
|
-
copies or substantial portions of the Software.
|
|
81
|
-
|
|
82
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
83
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
84
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
85
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
86
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
87
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
88
|
-
SOFTWARE.
|
|
89
|
-
*/
|