Skip to content

Commit

Permalink
feat: upgrade to angular 18 (#425)
Browse files Browse the repository at this point in the history
  • Loading branch information
xieziyu authored May 25, 2024
1 parent 0feaca0 commit 6e98746
Show file tree
Hide file tree
Showing 46 changed files with 4,649 additions and 2,234 deletions.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
scripts/convert.js
134 changes: 51 additions & 83 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,86 +1,54 @@
- 2024.05.16: v17.2.0

- Feat: `provideEcharts` supports default theme config. (by [wheeljs](https://github.com/wheeljs))
- Fix: Issue [#413](https://github.com/xieziyu/ngx-echarts/issues/413) (Thanks to [s9ke](https://github.com/s9ke))

- 2023.11.10: v17.1.0 / v16.2.0:

- Feat: Exported standalone `NgxEchartsDirective`, `provideEcharts` and `provideEchartsCore`

- 2023.11.08: v17.0.1:

- Feat: upgrade to Angular 17

- 2023.10.11: v16.1.0:

- Feat: Add types to `chartXXX` EventEmitters. Support new events such as: `'selectchanged'`

- 2023.05.10: v16.0.0:

- Feat: upgrade to Angular 16
- Chore: replaced tslint with eslint.

- 2023.03.27: v15.0.3:

- Fix: `[loading]=true` is not triggered when chart initialized.

- 2023.03.20: v15.0.2:

- Fix: unsubscribe ChangeFilter subscriptions onDestroy.

- 2022.12.01: v15.0.1:

- Feat: Support nullable @Inputs. Issue [#378](https://github.com/xieziyu/ngx-echarts/issues/378)

- 2022.11.23: v15.0.0:

- Feat: upgrade to Angular 15

- 2022.06.21: v14.0.0:

- Feat: upgrade to Angular 14

- 2021.12.07: v8.0.1:

- Fix: NgxEchartsModule.forChild() issue [#334](https://github.com/xieziyu/ngx-echarts/issues/334)

- 2021.11.08: v8.0.0 / v7.1.0:

- Fix: remove @juggle/resize-observer from the peer dependencies
- Perf: fix performance issue [#330](https://github.com/xieziyu/ngx-echarts/issues/330)

- 2021.05.17: v7.0.0:

- Feat: support Angular v11, ECharts v5
- Feat: support echart theme object
- Perf: resize animation

- 2021.01.10: v6.0.1:

- [PR #295](https://github.com/xieziyu/ngx-echarts/pull/295): Guard dispose (by [taipeiwu](https://github.com/taipeiwu))

- 2021.01.10: v6.0.0:

- [PR #285](https://github.com/xieziyu/ngx-echarts/pull/285): Guard dispose (by [gjsmith66](https://github.com/gjsmith66))
- update demo to use echarts v5.0
- [PR #282](https://github.com/xieziyu/ngx-echarts/pull/282): fix avoid "ResizeObserver loop limit exceeded" error (by [parkdihoon](https://github.com/parkdihoon))
- [PR #272](https://github.com/xieziyu/ngx-echarts/pull/272): Angular 10 support (by [Ghostbird](https://github.com/Ghostbird))

- 2020.11.07: v5.2.1:

- Required `resize-observer-polyfill`
- [PR #271](https://github.com/xieziyu/ngx-echarts/pull/271): Fix autoResize functionality (by [ThomasBower](https://github.com/ThomasBower))
- Exposed methods: `refreshChart()` and `resize()`

- 2020.07.24: v5.1.0:

- [PR #240](https://github.com/xieziyu/ngx-echarts/pull/240): Added output 'optionsError' (by [trajnisz](https://github.com/trajnisz))
- [PR #242](https://github.com/xieziyu/ngx-echarts/pull/242): Add output for brushEnd event (by [Uular](https://github.com/Uular))
- [PR #246](https://github.com/xieziyu/ngx-echarts/pull/246): Allow loading echarts library lazily via native import (by [smnbbrv](https://github.com/smnbbrv))

- 2020.05.19: v5.0.0
- **BREAKING CHANGES**:
* 2024.05.25: v18.0.0
+ Feat: Upgrade to angular 18
* 2024.05.16: v17.2.0
+ Feat: `provideEcharts` supports default theme config. (by [wheeljs](https://github.com/wheeljs))
+ Fix: Issue [#413](https://github.com/xieziyu/ngx-echarts/issues/413) (Thanks to [s9ke](https://github.com/s9ke))
* 2023.11.10: v17.1.0 / v16.2.0:
+ Feat: Exported standalone `NgxEchartsDirective`, `provideEcharts` and `provideEchartsCore`
* 2023.11.08: v17.0.1:
+ Feat: upgrade to Angular 17
* 2023.10.11: v16.1.0:
+ Feat: Add types to `chartXXX` EventEmitters. Support new events such as: `'selectchanged'`
* 2023.05.10: v16.0.0:
+ Feat: upgrade to Angular 16
+ Chore: replaced tslint with eslint.
* 2023.03.27: v15.0.3:
+ Fix: `[loading]=true` is not triggered when chart initialized.
* 2023.03.20: v15.0.2:
+ Fix: unsubscribe ChangeFilter subscriptions onDestroy.
* 2022.12.01: v15.0.1:
+ Feat: Support nullable @Inputs. Issue [#378](https://github.com/xieziyu/ngx-echarts/issues/378)
* 2022.11.23: v15.0.0:
+ Feat: upgrade to Angular 15
* 2022.06.21: v14.0.0:
+ Feat: upgrade to Angular 14
* 2021.12.07: v8.0.1:
+ Fix: NgxEchartsModule.forChild() issue [#334](https://github.com/xieziyu/ngx-echarts/issues/334)
* 2021.11.08: v8.0.0 / v7.1.0:
+ Fix: remove @juggle/resize-observer from the peer dependencies
+ Perf: fix performance issue [#330](https://github.com/xieziyu/ngx-echarts/issues/330)
* 2021.05.17: v7.0.0:
+ Feat: support Angular v11, ECharts v5
+ Feat: support echart theme object
+ Perf: resize animation
* 2021.01.10: v6.0.1:
+ [PR #295](https://github.com/xieziyu/ngx-echarts/pull/295): Guard dispose (by [taipeiwu](https://github.com/taipeiwu))
* 2021.01.10: v6.0.0:
+ [PR #285](https://github.com/xieziyu/ngx-echarts/pull/285): Guard dispose (by [gjsmith66](https://github.com/gjsmith66))
+ update demo to use echarts v5.0
+ [PR #282](https://github.com/xieziyu/ngx-echarts/pull/282): fix avoid "ResizeObserver loop limit exceeded" error (by [parkdihoon](https://github.com/parkdihoon))
+ [PR #272](https://github.com/xieziyu/ngx-echarts/pull/272): Angular 10 support (by [Ghostbird](https://github.com/Ghostbird))
* 2020.11.07: v5.2.1:
+ Required `resize-observer-polyfill`
+ [PR #271](https://github.com/xieziyu/ngx-echarts/pull/271): Fix autoResize functionality (by [ThomasBower](https://github.com/ThomasBower))
+ Exposed methods: `refreshChart()` and `resize()`
* 2020.07.24: v5.1.0:
+ [PR #240](https://github.com/xieziyu/ngx-echarts/pull/240): Added output 'optionsError' (by [trajnisz](https://github.com/trajnisz))
+ [PR #242](https://github.com/xieziyu/ngx-echarts/pull/242): Add output for brushEnd event (by [Uular](https://github.com/Uular))
+ [PR #246](https://github.com/xieziyu/ngx-echarts/pull/246): Allow loading echarts library lazily via native import (by [smnbbrv](https://github.com/smnbbrv))
* 2020.05.19: v5.0.0
+ **BREAKING CHANGES**:
- `NgxEchartsModule` provides `.forRoot()` method to inject `echarts` core.
- Due to `.forRoot` method, we can do custom build without `NgxEchartsCoreModule`. Just import the `echarts` core from `echarts/src/echarts`, and other necessary charts.
- `NgxEchartsCoreModule` is removed.
- `[detectEventChanges]` is removed.
- `[detectEventChanges]` is removed.
7 changes: 3 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@

Latest version @npm:

- `v18.0.0` for Angular 18
- `v17.2.0` for Angular 17
- `v16.2.0` for Angular 16
- `v15.0.3` for Angular 15
Expand All @@ -65,10 +66,8 @@ A starter project on Github: https://github.com/xieziyu/ngx-echarts-starter

# Latest Update

2024.05.16: v17.2.0

- Feat: `provideEcharts` supports default theme config. (by [wheeljs](https://github.com/wheeljs))
- Fix: Issue [#413](https://github.com/xieziyu/ngx-echarts/issues/413) (Thanks to [s9ke](https://github.com/s9ke))
* 2024.05.25: v18.0.0
+ Feat: Upgrade to angular 18

[CHANGELOG.md](./CHANGELOG.md)

Expand Down
22 changes: 13 additions & 9 deletions angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,15 @@
"prefix": "app",
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:browser",
"builder": "@angular-devkit/build-angular:application",
"options": {
"outputPath": "dist/docs",
"outputPath": {
"base": "dist/docs"
},
"index": "src/index.html",
"main": "src/main.ts",
"polyfills": "src/polyfills.ts",
"polyfills": [
"src/polyfills.ts"
],
"tsConfig": "tsconfig.app.json",
"assets": [
"src/favicon.png",
Expand All @@ -58,12 +61,15 @@
"node_modules/prismjs/components/prism-bash.min.js",
"node_modules/prismjs/components/prism-diff.min.js"
],
"vendorChunk": true,
"extractLicenses": false,
"buildOptimizer": false,
"sourceMap": true,
"optimization": false,
"namedChunks": true
"namedChunks": true,
"browser": "src/main.ts",
"loader": {
".html": "text",
".txt": "text"
}
},
"configurations": {
"production": {
Expand All @@ -78,8 +84,6 @@
"sourceMap": false,
"namedChunks": false,
"extractLicenses": true,
"vendorChunk": false,
"buildOptimizer": true,
"budgets": [
{
"type": "initial",
Expand Down
37 changes: 19 additions & 18 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"scripts": {
"ng": "ng",
"start": "ng serve --port=4202",
"convert": "node ./scripts/convert.js",
"build": "ng build",
"build:prod": "ng build --configuration production --base-href ./",
"build:lib": "ng build ngx-echarts",
Expand All @@ -24,33 +25,33 @@
},
"private": true,
"dependencies": {
"@angular/animations": "~17.0.1",
"@angular/common": "~17.0.1",
"@angular/compiler": "~17.0.1",
"@angular/core": "~17.0.1",
"@angular/forms": "~17.0.1",
"@angular/platform-browser": "~17.0.1",
"@angular/platform-browser-dynamic": "~17.0.1",
"@angular/router": "~17.0.1",
"@ant-design/icons-angular": "^13.1.0",
"@angular/animations": "~18.0.0",
"@angular/common": "~18.0.0",
"@angular/compiler": "~18.0.0",
"@angular/core": "~18.0.0",
"@angular/forms": "~18.0.0",
"@angular/platform-browser": "~18.0.0",
"@angular/platform-browser-dynamic": "~18.0.0",
"@angular/router": "~18.0.0",
"@ant-design/icons-angular": "^17.0.0",
"echarts": "^5.4.2",
"echarts-gl": "^2.0.9",
"ng-zorro-antd": "~16.2.2",
"ng-zorro-antd": "~17.4.0",
"rxjs": "~7.5.5",
"tslib": "~2.4.0",
"zone.js": "~0.14.2"
},
"devDependencies": {
"@angular-devkit/build-angular": "~17.0.0",
"@angular-devkit/core": "~17.0.0",
"@angular-devkit/build-angular": "~18.0.1",
"@angular-devkit/core": "~18.0.1",
"@angular-eslint/builder": "^17.0.0",
"@angular-eslint/eslint-plugin": "^17.0.0",
"@angular-eslint/eslint-plugin-template": "^17.0.0",
"@angular-eslint/schematics": "^17.0.0",
"@angular-eslint/template-parser": "^17.0.0",
"@angular/cli": "~17.0.0",
"@angular/compiler-cli": "~17.0.1",
"@angular/language-service": "~17.0.1",
"@angular/cli": "~18.0.1",
"@angular/compiler-cli": "~18.0.0",
"@angular/language-service": "~18.0.0",
"@compodoc/compodoc": "^1.1.19",
"@types/jasmine": "~4.0.3",
"@types/jasminewd2": "~2.0.10",
Expand All @@ -70,15 +71,15 @@
"karma-coverage-istanbul-reporter": "~3.0.3",
"karma-jasmine": "~5.1.0",
"karma-jasmine-html-reporter": "^2.0.0",
"ng-packagr": "^17.0.0",
"ngx-markdown": "^16.0.0",
"ng-packagr": "^18.0.0",
"ngx-markdown": "^17.2.1",
"npm-run-all": "^4.1.5",
"prettier": "^2.8.8",
"prettier-eslint": "^15.0.1",
"prismjs": "^1.28.0",
"protractor": "~7.0.0",
"raw-loader": "^4.0.2",
"ts-node": "~10.8.1",
"typescript": "~5.2.2"
"typescript": "~5.4.5"
}
}
2 changes: 1 addition & 1 deletion projects/ngx-echarts/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ngx-echarts",
"version": "17.2.0",
"version": "18.0.0",
"author": "Xie, Ziyu",
"license": "MIT",
"keywords": [
Expand Down
50 changes: 50 additions & 0 deletions scripts/convert.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
const fs = require('fs');
const path = require('path');

// The custom loader of angular new build system DO NOT support the '.ts' files
// So we need to convert the '.ts' files to '.txt' files as a workaround

const dirList = [
'./src/app/pages/demo-basic/basic/basic-dataset',
'./src/app/pages/demo-basic/basic/basic-events',
'./src/app/pages/demo-basic/basic/basic-init-opts',
'./src/app/pages/demo-basic/basic/basic-instance',
'./src/app/pages/demo-basic/basic/basic-loading',
'./src/app/pages/demo-basic/basic/basic-simple',
'./src/app/pages/demo-basic/basic/basic-themes',
'./src/app/pages/demo-basic/basic/basic-update',
'./src/app/pages/demo-advanced/advanced/connect-charts',
'./src/app/pages/demo-advanced/advanced/line-draggable',
'./src/app/pages/demo-gl/gl-bar3d/bar3d-dataset',
'./src/app/pages/demo-series/series-graph/graph-force-layout',
'./src/app/pages/demo-series/series-graph/graph-simple',
'./src/app/pages/demo-series/series-heatmap/heatmap-calendar',
'./src/app/pages/demo-series/series-heatmap/heatmap-discrete',
'./src/app/pages/demo-series/series-tree/tree-from-left-to-right',
'./src/app/pages/demo-series/series-tree/tree-radial',
];

for (let dir of dirList) {
fs.readdir(dir, (err, files) => {
if (err) throw err;

files.forEach(file => {
if (path.extname(file) === '.ts') {
const filePath = path.join(dir, file);
const outputFilePath = path.join(dir, file.replace('.ts', '.txt'));

// 读取 .ts 文件内容
fs.readFile(filePath, 'utf8', (err, data) => {
if (err) throw err;

// 写入到 .txt 文件
fs.writeFile(outputFilePath, data, (err) => {
if (err) throw err;
console.log(`${file} -- copied --> ${outputFilePath}`);
});
});
}
});
});
}

6 changes: 3 additions & 3 deletions src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { MarkdownModule } from 'ngx-markdown';
import { FormsModule } from '@angular/forms';
import { HttpClientModule } from '@angular/common/http';
import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { registerLocaleData, LocationStrategy, HashLocationStrategy } from '@angular/common';
import en from '@angular/common/locales/en';
Expand All @@ -22,14 +22,14 @@ registerLocaleData(en);

@NgModule({
declarations: [AppComponent],
bootstrap: [AppComponent],
imports: [
BrowserModule,
LayoutModule,
AppRoutingModule,
FormsModule,
NgZorroCustomModule,
MarkdownModule.forRoot(),
HttpClientModule,
BrowserAnimationsModule,
NgxEchartsDirective,
],
Expand All @@ -39,7 +39,7 @@ registerLocaleData(en);
useClass: HashLocationStrategy,
},
provideEcharts(),
provideHttpClient(withInterceptorsFromDi()),
],
bootstrap: [AppComponent],
})
export class AppModule {}
Loading

0 comments on commit 6e98746

Please sign in to comment.