rescript-relay 1.0.0-beta.8 → 1.0.0-rc.1

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  # master
2
2
 
3
- # 1.0.0-beta.8
3
+ # 1.0.0-rc.1
4
4
 
5
5
  _[Here's a commit showing a project being upgraded to this version](https://github.com/zth/rescript-relay/commit/5831c2f1f0f13eedc1cb60468c32fd32b2dc01d3)_
6
6
 
@@ -8,7 +8,8 @@ The time has finally come - RescriptRelay `1.0.0` is in beta! The one, big major
8
8
 
9
9
  ## Upgrade versions
10
10
 
11
- - `react-relay` and `relay-runtime` to `13.0.1`
11
+ - `react-relay` and `relay-runtime` to `14.1.0`
12
+ - `react` and `react-dom` to `18.0.0`
12
13
 
13
14
  ## Remove Packages
14
15
 
@@ -27,10 +28,122 @@ You can go ahead and remove these packages, that are no longer needed, as the co
27
28
  - Full support for `reanalyze` as all false positive dead code results from generated code are now suppressed.
28
29
  - Bindings for `requiredFieldLogger` for logging when missing fields are encountered (kudos [Emilios1995](https://github.com/Emilios1995)).
29
30
  - Improved utils for [dealing with enums](https://rescript-relay-documentation.vercel.app/docs/enums).
31
+ - `recordSourceRecords` is now typed as `Js.Json.t` rather than being abstract.
30
32
 
31
- ## Beta fix changelog
33
+ ## Breaking changes
34
+
35
+ - 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!
36
+ - 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.
37
+ - `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), ())`.
38
+ Crash course:
39
+
40
+ - `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`_.
41
+ - `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)_.
42
+ - `makeRefetchVariables()` means _refetch, use the same values for all variables that was used in the last fetch, change nothing_.
43
+
44
+ This way you can surgically change only certain values when refetching, without having to keep track of the current values for the other values.
45
+
46
+ 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!
47
+
48
+ ## 1.0.0 development changelog
49
+
50
+ ### rc.1
51
+
52
+ - Restore half-broken connection helper function inlining.
53
+
54
+ ### rc.0
55
+
56
+ - _potentially breaking_ `getConnectionNodes` is now located directly in the generated module, and not in a nested `Utils` module.
57
+ - Support [provided variables](https://relay.dev/docs/api-reference/graphql-and-directives/#provided-variables). More info in the docs.
58
+ - Windows support! :tada:
59
+ - 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)
60
+ - 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.
61
+ - 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.
62
+ - _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.
63
+
64
+ ## beta.26
65
+
66
+ - Upgrade Relay packages to version `14.1.0`.
67
+
68
+ ## beta.25
69
+
70
+ - Change signature of preload function (router related).
71
+
72
+ ## beta.24
73
+
74
+ - Fix compatibility with ReScript v10
75
+
76
+ ## beta.23
77
+
78
+ - Add Environment isServer option @MoOx
79
+ - Fix incorrect react-relay peerDependencies version @MoOx
80
+ - Remove rescript from dependencies @anmonteiro
81
+ - Fix instantiation of Relay context @vikfroberg
82
+ - Add undocumented holdGC method on relay store @MoOx
83
+
84
+ ### beta.22
85
+
86
+ - 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).
87
+ - Add links for `Operation` module in `Query`, `Mutation`, `Subscription` and `Fragment` ([XiNiHa](https://github.com/XiNiHa))
88
+
89
+ ### beta.21
90
+
91
+ - Support formatting commented out operations in the CLI ([reck753](https://github.com/reck753)).
92
+ - Support `@rescriptRelayIgnoreUnused` directive on fragment definitions to insert annotations that makes `reanalyze` consider all fields in the fragment used, even if they aren't.
93
+ - 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).
94
+
95
+ ### beta.20
96
+
97
+ - Fix enums appearing in `@raw_response_type` (local query updates, optimistic responses) to be input enums.
98
+
99
+ ### beta.19
100
+
101
+ - Fix top level node interface issue.
102
+
103
+ ### beta.18
104
+
105
+ - Fix `useTransition` bindings, where `startTransition` broke after going to React 18. Kudos to [Emilios1995](https://github.com/Emilios1995) for researching and finding the issue!
106
+
107
+ ### beta.17
108
+
109
+ - Upgrade to stable React 18
110
+
111
+ ### beta.16
112
+
113
+ - Fix bug that caused issues when using unions in optimistic responses and `commitLocalPayload`.
114
+ - 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.
115
+
116
+ ### beta.15
117
+
118
+ - Fixes for input objects.
119
+
120
+ ### beta.14
121
+
122
+ - Fixes a few issues introduced in `beta.13`.
123
+ - 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.
124
+
125
+ ### beta.13
126
+
127
+ - `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).
128
+ - Make all object makers inlined. This should improve bundle size some.
129
+ - Support more Linux versions in CI (like the images Vercel uses).
130
+
131
+ ### beta.12
132
+
133
+ - Make CLI work with `relay.config.cjs`.
134
+
135
+ ### beta.11
136
+
137
+ - Another batch of experimental stuff... Nothing new in this version compared to `beta.9`.
138
+
139
+ ### beta.10
140
+
141
+ - Sneaking out some experimental stuff... Nothing new in this version compared to `beta.9`.
142
+
143
+ ### beta.9
32
144
 
33
- ### unreleased
145
+ - `recordSourceRecords` is now typed as `Js.Json.t` rather than being abstract.
146
+ - The field name of the `id` field of the `Node` interface is now configurable via `schemaConfig: {nodeInterfaceIdField: "idNameHere"}`.
34
147
 
35
148
  ### beta.8
36
149
 
@@ -70,7 +183,7 @@ You can go ahead and remove these packages, that are no longer needed, as the co
70
183
 
71
184
  _[Here's a commit showing a project being upgraded to this version](https://github.com/zth/rescript-relay/commit/6e96dfafaec918b1d4e9519d3fcbf5e5c46be6c0)_
72
185
 
73
- 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.
186
+ 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.
74
187
 
75
188
  ## Upgrade versions
76
189
 
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 [decicated VSCode extension](https://marketplace.visualstudio.com/items?itemName=GabrielNordeborn.vscode-rescript-relay). Note: It only works with ReScript syntax.
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 some between versions (including breaking changes, although we'll try and keep them to a minimum) as we iterate and reach a stable version.
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) => {