Skip to content

Conversation

@Abbondanzo
Copy link
Contributor

Summary:
This diff adds the ability to experiment with using NestedScrollView instead of ScrollView as the parent class for ReactScrollView on Android.

Since Java doesn't support multiple inheritance or conditional parent class selection, this is implemented using code generation:

  • A Python script (generate-nested-scroll-view.py) generates ReactNestedScrollView.java and ReactNestedScrollViewManager.kt from their respective source files
  • The generated files are identical to the originals except they extend NestedScrollView instead of ScrollView
  • A Buck genrule verifies the generated files stay in sync with source files at build time
  • The useNestedScrollViewAndroid feature flag controls which implementation is used at runtime

This approach allows us to safely A/B test the NestedScrollView implementation without requiring JS changes, since both managers register with the same REACT_CLASS name ("RCTScrollView").

Changelog: [Internal]

Differential Revision: D90902079

@meta-codesync
Copy link

meta-codesync bot commented Jan 19, 2026

@Abbondanzo has exported this pull request. If you are a Meta employee, you can view the originating Diff in D90902079.

@meta-cla meta-cla bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Jan 19, 2026
Summary:

This diff adds the ability to experiment with using `NestedScrollView` instead of `ScrollView` as the parent class for `ReactScrollView` on Android.

Since Java doesn't support multiple inheritance or conditional parent class selection, this is implemented using code generation:
- A Python script (`generate-nested-scroll-view.py`) generates `ReactNestedScrollView.java` and `ReactNestedScrollViewManager.kt` from their respective source files
- The generated files are identical to the originals except they extend `NestedScrollView` instead of `ScrollView`
- A Buck genrule verifies the generated files stay in sync with source files at build time
- The `useNestedScrollViewAndroid` feature flag controls which implementation is used at runtime

This approach allows us to safely A/B test the NestedScrollView implementation without requiring JS changes, since both managers register with the same `REACT_CLASS` name (`"RCTScrollView"`).

Changelog: [Internal]

Differential Revision: D90902079
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. fb-exported meta-exported p: Facebook Partner: Facebook Partner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants