Skip to content

Accept a payload on @react.componentWithProps with a deprecation warning - #8944

Merged
cknitt merged 1 commit into
masterfrom
component-with-props-payload
Oct 21, 2026
Merged

cknitt merged 1 commit into
masterfrom
component-with-props-payload

Conversation

@cknitt

@cknitt cknitt commented Oct 21, 2026

Copy link
Copy Markdown
Member

#8884 made a payload on @react.componentWithProps / @jsx.componentWithProps a hard error (@react.componentWithProps takes no payload.). Before, the JSX transform never looked at that payload, so code like @react.componentWithProps(: props) (copied from @react.component(: props)) compiled fine and now breaks.

This restores the 12.x behavior with a deprecation warning:

  • The component node still can't hold the payload, so the attribute stays in the parsetree and formatting keeps it as written.
  • The JSX transform now takes a lone componentWithProps with a payload as the component and warns: deprecated: @react.componentWithProps takes no payload. The payload has no effect; remove it. This applies to let bindings, externals (which still get the existing "cannot be externals" error) and signature items.
  • A componentWithProps with a payload next to another component annotation is now reported as a duplicate annotation instead of as a payload error.

Tests: the react_componentWithProps_invalid_payload super_errors fixture becomes react_componentWithProps_payload, which compiles and only warns. A sharedPropsWithProps ppx case shows that the payload form transforms the same as the bare attribute.

🤖 Generated with Claude Code

https://claude.ai/code/session_01GPwM4m3vhYgbdzgXvmQ7Te

#8884 made a payload on @react.componentWithProps an error, breaking code
that compiled before; the payload was always ignored.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01GPwM4m3vhYgbdzgXvmQ7Te
Signed-off-by: Christoph Knittel <[email protected]>
@github-actions

Copy link
Copy Markdown

@cknitt

cknitt commented Oct 21, 2026

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-21T13:26:32.205162Z 5c27c63 Manual request
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@codecov

codecov Bot commented Oct 21, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 90.47619% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 81.16%. Comparing base (38ba55a) to head (5c27c63).
⚠️ Report is 5 commits behind head on master.

Files with missing lines Patch % Lines
compiler/syntax/src/jsx_common.ml 88.88% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #8944      +/-   ##
==========================================
+ Coverage   81.14%   81.16%   +0.02%     
==========================================
  Files         456      457       +1     
  Lines       63760    63885     +125     
==========================================
+ Hits        51738    51855     +117     
- Misses      12022    12030       +8     
Files with missing lines Coverage Δ
compiler/syntax/src/jsx_v4.ml 86.89% <100.00%> (+0.07%) ⬆️
compiler/syntax/src/jsx_common.ml 82.85% <88.88%> (+6.66%) ⬆️

... and 12 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Another round soon, please!

Reviewed commit: 5c27c6373d

ℹ️ 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".

@cknitt
cknitt marked this pull request as ready for review October 21, 2026 13:27
@cknitt
cknitt requested a review from tsnobip October 21, 2026 13:27
@pkg-pr-new

pkg-pr-new Bot commented Oct 21, 2026

Copy link
Copy Markdown

Open in StackBlitz

rescript

npm i https://pkg.pr.new/rescript@8944

@rescript/belt

npm i https://pkg.pr.new/@rescript/belt@8944

@rescript/darwin-arm64

npm i https://pkg.pr.new/@rescript/darwin-arm64@8944

@rescript/linux-arm64

npm i https://pkg.pr.new/@rescript/linux-arm64@8944

@rescript/linux-x64

npm i https://pkg.pr.new/@rescript/linux-x64@8944

@rescript/runtime

npm i https://pkg.pr.new/@rescript/runtime@8944

@rescript/win32-x64

npm i https://pkg.pr.new/@rescript/win32-x64@8944

commit: 5c27c63

@github-actions

Copy link
Copy Markdown

@cknitt
cknitt requested a review from cristianoc October 21, 2026 16:06
@cknitt
cknitt merged commit 2d0a9f0 into master Oct 21, 2026
28 checks passed
@cknitt
cknitt deleted the component-with-props-payload branch October 21, 2026 17:27
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.

2 participants