Skip to content

Commit 5f28ae4

Browse files
Merge branch 'main' into patch-1
2 parents 1896570 + 3b57346 commit 5f28ae4

410 files changed

Lines changed: 43586 additions & 57234 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.github/workflows/codeql-analysis.yml‎

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ jobs:
2424
analyze:
2525
name: Analyze
2626
runs-on: ubuntu-latest
27+
permissions:
28+
actions: read
29+
contents: read
30+
security-events: write
2731

2832
strategy:
2933
fail-fast: false
@@ -35,11 +39,13 @@ jobs:
3539

3640
steps:
3741
- name: Checkout repository
38-
uses: actions/checkout@v2
42+
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
43+
with:
44+
persist-credentials: false
3945

4046
# Initializes the CodeQL tools for scanning.
4147
- name: Initialize CodeQL
42-
uses: github/codeql-action/init@v2
48+
uses: github/codeql-action/init@54f647b7e1bb85c95cddabcd46b0c578ec92bc1a # v4.36.3
4349
with:
4450
languages: ${{ matrix.language }}
4551
# If you wish to specify custom queries, you can do so here or in a config file.
@@ -50,7 +56,7 @@ jobs:
5056
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
5157
# If this step fails, then you should remove it and run the build manually (see below)
5258
- name: Autobuild
53-
uses: github/codeql-action/autobuild@v2
59+
uses: github/codeql-action/autobuild@54f647b7e1bb85c95cddabcd46b0c578ec92bc1a # v4.36.3
5460

5561
# ℹ️ Command-line programs to run using the OS shell.
5662
# 📚 https://git.io/JvXDl
@@ -64,4 +70,4 @@ jobs:
6470
# make release
6571

6672
- name: Perform CodeQL Analysis
67-
uses: github/codeql-action/analyze@v2
73+
uses: github/codeql-action/analyze@54f647b7e1bb85c95cddabcd46b0c578ec92bc1a # v4.36.3

‎.github/workflows/test.yml‎

Lines changed: 44 additions & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -15,39 +15,29 @@ on:
1515
schedule:
1616
- cron: 0 0 * * 1-5
1717

18+
permissions:
19+
contents: read
20+
1821
jobs:
1922
build:
2023
runs-on: ubuntu-latest
2124
name: Build
2225
steps:
2326
- name: Checkout
24-
uses: actions/checkout@v3
27+
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
28+
with:
29+
persist-credentials: false
2530
- name: Setup node
26-
uses: actions/setup-node@v3
31+
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
2732
with:
28-
node-version: '18'
33+
node-version: '20'
2934
check-latest: false
30-
- name: angular build cache
31-
uses: actions/cache@v3
32-
with:
33-
path: ./.angular
34-
key: angular-cache
35-
- name: node_modules cache
36-
uses: actions/cache@v3
37-
id: node_modules_cache
38-
with:
39-
path: ./node_modules
40-
key: ${{ runner.os }}-18-${{ hashFiles('package-lock.json') }}
41-
restore-keys: |
42-
${{ runner.os }}-18-
4335
- name: Install deps
44-
if: steps.node_modules_cache.outputs.cache-hit != 'true'
45-
run: |
46-
npm ci
36+
run: npm ci
4737
- name: Build
4838
run: ./tools/build.sh
4939
- name: 'Upload Artifact'
50-
uses: actions/upload-artifact@v3
40+
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
5141
with:
5242
name: angularfire-${{ github.run_id }}
5343
path: dist
@@ -59,32 +49,26 @@ jobs:
5949
strategy:
6050
matrix:
6151
os: [ ubuntu-latest, macos-latest, windows-latest ]
62-
node: ["18", "20"]
52+
node: ["20", "22", "24"]
6353
fail-fast: false
6454
name: Test Node ${{ matrix.node }} (${{ matrix.os }})
6555
steps:
6656
- name: Checkout
67-
uses: actions/checkout@v3
57+
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
58+
with:
59+
persist-credentials: false
6860
- name: Setup node
69-
uses: actions/setup-node@v3
61+
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
7062
with:
7163
node-version: ${{ matrix.node }}
7264
check-latest: true
73-
- name: node_modules cache
74-
id: node_modules_cache
75-
uses: actions/cache@v3
76-
with:
77-
path: ./node_modules
78-
key: ${{ runner.os }}-${{ matrix.node }}-${{ hashFiles('package-lock.json') }}
79-
restore-keys: |
80-
${{ runner.os }}-${{ matrix.node }}-
8165
- name: Install deps
82-
if: steps.node_modules_cache.outputs.cache-hit != 'true'
8366
run: npm ci
8467
- name: Download Artifacts
85-
uses: actions/download-artifact@v3
86-
- name: Relocate Artifacts
87-
run: mv angularfire-${{ github.run_id }} dist
68+
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
69+
with:
70+
name: angularfire-${{ github.run_id }}
71+
path: dist
8872
- name: Test Node
8973
run: |
9074
npm run build:jasmine
@@ -105,37 +89,26 @@ jobs:
10589
fail-fast: false
10690
steps:
10791
- name: Checkout
108-
uses: actions/checkout@v3
92+
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
93+
with:
94+
persist-credentials: false
10995
- name: Setup node
110-
uses: actions/setup-node@v3
96+
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
11197
with:
112-
node-version: 18
98+
node-version: 20
11399
check-latest: false
114100
- name: Setup java
115-
uses: actions/setup-java@v3
101+
uses: actions/setup-java@1bcf9fb12cf4aa7d266a90ae39939e61372fe520 # v5.4.0
116102
with:
117103
distribution: 'temurin'
118-
java-version: '11'
119-
- name: node_modules cache
120-
id: node_modules_cache
121-
uses: actions/cache@v3
122-
with:
123-
path: ./node_modules
124-
key: ${{ runner.os }}-${{ matrix.node }}-${{ hashFiles('package-lock.json') }}
125-
restore-keys: |
126-
${{ runner.os }}-${{ matrix.node }}-
104+
java-version: '21'
127105
- name: Install deps
128-
if: steps.node_modules_cache.outputs.cache-hit != 'true'
129106
run: npm ci
130-
- name: Firebase emulator cache
131-
uses: actions/cache@v3
132-
with:
133-
path: ~/.cache/firebase/emulators
134-
key: firebase_emulators
135107
- name: Download Artifacts
136-
uses: actions/download-artifact@v3
137-
- name: Relocate Artifacts
138-
run: mv angularfire-${{ github.run_id }} dist
108+
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
109+
with:
110+
name: angularfire-${{ github.run_id }}
111+
path: dist
139112
- name: Test browser
140113
run: npm run test:${{ matrix.browser }}
141114

