Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# master

# 4.4.1

- Change name on internal fetch fn to avoid accidental shadowing.

# 4.4.0

- Introduce `rescript-relay-compiler tools`, exposing Relay analysis commands like `definition-audit`, `find-schema-references`, `fragment-dependents`, and `print-operation`.
Expand Down
2 changes: 1 addition & 1 deletion packages/rescript-relay/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "rescript-relay",
"version": "4.4.0",
"version": "4.4.1",
"main": "src/RescriptRelay.res",
"license": "MIT",
"author": "Gabriel Nordeborn",
Expand Down
4 changes: 2 additions & 2 deletions packages/rescript-relay/rescript-relay-ppx/library/Query.ml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ let make ~loc ~moduleName ~hasRawResponseType ~hasAutocodesplitDirective =
[
[%stri
let fetch =
RescriptRelay_QueryNonReact.fetch ~convertResponse
RescriptRelay_QueryNonReact.fetch_ ~convertResponse
~convertVariables
~node:[%e valFromGeneratedModule ["node"]]];
[%stri
Expand All @@ -91,7 +91,7 @@ let make ~loc ~moduleName ~hasRawResponseType ~hasAutocodesplitDirective =
[
[%stri
let fetch =
RescriptRelay_Query.fetch ~convertResponse ~convertVariables
RescriptRelay_Query.fetch_ ~convertResponse ~convertVariables
~node:[%e valFromGeneratedModule ["node"]]];
Comment on lines 93 to 95
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Emit the public fetch helper from generated query modules

In the default React mode, the PPX now generates RescriptRelay_Query.fetch_ here, but packages/rescript-relay/src/RescriptRelay_Query.resi still only exposes fetch. Downstream [%relay.query] artifacts will therefore reference a symbol that is not in the published interface and fail to type-check as soon as a consumer upgrades to this PPX/runtime pair.

Useful? React with 👍 / 👎.

[%stri
let fetchPromised =
Expand Down
2 changes: 1 addition & 1 deletion packages/rescript-relay/src/RescriptRelay_Query.res
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ external fetchQuery: (
option<fetchQueryOptions>,
) => Observable.t<'response> = "fetchQuery"

let fetch = (
let fetch_ = (
~node,
~convertResponse: 'response => 'response,
~convertVariables: 'variables => 'variables,
Expand Down
2 changes: 1 addition & 1 deletion packages/rescript-relay/src/RescriptRelay_Query.resi
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ let usePreloaded: (
~mkQueryRef: 'queryRef => 'queryRef,
) => (~queryRef: 'queryRef) => 'response

let fetch: (
let fetch_: (
~node: queryNode<'a>,
~convertResponse: 'response => 'response,
~convertVariables: 'variables => 'variables,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ external toPromise: observable<'a> => promise<'a> = "toPromise"

external ignoreSubscription: subscription => unit = "%ignore"

let fetch = (
let fetch_ = (
~node,
~convertResponse: 'response => 'response,
~convertVariables: 'variables => 'variables,
Comment on lines +38 to 41
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Keep RescriptRelay_QueryNonReact.fetch as a public export

This file has no .resi, and packages/rescript-relay/package.json exports ./src/*, so renaming the top-level binding from fetch to fetch_ is a breaking API change for anyone importing the non-React runtime directly. Existing callers of RescriptRelay_QueryNonReact.fetch will stop compiling (ReScript) or start getting undefined (JS) after upgrading.

Useful? React with 👍 / 👎.

Expand Down
Loading