Title: build(firestore): stop zone-wrapping functions that schedule no work by armando-navarro · Pull Request #3842 · angular/angularfire · GitHub
Open Graph Title: build(firestore): stop zone-wrapping functions that schedule no work by armando-navarro · Pull Request #3842 · angular/angularfire
X Title: build(firestore): stop zone-wrapping functions that schedule no work by armando-navarro · Pull Request #3842 · angular/angularfire
Description: Checklist Issue number for this PR: #3841 Docs included?: in #3835, the docs PR for 22.0.0-rc.1. The commit there updates docs/zones.md. Test units included?: yes. src/firestore/unwrapped.spec.ts, new specs in src/firestore/lite/lite.spec.ts, shared helpers in src/firestore/zone-wrap-spec-support.ts. Breaking change?: no. In a clean directory, yarn install, yarn test run successfully?: yes, with npm: npm ci, then the build, lint and spec runs under Verification. Description Fixes #3841. Refs #3611, #3607. Twenty-five synchronous Firestore functions are re-exported without the zone wrapper, in @angular/fire/firestore and @angular/fire/firestore/lite. They only build or compare values, so the wrapper did nothing for them except print a false injection-context warning. The full list and the functions that stay wrapped are in #3841. Wrapping every function is a safeguard, in case a function that looks synchronous starts a timer inside the SDK. So this PR does not rely on reading the source alone: the new specs record every task each function schedules, on every CI run, against both firebase 12 and firebase 13. If one of these functions starts scheduling work, CI fails and says which one. Changes tools/build.ts: null entries in firestoreOverrides for the 25 functions. null makes the generator skip the wrapped re-export, so export * from 'firebase/firestore' hands out the SDK's own function. src/firestore/firebase.ts, src/firestore/lite/firebase.ts: regenerated. 25 wrapped exports removed from each, nothing added. src/firestore/zone-wrap-spec-support.ts: records the tasks a call schedules in a child zone, checks every unwrapped function with one sample call each, and checks that the set of functions AngularFire hands out unwrapped is exactly the listed set. src/firestore/unwrapped.spec.ts, src/firestore/lite/lite.spec.ts: run those checks for the full SDK (38 functions) and Lite (32), plus controls showing the recorder sees a timer, a promise callback, a late promise callback and an event listener, and that a still-wrapped function still warns. Behavior to know These functions no longer print the injection-context warning, at any log level. In a zone.js app, calling one inside an injection context but outside the Angular zone no longer triggers an extra unneeded change detection pass, which had nothing to update. ensureFirestoreConfigured and executeWrite, internal exports of firebase/firestore that its type declarations omit, were already re-exported unwrapped and are unchanged. Verification Build, ng lint, test:node (401 specs, 0 failures) pass. Chrome headless through firebase-tools emulators:exec: 185 of 233 executed, 48 skipped by pending(), all passing. With main's tools/build.ts and the new specs, 3 specs fail: both checks that the functions are the SDK's own, and the check that where does not warn.
Open Graph Description: Checklist Issue number for this PR: #3841 Docs included?: in #3835, the docs PR for 22.0.0-rc.1. The commit there updates docs/zones.md. Test units included?: yes. src/firestore/unwrapped.spec.ts,...
X Description: Checklist Issue number for this PR: #3841 Docs included?: in #3835, the docs PR for 22.0.0-rc.1. The commit there updates docs/zones.md. Test units included?: yes. src/firestore/unwrapped.spec.ts,...
Opengraph URL: https://github.com/angular/angularfire/pull/3842
X: @github
Domain: github.com
IPv4 address: 140.82.113.4
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:397fa361-84eb-dc55-fbf9-1f2d8de4646c |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | EB12:9286A:2B950D3:39C3F6E:6B0363C0 |
| html-safe-nonce | db085c913aff981f74e2bfacf99049d27a89088dee5e99802434f89c39647191 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFQjEyOjkyODZBOjJCOTUwRDM6MzlDM0Y2RTo2QjAzNjNDMCIsInZpc2l0b3JfaWQiOiIzMTE1MzQ4Mjc1NDU1MTkwNDEiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | ef51d0417785b3d30ebe6fcbd3cd14d0af3b03e7dcdc40c4fd4eb3e74554e695 |
| hovercard-subject-tag | pull_request:5196988414 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/angular/angularfire/pull/3842/files |
| twitter:image | https://avatars.githubusercontent.com/u/13904589?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/13904589?s=400&v=4 |
| og:image:alt | Checklist Issue number for this PR: #3841 Docs included?: in #3835, the docs PR for 22.0.0-rc.1. The commit there updates docs/zones.md. Test units included?: yes. src/firestore/unwrapped.spec.ts,... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456 |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/angular/angularfire git https://github.com/angular/angularfire.git |
| octolytics-dimension-user_id | 139426 |
| octolytics-dimension-user_login | angular |
| octolytics-dimension-repository_id | 49453413 |
| octolytics-dimension-repository_nwo | angular/angularfire |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 49453413 |
| octolytics-dimension-repository_network_root_nwo | angular/angularfire |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 423dbb54c5e7bfecc838eb387c1435eb3d0e760d |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | no-cache |
Viewport: width=device-width