navigation:codegen: optional number and boolean params break the iOS build

Đang mở
#518 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 3 ngày

@RaphaelFakhri đang làm issue này rồi.

Từ ngày 5/11/2026.

  • #519 của @RaphaelFakhri — đang mở

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
45/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
react-native, swift, typescript
Lĩnh vực
build-system, mobile

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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

  1. Add a method with optional primitive params to brownfield.navigation.ts:

    export interface BrownfieldNavigationSpec {
      openFeed(page?: number, animated?: boolean): void;
    }
    
  2. Run npx brownfield navigation:codegen.

  3. 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 *.

Ngôn ngữ chính
TypeScript
Star
553
Fork
58
Merge trung bình
3 ngày 18 giờ
Pull request đã merge (30 ngày)
16

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. 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.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của callstack/react-native-brownfield

Tất cả issue của callstack/react-native-brownfield

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.