Skip to content

Commit bc926a8

Browse files
authored
Single n19 sample (#3591)
1 parent 45ccd39 commit bc926a8

File tree

267 files changed

+20439
-41931
lines changed

Some content is hidden

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

267 files changed

+20439
-41931
lines changed

Diff for: README.md

+9-28
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,7 +44,6 @@ interface Item {
4444

4545
@Component({
4646
selector: 'app-root',
47-
standalone: true,
4847
template: `
4948
<ul>
5049
@for (item of (item$ | async); track item) {
@@ -53,30 +52,16 @@ interface Item {
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+
item$ = collectionData<Item>(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

Diff for: samples/advanced/.editorconfig renamed to sample/.editorconfig

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ trim_trailing_whitespace = true
1010

1111
[*.ts]
1212
quote_type = single
13+
ij_typescript_use_double_quotes = false
1314

1415
[*.md]
1516
max_line_length = off
File renamed without changes.
+15-14
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,47 @@
1-
# See http://help.github.com/ignore-files/ for more about ignoring files.
1+
# See https://docs.github.com/get-started/getting-started-with-git/ignoring-files for more about ignoring files.
22

3-
# compiled output
3+
# Compiled output
44
/dist
55
/tmp
66
/out-tsc
7-
# Only exists if Bazel was run
87
/bazel-out
98

10-
# dependencies
9+
# Node
1110
/node_modules
12-
13-
# profiling files
14-
chrome-profiler-events*.json
11+
npm-debug.log
12+
yarn-error.log
1513

1614
# IDEs and editors
17-
/.idea
15+
.idea/
1816
.project
1917
.classpath
2018
.c9/
2119
*.launch
2220
.settings/
2321
*.sublime-workspace
2422

25-
# IDE - VSCode
23+
# Visual Studio Code
2624
.vscode/*
2725
!.vscode/settings.json
2826
!.vscode/tasks.json
2927
!.vscode/launch.json
3028
!.vscode/extensions.json
3129
.history/*
3230

33-
# misc
31+
# Miscellaneous
3432
/.angular/cache
35-
/.sass-cache
33+
.sass-cache/
3634
/connect.lock
3735
/coverage
3836
/libpeerconnection.log
39-
npm-debug.log
40-
yarn-error.log
4137
testem.log
4238
/typings
4339

44-
# System Files
40+
# System files
4541
.DS_Store
4642
Thumbs.db
43+
44+
# Firebase
45+
.firebase
46+
*-debug.log
47+
.runtimeconfig.json

Diff for: sample/README.md

+59
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
# Ng19Test
2+
3+
This project was generated using [Angular CLI](https://github.com/angular/angular-cli) version 19.0.0.
4+
5+
## Development server
6+
7+
To start a local development server, run:
8+
9+
```bash
10+
ng serve
11+
```
12+
13+
Once the server is running, open your browser and navigate to `http://localhost:4200/`. The application will automatically reload whenever you modify any of the source files.
14+
15+
## Code scaffolding
16+
17+
Angular CLI includes powerful code scaffolding tools. To generate a new component, run:
18+
19+
```bash
20+
ng generate component component-name
21+
```
22+
23+
For a complete list of available schematics (such as `components`, `directives`, or `pipes`), run:
24+
25+
```bash
26+
ng generate --help
27+
```
28+
29+
## Building
30+
31+
To build the project run:
32+
33+
```bash
34+
ng build
35+
```
36+
37+
This will compile your project and store the build artifacts in the `dist/` directory. By default, the production build optimizes your application for performance and speed.
38+
39+
## Running unit tests
40+
41+
To execute unit tests with the [Karma](https://karma-runner.github.io) test runner, use the following command:
42+
43+
```bash
44+
ng test
45+
```
46+
47+
## Running end-to-end tests
48+
49+
For end-to-end (e2e) testing, run:
50+
51+
```bash
52+
ng e2e
53+
```
54+
55+
Angular CLI does not come with an end-to-end testing framework by default. You can choose one that suits your needs.
56+
57+
## Additional Resources
58+
59+
For more information on using the Angular CLI, including detailed command references, visit the [Angular CLI Overview and Command Reference](https://angular.dev/tools/cli) page.

Diff for: sample/angular.json

+97
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
{
2+
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
3+
"version": 1,
4+
"newProjectRoot": "projects",
5+
"projects": {
6+
"ng19-test": {
7+
"projectType": "application",
8+
"schematics": {},
9+
"root": "",
10+
"sourceRoot": "src",
11+
"prefix": "app",
12+
"architect": {
13+
"build": {
14+
"builder": "@angular-devkit/build-angular:application",
15+
"options": {
16+
"outputPath": "dist/ng19-test",
17+
"index": "src/index.html",
18+
"browser": "src/main.ts",
19+
"polyfills": [],
20+
"tsConfig": "tsconfig.app.json",
21+
"assets": [
22+
{
23+
"glob": "**/*",
24+
"input": "public"
25+
}
26+
],
27+
"styles": [
28+
"src/styles.css"
29+
],
30+
"scripts": [],
31+
"server": "src/main.server.ts",
32+
"outputMode": "server",
33+
"ssr": {
34+
"entry": "src/server.ts"
35+
},
36+
"externalDependencies": ["firebase-admin", "cookie-store"]
37+
},
38+
"configurations": {
39+
"production": {
40+
"budgets": [
41+
{
42+
"type": "initial",
43+
"maximumWarning": "500kB",
44+
"maximumError": "1MB"
45+
},
46+
{
47+
"type": "anyComponentStyle",
48+
"maximumWarning": "4kB",
49+
"maximumError": "8kB"
50+
}
51+
],
52+
"outputHashing": "all"
53+
},
54+
"development": {
55+
"optimization": false,
56+
"extractLicenses": false,
57+
"sourceMap": true
58+
}
59+
},
60+
"defaultConfiguration": "production"
61+
},
62+
"serve": {
63+
"builder": "@angular-devkit/build-angular:dev-server",
64+
"configurations": {
65+
"production": {
66+
"buildTarget": "ng19-test:build:production"
67+
},
68+
"development": {
69+
"buildTarget": "ng19-test:build:development"
70+
}
71+
},
72+
"defaultConfiguration": "development"
73+
},
74+
"extract-i18n": {
75+
"builder": "@angular-devkit/build-angular:extract-i18n"
76+
},
77+
"test": {
78+
"builder": "@angular-devkit/build-angular:karma",
79+
"options": {
80+
"polyfills": [],
81+
"tsConfig": "tsconfig.spec.json",
82+
"assets": [
83+
{
84+
"glob": "**/*",
85+
"input": "public"
86+
}
87+
],
88+
"styles": [
89+
"src/styles.css"
90+
],
91+
"scripts": []
92+
}
93+
}
94+
}
95+
}
96+
}
97+
}
File renamed without changes.

Diff for: samples/.emulator/firebase.json renamed to sample/firebase.json

+15
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,21 @@
99
"storage": {
1010
"rules": "storage.rules"
1111
},
12+
"functions": [
13+
{
14+
"source": "functions",
15+
"codebase": "default",
16+
"ignore": [
17+
"node_modules",
18+
".git",
19+
"firebase-debug.log",
20+
"firebase-debug.*.log"
21+
],
22+
"predeploy": [
23+
"npm --prefix \"$RESOURCE_DIR\" run build"
24+
]
25+
}
26+
],
1227
"emulators": {
1328
"auth": {
1429
"port": 9099
File renamed without changes.
File renamed without changes.

Diff for: samples/.emulator/functions/.gitignore renamed to sample/functions/.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,4 @@ typings/
1010

1111
# Node.js dependency directory
1212
node_modules/
13+
lib/

0 commit comments

Comments
 (0)