Repository navigation
feat(app, sdk): bump Firebase JS SDK to 13.4.0 - #9532
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #9532 +/- ##
============================================
+ Coverage 75.52% 75.76% +0.25%
Complexity 2361 2361
============================================
Files 633 637 +4
Lines 42025 42406 +381
Branches 5287 5312 +25
============================================
+ Hits 31736 32126 +390
+ Misses 8718 8717 -1
+ Partials 1571 1563 -8
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
russellwheatley
left a comment
There was a problem hiding this comment.
Couple of things before this goes in, mainly a guard so the firebase pins can't drift apart again. Also iOS (debug, 0) was cancelled in Pre-Boot Simulator before any tests ran, so that just needs a re-run.
|
|
||
| import type { PackageConfig } from '../src/types'; | ||
|
|
||
| const WINDOW_FUNCTIONS = |
There was a problem hiding this comment.
I think these version labels are off. 13.4.0 pulls the same @firebase/firestore@4.20.0 and @firebase/ai@3.1.0 as 13.3.0, so nothing documented here is new in 13.4. From the published d.ts files, the DML stages, literals() and atomic landed in 13.1.0 (firestore 4.19.0), and window functions plus the AI SpeechMetadata / ALREADY_INITIALIZED changes landed in 13.3.0 (firestore 4.20.0, ai 3.1.0). They only surface now because root firebase was still on 13.0.0 after the last two bumps. Might be simplest to drop the version from these strings ("firebase-js-sdk added ...") rather than correct each one. Same for line 80, the commit body and the PR description.
There was a problem hiding this comment.
Dropped the version from every reason string, and fixed the commit body and PR description to match.
| "eslint-plugin-prettier": "^5.5.5", | ||
| "eslint-plugin-react": "^7.37.5", | ||
| "firebase": "13.0.0", | ||
| "firebase": "13.4.0", |
There was a problem hiding this comment.
The 13.1.0 and 13.3.0 bumps only moved packages/app, so compare-types (which reads root node_modules/firebase) was checking against 13.0.0 for two releases without anyone noticing. Can we add a simple check so these stay in sync? Something at the top of main() in .github/scripts/compare-types/src/index.ts would do, since that already runs in CI:
const pins = ['package.json', 'packages/app/package.json', 'tests/package.json', 'tests-macos/package.json'].map(
f => {
const pkg = JSON.parse(fs.readFileSync(path.join(repoRoot, f), 'utf8'));
return [f, pkg.dependencies?.firebase ?? pkg.devDependencies?.firebase] as const;
},
);
if (new Set(pins.map(([, v]) => v)).size !== 1) {
console.error('\n❌ firebase versions out of sync:', Object.fromEntries(pins));
process.exit(1);
}Doesn't need to be that exactly, a standalone script wired into lint would be fine too.
There was a problem hiding this comment.
Added checkFirebasePinsInSync() at the top of main() in src/index.ts, close to your snippet. REPO_ROOT is now exported from registry.ts. Checked it by setting tests-macos back to 13.0.0: it prints the version map and exits 1.
| reason: | ||
| 'firebase-js-sdk adds `ALREADY_INITIALIZED` for getAI() calls that conflict with a cached ' + | ||
| 'AI instance. RN Firebase getAI() does not cache instances, so it never raises this code. ' + | ||
| 'The JS SDK also declares a readonly object while RN uses an enum.', |
There was a problem hiding this comment.
can drop this last sentence. compare-types already treats the readonly object and the enum as equivalent (enumLikeVariableShape in compare.ts), which is why AIErrorCode wasn't listed before. The only real difference is ALREADY_INITIALIZED.
There was a problem hiding this comment.
Dropped it, thanks.
Move firebase to 13.4.0 in packages/app, the root and the test apps. The 13.1.0 and 13.3.0 bumps only moved packages/app, so compare-types kept reading firebase 13.0.0 from the root. Document the public API it now sees: AI multi-speaker speech metadata and the ALREADY_INITIALIZED error code, and Firestore pipelines window functions, DML stages and the literals() source. compare-types now fails when the firebase pins in the root, packages/app, tests and tests-macos package.json files differ.
63b8421 to
2a12d26
Compare
Bumps the Firebase JS SDK to 13.4.0 (
packages/appdependency, root,tests/andtests-macos/).The 13.1.0 and 13.3.0 bumps only moved
packages/app. Compare-types reads the rootnode_modules/firebase, so it kept checking against 13.0.0. Moving the root pin brings in the public API that landed in 13.1.0 and 13.3.0. This PR documents it in the compare-types configs and leaves the implementation for later.configs/ai.tsSpeechMetadata(missing) andTextPart.speechMetadata(different shape): multi-speaker TTS hints. RN Firebase AI has no multi-speaker TTS path.AIErrorCode(different shape): newALREADY_INITIALIZEDforgetAI()calls that conflict with a cached instance. RNgetAI()does not cache instances, so it never raises this code.configs/firestore-pipelines.tsrank,WindowFunction,AliasedWindowFunction,WindowSpec,DocumentWindowFrame,RangeWindowFrame,AddWindowFieldsStageOptions, plus'WindowFunction'inExpressionType.InsertStageOptions,UpdateStageOptions,UpsertStageOptions,DeleteStageOptions, plusatomiconPipelineExecuteOptions.LiteralsStageOptions: theliterals()pipeline source.Pin guard
compare-typesnow exits 1 before comparing if thefirebaseversions in the root,packages/app,testsandtests-macospackage.jsonfiles differ.Once this lands, the
firebasepart of the Dependabot npm-minor-patch group is already onmain, which leaves #9450 with onlyweb-streams-polyfilland@expo/plist.Validation
yarnexits 0.yarn compare:typespasses, with every package documented.tests-macosback to 13.0.0 makescompare-typesexit 1 with the version map.yarn lint:js,yarn tsc:compileand Prettier on the changed lines pass.