Skip to content

Commit db51088

Browse files
committed
chore: fix build
1 parent 1ee6ec2 commit db51088

File tree

6 files changed

+50
-61
lines changed

6 files changed

+50
-61
lines changed

README.md

Lines changed: 25 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -24,35 +24,34 @@ For now you can search the codebase for "Perf Tip" later on there will be proppe
2424

2525
### Bundle Stats
2626

27-
<!-- bundle-stats-start -->
28-
29-
| Names | Size |
30-
| ----------------------------------------------------------------------------------- | ------------- |
31-
| main.js | 343.15 KB |
32-
| styles.css | 6.17 KB |
33-
| runtime.js | 2.61 KB |
34-
| **Initial Total** | **351.93 KB** |
35-
| Names | Size |
36-
| app_pages_movie-detail-page_movie-detail-page_component_ts.js | 16.83 KB |
37-
| app_pages_person-detail-page_person-detail-page_component_ts.js | 11.79 KB |
38-
| a-6a8199.js | 10.07 KB |
39-
| app_pages_account-feature_list-detail-page_list-movies_list-movies_compon-d13d08.js | 9.83 KB |
40-
| common.js | 7.69 KB |
41-
| app_pages_account-feature_list-detail-page_list-items-edit_list-items-edi-13eb42.js | 7.23 KB |
42-
| app_pages_movie-list-page_movie-list-page_component_ts.js | 5.84 KB |
43-
| app_pages_account-feature_list-create-page_list-create-page_component_ts--1f481e.js | 5.7 KB |
44-
| app_app-shell_account-menu_account-menu_component_ts.js | 5.63 KB |
45-
| app_pages_account-feature_account-list-page_account-list-page_component_ts.js | 4.89 KB |
46-
| app_pages_account-feature_list-detail-page_list-image_list-image_componen-cb4b89.js | 4.36 KB |
47-
| default-node_modules_rx-angular_template_fesm2022_template-if_mjs.js | 4.23 KB |
48-
| app_pages_account-feature_list-detail-page_list-remove_list-remove_compon-a10eb2.js | 3.41 KB |
49-
| app_pages_account-feature_list-detail-page_list-detail-page_component_ts--a2c81d.js | 3.24 KB |
50-
| app_pages_not-found-page_not-found-page_component_ts.js | 1.77 KB |
51-
| app_pages_account-feature_list-detail-page_list-detail-page_routes_ts.js | 1.54 KB |
52-
| app_pages_account-feature_account-feature-page_routes_ts.js | 926 Bytes |
5327

28+
<!-- bundle-stats-start -->
29+
| Names | Size |
30+
| --- | --- |
31+
| main.js | 369.67 KB |
32+
| styles.css | 6.17 KB |
33+
| runtime.js | 2.61 KB |
34+
| **Initial Total** | **378.45 KB** |
35+
| Names | Size |
36+
| app_pages_movie-detail-page_movie-detail-page_component_ts.js | 16.56 KB |
37+
| a-4d8953.js | 13.09 KB |
38+
| app_pages_person-detail-page_person-detail-page_component_ts.js | 11.81 KB |
39+
| app_pages_account-feature_list-create-page_list-create-page_component_ts--1f481e.js | 9.43 KB |
40+
| app_app-shell_account-menu_account-menu_component_ts.js | 9.36 KB |
41+
| common.js | 8.5 KB |
42+
| app_pages_account-feature_list-detail-page_list-items-edit_list-items-edi-13eb42.js | 7.25 KB |
43+
| app_pages_movie-list-page_movie-list-page_component_ts.js | 5.89 KB |
44+
| app_pages_account-feature_account-list-page_account-list-page_component_ts.js | 4.92 KB |
45+
| app_pages_account-feature_list-detail-page_list-image_list-image_componen-cb4b89.js | 4.39 KB |
46+
| app_pages_account-feature_list-detail-page_list-remove_list-remove_compon-a10eb2.js | 3.39 KB |
47+
| app_pages_account-feature_list-detail-page_list-detail-page_component_ts--a2c81d.js | 3.24 KB |
48+
| app_pages_not-found-page_not-found-page_component_ts.js | 1.79 KB |
49+
| app_pages_account-feature_list-detail-page_list-detail-page_routes_ts.js | 1.5 KB |
50+
| app_pages_account-feature_account-feature-page_routes_ts.js | 852 Bytes |
51+
| app_pages_account-feature_list-detail-page_list-movies_list-movies_component_ts.js | 678 Bytes |
5452
<!-- bundle-stats-end -->
5553

54+
5655
## Comparison to next and nuxt
5756