@@ -145,26 +118,19 @@ jobs:
145118
strategy:
146119
matrix:
147120
os: [ ubuntu-latest, macos-latest, windows-latest ]
148-
node: ["18"]
121+
node: ["20"]
149122
fail-fast: false
150123
steps:
151124
- name: Checkout
152-
uses: actions/checkout@v3
125+
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
126+
with:
127+
persist-credentials: false
153128
- name: Setup node
154-
uses: actions/setup-node@v3
129+
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
155130
with:
156131
node-version: ${{ matrix.node }}
157132
check-latest: true
158-
- name: node_modules cache
159-
uses: actions/cache@v3
160-
id: node_modules_cache
161-
with:
162-
path: ./node_modules
163-
key: ${{ runner.os }}-${{ matrix.node }}-${{ hashFiles('package-lock.json') }}
164-
restore-keys: |
165-
${{ runner.os }}-${{ matrix.node }}-
166133
- name: Install deps
167-
if: steps.node_modules_cache.outputs.cache-hit != 'true'
168134
run: npm ci
169135
#- name: Lint
170136
# run: npm run lint
@@ -174,16 +140,11 @@ jobs:
174140
run: |
175141
npm run build:jasmine
176142
npm run test:node
177-
- name: Firebase emulator cache
178-
uses: actions/cache@v3
179-
with:
180-
path: ~/.cache/firebase/emulators
181-
key: firebase_emulators
182143
- name: Setup java
183-
uses: actions/setup-java@v3
144+
uses: actions/setup-java@1bcf9fb12cf4aa7d266a90ae39939e61372fe520 # v5.4.0
184145
with:
185146
distribution: 'temurin'
186-
java-version: '11'
147+
java-version: '21'
187148
- name: Test headless
188149
run: npm run test:chrome-headless
189150
# Tests are flaky on Windows
@@ -204,16 +165,19 @@ jobs:
204165
if: ${{ github.ref == 'refs/heads/main' || github.event_name == 'release' }}
205166
steps:
206167
- name: Setup node
207-
uses: actions/setup-node@v3
168+
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
208169
with:
209-
node-version: '18'
170+
node-version: '20'
210171
registry-url: 'https://registry.npmjs.org'
211172
check-latest: false
212173
- name: 'Download Artifacts'
213-
uses: actions/download-artifact@v3
174+
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
175+
with:
176+
name: angularfire-${{ github.run_id }}
177+
path: dist
214178
- name: Publish
215179
run: |
216-
cd ./angularfire-${{ github.run_id }}/packages-dist
180+
cd ./dist/packages-dist
217181
chmod +x publish.sh
218182
./publish.sh
219183
env:

‎README.md‎

