Skip to content

Commit

Permalink
upgrade the compiler and deps to Relay 17.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
zth committed Jun 16, 2024
1 parent 1ffdce9 commit 4e78b59
Show file tree
Hide file tree
Showing 12 changed files with 54 additions and 40 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@

# Unreleased

- **Upgrade versions**: `react-relay` and `relay-runtime` to `17.0.0`.
- BREAKING: The `customScalars` option in the Relay config is now called `customScalarTypes`.
- BREAKING: `requiredFieldLogger` in the `Environment` config is now called `relayFieldLogger`.

# 3.0.0-rc.5

- Support for Relay `@updatable` queries and fragments (https://relay.dev/docs/guided-tour/updating-data/imperatively-modifying-store-data/#optimistic-updaters-vs-updaters). https://github.com/zth/rescript-relay/pull/501
Expand Down
2 changes: 1 addition & 1 deletion packages/relay
Submodule relay updated 1704 files
5 changes: 1 addition & 4 deletions packages/rescript-relay/__tests__/TestRelayUserResolver.res
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
/**
* @RelayResolver
*
* @onType User
* @fieldName fullName
* @RelayResolver User.fullName:RelayResolverValue
* @rootFragment TestRelayUserResolver
*
* A users full name.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ module Query = %relay(`
`)

module Logger = {
let loggedArg = ref((None: option<RescriptRelay.RequiredFieldLogger.arg>))
let loggedArg = ref((None: option<RescriptRelay.RelayFieldLogger.arg>))

let mock: RescriptRelay.RequiredFieldLogger.t = arg => loggedArg := Some(arg)
let mock: RescriptRelay.RelayFieldLogger.t = arg => loggedArg := Some(arg)

let getLoggedArg = () => loggedArg.contents

let expectedArg: RescriptRelay.RequiredFieldLogger.arg = MissingFieldLog({
let expectedArg: RescriptRelay.RelayFieldLogger.arg = MissingFieldLog({
owner: "TestRequiredFieldLoggerQuery",
fieldPath: "loggedInUser.firstName",
})
Expand All @@ -26,7 +26,7 @@ let test_requiredFieldLogger = () => {
let environment = RescriptRelay.Environment.make(
~network,
~store=RescriptRelay.Store.make(~source=RescriptRelay.RecordSource.make()),
~requiredFieldLogger=Logger.mock,
~relayFieldLogger=Logger.mock,
)

Js.Promise.make((~resolve, ~reject as _) => {
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions packages/rescript-relay/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
},
"devDependencies": {
"@glennsl/rescript-fetch": "^0.2.0",
"@rescript/react": "0.12.1",
"@rescript/react": "0.12.2",
"@testing-library/jest-dom": "^5.16.3",
"@testing-library/react": "^13.0.0-alpha.6",
"graphql-query-test-mock": "^0.12.1",
Expand All @@ -49,13 +49,13 @@
"node-fetch": "^2.6.0",
"react": "18.2.0",
"react-dom": "18.2.0",
"react-relay": "16.0.0",
"relay-runtime": "16.0.0",
"rescript": "^11.0.0"
"react-relay": "17.0.0",
"relay-runtime": "17.0.0",
"rescript": "11.1.1"
},
"peerDependencies": {
"@rescript/react": "^0.12.1",
"react-relay": "16.0.0",
"react-relay": "17.0.0",
"relay-runtime": "*",
"rescript": "^11.0.0"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/rescript-relay/relay.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ module.exports = {
: "./__tests__/__generated__",
src: PERSISTING ? "./__tests_preloaded__" : "./__tests__",
language: "rescript",
customScalars: {
customScalarTypes: {
Datetime: "TestsUtils.Datetime",
IntString: "TestsUtils.IntString",
JSON: "Js.Json.t",
Expand Down
8 changes: 4 additions & 4 deletions packages/rescript-relay/src/RescriptRelay.res
Original file line number Diff line number Diff line change
Expand Up @@ -552,7 +552,7 @@ module Store = {
@send external holdGC: t => unit = "holdGC"
}

module RequiredFieldLogger = {
module RelayFieldLogger = {
@tag("kind")
type arg =
| @as("missing_field.log") MissingFieldLog({owner: string, fieldPath: string})
Expand All @@ -576,7 +576,7 @@ module Environment = {
getDataID?: (~nodeObj: 'a, ~typeName: string) => string,
treatMissingFieldsAsNull?: bool,
missingFieldHandlers: array<MissingFieldHandler.t>,
requiredFieldLogger?: RequiredFieldLogger.t,
relayFieldLogger?: RelayFieldLogger.t,
isServer?: bool,
}

Expand All @@ -589,7 +589,7 @@ module Environment = {
~getDataID=?,
~treatMissingFieldsAsNull=?,
~missingFieldHandlers=?,
~requiredFieldLogger=?,
~relayFieldLogger=?,
~isServer=?,
) =>
make({
Expand All @@ -601,7 +601,7 @@ module Environment = {
| Some(handlers) => handlers->Belt.Array.concat([nodeInterfaceMissingFieldHandler])
| None => [nodeInterfaceMissingFieldHandler]
},
?requiredFieldLogger,
?relayFieldLogger,
?isServer,
})

Expand Down
4 changes: 2 additions & 2 deletions packages/rescript-relay/src/RescriptRelay.resi
Original file line number Diff line number Diff line change
Expand Up @@ -691,7 +691,7 @@ module Disposable: {
}

/**A required field logger, which gets called when a field annotated with the @required directive was missing from the response*/
module RequiredFieldLogger: {
module RelayFieldLogger: {
@tag("kind")
type arg =
| @as("missing_field.log") MissingFieldLog({owner: string, fieldPath: string})
Expand Down Expand Up @@ -722,7 +722,7 @@ module Environment: {
) => string=?,
~treatMissingFieldsAsNull: bool=?,
~missingFieldHandlers: array<MissingFieldHandler.t>=?,
~requiredFieldLogger: RequiredFieldLogger.t=?,
~relayFieldLogger: RelayFieldLogger.t=?,
~isServer: bool=?,
) => t

Expand Down
2 changes: 1 addition & 1 deletion packages/rescript-relay/src/RescriptRelay_Fragment.res
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ let usePaginationFragment = (
}
}

@module("react-relay/lib/relay-hooks/useBlockingPaginationFragment")
@module("react-relay/lib/relay-hooks/legacy/useBlockingPaginationFragment")
external useBlockingPaginationFragment_: (
fragmentNode<'node>,
'fragmentRef,
Expand Down
34 changes: 17 additions & 17 deletions packages/rescript-relay/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -521,10 +521,10 @@
"@jridgewell/resolve-uri" "^3.0.3"
"@jridgewell/sourcemap-codec" "^1.4.10"

"@rescript/react@0.12.1":
version "0.12.1"
resolved "https://registry.yarnpkg.com/@rescript/react/-/react-0.12.1.tgz#7bddb957a1bc08b944c6597f28549ac410982d64"
integrity sha512-ZD7nhDr5FZgLYqRH9s4CNM+LRz/3IMuTb+LH12fd2Akk0xYkYUP+DZveB2VQUC2UohJnTf/c8yPSNsiFihVCCg==
"@rescript/react@0.12.2":
version "0.12.2"
resolved "https://registry.yarnpkg.com/@rescript/react/-/react-0.12.2.tgz#a4a216cb317723005387be297008daca106540ff"
integrity sha512-EOF19dLTG4Y9K59JqMjG5yfvIsrMZqfxGC2J/oe9gGgrMiUrzZh3KH9khTcR1Z3Ih0lRViSh0/iYnJz20gGoag==

"@sinonjs/commons@^1.7.0":
version "1.8.3"
Expand Down Expand Up @@ -2541,16 +2541,16 @@ react-is@^17.0.1:
resolved "https://registry.yarnpkg.com/react-is/-/react-is-17.0.2.tgz#e691d4a8e9c789365655539ab372762b0efb54f0"
integrity sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w==

react-relay@16.0.0:
version "16.0.0"
resolved "https://registry.yarnpkg.com/react-relay/-/react-relay-16.0.0.tgz#50201d309559401c19184f9a6e2cf32127175d21"
integrity sha512-3Dje0NLJFwt6b3xqgbiCGlTnpxoZe1OTPsXIPtFdftgDWQzSfrwqkBYUKab6bV2HhCKWCzXWafb8wURLDAlNJQ==
react-relay@17.0.0:
version "17.0.0"
resolved "https://registry.yarnpkg.com/react-relay/-/react-relay-17.0.0.tgz#1f8b6aefaa73b8af8378300d419289a57a6f94c9"
integrity sha512-Kn0CMiKZtWc+EisFPmzuZ53RtDeLlJO+EUVJwqxNkOs5g1jDjVi1v+k48kHeTyim2X43Rr0S2aeailllci5SgQ==
dependencies:
"@babel/runtime" "^7.0.0"
fbjs "^3.0.2"
invariant "^2.2.4"
nullthrows "^1.1.1"
relay-runtime "16.0.0"
relay-runtime "17.0.0"

react@18.2.0:
version "18.2.0"
Expand Down Expand Up @@ -2581,10 +2581,10 @@ regexp.prototype.flags@^1.2.0:
define-properties "^1.1.3"
functions-have-names "^1.2.2"

relay-runtime@16.0.0:
version "16.0.0"
resolved "https://registry.yarnpkg.com/relay-runtime/-/relay-runtime-16.0.0.tgz#66efc4ea95a291885dab04f90676ab4c004442ea"
integrity sha512-gJ70upfOxmFgtvFEKn7sU72uN2XF9Bg5Bml9oGRqe0rFWJDj1ItsljWzOZ972EyDE+pZG/VKbqiz3gUjhbsejQ==
relay-runtime@17.0.0:
version "17.0.0"
resolved "https://registry.yarnpkg.com/relay-runtime/-/relay-runtime-17.0.0.tgz#771084ea3b44f2f1eb578da861511a5558c4e07b"
integrity sha512-7b2R3G3DP7VHq7/1ltwQfYn3KkTHIB2NNt3KijIZoNQ73avwpOXBEL0MelSXwq8L+K8lcgAW5VAT7o0LUhnJPQ==
dependencies:
"@babel/runtime" "^7.0.0"
fbjs "^3.0.2"
Expand All @@ -2595,10 +2595,10 @@ require-directory@^2.1.1:
resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42"
integrity sha1-jGStX9MNqxyXbiNE/+f3kqam30I=

rescript@^11.0.0:
version "11.0.0"
resolved "https://registry.yarnpkg.com/rescript/-/rescript-11.0.0.tgz#9a0b6fc998c360543c459aba49b77a572a0306cd"
integrity sha512-uIUwDZZmDUb7ymGkBiiGioxMg8hXh1mze/2k/qhYQcZGgi7PrLHQIW9AksM7gb9WnpjCAvFsA8U2VgC0nA468w==
rescript@11.1.1:
version "11.1.1"
resolved "https://registry.yarnpkg.com/rescript/-/rescript-11.1.1.tgz#3e3b59751e5d7472156615e13d957c70d5342c5c"
integrity sha512-FMELeoiR1n3LzBdBt+k7U4l0vsz5Xh0HBSHf+0NhyhzZkMRLkEKEDNrcqZc6RIux9bxmxoO+zEa9qFM01VOXAw==

resolve-cwd@^3.0.0:
version "3.0.0"
Expand Down

0 comments on commit 4e78b59

Please sign in to comment.