Skip to content

ci: update AI package workflow to use compare script#8942

Merged
russellwheatley merged 13 commits intomainfrom
ai-package-compare-types
Mar 31, 2026
Merged

ci: update AI package workflow to use compare script#8942
russellwheatley merged 13 commits intomainfrom
ai-package-compare-types

Conversation

@russellwheatley
Copy link
Copy Markdown
Member

@russellwheatley russellwheatley commented Mar 27, 2026

Description

Summary

  • Added AI package coverage to the compare-types workflow by registering ai, adding the ai-sdk.d.ts snapshot, and creating an AI-specific config.ts.
  • Improved the compare script so it handles enums and enum-like SDK constant objects correctly, and filters out private/internal API noise when comparing public types.
  • Documented the known AI package differences in config.ts and removed stale config entries uncovered by the parser fixes.
  • Removed the AI Cursor rule markdown files from this repo because that guidance has been moved to the private skill repository.

Why

  • This makes AI API drift detectable in CI without needing a local firebase-js-sdk checkout, so new web SDK features or type changes are easier to spot and evaluate for RNFB parity.
  • The compare script changes were needed because AI exposes enum-heavy types and generated declarations include private/internal members that previously produced misleading false positives.
  • Populating the AI config and removing stale entries makes the compare output actionable: only real, intentional public API differences remain documented.
  • Moving the AI rules out of this repo keeps the public branch focused on the compare-types workflow while retaining the porting guidance in the private skill system.

Related issues

Release Summary

Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
    • Yes
  • My change supports the following platforms;
    • Android
    • iOS
    • Other (macOS, web)
  • My change includes tests;
    • e2e tests added or updated in packages/\*\*/e2e
    • jest tests added or updated in packages/\*\*/__tests__
  • I have updated TypeScript types that are affected by my change.
  • This is a breaking change;
    • Yes
    • No

Test Plan


Think react-native-firebase is great? Please consider supporting the project with any of the below:

@vercel
Copy link
Copy Markdown

vercel bot commented Mar 27, 2026

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

Project Deployment Actions Updated (UTC)
react-native-firebase Error Error Mar 27, 2026 4:17pm

Request Review

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request integrates the AI package into the automated type comparison suite, ensuring that public API differences between the React Native Firebase implementation and the Firebase JS SDK are tracked and documented. To support this, the comparison script was enhanced to handle TypeScript enums, including logic to compare enums against equivalent 'enum-like' variable declarations. Additionally, several internal documentation files regarding the porting workflow were removed in favor of the new configuration-driven approach. I have no feedback to provide as there are no review comments.

@russellwheatley russellwheatley marked this pull request as ready for review March 27, 2026 16:20
@mikehardy
Copy link
Copy Markdown
Collaborator

kicked off android CI again, appeared to be a flake, rerun will provide another data point

macOS failure is #8947 - unrelated, non-blocking but at least a local test with this PR rebased after 8947 goes in would be good since the AI package makes heavy use of firebase-js-sdk which exposes problems between pure-web and web-APIs-in-react-native-execution context which macOS / Other platform probes well

Copy link
Copy Markdown
Collaborator

@mikehardy mikehardy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks amazing, my comments are "thinking out loud" only, nothing to stop the merge here

Comment on lines +50 to +52
name: 'OnDeviceParams',
reason:
'On-device inference params are only used by the browser Chrome adapter / hybrid flow, which is not supported in React Native.',
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was curious about this assertion (I'm aware of firebase-ml, and some native / on-device SDK work in the google AI area and was sure they had something ?) and sure enough there is stuff for Android:

https://firebase.google.com/docs/ai-logic/hybrid/android/get-started?api=dev

On-device inference only supports single-turn text generation (not chat), with streaming or non-streaming output. It supports the following text-generation capabilities:

Generating text from text-only input

Generating text from text-and-image input, specifically a single Bitmap image as input

Something to think about as enabling-via-bindings this sort of native integration is the reason react-native-firebase exists vs pure firebase-js-sdk

InterfaceShape,
TypeAliasShape,
VariableShape,
EnumShape,
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Happy to see this - was one of the few things that seemed low signal-to-noise

@mikehardy mikehardy added the Workflow: Pending Merge Waiting on CI or similar label Mar 31, 2026
@russellwheatley russellwheatley merged commit 47208f0 into main Mar 31, 2026
26 of 32 checks passed
@russellwheatley russellwheatley deleted the ai-package-compare-types branch March 31, 2026 15:49
@mikehardy mikehardy removed the Workflow: Pending Merge Waiting on CI or similar label Mar 31, 2026
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.

2 participants