5857
- [angular](https://angular-movies-a12d3.web.app/list/category/popular)

nx.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,12 @@
1414
"targetDefaults": {
1515
"build": {
1616
"dependsOn": ["^build"],
17-
"inputs": ["production", "^production"]
17+
"inputs": ["production", "^production"],
18+
"cache": true
1819
},
1920
"lint": {
20-
"inputs": ["default", "{workspaceRoot}/.eslintrc.json"]
21+
"inputs": ["default", "{workspaceRoot}/.eslintrc.json"],
22+
"cache": true
2123
},
2224
"emulate-firebase": {
2325
"dependsOn": ["build"]

projects/cloudflare-worker/src/index.ts

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,18 @@
1-
import 'zone.js';
2-
import 'zone.js/dist/zone-node';
31
import '@angular/platform-server/init';
42

5-
import {renderApplication} from '@angular/platform-server';
6-
import {EdgeEnvironment, provideEdgeEnvironment,} from './app/environment.token';
3+
import { renderApplication } from '@angular/platform-server';
4+
import {
5+
EdgeEnvironment,
6+
provideEdgeEnvironment,
7+
} from './app/environment.token';
78
import bootstrap from './app/bootstrap';
89

910
// We attach the Cloudflare `fetch()` handler to the global scope
1011
// so that we can export it when we process the Angular output.
1112
// See tools/bundle.mjs
1213
(globalThis as any).__workerFetchHandler = async function fetch(
1314
request: Request,
14-
environment: EdgeEnvironment
15+
environment: EdgeEnvironment,
1516
) {
1617
const url = new URL(request.url);
1718
const cacheKey = new Request(url.toString(), request).url;
@@ -37,9 +38,9 @@ import bootstrap from './app/bootstrap';
3738
const content = await renderApplication(
3839
() =>
3940
bootstrap({
40-
providers: [provideEdgeEnvironment({request, env: environment})],
41+
providers: [provideEdgeEnvironment({ request, env: environment })],
4142
}),
42-
{document, url: url.pathname}
43+
{ document, url: url.pathname },
4344
);
4445

4546
await environment.NGMOVIES.put(cacheKey, content, {

projects/firebase-function/project.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@
1313
"target": "node",
1414
"compiler": "tsc",
1515
"deleteOutputPath": false,
16-
"outputPath": "./dist/projects/movies/server",
16+
"outputPath": "{workspaceRoot}/dist/projects/movies/server",
1717
"outputFileName": "index.js",
18-
"main": "projects/firebase-function/src/index.ts",
19-
"tsConfig": "./projects/firebase-function/tsconfig.function.json",
20-
"webpackConfig": "projects/firebase-function/webpack.config.js"
18+
"main": "{projectRoot}/src/index.ts",
19+
"tsConfig": "{projectRoot}/tsconfig.function.json",
20+
"webpackConfig": "{projectRoot}/webpack.config.js"
2121
},
2222
"configurations": {
2323
"production": {

projects/ng-universal-express/src/app/http-timing.interceptor.ts

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,20 @@
11
import { HttpEvent, HttpHandlerFn, HttpRequest } from '@angular/common/http';
22
import { finalize, Observable } from 'rxjs';
3-
import { inject } from '@angular/core';
4-
import { RESPONSE } from '@nguniversal/express-engine/tokens';
5-
6-
type ServerTimingRequest = {
7-
startTime(token: string, description: string): void;
8-
endTime(token: string): void;
9-
};
103

114
let index = 0;
125

136
export function requestTimingInterceptor(
14-
requestName?: (_request: HttpRequest<any>) => string
7+
requestName?: (_request: HttpRequest<any>) => string,
158
) {
169
return (
1710
request: HttpRequest<any>,
18-
next: HttpHandlerFn
11+
next: HttpHandlerFn,
1912
): Observable<HttpEvent<any>> => {
20-
const responseWithTiming = inject(RESPONSE, {
21-
optional: true,
22-
}) as unknown as HttpRequest<any> & ServerTimingRequest;
13+
const responseWithTiming = null as any;
2314
const u = 'request' + index++;
2415
responseWithTiming?.startTime(
2516
u,
26-
requestName ? requestName(request) : request.urlWithParams
17+
requestName ? requestName(request) : request.urlWithParams,
2718
);
2819
return next(request).pipe(finalize(() => responseWithTiming?.endTime(u)));
2920
};

projects/ng-universal-express/src/index.ts

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
1-
import 'zone.js';
2-
import 'zone.js/dist/zone-node';
31
// The Express app is exported so that it can be used by serverless Functions.
42
import express from 'express';
53
import { existsSync } from 'node:fs';
64
import { join } from 'node:path';
7-
import { ngExpressEngine } from '@nguniversal/express-engine';
8-
import bootstrap from './app/bootstrap';
95
import { useCompression, useTiming } from './app/utils';
106
import { APP_BASE_HREF } from '@angular/common';
117
// bootstrap needs to get exported for the pre-render task
@@ -16,7 +12,7 @@ export function app(): express.Express {
1612

1713
const distributionFolder = join(
1814
process.cwd(),
19-
'dist/projects/movies/browser'
15+
'dist/projects/movies/browser',
2016
);
2117

2218
const indexHtml = existsSync(join(distributionFolder, 'index.html'))
@@ -29,7 +25,7 @@ export function app(): express.Express {
2925
useTiming(server);
3026

3127
// Our Universal express-engine (found @ https://github.com/angular/universal/tree/master/modules/express-engine)
32-
server.engine('html', ngExpressEngine({ bootstrap }));
28+
// server.engine('html', ngExpressEngine({ bootstrap }));
3329

3430
server.set('view engine', 'html');
3531
server.set('views', distributionFolder);
@@ -41,7 +37,7 @@ export function app(): express.Express {
4137
maxAge: '1y',
4238
// missing assets results in 404 instead of continuing to next route handler (and rendering route)
4339
fallthrough: false,
44-
})
40+
}),
4541
);
4642

4743
server.get(
@@ -61,9 +57,9 @@ export function app(): express.Express {
6157
(_, html) => {
6258
response.endTime('SSR');
6359
response.send(html);
64-
}
60+
},
6561
);
66-
}
62+
},
6763
);
6864

6965
return server;

0 commit comments

Comments
 (0)