rescript-relay 0.0.0-cli-b8d52924 → 0.0.0-linux-musl-d5435e23
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 +141 -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 +23 -23
- package/postinstall.js +43 -13
- package/ppx-darwin +0 -0
- package/ppx-linux +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/src/ReactDOMExperimental.bs.js +19 -1
- package/src/ReactDOMExperimental.res +16 -3
- package/src/ReactExperimental.bs.js +1 -16
- package/src/ReactExperimental.res +4 -20
- package/src/RescriptRelay.bs.js +32 -21
- package/src/RescriptRelay.res +76 -31
- package/src/RescriptRelay.resi +66 -39
- package/src/experimental-router/RescriptRelayRouter.bs.js +15 -4
- package/src/experimental-router/RescriptRelayRouter.res +11 -2
- package/src/experimental-router/RescriptRelayRouter.resi +2 -0
- package/src/utils.js +182 -190
- package/src/utils.mjs +339 -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/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,146 @@
|
|
|
1
1
|
# master
|
|
2
2
|
|
|
3
|
+
# 1.0.0-beta.12
|
|
4
|
+
|
|
5
|
+
_[Here's a commit showing a project being upgraded to this version](https://github.com/zth/rescript-relay/commit/5831c2f1f0f13eedc1cb60468c32fd32b2dc01d3)_
|
|
6
|
+
|
|
7
|
+
The time has finally come - RescriptRelay `1.0.0` is in beta! The one, big major thing this release brings is that the ReScript type generation for the Relay compiler has been completely rewritten, and fully integrated into the new Relay Rust compiler. The RescriptRelay fork of the compiler is available and maintained [here])(https://github.com/zth/relay/tree/rescript-relay).
|
|
8
|
+
|
|
9
|
+
## Upgrade versions
|
|
10
|
+
|
|
11
|
+
- `react-relay` and `relay-runtime` to `13.1.1`
|
|
12
|
+
|
|
13
|
+
## Remove Packages
|
|
14
|
+
|
|
15
|
+
You can go ahead and remove these packages, that are no longer needed, as the compiler is now shipped in the main package:
|
|
16
|
+
|
|
17
|
+
- `relay-config`
|
|
18
|
+
- `relay-compiler`
|
|
19
|
+
- `graphql` (if you don't use it for anything else)
|
|
20
|
+
|
|
21
|
+
## Improvements
|
|
22
|
+
|
|
23
|
+
- The compiler itself should be _much_ faster than the old one. An order of magnitude faster. Especially for incremental compilation in watch mode.
|
|
24
|
+
- There's no longer any need to manually select `__typename` on interfaces and unions for RescriptRelay's sake, unless you actually want to use it yourself.
|
|
25
|
+
- We now support the `@required` directive from Relay, which is a new directive that lets you force non-nullability for nullable fields on the client side. You can then choose to throw an error if null values are encountered, or let the null value bubble up. Docs are coming soon.
|
|
26
|
+
- The errors reported by the compiler is now quite a lot better.
|
|
27
|
+
- Full support for `reanalyze` as all false positive dead code results from generated code are now suppressed.
|
|
28
|
+
- Bindings for `requiredFieldLogger` for logging when missing fields are encountered (kudos [Emilios1995](https://github.com/Emilios1995)).
|
|
29
|
+
- Improved utils for [dealing with enums](https://rescript-relay-documentation.vercel.app/docs/enums).
|
|
30
|
+
- `recordSourceRecords` is now typed as `Js.Json.t` rather than being abstract.
|
|
31
|
+
|
|
32
|
+
## Beta fix changelog
|
|
33
|
+
|
|
34
|
+
### unreleased
|
|
35
|
+
|
|
36
|
+
### beta.12
|
|
37
|
+
|
|
38
|
+
- Make CLI work with `relay.config.cjs`.
|
|
39
|
+
|
|
40
|
+
### beta.11
|
|
41
|
+
|
|
42
|
+
- Another batch of experimental stuff... Nothing new in this version compared to `beta.9`.
|
|
43
|
+
|
|
44
|
+
### beta.10
|
|
45
|
+
|
|
46
|
+
- Sneaking out some experimental stuff... Nothing new in this version compared to `beta.9`.
|
|
47
|
+
|
|
48
|
+
### beta.9
|
|
49
|
+
|
|
50
|
+
- `recordSourceRecords` is now typed as `Js.Json.t` rather than being abstract.
|
|
51
|
+
- The field name of the `id` field of the `Node` interface is now configurable via `schemaConfig: {nodeInterfaceIdField: "idNameHere"}`.
|
|
52
|
+
|
|
53
|
+
### beta.8
|
|
54
|
+
|
|
55
|
+
- More fixes for conversion instructions in variables and input objects.
|
|
56
|
+
- Project now works in `"type": "module"` mode in `package.json` (kudos [cometkim](https://github.com/cometkim))
|
|
57
|
+
|
|
58
|
+
### beta.7
|
|
59
|
+
|
|
60
|
+
- Full support for `reanalyze` as all false positive dead code results from generated code are now suppressed.
|
|
61
|
+
- Bindings for `requiredFieldLogger` for logging when missing fields are encountered (kudos [Emilios1995](https://github.com/Emilios1995)).
|
|
62
|
+
- Fix bug with conversion instructions in variables with input instructions.
|
|
63
|
+
|
|
64
|
+
### beta.6
|
|
65
|
+
|
|
66
|
+
- Fix wrong enum type being printed in input objects
|
|
67
|
+
- Fix `__typename` not being automatically selected (and by that forcing a manual select) in some cases, even though it's not supposed to be required to select manually anymore
|
|
68
|
+
|
|
69
|
+
### beta.5
|
|
70
|
+
|
|
71
|
+
- Generate helpers for moving between unsafe enums coming from the server, and safe enums. Also, provide a "fromString" function for each enum used, that can be used to turn any string into your enum.
|
|
72
|
+
- Suppress dead code warnings _in most places_ when running `reanalyze` on a `rescript-relay` code base. Still a few things left to fix, that requires changes to reanalyze. But this should be much better than before.
|
|
73
|
+
|
|
74
|
+
### beta.4
|
|
75
|
+
|
|
76
|
+
- Revert JSON.parse micro optimization experiment.
|
|
77
|
+
|
|
78
|
+
### beta.3
|
|
79
|
+
|
|
80
|
+
- Fix issue with duplicate keys being printed in the conversion instructions.
|
|
81
|
+
- Get rid of the need of nullability conversion instructions, and infer them instead.
|
|
82
|
+
|
|
83
|
+
### beta.2
|
|
84
|
+
|
|
85
|
+
- Fix issue with recursive input objects not being converted correctly.
|
|
86
|
+
|
|
87
|
+
# 0.23.0
|
|
88
|
+
|
|
89
|
+
_[Here's a commit showing a project being upgraded to this version](https://github.com/zth/rescript-relay/commit/6e96dfafaec918b1d4e9519d3fcbf5e5c46be6c0)_
|
|
90
|
+
|
|
91
|
+
Finally, a new release! This brings the Relay version to 12, and the React version to 18 (in rc.0 at the time of writing). This release has a few breaking changes which are necessary as we're slowly approaching version 1.0.0 of RescriptRelay. Check the new "Migrations" section below for a few scripts you can run to help the migration.
|
|
92
|
+
|
|
93
|
+
## Upgrade versions
|
|
94
|
+
|
|
95
|
+
- `react-relay` to `12.0.0`
|
|
96
|
+
- `relay-compiler` to `12.0.0`
|
|
97
|
+
- `relay-config` to `12.0.0`
|
|
98
|
+
- `relay-runtime` to `12.0.0`
|
|
99
|
+
|
|
100
|
+
React to React 18 rc:
|
|
101
|
+
|
|
102
|
+
- `react` to `rc` (`yarn add react@rc`)
|
|
103
|
+
- `react-dom` to `rc`(`yarn add react-dom@rc`)
|
|
104
|
+
|
|
105
|
+
## Migrations
|
|
106
|
+
|
|
107
|
+
Want help migrating most of the changes in this release? Install [comby](https://comby.dev) and run the migrations below (paste them into your terminal at the root of your project). Comby will guide you through the proposed changes.
|
|
108
|
+
|
|
109
|
+
- `comby 'ReactExperimental.unstable_useDeferredValue(:[1])' 'ReactExperimental.useDeferredValue(:[1])' .res -matcher .re -exclude-dir node_modules -review`
|
|
110
|
+
- `comby 'ReactExperimental.renderConcurrentRootAtElementWithId' 'ReactDOMExperimental.renderConcurrentRootAtElementWithId' .res -matcher .re -exclude-dir node_modules -review`
|
|
111
|
+
- `comby 'let (:[1], :[2]) = ReactExperimental.unstable_useTransition()' 'let (:[2], :[1]) = ReactExperimental.useTransition()' .res -matcher .re -exclude-dir node_modules -review`
|
|
112
|
+
|
|
113
|
+
## Breaking changes
|
|
114
|
+
|
|
115
|
+
- Remove `reason-promise` (unless you're using it for something else yourself and want to keep it). We're waiting for the official new Promise bindings, but since they seem to be quite far away, we'll have to revert back to stock `Js.Promise` for now. This is because `reason-promise` clashes with other Promise bindings that people might want to use before the new official ones are actually shipped.
|
|
116
|
+
- `ReactExperimental.unstable_useTransition` is now called `ReactExperimental.useTransition`, and the order of the tuple that's returned has been reversed to align with the underlying API. This means that what was before `let (startTransition, isTransitioning) = ReactExperimental.unstable_useTransition()` is now `let (isTransitioning, startTransition) = ReactExperimental.useTransition()` (migration available above).
|
|
117
|
+
- `ReactExperimental.unstable_useDeferredValue` is now called `ReactExperimental.useDeferredValue` (migration available above).
|
|
118
|
+
- `ReactExperimental.renderConcurrentRootAtElementWithId` has moved to `ReactDOMExperimental`: `ReactDOMExperimental.renderConcurrentRootAtElementWithId` (migration available above).
|
|
119
|
+
|
|
120
|
+
## Fixes & misc
|
|
121
|
+
|
|
122
|
+
- You're now allowed to configure Relay via `package.json`.
|
|
123
|
+
|
|
124
|
+
# 0.22.0
|
|
125
|
+
|
|
126
|
+
This release brings a few `rescript-relay-cli` improvements under the hood, as well as the breaking (but very easily fixable) change of uncurrying the `sink` methods received back from `RescriptRelay.Observable.make`.
|
|
127
|
+
|
|
128
|
+
## Breaking changes
|
|
129
|
+
|
|
130
|
+
- Uncurry `sink` methods. What was previously `sink => sink.error(err)` etc should now instead be `sink => sink.error(. err)`.
|
|
131
|
+
|
|
132
|
+
## Fixes & misc
|
|
133
|
+
|
|
134
|
+
- Improvements to the `remove-unused-fields` CLI.
|
|
135
|
+
|
|
136
|
+
# 0.21.1
|
|
137
|
+
|
|
138
|
+
- A few bug fixes to the `remove-unused-fields` command in the CLI.
|
|
139
|
+
|
|
140
|
+
# 0.21.0
|
|
141
|
+
|
|
142
|
+
- Adds `rescript-relay-cli`, a CLI for removing unused fields and formatting GraphQL in your project. Read more [here](https://github.com/zth/rescript-relay/blob/master/packages/rescript-relay-cli/README.md) (especially look at `remove-unused-fields`).
|
|
143
|
+
|
|
3
144
|
# 0.20.1
|
|
4
145
|
|
|
5
146
|
Quick patch release fixing the Linux binaries that broke with the last release.
|
package/README.md
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
# rescript-relay
|
|
2
2
|
|
|
3
|
-
Use Relay with ReScript
|
|
3
|
+
Use Relay with ReScript.
|
|
4
4
|
|
|
5
5
|
[**Join our Discord**](https://discord.gg/wzj4EN8XDc)
|
|
6
6
|
|
|
7
7
|
## Getting started
|
|
8
8
|
|
|
9
|
-
> Are you using version `>= 0.13.0` and ReScript syntax with VSCode? Make sure you install our [
|
|
9
|
+
> Are you using version `>= 0.13.0` and ReScript syntax with VSCode? Make sure you install our [dedicated VSCode extension](https://marketplace.visualstudio.com/items?itemName=GabrielNordeborn.vscode-rescript-relay). Note: It only works with ReScript syntax.
|
|
10
10
|
|
|
11
11
|
Check out the [documentation](https://rescript-relay-documentation.vercel.app).
|
|
12
12
|
|
|
13
|
-
Also, check out the [changelog](CHANGELOG.md) - things will continue change
|
|
13
|
+
Also, check out the [changelog](CHANGELOG.md) - things will continue to change between versions (including breaking changes, although we'll try and keep them to a minimum) as we iterate and reach a stable version.
|
|
14
14
|
|
|
15
15
|
## What it looks like
|
|
16
16
|
|
|
@@ -18,15 +18,13 @@ Your components define what data they need through `%relay()`.
|
|
|
18
18
|
|
|
19
19
|
```rescript
|
|
20
20
|
/* Avatar.res */
|
|
21
|
-
module UserFragment = %relay(
|
|
22
|
-
`
|
|
21
|
+
module UserFragment = %relay(`
|
|
23
22
|
fragment Avatar_user on User {
|
|
24
23
|
firstName
|
|
25
24
|
lastName
|
|
26
25
|
avatarUrl
|
|
27
26
|
}
|
|
28
|
-
`
|
|
29
|
-
)
|
|
27
|
+
`)
|
|
30
28
|
|
|
31
29
|
@react.component
|
|
32
30
|
let make = (~user) => {
|
|
@@ -52,16 +50,14 @@ Hooks to use your fragments are autogenerated for you. The hook needs a _fragmen
|
|
|
52
50
|
|
|
53
51
|
```rescript
|
|
54
52
|
/* UserProfile.res */
|
|
55
|
-
module UserFragment = %relay(
|
|
56
|
-
`
|
|
53
|
+
module UserFragment = %relay(`
|
|
57
54
|
fragment UserProfile_user on User {
|
|
58
55
|
firstName
|
|
59
56
|
lastName
|
|
60
57
|
friendCount
|
|
61
58
|
...Avatar_user
|
|
62
59
|
}
|
|
63
|
-
`
|
|
64
|
-
)
|
|
60
|
+
`)
|
|
65
61
|
|
|
66
62
|
@react.component
|
|
67
63
|
let make = (~user) => {
|