Skip to content

Commit 1302e3a

Browse files
authored
v17.1.0 (#3524)
* Preview note in README * Bump version * Deprecation note on legacy ng-deploy * Add vertexai wrapper * Drop ng-deploy setup from ng-add * Start moving docs towards standalone
1 parent 05e9da2 commit 1302e3a

20 files changed

+534
-1226
lines changed

README.md

+12-15
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,17 @@ by conforming to Angular conventions.
1919
## Example use
2020

2121
```ts
22-
import { provideFirebaseApp, getApp, initializeApp } from '@angular/fire/app';
22+
import { provideFirebaseApp, initializeApp } from '@angular/fire/app';
2323
import { getFirestore, provideFirestore } from '@angular/fire/firestore';
2424

25-
@NgModule({
26-
imports: [
25+
export const appConfig: ApplicationConfig = {
26+
providers: [
2727
provideFirebaseApp(() => initializeApp({ ... })),
2828
provideFirestore(() => getFirestore()),
29+
...
2930
],
3031
...
3132
})
32-
export class AppModule { }
3333
```
3434

3535
```ts
@@ -44,11 +44,14 @@ interface Item {
4444

4545
@Component({
4646
selector: 'app-root',
47+
standalone: true,
4748
template: `
4849
<ul>
49-
<li *ngFor="let item of item$ | async">
50-
{{ item.name }}
51-
</li>
50+
@for (item of (item$ | async); track item) {
51+
<li>
52+
{{ item.name }}
53+
</li>
54+
}
5255
</ul>
5356
`
5457
})
@@ -96,11 +99,11 @@ We have three sample apps in this repository:
9699

97100
Get help on our [Q&A board](https://github.com/angular/angularfire/discussions?discussions_q=category%3AQ%26A), the official [Firebase Mailing List](https://groups.google.com/forum/#!forum/firebase-talk), the [Firebase Community Slack](https://firebase.community/) (`#angularfire2`), the [Angular Community Discord](http://discord.gg/angular) (`#firebase`), [Gitter](https://gitter.im/angular/angularfire2), the [Firebase subreddit](https://www.reddit.com/r/firebase), or [Stack Overflow](https://stackoverflow.com/questions/tagged/angularfire2).
98101

99-
> **NOTE:** AngularFire is maintained by Googlers but is not a supported Firebase product. Questions on the mailing list and issues filed here are answered on a <strong>best-effort basis</strong> by maintainers and other community members. If you are able to reproduce a problem with Firebase <em>outside of AngularFire's implementation</em>, please [file an issue on the Firebase JS SDK](https://github.com/firebase/firebase-js-sdk/issues) or reach out to the personalized [Firebase support channel](https://firebase.google.com/support/).
102+
> **NOTE:** While relatively stable, AngularFire is a [developer preview](https://angular.io/guide/releases#developer-preview) and is subject to change before general availability. Questions on the mailing list and issues filed here are answered on a <strong>best-effort basis</strong> by maintainers and other community members. If you are able to reproduce a problem with Firebase <em>outside of AngularFire's implementation</em>, please [file an issue on the Firebase JS SDK](https://github.com/firebase/firebase-js-sdk/issues) or reach out to the personalized [Firebase support channel](https://firebase.google.com/support/).
100103
101104
## Developer Guide
102105

103-
This developer guide assumes you're using the new tree-shakable AngularFire API, [if you're looking for the compatability API you can find the documentation here](docs/compat.md).
106+
This developer guide assumes you're using the new tree-shakable AngularFire API, [if you're looking for the compatibility API you can find the documentation here](docs/compat.md).
104107

105108
[See the v7 upgrade guide for more information on this change.](docs/version-7-upgrade.md).
106109

@@ -188,9 +191,3 @@ import { } from '@angular/fire/app-check';
188191
</td>
189192
</tr>
190193
</table>
191-
192-
### Deploying your site
193-
194-
* Deploy to Firebase Hosting
195-
* Angular Universal: Deploy to Cloud Functions
196-
* Angular Universal: Deploy to Cloud Run

package-lock.json

+316-301
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@angular/fire",
3-
"version": "17.0.0",
3+
"version": "17.1.0",
44
"description": "Angular + Firebase = ❤️",
55
"private": true,
66
"scripts": {
@@ -55,7 +55,7 @@
5555
"@angular/platform-browser-dynamic": "^17.0.0",
5656
"@angular/router": "^17.0.0",
5757
"@schematics/angular": "^17.0.0",
58-
"firebase": "^10.7.0",
58+
"firebase": "^10.12.0",
5959
"firebase-admin": "^9.11.1",
6060
"firebase-functions": "^3.6.0",
6161
"firebase-tools": "^13.0.0",

src/app/firebase.ts

+2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
"firebase-tools": { "optional": true }
3535
},
3636
"dependencies": {
37-
"firebase": "^10.7.0",
37+
"firebase": "^10.12.0",
3838
"rxfire": "^6.0.5",
3939
"@angular-devkit/schematics": "^17.0.0",
4040
"@schematics/angular": "^17.0.0",

src/schematics/common.ts

+1-39
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { SchematicContext, SchematicsException, Tree } from '@angular-devkit/schematics';
22
import * as semver from 'semver';
3-
import { FirebaseHostingSite, FirebaseRc } from './interfaces';
3+
import { FirebaseHostingSite } from './interfaces';
44

55
export const shortSiteName = (site?: FirebaseHostingSite) => site?.name?.split('/').pop();
66

@@ -18,44 +18,6 @@ export const overwriteIfExists = (
1818
}
1919
};
2020

