Skip to content

fix(nitrogen): qualify iOS bridge headers - #1531

Open
huytdps13400 wants to merge 1 commit into
margelo:mainfrom
huytdps13400:fix/1293-ios-header-collisions
Open

fix(nitrogen): qualify iOS bridge headers#1531
huytdps13400 wants to merge 1 commit into
margelo:mainfrom
huytdps13400:fix/1293-ios-header-collisions

Conversation

@huytdps13400

Copy link
Copy Markdown

Summary

  • emit module-qualified framework includes for module-local shared C++ headers used by generated iOS bridges
  • preserve existing system/external imports and quoted private Swift-bridge imports
  • keep the previous local-before-system ordering so this change does not alter transitive include behavior
  • regenerate the checked-in NitroTest and NitroTestExternal iOS fixtures

Root cause

Nitrogen emitted shared types such as Orientation.hpp as quoted includes. With static frameworks, identically named public headers from multiple Nitro modules can be copied into separate framework header namespaces, while an unqualified include remains ambiguous and may resolve to the wrong module.

The iOS bridge headers now emit <IosModule/Header.hpp>, so CocoaPods resolves each type through the owning module.

Regression coverage

The existing NitroTest specs already exercise local structs, enums, HybridObject specs, and a second external Nitro module. Their checked-in generated output now contains 82 module-qualified local includes. bun specs is the golden regression: reverting the generator changes these fixtures and fails the CI regeneration check.

Verification

  • bun specs
  • bun run build
  • bun typecheck
  • all five JS/TS lint-ci package checks
  • bun nitro-test test --runInBand
  • Xcode 26.6 iOS example build with USE_FRAMEWORKS=static: BUILD SUCCEEDED
  • Xcode 26.6 iOS example build without frameworks: BUILD SUCCEEDED
  • generated-output sweep: no iOS header uses a quoted include for a module-local generated/shared/c++ header
  • git diff --check

Fixes #1293

@vercel

vercel Bot commented Aug 26, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
nitro-docs Skipped Skipped Aug 26, 2026 7:22am

Request Review

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Nitrogen iOS bridge headers use quoted includes for shared C++ types — collides when two Nitro modules share a header filename

1 participant