Lines changed: 12 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ export const appConfig: ApplicationConfig = {
3333
```
3434

3535
```ts
36+
import { AsyncPipe } from '@angular/common';
3637
import { inject } from '@angular/core';
3738
import { Firestore, collectionData, collection } from '@angular/fire/firestore';
38-
import { Observable } from 'rxjs';
3939

4040
interface Item {
4141
name: string,
@@ -44,39 +44,24 @@ interface Item {
4444

4545
@Component({
4646
selector: 'app-root',
47-
standalone: true,
4847
template: `
4948
<ul>
50-
@for (item of (item$ | async); track item) {
49+
@for (item of (items$ | async); track item) {
5150
<li>
5251
{{ item.name }}
5352
</li>
5453
}
5554
</ul>
56-
`
55+
`,
56+
imports: [AsyncPipe]
5757
})
5858
export class AppComponent {
59-
item$: Observable<Item[]>;
60-
firestore: Firestore = inject(Firestore);
61-
62-
constructor() {
63-
const itemCollection = collection(this.firestore, 'items');
64-
this.item$ = collectionData<Item>(itemCollection);
65-
}
59+
firestore = inject(Firestore);
60+
itemCollection = collection(this.firestore, 'items');
61+
items$ = collectionData<Item>(this.itemCollection);
6662
}
6763
```
6864

69-
### Polyfills
70-
71-
Neither AngularFire nor Firebase ship with polyfills. To have compatibility across a wide-range of environments, we suggest the following polyfills be added to your application:
72-
73-
| API | Environments | Suggested Polyfill | License |
74-
|-----|--------------|--------------------|---------|
75-
| Various ES5+ features | Safari &lt; 10 | [`core-js/stable`](https://github.com/zloirock/core-js#readme) | MIT |
76-
| `globalThis` | [Chrome &lt; 71<br>Safari &lt; 12.1<br>iOS &lt; 12.2<br>Node &lt; 12](https://caniuse.com/mdn-javascript_builtins_globalthis) | [`globalThis`](https://github.com/es-shims/globalThis#readme) | MIT |
77-
| `Proxy` | [Safari &lt; 10](https://caniuse.com/proxy) | [`proxy-polyfill`](https://github.com/GoogleChrome/proxy-polyfill#readme) | Apache 2.0 |
78-
| `fetch` | [Safari &lt; 10.1<br>iOS &lt; 10.3](https://caniuse.com/fetch) | [`cross-fetch`](https://github.com/lquixada/cross-fetch#readme) | MIT |
79-
8065
## Resources
8166

8267
[Quickstart](docs/install-and-setup.md) - Get your first application up and running by following our quickstart guide.
@@ -85,15 +70,11 @@ Neither AngularFire nor Firebase ship with polyfills. To have compatibility acro
8570

8671
[Stackblitz Template](https://stackblitz.com/edit/angular-fire-start) - Remember to set your Firebase configuration in `app/app.module.ts`.
8772

88-
[Upgrading to v7.0? Check out our guide.](docs/version-7-upgrade.md)
89-
90-
### Sample apps
73+
[Upgrading from v6.0? Check out our guide.](docs/version-7-upgrade.md)
9174

92-
We have three sample apps in this repository:
75+
### Sample app
9376

94-
1. [`samples/compat`](samples/compat) a kitchen sink application that demonstrates use of the "compatibility" API
95-
1. [`samples/modular`](samples/modular) a kitchen sink application that demonstrates the new tree-shakable API
96-
1. [`samples/advanced`](samples/advanced) the same app as `samples/modular` but demonstrates more advanced concepts such as Angular Universal state-transfer, dynamically importing Firebase feature modules, and Firestore data bundling.
77+
The [`sample`](sample) folder contains a kitchen sink application that demonstrates use of the "modular" API, in a zoneless server-rendered application, with all the bells and whistles.
9778

9879
### Having troubles?
9980

@@ -193,9 +174,9 @@ import { } from '@angular/fire/app-check';
193174
<tr>
194175
<td>
195176

196-
#### [Vertex AI](docs/vertexai.md#vertex-ai-preview)
177+
#### [Vertex AI](docs/vertexai.md#vertex-ai)
197178
```ts
198-
import { } from '@angular/fire/vertexai-preview';
179+
import { } from '@angular/fire/vertexai';
199180
```
200181
</td>
201182

‎docs/auth.md‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ import { Auth, User, user } from '@angular/fire/auth';
106106

107107
export class UserComponent implements OnDestroy {
108108
private auth: Auth = inject(Auth);
109-
user$ = user(auth);
109+
user$ = user(this.auth);
110110
userSubscription: Subscription;
111111
...
112112

@@ -136,7 +136,7 @@ import { Auth, authState } from '@angular/fire/auth';
136136

137137
export class UserComponent implements OnDestroy {
138138
private auth: Auth = inject(Auth);
139-
authState$ = authState(auth);
139+
authState$ = authState(this.auth);
140140
authStateSubscription: Subscription;
141141
...
142142

@@ -165,7 +165,7 @@ import { Auth, idToken } from '@angular/fire/auth';
165165

166166
export class UserComponent implements OnDestroy {
167167
private auth: Auth = inject(Auth);
168-
idToken$ = idToken(auth);
168+
idToken$ = idToken(this.auth);
169169
idTokenSubscription: Subscription;
170170
...
171171

0 commit comments

Comments
 (0)