21-
function emptyFirebaseRc() {
22-
return {
23-
targets: {}
24-
};
25-
}
26-
27-
function generateFirebaseRcTarget(firebaseProject: string, firebaseHostingSite: FirebaseHostingSite|undefined, project: string) {
28-
return {
29-
hosting: {
30-
[project]: [
31-
shortSiteName(firebaseHostingSite) ?? firebaseProject
32-
]
33-
}
34-
};
35-
}
36-
37-
export function generateFirebaseRc(
38-
tree: Tree,
39-
path: string,
40-
firebaseProject: string,
41-
firebaseHostingSite: FirebaseHostingSite|undefined,
42-
project: string
43-
) {
44-
const firebaseRc: FirebaseRc = tree.exists(path)
45-
? safeReadJSON(path, tree)
46-
: emptyFirebaseRc();
47-
48-
firebaseRc.targets = firebaseRc.targets || {};
49-
firebaseRc.targets[firebaseProject] = generateFirebaseRcTarget(
50-
firebaseProject,
51-
firebaseHostingSite,
52-
project
53-
);
54-
firebaseRc.projects = { default: firebaseProject };
55-
56-
overwriteIfExists(tree, path, stringifyFormatted(firebaseRc));
57-
}
58-
5921
export function safeReadJSON(path: string, tree: Tree) {
6022
try {
6123
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion

src/schematics/deploy/actions.ts

+9-1
Original file line numberDiff line numberDiff line change
@@ -390,6 +390,8 @@ export default async function deploy(
390390
options: DeployBuilderOptions,
391391
firebaseToken?: string,
392392
) {
393+
const legacyNgDeploy = !options.version || options.version < 2;
394+
393395
if (!firebaseToken && !process.env.GOOGLE_APPLICATION_CREDENTIALS) {
394396
await firebaseTools.login();
395397
const user = await firebaseTools.login({ projectRoot: context.workspaceRoot });
@@ -401,6 +403,12 @@ export default async function deploy(
401403
console.log(`Using Google Application Credentials.`);
402404
}
403405

406+
if (legacyNgDeploy) {
407+
console.error(`Legacy ng-deploy Firebase is deprecated.
408+
Please migrate to Firebase Hosting's integration with Angular https://firebase.google.com/docs/hosting/frameworks/angular
409+
or the new Firebase App Hosting product https://firebase.google.com/docs/app-hosting`);
410+
}
411+
404412
if (prerenderBuildTarget) {
405413
const run = await context.scheduleTarget(
406414
targetFromTargetString(prerenderBuildTarget.name),
@@ -465,7 +473,7 @@ export default async function deploy(
465473

466474
firebaseTools.logger.logger.add(logger);
467475

468-
if ((!options.version || options.version < 2) && serverBuildTarget) {
476+
if (legacyNgDeploy && serverBuildTarget) {
469477
if (options.ssr === 'cloud-run') {
470478
await deployToCloudRun(
471479
firebaseTools,

src/schematics/interfaces.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import { RuntimeOptions } from 'firebase-functions';
22

33
export const enum FEATURES {
4-
Hosting,
54
Authentication,
65
Analytics,
76
AppCheck,
@@ -12,10 +11,10 @@ export const enum FEATURES {
1211
Firestore,
1312
Storage,
1413
RemoteConfig,
14+
VertexAI,
1515
}
1616

1717
export const featureOptions = [
18-
{ name: 'ng deploy -- hosting', value: FEATURES.Hosting },
1918
{ name: 'Authentication', value: FEATURES.Authentication },
2019
{ name: 'Google Analytics', value: FEATURES.Analytics },
2120
{ name: 'App Check', value: FEATURES.AppCheck },
@@ -26,6 +25,7 @@ export const featureOptions = [
2625
{ name: 'Performance Monitoring', value: FEATURES.Performance },
2726
{ name: 'Cloud Storage', value: FEATURES.Storage },
2827
{ name: 'Remote Config', value: FEATURES.RemoteConfig },
28+
{ name: 'VertexAI (preview)', value: FEATURES.VertexAI },
2929
];
3030

3131
export const enum PROJECT_TYPE { Static, CloudFunctions, CloudRun, WebFrameworks }

0 commit comments

Comments
 (0)