Skip to content

feat(nitrogen): require static and initializer implementation contracts - #1854

Merged
mrousavy merged 2 commits into
v1from
mrousavy/v1-static-implementation-contracts
Oct 21, 2026
Merged

mrousavy merged 2 commits into
v1from
mrousavy/v1-static-implementation-contracts

Conversation

@mrousavy

@mrousavy mrousavy commented Oct 20, 2026 •

Copy link
Copy Markdown
Member

Generated Swift protocols require the spec's initializers, static methods, and static properties. Non-final implementations declare required initializers, and derived implementations satisfy inherited static requirements.

Kotlin specs always expose a nested Companion interface. Implementations with static members must conform; generated factories check constructors separately. JNI calls the generated @JvmStatic entry points directly. The generated Bridge companion is protected so subclasses retain access to TAG.

Empty sections stay visible in the Swift protocol and Kotlin companion-interface templates. Updates the implementations, examples, and generated output.

Validation:

  • Regenerated standalone and React Native specs; Nitrogen typecheck, ESLint, and formatting checks pass.
  • Standalone and React Native Kotlin source sets compile. Kotlin compiler probes cover empty interfaces, optional implementation configuration, companion conformance, static members, and bridge visibility across modules.
  • Swift compiler probes cover required initializers, static members, inheritance, and missing implementations. All 13 generated Swift protocols have the requested sections, including empty ones.

@vercel

vercel Bot commented Oct 20, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
nitro-docs Ready Ready Preview Oct 21, 2026 10:26am UTC

Request Review

Comment thread packages/nitrogen/src/syntax/kotlin/KotlinHybridObject.ts Outdated
Comment thread packages/nitrogen/src/syntax/kotlin/KotlinHybridObject.ts Outdated
Comment thread docs/docs/concepts/nitrogen.md Outdated
Comment thread packages/nitrogen/src/syntax/kotlin/KotlinHybridObject.ts Outdated
Comment thread packages/nitrogen/src/syntax/kotlin/KotlinHybridObject.ts
Comment thread packages/nitrogen/src/syntax/swift/SwiftHybridObject.ts Outdated
@mrousavy
mrousavy merged commit 42d7f2b into v1 Oct 21, 2026
21 of 24 checks passed

This branch was successfully deployed

1 active deployment
Preview — 50fc3464 Deployed Oct 21, 2026 by vercel[bot]
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.

1 participant