Skip to content

Rename fetch to avoid shadowing#608

Merged
zth merged 3 commits intomasterfrom
fix-mangle-fetch
Mar 19, 2026
Merged

Rename fetch to avoid shadowing#608
zth merged 3 commits intomasterfrom
fix-mangle-fetch

Conversation

@zth
Copy link
Copy Markdown
Owner

@zth zth commented Mar 19, 2026

No description provided.

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ef09e1a3bf

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines 93 to 95
let fetch =
RescriptRelay_Query.fetch ~convertResponse ~convertVariables
RescriptRelay_Query.fetch_ ~convertResponse ~convertVariables
~node:[%e valFromGeneratedModule ["node"]]];
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 👍 / 👎.

Comment on lines +38 to 41
let fetch_ = (
~node,
~convertResponse: 'response => 'response,
~convertVariables: 'variables => 'variables,
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 👍 / 👎.

@zth zth merged commit af5ade7 into master Mar 19, 2026
6 checks passed
@zth zth deleted the fix-mangle-fetch branch March 19, 2026 16:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant