Skip to content

Update angular recipe #40

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 8, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions ci/typescript/create_angular_ng.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ function merge-json() {
npm install -g @angular/cli

# 2. Create Angular application
ng new angular_ng --directory ./ --minimal --routing=false --skip-git --ssr=false --style=css
ng new angular_ng --directory ./ --minimal --routing=false --skip-git --ssr=false --style=css --zoneless=false

# 3. Build and serve the initial project
# npm run build
Expand Down Expand Up @@ -64,8 +64,8 @@ export class BokehJSComponent implements OnInit {
}
EOF

# 6. Replace src/app/app.component.ts so that it uses the BokehJSComponent
cat > src/app/app.component.ts << EOF
# 6. Replace src/app/app.ts so that it uses the BokehJSComponent
cat > src/app/app.ts << EOF
import { Component } from '@angular/core'
import { BokehJSComponent } from './bokeh-js/bokeh-js.component';

Expand All @@ -76,7 +76,7 @@ import { BokehJSComponent } from './bokeh-js/bokeh-js.component';
styles: [],
})

export class AppComponent {}
export class App {}
EOF

# 7. Remove some build warnings by allowing non ESM imports by adding to angular.json
Expand Down
8 changes: 4 additions & 4 deletions recipes/src/recipes/typescript/angular_ng_recipe.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export class AngularNgRecipe extends Recipe {

this.add(new CommandStep(
'Create Angular application',
['ng new angular_ng --directory ./ --minimal --routing=false --skip-git --ssr=false --style=css']
['ng new angular_ng --directory ./ --minimal --routing=false --skip-git --ssr=false --style=css --zoneless=false']
));

this.add(new CommandStep(
Expand Down Expand Up @@ -55,8 +55,8 @@ export class AngularNgRecipe extends Recipe {
);

this.add(new ReplaceFileStep(
'Replace `src/app/app.component.ts` so that it uses the `BokehJSComponent`',
'src/app/app.component.ts',
'Replace `src/app/app.ts` so that it uses the `BokehJSComponent`',
'src/app/app.ts',
"import { Component } from '@angular/core'\n" +
"import { BokehJSComponent } from './bokeh-js/bokeh-js.component';\n\n" +
"@Component({\n" +
Expand All @@ -65,7 +65,7 @@ export class AngularNgRecipe extends Recipe {
" template: \\`<app-bokeh-js></app-bokeh-js>\\`,\n" +
" styles: [],\n" +
"})\n\n" +
"export class AppComponent {}")
"export class App {}")
);

this.add(new MergeJsonStep(
Expand Down
6 changes: 3 additions & 3 deletions typescript/angular_ng/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ The Angular web framework includes its own builder `ng` in the `@angular/cli` pa
2. Create Angular application

```bash
ng new angular_ng --directory ./ --minimal --routing=false --skip-git --ssr=false --style=css
ng new angular_ng --directory ./ --minimal --routing=false --skip-git --ssr=false --style=css --zoneless=false
```

3. Build and serve the initial project
Expand Down Expand Up @@ -65,7 +65,7 @@ The Angular web framework includes its own builder `ng` in the `@angular/cli` pa
}
```

6. Replace `src/app/app.component.ts` so that it uses the `BokehJSComponent` containing
6. Replace `src/app/app.ts` so that it uses the `BokehJSComponent` containing

```ts
import { Component } from '@angular/core'
Expand All @@ -78,7 +78,7 @@ The Angular web framework includes its own builder `ng` in the `@angular/cli` pa
styles: [],
})

export class AppComponent {}
export class App {}
```

7. Remove some build warnings by allowing non ESM imports by adding to `angular.json`
Expand Down
2 changes: 1 addition & 1 deletion typescript/angular_ng/created/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# AngularNg

This project was generated using [Angular CLI](https://github.com/angular/angular-cli) version 19.2.9.
This project was generated using [Angular CLI](https://github.com/angular/angular-cli) version 20.0.1.

## Development server

Expand Down
9 changes: 3 additions & 6 deletions typescript/angular_ng/created/angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,8 @@
"prefix": "app",
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:application",
"builder": "@angular/build:application",
"options": {
"outputPath": "dist/angular_ng",
"index": "src/index.html",
"browser": "src/main.ts",
"polyfills": [
"zone.js"
Expand All @@ -56,7 +54,6 @@
"styles": [
"src/styles.css"
],
"scripts": [],
"allowedCommonJsDependencies": [
"@bokeh/bokehjs",
"mathjax-full",
Expand All @@ -77,7 +74,7 @@
"defaultConfiguration": "production"
},
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
"builder": "@angular/build:dev-server",
"configurations": {
"production": {
"buildTarget": "angular_ng:build:production"
Expand All @@ -89,7 +86,7 @@
"defaultConfiguration": "development"
},
"extract-i18n": {
"builder": "@angular-devkit/build-angular:extract-i18n"
"builder": "@angular/build:extract-i18n"
}
}
}
Expand Down
21 changes: 10 additions & 11 deletions typescript/angular_ng/created/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,21 @@
},
"private": true,
"dependencies": {
"@angular/common": "^19.2.0",
"@angular/compiler": "^19.2.0",
"@angular/core": "^19.2.0",
"@angular/forms": "^19.2.0",
"@angular/platform-browser": "^19.2.0",
"@angular/platform-browser-dynamic": "^19.2.0",
"@angular/router": "^19.2.0",
"@angular/common": "^20.0.0",
"@angular/compiler": "^20.0.0",
"@angular/core": "^20.0.0",
"@angular/forms": "^20.0.0",
"@angular/platform-browser": "^20.0.0",
"@angular/router": "^20.0.0",
"@bokeh/bokehjs": "file:../../../../bokeh-bokehjs-3.8.0-dev.1.tgz",
"rxjs": "~7.8.0",
"tslib": "^2.3.0",
"zone.js": "~0.15.0"
},
"devDependencies": {
"@angular-devkit/build-angular": "^19.2.9",
"@angular/cli": "^19.2.9",
"@angular/compiler-cli": "^19.2.0",
"typescript": "~5.7.2"
"@angular/build": "^20.0.1",
"@angular/cli": "^20.0.1",
"@angular/compiler-cli": "^20.0.0",
"typescript": "~5.8.2"
}
}
8 changes: 6 additions & 2 deletions typescript/angular_ng/created/src/app/app.config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
import { ApplicationConfig, provideZoneChangeDetection } from '@angular/core';
import { ApplicationConfig, provideBrowserGlobalErrorListeners, provideZoneChangeDetection } from '@angular/core';

export const appConfig: ApplicationConfig = {
providers: [provideZoneChangeDetection({ eventCoalescing: true })]
providers: [
provideBrowserGlobalErrorListeners(),
provideZoneChangeDetection({ eventCoalescing: true }),

]
};
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ import { BokehJSComponent } from './bokeh-js/bokeh-js.component';
styles: [],
})

export class AppComponent {}
export class App {}
4 changes: 2 additions & 2 deletions typescript/angular_ng/created/src/main.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { bootstrapApplication } from '@angular/platform-browser';
import { appConfig } from './app/app.config';
import { AppComponent } from './app/app.component';
import { App } from './app/app';

bootstrapApplication(AppComponent, appConfig)
bootstrapApplication(App, appConfig)
.catch((err) => console.error(err));
8 changes: 4 additions & 4 deletions typescript/angular_ng/created/tsconfig.app.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
"outDir": "./out-tsc/app",
"types": []
},
"files": [
"src/main.ts"
],
"include": [
"src/**/*.d.ts"
"src/**/*.ts"
],
"exclude": [
"src/**/*.spec.ts"
]
}
14 changes: 9 additions & 5 deletions typescript/angular_ng/created/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,29 @@
{
"compileOnSave": false,
"compilerOptions": {
"outDir": "./dist/out-tsc",
"strict": true,
"noImplicitOverride": true,
"noPropertyAccessFromIndexSignature": true,
"noImplicitReturns": true,
"noFallthroughCasesInSwitch": true,
"skipLibCheck": true,
"isolatedModules": true,
"esModuleInterop": true,
"experimentalDecorators": true,
"moduleResolution": "bundler",
"importHelpers": true,
"target": "ES2022",
"module": "ES2022"
"module": "preserve"
},
"angularCompilerOptions": {
"enableI18nLegacyMessageIdFormat": false,
"strictInjectionParameters": true,
"strictInputAccessModifiers": true,
"typeCheckHostBindings": true,
"strictTemplates": true
}
},
"files": [],
"references": [
{
"path": "./tsconfig.app.json"
}
]
}