rescript-relay 0.0.0-test-rust-compiler-a2f32b9e → 0.0.0-test-arm-8bf00155
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 +415 -8
- package/README.md +14 -10
- package/cli/cli.js +29 -35
- package/package.json +22 -17
- package/postinstall.js +52 -22
- package/ppx-linux +0 -0
- package/ppx-macos-arm64 +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 +7 -4
- package/src/ReactDOMExperimental.res +2 -6
- package/src/ReactExperimental.bs.js +16 -1
- package/src/ReactExperimental.res +9 -4
- package/src/ReactExperimental.resi +18 -0
- package/src/RescriptRelay.bs.js +38 -73
- package/src/RescriptRelay.res +131 -138
- package/src/RescriptRelay.resi +309 -353
- package/src/RescriptRelayUtils.bs.js +28 -29
- package/src/RescriptRelayUtils.res +3 -5
- package/src/RescriptRelayUtils.resi +3 -5
- package/src/RescriptRelay_Fragment.bs.js +116 -0
- package/src/RescriptRelay_Fragment.res +233 -0
- package/src/RescriptRelay_Fragment.resi +79 -0
- package/src/RescriptRelay_Internal.bs.js +63 -16
- package/src/RescriptRelay_Internal.res +39 -18
- package/src/RescriptRelay_Internal.resi +5 -0
- package/src/RescriptRelay_Mutation.bs.js +57 -0
- package/src/RescriptRelay_Mutation.res +144 -0
- package/src/RescriptRelay_Mutation.resi +52 -0
- package/src/RescriptRelay_Query.bs.js +101 -0
- package/src/RescriptRelay_Query.res +177 -0
- package/src/RescriptRelay_Query.resi +62 -0
- package/src/RescriptRelay_RelayResolvers.bs.js +13 -0
- package/src/RescriptRelay_RelayResolvers.res +21 -0
- package/src/RescriptRelay_RelayResolvers.resi +10 -0
- package/src/RescriptRelay_Subscriptions.bs.js +24 -0
- package/src/RescriptRelay_Subscriptions.res +50 -0
- package/src/RescriptRelay_Subscriptions.resi +14 -0
- package/src/utils.js +213 -161
- package/src/utils.mjs +412 -0
- package/src/experimental-router/RescriptRelayRouter.bs.js +0 -423
- package/src/experimental-router/RescriptRelayRouter.res +0 -379
- package/src/experimental-router/RescriptRelayRouter.resi +0 -77
package/CHANGELOG.md
CHANGED
|
@@ -1,8 +1,225 @@
|
|
|
1
1
|
# master
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
**All work on version `2.x` is in the [2.x branch](https://github.com/zth/rescript-relay/tree/2.x).**
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
# **Version 3**
|
|
6
|
+
|
|
7
|
+
- Set explicit peer dependencies: `@rescript/react >= 0.12.1`, `react-relay@16.0.0`, `relay-runtime@16.0.0`.
|
|
8
|
+
- Clean up connection handler generators now that v3 let us use a better representation.
|
|
9
|
+
- Fix issue with default args in connection id makers. https://github.com/zth/rescript-relay/pull/488
|
|
10
|
+
- Fix issue with PPX not actually converting all functions to uncurried.
|
|
11
|
+
|
|
12
|
+
# 3.0.0-rc.4
|
|
13
|
+
|
|
14
|
+
- Fix an error in postinstall.js when reinstalling rescript-relay dependency (https://github.com/zth/rescript-relay/pull/487)
|
|
15
|
+
|
|
16
|
+
# 3.0.0-rc.3
|
|
17
|
+
|
|
18
|
+
- Fix issue with custom scalars in arrays not being autoconverted properly.
|
|
19
|
+
|
|
20
|
+
# 3.0.0-rc.2
|
|
21
|
+
|
|
22
|
+
- Depend on ReScript v11 and RescriptReact 0.12.0.
|
|
23
|
+
- BREAKING: Use zero cost tagged variants for `RequiredFieldLogger`.
|
|
24
|
+
- Add support for the `relay_resolver.error` event kind.
|
|
25
|
+
|
|
26
|
+
# 3.0.0-rc.1
|
|
27
|
+
|
|
28
|
+
- Get rid of functor for creating `loadQuery`.
|
|
29
|
+
- Support for the `@preloadable` directive.
|
|
30
|
+
|
|
31
|
+
# 3.0.0-rc.0
|
|
32
|
+
|
|
33
|
+
- First RC version.
|
|
34
|
+
|
|
35
|
+
# 3.0.0-alpha.5
|
|
36
|
+
|
|
37
|
+
## Improvements
|
|
38
|
+
|
|
39
|
+
- Emit `@live` for union variant cases to prevent false positives in unions.
|
|
40
|
+
- Set `@rescript/tools` version explicitly.
|
|
41
|
+
- First class support for input unions, leveraging the `@oneOf` directive.
|
|
42
|
+
|
|
43
|
+
# 3.0.0-alpha.4
|
|
44
|
+
|
|
45
|
+
## Improvements
|
|
46
|
+
|
|
47
|
+
- Enums in input objects are now (properly) typed as their input variants.
|
|
48
|
+
- Single item enums are now not emitted as `@unboxed`.
|
|
49
|
+
- Remove unused fields CLI now properly account for only record fields.
|
|
50
|
+
|
|
51
|
+
# 3.0.0-alpha.3
|
|
52
|
+
|
|
53
|
+
## Improvements
|
|
54
|
+
|
|
55
|
+
- Use an up-to-date `reanalyze` from the new `@rescript/tools` package, for powering the CLI.
|
|
56
|
+
|
|
57
|
+
# 3.0.0-alpha.2
|
|
58
|
+
|
|
59
|
+
This brings the supported Relay version to 16.
|
|
60
|
+
|
|
61
|
+
## Upgrade versions
|
|
62
|
+
|
|
63
|
+
- `react-relay` and `relay-runtime` to `>=16.0.0`
|
|
64
|
+
|
|
65
|
+
# 3.0.0-alpha.1
|
|
66
|
+
|
|
67
|
+
Below is a series of releases for version 3 of RescriptRelay, which contain a large amount of breaking changes. The releases are cut up with a few breaking changes for each, to make them slightly less hard to migrate to. You're encouraged to start from the bottom and work your way up through the versions.
|
|
68
|
+
|
|
69
|
+
Dedicated tooling for migrating is coming, as well as docs.
|
|
70
|
+
|
|
71
|
+
# 0.0.0-version-3-8b552902
|
|
72
|
+
|
|
73
|
+
## Breaking changes
|
|
74
|
+
|
|
75
|
+
- Unions are now represented as regular variants. Commit showing how this is migrated to in the tests: https://github.com/zth/rescript-relay/commit/3b5df51b80a0e1222b376fcfc730bb5dd0de099a
|
|
76
|
+
|
|
77
|
+
# 0.0.0-version-3-3504d777
|
|
78
|
+
|
|
79
|
+
## Breaking changes
|
|
80
|
+
|
|
81
|
+
- All trailing unit arguments are removed. Commit showing how this is migrated to in the tests: https://github.com/zth/rescript-relay/commit/2a16791268afb29d106362d0cf17915f69d5b4ff
|
|
82
|
+
|
|
83
|
+
# 0.0.0-version-3-aeebeaab
|
|
84
|
+
|
|
85
|
+
## Breaking changes
|
|
86
|
+
|
|
87
|
+
- Object maker functions are removed, and leverage optional fields for all variables/input objects. Also a large change, tooling upcoming. Commit showing how this is migrated to in the tests: https://github.com/zth/rescript-relay/commit/fd6b07a1b26620c91e5de61f930235c35517da6a
|
|
88
|
+
|
|
89
|
+
# 0.0.0-version-3-89bccc22
|
|
90
|
+
|
|
91
|
+
## Breaking changes
|
|
92
|
+
|
|
93
|
+
- Remove "top level node field" transform. Previously, a single selection on the top level `node` field (like `node(id: $id) { ... on User { id, name }}`) would skip the union mechanism and automatically collapse the generated types to `option<user>`. This has now changed and the top level node field behaves just like any union. Commit showing how this is migrated to in the tests: https://github.com/zth/rescript-relay/commit/9ce73196794dbc6eba435414fcff708e7c53df78
|
|
94
|
+
- Enums are now (unboxed) regular variants rather than polyvariants. This is a large change, but we're going to provide some tools for easing the transition. Commit showing how this is migrated to in the tests: https://github.com/zth/rescript-relay/commit/9da425a3e65ce3e9403168af421522028424a4f0
|
|
95
|
+
|
|
96
|
+
# 2.0.0
|
|
97
|
+
|
|
98
|
+
RescriptRelay `2.0.0` is here! This isn't a large release really, but it's a major release just because it relies on functionality from ReScript `v11`. Meaning the lower bound of the required ReScript version is `>=11.0.0-beta.2`.
|
|
99
|
+
|
|
100
|
+
### Uncurried mode
|
|
101
|
+
|
|
102
|
+
`2.0.0` is built to work with uncurried mode. It's not fully _optimized_, that'll come in `3.0.0`, but it works well in uncurried mode.
|
|
103
|
+
|
|
104
|
+
You can activate uncurried mode with `RescriptRelay` by setting `"uncurried": true` (`true` is also the default in ReScript `>=11.0.0-beta.2`) in your `bsconfig.json`, and then ensuring that you pass `-uncurried` to `rescript-relay/ppx` in `ppx-flags`: `"ppx-flags": [["rescript-relay/ppx", "-uncurried"]]`.
|
|
105
|
+
|
|
106
|
+
# 2.0.0-alpha.1
|
|
107
|
+
|
|
108
|
+
## Improvements
|
|
109
|
+
|
|
110
|
+
- `%relay.deferredComponent` now works with uncurried mode.
|
|
111
|
+
|
|
112
|
+
# 2.0.0-alpha.0
|
|
113
|
+
|
|
114
|
+
First alpha of the `2.x` series of releases. `2.x` focuses on compat with ReScript `v11`, including uncurried mode.
|
|
115
|
+
|
|
116
|
+
### Uncurried mode
|
|
117
|
+
|
|
118
|
+
You can activate uncurried mode with `RescriptRelay` by setting `"uncurried": true` in your `bsconfig.json`, and then ensuring that you pass `-uncurried` to `rescript-relay/ppx` in `ppx-flags`: `"ppx-flags": [["rescript-relay/ppx", "-uncurried"]]`.
|
|
119
|
+
|
|
120
|
+
## Upgrade versions
|
|
121
|
+
|
|
122
|
+
- `rescript` to `>=11.0.0-beta.0`
|
|
123
|
+
- `@rescript/react` to `>=0.12.0-alpha.2`
|
|
124
|
+
|
|
125
|
+
## Improvements
|
|
126
|
+
|
|
127
|
+
- Leverage variant's new `string` representation + `@as()` to get rid of `mapFetchPolicy`. This was internal so it should not affect you as an end user.
|
|
128
|
+
|
|
129
|
+
# 1.2.0
|
|
130
|
+
|
|
131
|
+
This release mainly makes preparations under the hood for the upcoming `2.0` (ReScript v11 + uncurried mode support) and `3.0` (lots of changes, full uncurried mode only).
|
|
132
|
+
|
|
133
|
+
## Breaking changes
|
|
134
|
+
|
|
135
|
+
- A trailing unit `()` arg is no longer needed in `Query.usePreloaded()`. What was previously `Query.usePreloaded(~queryRef, ())` is now just `Query.usePreloaded(~queryRef)`.
|
|
136
|
+
|
|
137
|
+
## Improvements
|
|
138
|
+
|
|
139
|
+
- Add `@live` annotations to generated JSXv4 dynamic import compat modules, so they don't show up in dead code analysis (which they shouldn't).
|
|
140
|
+
- Preparations under the hood for ReScript v11 + uncurried mode.
|
|
141
|
+
|
|
142
|
+
# 1.1.1
|
|
143
|
+
|
|
144
|
+
- Fix M1 binary to include new JSXv4 dynamic import compat changes.
|
|
145
|
+
|
|
146
|
+
# 1.1.0
|
|
147
|
+
|
|
148
|
+
Notable changes:
|
|
149
|
+
|
|
150
|
+
- _JSX v4 is now required_
|
|
151
|
+
- Relay and @rescript/react upgraded
|
|
152
|
+
- M1 support for the PPX (should speed up builds for anyone on an M1)
|
|
153
|
+
|
|
154
|
+
## Upgrade versions
|
|
155
|
+
|
|
156
|
+
- `react-relay` and `relay-runtime` to `>=15.0.0`
|
|
157
|
+
- `@rescript/react` to `>=0.11.0`
|
|
158
|
+
|
|
159
|
+
## Breaking changes
|
|
160
|
+
|
|
161
|
+
- The signature for missing field handlers has changed. Previously you got an open type `{..}` as record, now instead you get a proper `RecordProxy.t` from the store. Check out [the changelog for Relay 15](https://github.com/facebook/relay/releases/tag/v15.0.0).
|
|
162
|
+
- ReScript `>=10.1` and JSX v4 is now required.
|
|
163
|
+
- Work around issue with JSX v4 and `%relay.deferredComponent`. You now need to annotate any component you want to use with `%relay.deferredComponent` with `@relay.deferredComponent`. https://github.com/zth/rescript-relay/pull/439
|
|
164
|
+
|
|
165
|
+
## Improvements
|
|
166
|
+
|
|
167
|
+
- Experimental support for allowing `null` in operation variables. Add `@rescriptRelayNullableVariables` to your operation (query, mutation, subscription) and you'll be allowed to pass `Js.null` (via the `Js.Null` module) to your server. https://github.com/zth/rescript-relay/pull/426
|
|
168
|
+
- :tada: M1 support for the PPX! This should speed up builds some. https://github.com/zth/rescript-relay/pull/435
|
|
169
|
+
|
|
170
|
+
## Bug Fixes
|
|
171
|
+
|
|
172
|
+
- Fix issue with conversion of custom scalars, where custom scalars represented as arrays would get converted "internally" although they should've really just been left alone. https://github.com/zth/rescript-relay/pull/433
|
|
173
|
+
|
|
174
|
+
# 1.0.5
|
|
175
|
+
|
|
176
|
+
## Bug Fixes
|
|
177
|
+
|
|
178
|
+
- Fix fairly large performance issue with runtime conversion. This should give a large speedup in certain cases.
|
|
179
|
+
|
|
180
|
+
# 1.0.4
|
|
181
|
+
|
|
182
|
+
## Improvements
|
|
183
|
+
|
|
184
|
+
- Improved autocomplete for fragments etc (pulled from upstream Relay compiler). https://github.com/facebook/relay/pull/4134
|
|
185
|
+
|
|
186
|
+
# 1.0.3
|
|
187
|
+
|
|
188
|
+
## Improvements
|
|
189
|
+
|
|
190
|
+
- Add `RescriptRelay.Disposable.ignore` for more ergonomic handling of ignoring disposables.
|
|
191
|
+
|
|
192
|
+
## Bug Fixes
|
|
193
|
+
|
|
194
|
+
- Fix the `remove-unused-fields` script for CI with Node.js version >14 in [#409](https://github.com/zth/rescript-relay/pull/409)
|
|
195
|
+
|
|
196
|
+
# 1.0.2
|
|
197
|
+
|
|
198
|
+
## Bug Fixes
|
|
199
|
+
|
|
200
|
+
- `private` is now correctly marked as a reserved word.
|
|
201
|
+
|
|
202
|
+
## Improvements
|
|
203
|
+
|
|
204
|
+
- Add ReScript 10 compat in peerDependencies https://github.com/zth/rescript-relay/pull/397 @MoOx
|
|
205
|
+
- `makeConnectionId` helpers are now marked as `@live` to not trigger the dead code analysis.
|
|
206
|
+
|
|
207
|
+
# 1.0.1
|
|
208
|
+
|
|
209
|
+
## Bug Fixes
|
|
210
|
+
|
|
211
|
+
- Fix issue with custom scalar of JSON values being accidentally mangled https://github.com/zth/rescript-relay/pull/395 @tsnobip
|
|
212
|
+
|
|
213
|
+
# 1.0.0
|
|
214
|
+
|
|
215
|
+
_[Here's a commit showing a project being upgraded to this version](https://github.com/zth/rescript-relay/commit/5831c2f1f0f13eedc1cb60468c32fd32b2dc01d3)_
|
|
216
|
+
|
|
217
|
+
The time has finally come - RescriptRelay `1.0.0` is released! This version brings a ton of new features and improvements. One of the the big major things 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).
|
|
218
|
+
|
|
219
|
+
## Upgrade versions
|
|
220
|
+
|
|
221
|
+
- `react-relay` and `relay-runtime` to `>=14.1.0`
|
|
222
|
+
- `react` and `react-dom` to `>=18.0.0`
|
|
6
223
|
|
|
7
224
|
## Remove Packages
|
|
8
225
|
|
|
@@ -12,22 +229,212 @@ You can go ahead and remove these packages, that are no longer needed, as the co
|
|
|
12
229
|
- `relay-compiler`
|
|
13
230
|
- `graphql` (if you don't use it for anything else)
|
|
14
231
|
|
|
15
|
-
## Breaking Changes
|
|
16
|
-
|
|
17
|
-
- The compiler expects the `__generated__` folder to always exist, so if you're not committing your artifacts to source control, make sure you add a `.gitkeep` to the generated folder so git keeps it around.
|
|
18
|
-
|
|
19
232
|
## Improvements
|
|
20
233
|
|
|
21
234
|
- The compiler itself should be _much_ faster than the old one. An order of magnitude faster. Especially for incremental compilation in watch mode.
|
|
22
235
|
- 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.
|
|
23
|
-
- 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
|
|
236
|
+
- 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.
|
|
24
237
|
- The errors reported by the compiler is now quite a lot better.
|
|
238
|
+
- Full support for `reanalyze` as all false positive dead code results from generated code are now suppressed.
|
|
239
|
+
- Bindings for `requiredFieldLogger` for logging when missing fields are encountered (kudos [Emilios1995](https://github.com/Emilios1995)).
|
|
240
|
+
- Improved utils for [dealing with enums](https://rescript-relay-documentation.vercel.app/docs/enums).
|
|
241
|
+
- `recordSourceRecords` is now typed as `Js.Json.t` rather than being abstract.
|
|
242
|
+
- Project now works in `"type": "module"` mode in `package.json` (kudos [cometkim](https://github.com/cometkim))
|
|
243
|
+
- The field name of the `id` field of the `Node` interface is now configurable via `schemaConfig: {nodeInterfaceIdField: "idNameHere"}`.
|
|
244
|
+
- Add support for experimental [Relay Resolvers](https://relay.dev/docs/next/guides/relay-resolvers). Undocumented so far, but looking at the [test](https://github.com/zth/rescript-relay/blob/master/packages/rescript-relay/__tests__/Test_relayResolvers.res) and [definition file](https://github.com/zth/rescript-relay/blob/master/packages/rescript-relay/__tests__/TestRelayUserResolver.res) should give you a hint of how it works.
|
|
245
|
+
- Support `@rescriptRelayIgnoreUnused` directive on fragment definitions to insert annotations that makes `reanalyze` consider all fields in the fragment used, even if they aren't.
|
|
246
|
+
- Support `@rescriptRelayAllowUnsafeEnum` directive on fields selecting enums, which will ignore safety measures for enums, meaning you won't need to add a catch all clause, etc. It'll essentially output the enum as an _input_ enum (as desribed in the docs).
|
|
247
|
+
- Support [provided variables](https://relay.dev/docs/api-reference/graphql-and-directives/#provided-variables). More info in the docs.
|
|
248
|
+
- Windows support! :tada:
|
|
249
|
+
- A `RelaySchemaAssets_graphql.res` is now emitted, containing type definitions for all enums and all input objects. This is designed to help with accessing and using enums and input objects outside of Relay's context. This means it'll be much easier to share makers for input objects, pass enums around, etc.
|
|
250
|
+
- Each fragment with a `@connection` now emits a `makeConnectionId` function that allows you to generate _type safe_ connection IDs. More on why this is useful in the documentation.
|
|
251
|
+
|
|
252
|
+
## Breaking changes
|
|
253
|
+
|
|
254
|
+
- The list of disallowed field names has been adapted to ReScript (it was never properly updated for ReScript when moving from ReasonML). This means that _some of your variable prop names might be renamed_. One example - if you previously had a variable in GraphQL called `$to`, you'd interact with that as `to_` in ReScript. This is because RescriptRelay would pin `to` as a reserved word, and rename it for you. But, `to` _isn't_ actually a keyword in ReScript (it was in ReasonML), so with this release, that `to_` in ReScript will be renamed to `to`. The fix is to just update all `to_` to `to` - let the compiler guide you!
|
|
255
|
+
- Using variable names that are reserved words in ReScript is now _disallowed at the Relay compiler level_. This means that Relay won't compile your project if you have variables whose names are reserved words. The fix is to simply rename the variables.
|
|
256
|
+
- `refetchVariables` now works as intended with regards to supplying only the variables you want _changed_ when refetching, as [detailed under `variables` here](https://relay.dev/docs/next/api-reference/use-refetchable-fragment/#return-value). This means that what was previously `makeRefetchVariables(~someValue=123, ())` should now be `makeRefetchVariables(~someValue=Some(123), ())`.
|
|
257
|
+
Crash course:
|
|
258
|
+
|
|
259
|
+
- `makeRefetchVariables(~someValue=Some(123), ())` means _refetch, use the same values for all variables that was used in the last fetch, but change `someValue` to `123`_.
|
|
260
|
+
- `makeRefetchVariables(~someValue=None, ())` means _refetch, use the same values for all variables that was used in the last fetch, but change `someValue` to `null` (unsetting it)_.
|
|
261
|
+
- `makeRefetchVariables()` means _refetch, use the same values for all variables that was used in the last fetch, change nothing_.
|
|
262
|
+
|
|
263
|
+
This way you can surgically change only certain values when refetching, without having to keep track of the current values for the other values.
|
|
264
|
+
|
|
265
|
+
More details on this [in the docs](https://rescript-relay-documentation.vercel.app/docs/refetching-and-loading-more-data#makerefetchvariables). Thanks to [@tsnobip](https://github.com/tsnobip) for fixing this!
|
|
266
|
+
|
|
267
|
+
- All enum type definitions now reside in `RelaySchemaAssets_graphql.enum_<yourEnumName>`, and are _not_ generated on the operation itself anymore. So, if you previously referred to the actual enum _type_, like `Fragment.Types.enum_MyFineEnum`, you'll now need to refer to that enum type as `RelaySchemaAssets_graphql.enum_MyFineEnum`.
|
|
268
|
+
- Input object fields with illegal names in ReScript previously had their maker function argument names suffixed with `_`, like `~type_: string`. This is now instead _prefixed_, like `~_type: string`. Prefixing like this instead of suffixing means we can ship fully zero cost maker functions, which we couldn't before for input objects with illegal field names.
|
|
269
|
+
|
|
270
|
+
## Assorted Changes and Fixes
|
|
271
|
+
|
|
272
|
+
- Add Environment isServer option @MoOx
|
|
273
|
+
- Remove rescript from dependencies @anmonteiro
|
|
274
|
+
- Add undocumented holdGC method on relay store @MoOx
|
|
275
|
+
- Fixed `setLinkedRecordToNull`, `setLinkedRecordToUndefined`, `setLinkedRecordsToNull` and `setLinkedRecordsToUndefined` methods by binding them to `setValue` instead of `setLinkedRecord/s`. Previously they were throwing an error because `setLinkedRecord/s` did not support "deleting" values using them. (@reck753)
|
|
276
|
+
- Fix long standing bug that would make whether connection helpers were emitted or not unreliable.
|
|
277
|
+
|
|
278
|
+
## 1.0.0 development changelog
|
|
279
|
+
|
|
280
|
+
- Fix bug in the new type safe connection ID makers where null default values wouldn't turn the variable into a `Js.Null.t<t>`, leading to type errors.
|
|
281
|
+
- Fix bug with connection handling where connections behind a `@include` or `@skip` directive would not be found.
|
|
282
|
+
- Move `getConnectionNodes` back into generated and auto included `Utils` module. This means that failing to generate `getConnectionNodes`, which can happen for various reasons, won't break the build, but rather not just emit the helper.
|
|
283
|
+
|
|
284
|
+
### rc.5
|
|
285
|
+
|
|
286
|
+
- Fix compat with `rescript@10.1.0-alpha.1`.
|
|
287
|
+
|
|
288
|
+
### rc.4
|
|
289
|
+
|
|
290
|
+
- _potentially breaking_ All enum type definitions now reside in `RelaySchemaAssets_graphql.enum_<yourEnumName>`, and are _not_ generated on the operation itself anymore. So, if you previously referred to the actual enum _type_, like `Fragment.Types.enum_MyFineEnum`, you'll now need to refer to that enum type as `RelaySchemaAssets_graphql.enum_MyFineEnum`.
|
|
291
|
+
- Fix bug in the new type safe connection ID makers where different types could end up in the same array, yielding type errors in ReScript.
|
|
292
|
+
|
|
293
|
+
### rc.3
|
|
294
|
+
|
|
295
|
+
- Fix bug in the new type safe connection ID makers where constant value `null` couldn't be used.
|
|
296
|
+
|
|
297
|
+
### rc.2
|
|
298
|
+
|
|
299
|
+
- Fix long standing bug that would make whether connection helpers were emitted or not unreliable.
|
|
300
|
+
|
|
301
|
+
### rc.1
|
|
302
|
+
|
|
303
|
+
- Restore half-broken connection helper function inlining.
|
|
304
|
+
|
|
305
|
+
### rc.0
|
|
306
|
+
|
|
307
|
+
- _potentially breaking_ `getConnectionNodes` and `connectionKey` is now located directly in the generated module, and not in a nested `Utils` module. `connectionKey` is also no longer exposed on the `Fragment` module, but only via the generated module for that fragment (`WhateverYourFragmentIsCalled_whatever_graphql.res`)
|
|
308
|
+
- Support [provided variables](https://relay.dev/docs/api-reference/graphql-and-directives/#provided-variables). More info in the docs.
|
|
309
|
+
- Windows support! :tada:
|
|
310
|
+
- Fixed `setLinkedRecordToNull`, `setLinkedRecordToUndefined`, `setLinkedRecordsToNull` and `setLinkedRecordsToUndefined` methods by binding them to `setValue` instead of `setLinkedRecord/s`. Previously they were throwing an error because `setLinkedRecord/s` did not support "deleting" values using them. (@reck753)
|
|
311
|
+
- A `RelaySchemaAssets_graphql.res` is now emitted, containing type definitions for all enums and all input objects. This is designed to help with accessing and using enums and input objects outside of Relay's context. This means it'll be much easier to share makers for input objects, pass enums around, etc.
|
|
312
|
+
- Each fragment with a `@connection` now emits a `makeConnectionId` function that allows you to generate _type safe_ connection IDs. More on why this is useful in the documentation.
|
|
313
|
+
- _breaking_ Input object fields with illegal names in ReScript previously had their maker function argument names suffixed with `_`, like `~type_: string`. This is now instead _prefixed_, like `~_type: string`. Prefixing like this instead of suffixing means we can ship fully zero cost maker functions, which we couldn't before for input objects with illegal field names.
|
|
314
|
+
|
|
315
|
+
## beta.26
|
|
316
|
+
|
|
317
|
+
- Upgrade Relay packages to version `14.1.0`.
|
|
318
|
+
|
|
319
|
+
## beta.25
|
|
320
|
+
|
|
321
|
+
- Change signature of preload function (router related).
|
|
322
|
+
|
|
323
|
+
## beta.24
|
|
324
|
+
|
|
325
|
+
- Fix compatibility with ReScript v10
|
|
326
|
+
|
|
327
|
+
## beta.23
|
|
328
|
+
|
|
329
|
+
- Add Environment isServer option @MoOx
|
|
330
|
+
- Fix incorrect react-relay peerDependencies version @MoOx
|
|
331
|
+
- Remove rescript from dependencies @anmonteiro
|
|
332
|
+
- Fix instantiation of Relay context @vikfroberg
|
|
333
|
+
- Add undocumented holdGC method on relay store @MoOx
|
|
334
|
+
|
|
335
|
+
### beta.22
|
|
336
|
+
|
|
337
|
+
- Fix locations for `%relay.deferredComponent` so jump-to-definition, hover etc works as expected (pointing to the dynamically imported module rather than what the PPX produces).
|
|
338
|
+
- Add links for `Operation` module in `Query`, `Mutation`, `Subscription` and `Fragment` ([XiNiHa](https://github.com/XiNiHa))
|
|
339
|
+
|
|
340
|
+
### beta.21
|
|
341
|
+
|
|
342
|
+
- Support formatting commented out operations in the CLI ([reck753](https://github.com/reck753)).
|
|
343
|
+
- Support `@rescriptRelayIgnoreUnused` directive on fragment definitions to insert annotations that makes `reanalyze` consider all fields in the fragment used, even if they aren't.
|
|
344
|
+
- Support `@rescriptRelayAllowUnsafeEnum` directive on fields selecting enums, which will ignore safety measures for enums, meaning you won't need to add a catch all clause, etc. It'll essentially output the enum as an _input_ enum (as desribed in the docs).
|
|
345
|
+
|
|
346
|
+
### beta.20
|
|
347
|
+
|
|
348
|
+
- Fix enums appearing in `@raw_response_type` (local query updates, optimistic responses) to be input enums.
|
|
349
|
+
|
|
350
|
+
### beta.19
|
|
351
|
+
|
|
352
|
+
- Fix top level node interface issue.
|
|
353
|
+
|
|
354
|
+
### beta.18
|
|
355
|
+
|
|
356
|
+
- Fix `useTransition` bindings, where `startTransition` broke after going to React 18. Kudos to [Emilios1995](https://github.com/Emilios1995) for researching and finding the issue!
|
|
357
|
+
|
|
358
|
+
### beta.17
|
|
359
|
+
|
|
360
|
+
- Upgrade to stable React 18
|
|
361
|
+
|
|
362
|
+
### beta.16
|
|
363
|
+
|
|
364
|
+
- Fix bug that caused issues when using unions in optimistic responses and `commitLocalPayload`.
|
|
365
|
+
- Add support for experimental [Relay Resolvers](https://relay.dev/docs/next/guides/relay-resolvers). Undocumented so far, but looking at the [test](https://github.com/zth/rescript-relay/blob/master/packages/rescript-relay/__tests__/Test_relayResolvers.res) and [definition file](https://github.com/zth/rescript-relay/blob/master/packages/rescript-relay/__tests__/TestRelayUserResolver.res) should give you a hint of how it works.
|
|
366
|
+
|
|
367
|
+
### beta.15
|
|
368
|
+
|
|
369
|
+
- Fixes for input objects.
|
|
370
|
+
|
|
371
|
+
### beta.14
|
|
372
|
+
|
|
373
|
+
- Fixes a few issues introduced in `beta.13`.
|
|
374
|
+
- The list of disallowed field names has been adapted to ReScript. This means that _some of your variable prop names might be renamed_. Check out the Breaking Changes section above for details.
|
|
375
|
+
|
|
376
|
+
### beta.13
|
|
377
|
+
|
|
378
|
+
- `refetchVariables` now works as intended with regards to supplying only the variables you want _changed_ when refetching, as [detailed under `variables` here](https://relay.dev/docs/next/api-reference/use-refetchable-fragment/#return-value). Check out the [docs](https://rescript-relay-documentation.vercel.app/docs/refetching-and-loading-more-data#makerefetchvariables).
|
|
379
|
+
- Make all object makers inlined. This should improve bundle size some.
|
|
380
|
+
- Support more Linux versions in CI (like the images Vercel uses).
|
|
381
|
+
|
|
382
|
+
### beta.12
|
|
383
|
+
|
|
384
|
+
- Make CLI work with `relay.config.cjs`.
|
|
385
|
+
|
|
386
|
+
### beta.11
|
|
387
|
+
|
|
388
|
+
- Another batch of experimental stuff... Nothing new in this version compared to `beta.9`.
|
|
389
|
+
|
|
390
|
+
### beta.10
|
|
391
|
+
|
|
392
|
+
- Sneaking out some experimental stuff... Nothing new in this version compared to `beta.9`.
|
|
393
|
+
|
|
394
|
+
### beta.9
|
|
395
|
+
|
|
396
|
+
- `recordSourceRecords` is now typed as `Js.Json.t` rather than being abstract.
|
|
397
|
+
- The field name of the `id` field of the `Node` interface is now configurable via `schemaConfig: {nodeInterfaceIdField: "idNameHere"}`.
|
|
398
|
+
|
|
399
|
+
### beta.8
|
|
400
|
+
|
|
401
|
+
- More fixes for conversion instructions in variables and input objects.
|
|
402
|
+
- Project now works in `"type": "module"` mode in `package.json` (kudos [cometkim](https://github.com/cometkim))
|
|
403
|
+
|
|
404
|
+
### beta.7
|
|
405
|
+
|
|
406
|
+
- Full support for `reanalyze` as all false positive dead code results from generated code are now suppressed.
|
|
407
|
+
- Bindings for `requiredFieldLogger` for logging when missing fields are encountered (kudos [Emilios1995](https://github.com/Emilios1995)).
|
|
408
|
+
- Fix bug with conversion instructions in variables with input instructions.
|
|
409
|
+
|
|
410
|
+
### beta.6
|
|
411
|
+
|
|
412
|
+
- Fix wrong enum type being printed in input objects
|
|
413
|
+
- 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
|
|
414
|
+
|
|
415
|
+
### beta.5
|
|
416
|
+
|
|
417
|
+
- 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.
|
|
418
|
+
- 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.
|
|
419
|
+
|
|
420
|
+
### beta.4
|
|
421
|
+
|
|
422
|
+
- Revert JSON.parse micro optimization experiment.
|
|
423
|
+
|
|
424
|
+
### beta.3
|
|
425
|
+
|
|
426
|
+
- Fix issue with duplicate keys being printed in the conversion instructions.
|
|
427
|
+
- Get rid of the need of nullability conversion instructions, and infer them instead.
|
|
428
|
+
|
|
429
|
+
### beta.2
|
|
430
|
+
|
|
431
|
+
- Fix issue with recursive input objects not being converted correctly.
|
|
25
432
|
|
|
26
433
|
# 0.23.0
|
|
27
434
|
|
|
28
435
|
_[Here's a commit showing a project being upgraded to this version](https://github.com/zth/rescript-relay/commit/6e96dfafaec918b1d4e9519d3fcbf5e5c46be6c0)_
|
|
29
436
|
|
|
30
|
-
Finally, a new release! This brings the Relay version to 12, and the React version to 18 (in rc.
|
|
437
|
+
Finally, a new release! This brings the Relay version to 12, and the React version to 18 (in rc.1 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.
|
|
31
438
|
|
|
32
439
|
## Upgrade versions
|
|
33
440
|
|
package/README.md
CHANGED
|
@@ -6,11 +6,11 @@ Use Relay with ReScript.
|
|
|
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) => {
|
|
@@ -102,6 +98,14 @@ let make = () => {
|
|
|
102
98
|
|
|
103
99
|
```
|
|
104
100
|
|
|
101
|
+
## Note about versioning
|
|
102
|
+
|
|
103
|
+
There's plenty of work ongoing to bring RescriptRelay to full ReScript v11 support, including uncurried mode. Here's the versioning scheme that'll be followed going forward:
|
|
104
|
+
|
|
105
|
+
- 1.x will receive critical bug fixes etc, but new features won't be added
|
|
106
|
+
- 2.x will soon ship, and it'll focus on compatibility with ReScript v11, and uncurried mode (uncurried mode will be optional). This is intended to make the transition to v11+ smooth
|
|
107
|
+
- 3.x will also soon ship, and that'll fully embrace uncurried mode (no curried mode available), and add a bunch of new stuff + change existing APIs to make them better and more ergonomic
|
|
108
|
+
|
|
105
109
|
## Examples
|
|
106
110
|
|
|
107
111
|
- A general example showcasing most available features: https://github.com/zth/rescript-relay/tree/master/example
|