navigation:codegen: optional number and boolean params break the iOS build
維護者通常 3 天內回覆
評估
- 難度
- 3/5
- 預估耗時
- 1-2 天
- 新手友好度
- 45/100
- Issue 類型
- 缺陷
- 描述清晰度
- 描述清楚
- 活躍度
- 停滯
- 技術堆疊
- react-native, swift, typescript
- 領域
- build-system, mobile
研究方向
Start with brownfield.navigation.ts and the navigation:codegen generator, then inspect the generated Swift protocol and Objective-C implementation alongside the React Native TurboModule spec. Reproduce with the optional number and boolean parameters shown in the issue and build the iOS app. Done when the generated iOS code compiles and represents both optional parameters as nullable NSNumber * values.
由索引模型根據 Issue 內容生成。
描述
The docs state that optional params are supported in brownfield.navigation.ts. For optional number and boolean params, brownfield navigation:codegen generates a Swift delegate that doesn't compile.
Steps to reproduce
-
Add a method with optional primitive params to
brownfield.navigation.ts:export interface BrownfieldNavigationSpec { openFeed(page?: number, animated?: boolean): void; } -
Run
npx brownfield navigation:codegen. -
Build the iOS app.
Expected behavior
The generated code compiles, and the params are nullable on iOS, as NSNumber * in the React Native TurboModule spec.
Actual behavior
The generated Swift protocol contains:
@objc func openFeed(_ page: Double?, animated animated: Bool?)
Swift reports "Method cannot be marked @objc because the type of the parameter cannot be represented in Objective-C". The Objective-C implementation declares (double)page and (BOOL)animated, while React Native codegen declares both params as NSNumber *.
- 主要語言
- TypeScript
- 星號
- 553
- 分支
- 58
- 平均合併
- 3 天 18 小時
- 30 天內合併 PR
- 16
環境準備
- 沒有 Dockerfile 或 Docker Compose 檔案
- 沒有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
callstack/react-native-brownfield 的其他 Issue
-
難度 2/5 1-3 小時 新手友好度 85/100
callstack/react-native-brownfield#502 · 1 則留言 ·
維護者通常 3 天內回覆
-
Android: initialize cannot be retried after it throws可能已有人在做 @malopezr7 於 9 天前認領。 未關閉
難度 3/5 1-2 天 新手友好度 57/100
callstack/react-native-brownfield#515 ·
維護者通常 3 天內回覆
-
`package:ios --add-spm-package`: allow project-declared extra XCFrameworks as binary targets可能已有人在做 @DanielPotorCK 於 11 天前認領。 未關閉
難度 4/5 3-5 天 新手友好度 55/100
callstack/react-native-brownfield#468 ·
維護者通常 3 天內回覆
-
iOS: emitOnBrownfieldMessage: can crash with std::bad_function_call when native posts before JS requires the TurboModule (cold-start race)可能已有人在做 @tlq5l 於 8 天前認領。 未關閉
難度 4/5 3-5 天 新手友好度 48/100
callstack/react-native-brownfield#420 ·
維護者通常 3 天內回覆
-
難度 5/5 一週以上 新手友好度 38/100
callstack/react-native-brownfield#406 ·
維護者通常 3 天內回覆
查看 callstack/react-native-brownfield 的全部 Issue
相似的 Issue
-
難度 2/5 1-3 小時 新手友好度 74/100
earendil-works/pi-claude-code#36 ·
維護者通常 6 天內回覆
-
難度 2/5 1-3 小時 新手友好度 65/100
維護者通常 1 天內回覆
-
Resources: New work of jabodetabek可能已有人在做 @rmt-svc 今天認領。 未關閉resources
難度 2/5 1-3 小時 新手友好度 62/100
railmapgen/rmp-gallery#4167 ·
維護者通常 2 天內回覆
-
documentation p1
難度 2/5 1-3 小時 新手友好度 75/100
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 83/100
microsoft/monaco-editor#5577 ·
維護者通常 1 天內回覆