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

Aberta
#518 0 comentários 0 reações 0 responsáveis Ver no GitHub

Mantenedores costumam responder em até 3 dias

@RaphaelFakhri já está trabalhando nisso.

Desde 5/11/2026.

  • #519 de @RaphaelFakhri — aberto

Avaliação

Dificuldade
3/5
Tempo estimado
1-2 dias
Facilidade para iniciantes
45/100
Tipo de issue
Bug
Clareza
Claramente especificada
Status de atividade
Estagnada
Stack de tecnologia
react-native, swift, typescript
Domínio
build-system, mobile

Direção de pesquisa

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.

Escrita pelo modelo de indexação a partir do texto da issue.

Descrição

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

Linguagem predominante
TypeScript
Estrelas
553
Forks
58
Merge médio
3d 18h
PRs com merge (30d)
16

Preparar o ambiente

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Mais de callstack/react-native-brownfield

Todas as issues de callstack/react-native-brownfield

Issues semelhantes

Mais issues de TypeScript

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.