Under RN_STRICT_API no feature-flag header is public, so a library cannot read a flag and an app cannot override one
Maintainer thường phản hồi trong vòng 2 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 45/100
Hướng nghiên cứu
Start by reading ReactNativePublicFeatureFlags.h, the feature flag headers under react/featureflags/, and PrivateGuard.h; the reproducer names the affected flags and the strict API compile that fails. Run the reproducer’s repro.sh to confirm the failure, then inspect the public header and override declarations. Done means strict API consumers can read the named flags and override one, while builds without RN_STRICT_API still compile.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Description
Every header in react/featureflags/ but ReactNativePublicFeatureFlags.h includes react/cxxstableapi/PrivateGuard.h, which is an #error once a build defines RN_STRICT_API. ReactNativePublicFeatureFlags.h declares ReactNativeFeatureFlags_DO_NOT_USE with seven flags and no way to override one. So with the strict C++ API on:
- a library whose Fabric code must agree with a flag (
preventShadowTreeCommitExhaustion,enableFabricCommitBranching,updateRuntimeShadowNodeReferencesOnCommit,cxxNativeAnimatedEnabled,enableFlexboxAutoMinSizeInStrictMode) has no header it may include to read it; - an app has no header it may include to override a flag through
ReactNativeFeatureFlagsOverridesOSSExperimentalorReactNativeFeatureFlags::override.
0.88.1 has the <React/FeatureFlags.h> umbrella for both; #58744 removed it and made the module private, from 0.89.0-rc.0.
Expected: a consumer that defines RN_STRICT_API can read every flag and override flags through a header the guards accept. Builds without RN_STRICT_API stay as they are.
Steps to reproduce
- Clone the reproducer below.
ReproducerApp/cpp/FlagReader.cppreads the five flags above through<react/featureflags/ReactNativeFeatureFlags.h>;ReproducerApp/cpp/FlagOverrides.cppoverrides one with aReactNativeFeatureFlagsOverridesOSSExperimentalsubclass andReactNativeFeatureFlags::override. - Run its
repro.sh:
It sparse-clones react/react-native atdocker run --rm -v "$PWD:/repro:ro" gcc:15 bash /repro/repro.shmainand compiles both files against itsReactCommonwith-fsyntax-only, once plain and once with-DRN_STRICT_API.bash repro.sh v0.89.0-rc.1does the same on the release candidate. - Expected: both files compile with
-DRN_STRICT_API, or a public header offers the same reads and the override. Actual: both compile without it and stop on the private-header#errorwith it, and the public header declares none of the five flags:
The script exits 1 while a strict compile stops on thatreact/react-native de7e643aa30b4e87376898b74037bd9712e9d4d6 == which flags ReactNativePublicFeatureFlags.h declares class ReactNativeFeatureFlags_DO_NOT_USE { preventShadowTreeCommitExhaustion: not declared enableFabricCommitBranching: not declared updateRuntimeShadowNodeReferencesOnCommit: not declared cxxNativeAnimatedEnabled: not declared enableFlexboxAutoMinSizeInStrictMode: not declared == FlagReader.cpp without RN_STRICT_API compiles == FlagReader.cpp with -DRN_STRICT_API react/cxxstableapi/PrivateGuard.h:32:2: error: #error "This is a private React Native header and is not part of the public API. Do not include it directly; it has no stability guarantee." == FlagOverrides.cpp without RN_STRICT_API compiles == FlagOverrides.cpp with -DRN_STRICT_API react/cxxstableapi/PrivateGuard.h:32:2: error: #error "This is a private React Native header and is not part of the public API. Do not include it directly; it has no stability guarantee." SUMMARY: under RN_STRICT_API 2 of 2 files stop on the private-header #error: no feature-flag header is public (react/react-native de7e643aa3)#errorand 0 once both compile.
React Native Version
0.89.0-rc.1
Affected Platforms
Build - Linux, Build - Windows
Areas
Fabric - The New Renderer
Output of npx @react-native-community/cli info
System:
OS: Linux 6.18 Debian GNU/Linux 13 (trixie) 13 (trixie)
CPU: (24) x64 AMD Ryzen 9 9950X3D 16-Core Processor
Memory: 120.35 GB / 125.63 GB
Shell:
version: 5.2.37
path: /bin/bash
Binaries:
Node:
version: 24.22.3
path: /usr/bin/node
Yarn: Not Found
npm:
version: 11.19.1
path: /usr/bin/npm
Watchman: Not Found
SDKs:
Android SDK: Not Found
IDEs:
Android Studio: Not Found
Languages:
Java: Not Found
Ruby: Not Found
npmPackages:
"@react-native-community/cli":
installed: 21.0.0
wanted: ^21.0.0
react: Not Found
react-native:
installed: 0.89.0-rc.1
wanted: ^0.89.0-rc.1
npmGlobalPackages:
"*react-native*": Not Found
Android:
hermesEnabled: Not found
newArchEnabled: Not found
iOS:
hermesEnabled: Not found
newArchEnabled: Not found
Stacktrace or Logs
react/cxxstableapi/PrivateGuard.h:32:2: error: #error "This is a private React Native header and is not part of the public API. Do not include it directly; it has no stability guarantee."
MANDATORY Reproducer
https://github.com/YevheniiKotyrlo/react-native-feature-flags-under-strict-cxx-api
Screenshots and Videos
No response
- Ngôn ngữ chính
- C++
- Star
- 127k
- Fork
- 25.5k
- Merge trung bình
- 3 ngày 22 giờ
- Pull request đã merge (30 ngày)
- 235
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của react/react-native
-
Needs: Author Feedback Needs: Repro
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
react/react-native#60059 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Needs: Triage :mag:
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
react/react-native#60000 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
`yarn test-ios` exits before building RNTester: `objc-test.sh` launches the WebSocket server script #59433 deletedCó thể đã có người làm @lazerg đã nhận 4 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
react/react-native#59939 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
iOS Fabric pointer-handler reset leaves the next lone touch non-primaryCó thể đã có người làm @alleneubank đã nhận 6 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
react/react-native#59919 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
react/react-native#59722 ·
Maintainer thường phản hồi trong vòng 2 ngày
Tất cả issue của react/react-native
Issue tương tự
-
[fuzzer-found][mlir][tosa] `TransposeOp::reifyResultShapes` crashes on unranked tensor inputĐang mởcrash generated by fuzzer mlir
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
llvm/llvm-project#243218 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
petercorke/robotics-toolbox-python#943 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
realtime
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 69/100
NVIDIA/cuda-quantum#5913 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[hidapi] update to 0.16.0Đang mởcategory:port-update
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 2 ngày
-
area:build bug
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 90/100
NatronGitHub/openfx-arena#71 ·
Maintainer thường phản hồi trong vòng 1 ngày