chore: forward-integrate main into v5 - #758
Conversation
…baseExtended#757) * fix: defer eager requests in storage, auth, and functions hooks useStorageDownloadURL, useIdTokenResult, and useCallableFunctionResponse built their request in the render body, so a discarded request fired on every render (and, for a missing storage object, an unhandled promise rejection). Wrap each in rxjs `defer` so the request is created lazily on subscription. useObservable subscribes once per observableId, so the request now runs once instead of once per render. Adds a regression test for useIdTokenResult confirming the deferred factory runs exactly once across re-renders (4 calls without the wrapper). Closes FirebaseExtended#743, FirebaseExtended#744. * docs: regenerate reference docs for defer import line shifts * test: add call-count regression test for useCallableFunctionResponse Mirrors the useIdTokenResult defer test: asserts the underlying callable is invoked once across re-renders. Addresses Armando's non-blocking follow-up on FirebaseExtended#757. * fix: preserve httpsCallable generics on mocked implementation getMockImplementation() erases the generic signature, breaking the explicit type arguments on originalImpl<...>() under strict mode. Cast to typeof httpsCallable to keep it. Failed Type check (React 18/19) in CI, tsconfig.json alone doesn't cover test/.
|
Caution The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased. |
…irebaseExtended#760) Bundling use-sync-external-store/shim (a CJS module) into the ESM dist makes rolldown emit a dynamic require() that throws "dynamic usage of require is not supported" when a reactfire data hook loads client-side in a Next.js App Router (strict ESM) context. This regression shipped in 4.2.4 and 4.2.5; 4.2.3 predates the current build toolchain and is clean. Externalizing the shim lets the consumer's bundler resolve it (it is already a runtime dependency), removing the require from our dist while keeping the shim's React 16/17 fallback. Verified the throw path is absent from the built ESM dist and from a rebuilt Next.js App Router client chunk.
armando-navarro
left a comment
There was a problem hiding this comment.
Thanks Tyler. I verified this is a clean forward-integration: the single commit here is the squash-merge of #757 (its parent is the current v5 tip), so merging fast-forwards v5 by exactly that one already-reviewed, already-shipped commit, with no conflicts and nothing extra.
I also re-checked the functions.test.tsx you added after my #757 approval (it addresses the functions-hook coverage I'd asked about): it passes, and reverting the defer makes it fail with four calls, so it's a real regression tripwire.
Two non-blocking notes:
mainhas moved two commits past this branch since it was cut, so this brings v5 up to #757 but not to main's current tip.- In particular it leaves out #760 (now tagged v4.2.6) and the version bump. Since v5 is still a strict ancestor of main, you could re-point this PR at main's current tip and fast-forward the whole way, folding #760 and the bump into one integration instead of needing a second sync right after.
- If stopping at #757 is deliberate, a note in the description would make that clear.
- The only failing check here is Publish (NPM); every functional check (build, both Node versions, both React type-checks) is green. Could you confirm that's the known publish flakiness rather than a new break?
Approving the integration.
Bumps [rollup](https://github.com/rollup/rollup) from 2.79.1 to 2.80.0. - [Release notes](https://github.com/rollup/rollup/releases) - [Changelog](https://github.com/rollup/rollup/blob/v2.80.0/CHANGELOG.md) - [Commits](rollup/rollup@v2.79.1...v2.80.0) --- updated-dependencies: - dependency-name: rollup dependency-version: 2.80.0 dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [jws](https://github.com/brianloveswords/node-jws) from 3.2.2 to 3.2.3. - [Release notes](https://github.com/brianloveswords/node-jws/releases) - [Changelog](https://github.com/auth0/node-jws/blob/master/CHANGELOG.md) - [Commits](auth0/node-jws@v3.2.2...v3.2.3) --- updated-dependencies: - dependency-name: jws dependency-version: 3.2.3 dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [braces](https://github.com/micromatch/braces) from 3.0.2 to 3.0.3. - [Changelog](https://github.com/micromatch/braces/blob/master/CHANGELOG.md) - [Commits](micromatch/braces@3.0.2...3.0.3) --- updated-dependencies: - dependency-name: braces dependency-version: 3.0.3 dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [postcss](https://github.com/postcss/postcss) from 8.5.16 to 8.5.23. - [Release notes](https://github.com/postcss/postcss/releases) - [Changelog](https://github.com/postcss/postcss/blob/main/CHANGELOG.md) - [Commits](postcss/postcss@8.5.16...8.5.23) --- updated-dependencies: - dependency-name: postcss dependency-version: 8.5.23 dependency-type: direct:development ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
|
Plan for this integration: going with Armando's suggestion to re-point at main's current tip rather than stopping at #757. Since v5 is still a strict ancestor of main, this stays a clean fast-forward (no conflicts). Re-pointing now folds in everything that has landed since this branch was cut: #757, #760, the 4.2.6 version bump, and the four Dependabot lockfile bumps (#761-764). Holding the re-point until Monday so we also capture anything that lands over the weekend and avoid a second sync right after. Re-pointing will move the head off the commit Armando approved, so it will need a fresh review (should be quick given it is a clean fast-forward). |
|
@armando-navarro heads up: I re-pointed and merged this while you're out, so the head moved off the commit you approved. Flagging exactly what changed in case you want to look when you're back. Your approval was on
Rationale for folding them in rather than stopping at #757: CI was green on the new head (build, tests on Node 22 and 24, type check on React 18 and 19, CodeQL, CLA). The one red on the commit is Merged as a merge commit ( No action needed from you. If anything here looks off, say so and I'll follow up. This also unblocks #735: the temporary storage |
Resolves conflicts from the FirebaseExtended#758 forward-integration: - src/storage.tsx: took v5's version. FirebaseExtended#735's temporary defer hunk and FirebaseExtended#757's defer fix are the same change, so FirebaseExtended#735's copy dissolves here as planned. Kept FirebaseExtended#757's explanatory comment. - docs/reference/functions/StorageImage.md and docs/reference/type-aliases/StorageImageProps.md: line-number churn only in generated "Defined in" links. Took v5's numbers, verified against the merged source (StorageImage L82, StorageImageProps L40).
Forward-integrates main into v5 (fast-forward, no conflicts) to bring in #757 (defer eager requests in storage/auth/functions hooks).
This lets #735's temporary storage
deferhunk dissolve on its next rebase, since that hunk was only kept to unblock the storage error test until #757 landed.No new changes beyond what's already on main: docs regen, src defer wraps in auth.tsx/functions.tsx/storage.tsx, and their tests. tsc (src + test configs) and the functions/auth emulator suites pass locally on Node 22.