Skip to content

Commit 0fe23c6

Browse files
feat: upgrade dependencies to the latest Angular v16.0.0-next.7 release (#322)
1 parent 20a01aa commit 0fe23c6

File tree

23 files changed

+1859
-1793
lines changed

23 files changed

+1859
-1793
lines changed

.eslintignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
node_modules

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -54,3 +54,4 @@ stats.html
5454

5555
# Nitro
5656
.nitro
57+
/migrations.json

apps/analog-app/src/main.providers.ts

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
/**
2+
* Common providers shared with client and server-side.
3+
*/
4+
import { Provider } from '@angular/core';
5+
import { provideHttpClient } from '@angular/common/http';
6+
import { provideFileRouter } from '@analogjs/router';
7+
8+
export const mainProviders: Provider = [
9+
provideFileRouter(),
10+
provideHttpClient(),
11+
];

apps/analog-app/src/main.server.ts

+15-9
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,34 @@
11
import 'zone.js/node';
22
import {
3+
provideServerRendering,
34
renderApplication,
45
ɵSERVER_CONTEXT as SERVER_CONTEXT,
56
} from '@angular/platform-server';
6-
import { provideFileRouter } from '@analogjs/router';
7-
import { withEnabledBlockingInitialNavigation } from '@angular/router';
7+
import { enableProdMode } from '@angular/core';
8+
import { bootstrapApplication } from '@angular/platform-browser';
89

910
import { AppComponent } from './app/app.component';
10-
import { enableProdMode } from '@angular/core';
11+
import { mainProviders } from './main.providers';
1112

1213
if (import.meta.env.PROD) {
1314
enableProdMode();
1415
}
1516

16-
export default async function render(url: string, document: string) {
17-
const html = await renderApplication(AppComponent, {
18-
appId: 'analog-app',
19-
document,
20-
url,
17+
export function bootstrap() {
18+
return bootstrapApplication(AppComponent, {
2119
providers: [
22-
provideFileRouter(withEnabledBlockingInitialNavigation()),
20+
mainProviders,
21+
provideServerRendering(),
2322
{ provide: SERVER_CONTEXT, useValue: 'ssr-analog' },
2423
],
2524
});
25+
}
26+
27+
export default async function render(url: string, document: string) {
28+
const html = await renderApplication(bootstrap, {
29+
document,
30+
url,
31+
});
2632

2733
return html;
2834
}

apps/analog-app/src/main.ts

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
import 'zone.js';
22
import { bootstrapApplication } from '@angular/platform-browser';
3-
import { provideHttpClient } from '@angular/common/http';
4-
import { provideFileRouter } from '@analogjs/router';
53

64
import { AppComponent } from './app/app.component';
5+
import { mainProviders } from './main.providers';
76

87
bootstrapApplication(AppComponent, {
9-
providers: [provideFileRouter(), provideHttpClient()],
8+
providers: [mainProviders],
109
}).catch((err) => console.error(err));

apps/astro-app/tsconfig.app.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@
2020
"target": "es2020",
2121
"module": "es2020",
2222
"lib": ["es2020", "dom"],
23-
"skipLibCheck": true
23+
"skipLibCheck": true,
24+
"ignoreDeprecations": "5.0"
2425
},
2526
"angularCompilerOptions": {
2627
"enableI18nLegacyMessageIdFormat": false,

apps/blog-app/src/main.providers.ts

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
/**
2+
* Common providers shared with client and server-side.
3+
*/
4+
import { Provider } from '@angular/core';
5+
import { provideHttpClient } from '@angular/common/http';
6+
import { withInMemoryScrolling } from '@angular/router';
7+
import { provideFileRouter } from '@analogjs/router';
8+
import { provideContent, withMarkdownRenderer } from '@analogjs/content';
9+
10+
export const mainProviders: Provider = [
11+
provideFileRouter(withInMemoryScrolling({ anchorScrolling: 'enabled' })),
12+
provideContent(withMarkdownRenderer()),
13+
provideHttpClient(),
14+
];

apps/blog-app/src/main.server.ts

+18-10
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,33 @@
11
import 'zone.js/node';
2+
import {
3+
provideServerRendering,
4+
renderApplication,
5+
ɵSERVER_CONTEXT as SERVER_CONTEXT,
6+
} from '@angular/platform-server';
27
import { enableProdMode } from '@angular/core';
3-
import { renderApplication } from '@angular/platform-server';
4-
import { provideContent, withMarkdownRenderer } from '@analogjs/content';
5-
import { provideFileRouter } from '@analogjs/router';
6-
import { withEnabledBlockingInitialNavigation } from '@angular/router';
8+
import { bootstrapApplication } from '@angular/platform-browser';
79

810
import { AppComponent } from './app/app.component';
11+
import { mainProviders } from './main.providers';
912

1013
if (import.meta.env.PROD) {
1114
enableProdMode();
1215
}
1316

17+
export function bootstrap() {
18+
return bootstrapApplication(AppComponent, {
19+
providers: [
20+
mainProviders,
21+
provideServerRendering(),
22+
{ provide: SERVER_CONTEXT, useValue: 'ssg-analog' },
23+
],
24+
});
25+
}
26+
1427
export default async function render(url: string, document: string) {
15-
const html = await renderApplication(AppComponent, {
16-
appId: 'blog-app',
28+
const html = await renderApplication(bootstrap, {
1729
document,
1830
url,
19-
providers: [
20-
provideFileRouter(withEnabledBlockingInitialNavigation()),
21-
provideContent(withMarkdownRenderer()),
22-
],
2331
});
2432

2533
return html;

apps/blog-app/src/main.ts

+3-7
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,9 @@
11
import 'zone.js';
22
import { bootstrapApplication } from '@angular/platform-browser';
3-
import { withInMemoryScrolling } from '@angular/router';
4-
import { provideFileRouter } from '@analogjs/router';
5-
import { provideContent, withMarkdownRenderer } from '@analogjs/content';
3+
64
import { AppComponent } from './app/app.component';
5+
import { mainProviders } from './main.providers';
76

87
bootstrapApplication(AppComponent, {
9-
providers: [
10-
provideFileRouter(withInMemoryScrolling({ anchorScrolling: 'enabled' })),
11-
provideContent(withMarkdownRenderer()),
12-
],
8+
providers: [mainProviders],
139
}).catch((err) => console.error(err));

jest.preset.js

+13-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
11
const nxPreset = require('@nrwl/jest/preset').default;
22

3-
module.exports = { ...nxPreset };
3+
module.exports = {
4+
...nxPreset,
5+
/* TODO: Update to latest Jest snapshotFormat
6+
* By default Nx has kept the older style of Jest Snapshot formats
7+
* to prevent breaking of any existing tests with snapshots.
8+
* It's recommend you update to the latest format.
9+
* You can do this by removing snapshotFormat property
10+
* and running tests with --update-snapshot flag.
11+
* Example: "nx affected --targets= --update-snapshot"
12+
* More info: https://jestjs.io/docs/upgrading-to-jest29#snapshot-format
13+
*/
14+
snapshotFormat: { escapeString: true, printBasicPrototype: true },
15+
};

package.json

+40-40
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
"scripts": {
66
"dev": "nx serve",
77
"ng": "nx",
8-
"postinstall": "node ./decorate-angular-cli.js && ngcc --properties es2020 browser module main",
98
"prepare": "git config core.hookspath .githooks",
109
"start": "nx serve",
1110
"build": "nx run-many --target build --all",
@@ -36,60 +35,61 @@
3635
"apps/docs-app"
3736
],
3837
"dependencies": {
39-
"@analogjs/content": "*",
40-
"@angular/animations": "15.1.2",
41-
"@angular/common": "15.1.2",
42-
"@angular/compiler": "15.1.2",
43-
"@angular/core": "15.1.2",
44-
"@angular/forms": "15.1.2",
45-
"@angular/platform-browser": "15.1.2",
46-
"@angular/platform-browser-dynamic": "15.1.2",
47-
"@angular/platform-server": "15.1.2",
48-
"@angular/router": "15.1.2",
38+
"@analogjs/content": "latest",
39+
"@angular/animations": "^16.0.0-next.7",
40+
"@angular/common": "^16.0.0-next.7",
41+
"@angular/compiler": "^16.0.0-next.7",
42+
"@angular/core": "^16.0.0-next.7",
43+
"@angular/forms": "^16.0.0-next.7",
44+
"@angular/platform-browser": "^16.0.0-next.7",
45+
"@angular/platform-browser-dynamic": "^16.0.0-next.7",
46+
"@angular/platform-server": "^16.0.0-next.7",
47+
"@angular/router": "^16.0.0-next.7",
4948
"@astrojs/react": "^2.0.2",
50-
"@nrwl/angular": "15.7.0",
49+
"@nrwl/angular": "15.9.2",
5150
"@types/react": "^18.0.21",
5251
"@types/react-dom": "^18.0.6",
52+
"ajv-formats": "^2.1.1",
5353
"front-matter": "^4.0.2",
5454
"marked": "^4.2.12",
5555
"react": "^18.0.0",
5656
"react-dom": "^18.0.0",
57-
"rxjs": "7.5.7",
57+
"rxjs": "7.8.0",
5858
"tslib": "^2.4.0",
59-
"zone.js": "~0.11.8"
59+
"zone.js": "0.13.0"
6060
},
6161
"devDependencies": {
62-
"@angular-devkit/build-angular": "15.1.3",
63-
"@angular-devkit/core": "~15.1.3",
64-
"@angular-devkit/schematics": "~15.1.3",
62+
"@angular-devkit/build-angular": "^16.0.0-next.7",
63+
"@angular-devkit/core": "^16.0.0-next.7",
64+
"@angular-devkit/schematics": "^16.0.0-next.7",
6565
"@angular-eslint/eslint-plugin": "15.2.0",
6666
"@angular-eslint/eslint-plugin-template": "15.2.0",
6767
"@angular-eslint/template-parser": "15.2.0",
68-
"@angular/cli": "~15.1.3",
69-
"@angular/compiler-cli": "15.1.2",
70-
"@angular/language-service": "15.1.2",
68+
"@angular/cli": "^16.0.0-next.7",
69+
"@angular/compiler-cli": "^16.0.0-next.7",
70+
"@angular/language-service": "^16.0.0-next.7",
7171
"@astrojs/markdown-component": "^1.0.2",
7272
"@commitlint/cli": "^17.4.2",
7373
"@commitlint/config-conventional": "^17.4.2",
74-
"@ngtools/webpack": "~15.1.3",
75-
"@nrwl/cli": "15.7.0",
76-
"@nrwl/cypress": "15.7.0",
77-
"@nrwl/devkit": "15.7.0",
78-
"@nrwl/eslint-plugin-nx": "15.7.0",
79-
"@nrwl/jest": "15.7.0",
80-
"@nrwl/js": "15.7.0",
81-
"@nrwl/linter": "15.7.0",
82-
"@nrwl/nx-plugin": "15.7.0",
83-
"@nrwl/vite": "15.7.0",
84-
"@nrwl/web": "15.7.0",
85-
"@nrwl/workspace": "15.7.0",
74+
"@ngtools/webpack": "^16.0.0-next.7",
75+
"@nrwl/cli": "15.9.2",
76+
"@nrwl/cypress": "15.9.2",
77+
"@nrwl/devkit": "15.9.2",
78+
"@nrwl/eslint-plugin-nx": "15.9.2",
79+
"@nrwl/jest": "15.9.2",
80+
"@nrwl/js": "15.9.2",
81+
"@nrwl/linter": "15.9.2",
82+
"@nrwl/nx-plugin": "15.9.2",
83+
"@nrwl/vite": "15.9.2",
84+
"@nrwl/web": "15.9.2",
85+
"@nrwl/workspace": "15.9.2",
8686
"@nx-plus/docusaurus": "15.0.0-rc.0",
87-
"@schematics/angular": "~15.1.3",
87+
"@schematics/angular": "^16.0.0-next.7",
8888
"@swc-node/register": "^1.4.2",
8989
"@swc/cli": "~0.1.55",
9090
"@swc/core": "^1.2.173",
9191
"@swc/helpers": "^0.4.14",
92-
"@types/jest": "29.4.0",
92+
"@types/jest": "29.4.4",
9393
"@types/marked": "^4.0.8",
9494
"@types/node": "18.11.18",
9595
"@types/prismjs": "^1.26.0",
@@ -104,16 +104,16 @@
104104
"eslint": "~8.33.0",
105105
"eslint-config-prettier": "8.6.0",
106106
"eslint-plugin-cypress": "^2.12.1",
107-
"jest": "29.4.1",
108-
"jest-environment-jsdom": "28.1.1",
107+
"jest": "29.4.3",
108+
"jest-environment-jsdom": "29.4.3",
109109
"jsdom": "^21.1.0",
110110
"jsonc-eslint-parser": "^2.1.0",
111111
"kolorist": "^1.6.0",
112112
"lint-staged": "^13.1.0",
113113
"minimist": "^1.2.7",
114-
"ng-packagr": "~15.1.1",
114+
"ng-packagr": "^16.0.0-next.0",
115115
"nitropack": "^1.0.0",
116-
"nx": "15.7.0",
116+
"nx": "15.9.2",
117117
"playwright": "^1.30.0",
118118
"postcss": "^8.4.21",
119119
"postcss-import": "~15.1.0",
@@ -126,8 +126,8 @@
126126
"start-server-and-test": "^1.15.3",
127127
"ts-jest": "29.0.5",
128128
"ts-node": "10.9.1",
129-
"typescript": "4.9.4",
130-
"vite": "4.0.4",
129+
"typescript": "5.0.3",
130+
"vite": "4.2.1",
131131
"vite-tsconfig-paths": "4.0.5",
132132
"vitest": "0.25.8",
133133
"webpack-bundle-analyzer": "^4.7.0"

packages/astro-angular/package.json

+12-12
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@analogjs/astro-angular",
33
"version": "0.1.0-beta.7",
4-
"description": "An Angular integration for Astro",
4+
"description": "Use Angular components within Astro",
55
"type": "module",
66
"author": "Brandon Roberts <[email protected]>",
77
"exports": {
@@ -30,18 +30,18 @@
3030
"@analogjs/vite-plugin-angular": "latest"
3131
},
3232
"peerDependencies": {
33-
"@angular-devkit/build-angular": "^15.0.0 || ^16.0.0-next.0",
34-
"@angular/animations": "^15.0.0 || ^16.0.0-next.0",
35-
"@angular/common": "^15.0.0 || ^16.0.0-next.0",
36-
"@angular/compiler-cli": "^15.0.0 || ^16.0.0-next.0",
37-
"@angular/compiler": "^15.0.0 || ^16.0.0-next.0",
38-
"@angular/core": "^15.0.0 || ^16.0.0-next.0",
39-
"@angular/language-service": "^15.0.0 || ^16.0.0-next.0",
40-
"@angular/platform-browser": "^15.0.0 || ^16.0.0-next.0",
41-
"@angular/platform-browser-dynamic": "^15.0.0 || ^16.0.0-next.0",
42-
"@angular/platform-server": "^15.0.0 || ^16.0.0-next.0",
33+
"@angular-devkit/build-angular": "^16.0.0-next.0",
34+
"@angular/animations": "^16.0.0-next.0",
35+
"@angular/common": "^16.0.0-next.0",
36+
"@angular/compiler-cli": "^16.0.0-next.0",
37+
"@angular/compiler": "^16.0.0-next.0",
38+
"@angular/core": "^16.0.0-next.0",
39+
"@angular/language-service": "^16.0.0-next.0",
40+
"@angular/platform-browser": "^16.0.0-next.0",
41+
"@angular/platform-browser-dynamic": "^16.0.0-next.0",
42+
"@angular/platform-server": "^16.0.0-next.0",
4343
"rxjs": "^7.5.6",
44-
"zone.js": "^0.11.0",
44+
"zone.js": "^0.13.0",
4545
"tslib": "^2.4.0"
4646
}
4747
}

packages/astro-angular/src/server.ts

+14-9
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,10 @@ import {
1111
} from '@angular/core';
1212
import {
1313
BEFORE_APP_SERIALIZED,
14+
provideServerRendering,
1415
renderApplication,
1516
} from '@angular/platform-server';
17+
import { bootstrapApplication } from '@angular/platform-browser';
1618

1719
const ANALOG_ASTRO_STATIC_PROPS = new InjectionToken<{
1820
props: Record<string, unknown>;
@@ -77,17 +79,20 @@ async function renderToStaticMarkup(
7779
const mirror = reflectComponentType(Component);
7880
const appId = mirror?.selector || Component.name.toString().toLowerCase();
7981
const document = `<${appId}></${appId}>`;
82+
const bootstrap = () =>
83+
bootstrapApplication(Component, {
84+
providers: [
85+
{
86+
provide: ANALOG_ASTRO_STATIC_PROPS,
87+
useValue: { props, mirror },
88+
},
89+
STATIC_PROPS_HOOK_PROVIDER,
90+
provideServerRendering(),
91+
],
92+
});
8093

81-
const html = await renderApplication(Component, {
82-
appId,
94+
const html = await renderApplication(bootstrap, {
8395
document,
84-
providers: [
85-
{
86-
provide: ANALOG_ASTRO_STATIC_PROPS,
87-
useValue: { props, mirror },
88-
},
89-
STATIC_PROPS_HOOK_PROVIDER,
90-
],
9196
});
9297

9398
return { html };

0 commit comments

Comments
 (0)