Skip to content
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

(feat) propose new release v5.0.0 #392

Open
wants to merge 94 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 86 commits
Commits
Show all changes
94 commits
Select commit Hold shift + click to select a range
26827f1
convert highcharts-chart.component.ts to standalone and deprecate module
Nov 21, 2024
a5b12ab
correct test file
Nov 21, 2024
b3e96db
mv to ng17
Nov 21, 2024
6127081
release 5.0.0-alpha.1
Nov 21, 2024
e90e398
use the new control flow
Nov 21, 2024
b52b80f
remove polyfills.ts
Nov 21, 2024
39e4e85
use standalone component instead of module
Nov 21, 2024
6c502ec
update README.md
Nov 21, 2024
85fb9a5
update to node 18
Nov 21, 2024
6a80fe1
lint file
Nov 21, 2024
39ee094
update to es2020
Nov 21, 2024
89a7343
fix tslint issue
Nov 21, 2024
6118a15
fix tslint issue
Nov 21, 2024
ded9d70
fix tslint issue
Nov 21, 2024
1ee8f7b
use new output function instead of decorator
Nov 21, 2024
f1517dd
use model signal to handle input/output
Nov 21, 2024
c1e7b2d
use destroyRef instead of OnDestroy hook
Nov 21, 2024
26a844d
convert to Signal Input
Nov 21, 2024
51a3ae8
add new packages
Nov 21, 2024
84187e2
remove unused packages
Nov 21, 2024
df279db
mv to ng 18
Nov 21, 2024
3ba8eb2
mark not standalone as false
Nov 21, 2024
ba3ef52
mv to ng 19
Nov 21, 2024
8aa6270
refactor highchart component
Nov 22, 2024
59056cd
generate jsdoc
Nov 22, 2024
0692786
remove old packages
Nov 22, 2024
3846fcb
update map collection
Nov 22, 2024
f149297
update karma
Nov 22, 2024
472708f
correct imports
Nov 22, 2024
ab734a0
use esbuild to build the demo app
Nov 22, 2024
d771296
convert demo project to standalone
Nov 22, 2024
81d488c
use onPush change detection
Nov 22, 2024
65dfaf6
ref local folder for test
Nov 22, 2024
e92337a
release v5.0.0
Nov 22, 2024
2492c56
move logic to directive, this give more flexibility to dev
Nov 24, 2024
0514986
add doc for directive
Nov 24, 2024
019eb17
create css class
Nov 24, 2024
fbc658a
create css class
Nov 24, 2024
0cf465b
split command
Nov 24, 2024
e5b4a15
introduce injection token and provider to supply with module factory
Nov 24, 2024
2512d05
modify directive to support new changes
Nov 24, 2024
f610e0d
adapt demo component
Nov 24, 2024
423a21e
a better approach to serve global setting and single providers
Nov 29, 2024
60b7970
correct demo app
Nov 29, 2024
0e23dcb
use new syntax approach to inject tokens
Nov 29, 2024
8aa9fc6
lint files
Nov 29, 2024
2b132a6
correct test component
Nov 29, 2024
b3bab66
correct test component
Nov 29, 2024
2623cad
allow to provide highchart at the child level
Nov 30, 2024
66ab624
correct demo app
Nov 30, 2024
9b3ac50
use better approach
Nov 30, 2024
2e3eb17
finish upgrade
Nov 30, 2024
b11b5c1
correct configuration
Nov 30, 2024
3c0c47c
add test for service
Dec 1, 2024
e30e6f7
add test for directive
Dec 1, 2024
ccdb9ac
revert back version so it will be changed when packing
Dec 7, 2024
eba03ff
add possible chart to input "constructorType"
Dec 7, 2024
1be6e8c
update should be optional
Dec 7, 2024
fe0d146
rename variable
Dec 7, 2024
b7469a8
update jsdoc for oneToOne and update input
Dec 7, 2024
dbd2576
patch packages
Dec 7, 2024
ee3a775
patch packages
Dec 7, 2024
60ad6c6
move default app to new folder
Dec 7, 2024
cbcfada
default command to my-app
Dec 7, 2024
9aa01fe
handle SSR case for directive
Dec 7, 2024
5622ee7
add new ssr-app for showcase
Dec 7, 2024
9b8000f
allowedCommonJsDependencies
Dec 7, 2024
8185c76
handle map case differently
Dec 7, 2024
158de68
correct title
Dec 7, 2024
9092306
increase budget
Dec 7, 2024
7824224
we can reuse app for both ssr and no-ssr
Dec 7, 2024
c40107a
reset config
Dec 7, 2024
ec37324
reset config
Dec 7, 2024
3c5b7f3
use signals
Dec 7, 2024
a5c097b
correct type
Dec 7, 2024
dd1617a
rename vars and add comments
Dec 7, 2024
2cfe946
rename readme v4
Dec 7, 2024
654b1a2
update readme.md
Dec 8, 2024
e87e1ad
update readme.md
Dec 8, 2024
1d962a9
add support to Highcharts 12
Dec 8, 2024
f8e348d
update showcase
Dec 8, 2024
ec4f722
correct types
Dec 8, 2024
79ee4d2
correct tests
Dec 8, 2024
1d4f93c
update readme
Dec 8, 2024
ee1bebb
update readme
Dec 8, 2024
7c80740
correct test
Dec 8, 2024
f6ecfc8
lazy load main module
Dec 9, 2024
103505b
address feedbacks
Dec 9, 2024
a57878c
update README.md
Dec 9, 2024
be5a027
correct test
Dec 9, 2024
e4fe3ff
switch to ESM
Dec 9, 2024
ee5f971
switch to ESM
Dec 9, 2024
d71ae0c
add new commands
Dec 9, 2024
8698e85
update readme
Dec 9, 2024
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
578 changes: 317 additions & 261 deletions README.md

Large diffs are not rendered by default.

541 changes: 541 additions & 0 deletions README_V4.md

Large diffs are not rendered by default.

209 changes: 152 additions & 57 deletions angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,89 +6,86 @@
"root": "",
"sourceRoot": "src",
"projectType": "application",
"schematics": {},
"prefix": "app",
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:browser",
"builder": "@angular/build:application",
"options": {
"aot": false,
"allowedCommonJsDependencies": [
"highcharts",
"highcharts-custom-events"
],
"outputPath": "dist",
"outputPath": "dist/my-app",
"index": "src/index.html",
"main": "src/main.ts",
"tsConfig": "./tsconfig.app.json",
"polyfills": "src/polyfills.ts",
"browser": "src/main.ts",
"polyfills": ["zone.js"],
"tsConfig": "tsconfig.app.json",
"assets": [
"src/assets",
"src/favicon.ico"
{
"glob": "**/*",
"input": "src/public"
},
{
"glob": "**/*",
"input": "./node_modules/@highcharts/map-collection/custom/",
"output": "/highcharts/"
}
],
"styles": [],
"scripts": [],
"vendorChunk": true,
"extractLicenses": false,
"buildOptimizer": false,
"sourceMap": true,
"optimization": false,
"namedChunks": true
"allowedCommonJsDependencies": ["*"]
},
"configurations": {
"production": {
"budgets": [
{
"type": "initial",
"maximumWarning": "800kB",
"maximumError": "1MB"
},
{
"type": "anyComponentStyle",
"maximumWarning": "6kb"
"maximumWarning": "4kB",
"maximumError": "8kB"
}
],
"optimization": true,
"outputHashing": "all",
"sourceMap": false,
"namedChunks": false,
"aot": true,
"extractLicenses": true,
"vendorChunk": false,
"buildOptimizer": true,
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.prod.ts"
}
]
"outputHashing": "all"
},
"development": {
"optimization": false,
"extractLicenses": false,
"sourceMap": true
}
},
"defaultConfiguration": ""
"defaultConfiguration": "production"
},
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
"options": {
"browserTarget": "my-app:build"
},
"builder": "@angular/build:dev-server",
"configurations": {
"production": {
"browserTarget": "my-app:build:production"
"buildTarget": "my-app:build:production"
},
"development": {
"buildTarget": "my-app:build:development"
}
}
},
"defaultConfiguration": "development"
},
"extract-i18n": {
"builder": "@angular-devkit/build-angular:extract-i18n",
"options": {
"browserTarget": "my-app:build"
}
"builder": "@angular/build:extract-i18n"
},
"test": {
"builder": "@angular-devkit/build-angular:karma",
"options": {
"main": "src/test.ts",
"karmaConfig": "./karma.conf.js",
"polyfills": "src/polyfills.ts",
"tsConfig": "./tsconfig.spec.json",
"scripts": [],
"styles": [],
"polyfills": ["core-js/es/reflect", "zone.js", "zone.js/testing"],
"tsConfig": "tsconfig.spec.json",
"assets": [
"src/assets",
"src/favicon.ico"
]
{
"glob": "**/*",
"input": "src/public"
}
],
"styles": [],
"scripts": []
}
}
}
Expand Down Expand Up @@ -121,20 +118,118 @@
},
"configurations": {
"production": {
"project": "highcharts-angular/ng-package.prod.json",
"tsConfig": "highcharts-angular/tsconfig.lib.prod.json"
},
"development": {
"tsConfig": "highcharts-angular/tsconfig.lib.json"
}
}
},
"defaultConfiguration": "production"
},
"test": {
"builder": "@angular-devkit/build-angular:karma",
"options": {
"main": "src/test.ts",
"karmaConfig": "./karma.conf.js",
"polyfills": "src/polyfills.ts",
"tsConfig": "./tsconfig.spec.json",
"karmaConfig": "highcharts-angular/karma.conf.js",
"polyfills": ["zone.js", "zone.js/testing"],
"tsConfig": "highcharts-angular/tsconfig.spec.json",
"scripts": [],
"styles": []
}
}
}
},
"my-ssr-app": {
"projectType": "application",
"schematics": {},
"root": "",
"sourceRoot": "src",
"prefix": "app",
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:application",
"options": {
"outputPath": "dist/my-ssr-app",
"index": "src/index.html",
"browser": "src/main.ts",
"polyfills": [
"zone.js"
],
"tsConfig": "tsconfig.app.json",
"assets": [
{
"glob": "**/*",
"input": "src/public"
},
{
"glob": "**/*",
"input": "./node_modules/@highcharts/map-collection/custom/",
"output": "/highcharts/"
}
],
"styles": [],
"scripts": [],
"server": "src/main.server.ts",
"prerender": true,
"ssr": {
"entry": "src/server.ts"
},
"allowedCommonJsDependencies": ["*"]
},
"configurations": {
"production": {
"budgets": [
{
"type": "initial",
"maximumWarning": "800kB",
"maximumError": "1MB"
},
{
"type": "anyComponentStyle",
"maximumWarning": "4kB",
"maximumError": "8kB"
}
],
"outputHashing": "all"
},
"development": {
"optimization": false,
"extractLicenses": false,
"sourceMap": true
}
},
"defaultConfiguration": "production"
},
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
"configurations": {
"production": {
"buildTarget": "my-ssr-app:build:production"
},
"development": {
"buildTarget": "my-ssr-app:build:development"
}
},
"defaultConfiguration": "development"
},
"extract-i18n": {
"builder": "@angular-devkit/build-angular:extract-i18n"
},
"test": {
"builder": "@angular-devkit/build-angular:karma",
"options": {
"polyfills": [
"zone.js",
"zone.js/testing"
],
"tsConfig": "tsconfig.spec.json",
"assets": [
{
"glob": "**/*",
"input": "src/public"
}
],
"styles": [],
"scripts": []
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions highcharts-angular/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
"angular"
],
"peerDependencies": {
"@angular/common": ">=16.0.0",
"@angular/core": ">=16.0.0",
"@angular/common": ">=19.0.0",
"@angular/core": ">=19.0.0",
"highcharts": ">=9.0.0"
},
"dependencies": {
Expand Down
81 changes: 12 additions & 69 deletions highcharts-angular/src/lib/highcharts-chart.component.ts
Original file line number Diff line number Diff line change
@@ -1,73 +1,16 @@
import type { OnChanges, OnDestroy } from '@angular/core';
import { Component, ElementRef, EventEmitter, Input, Output, NgZone, SimpleChanges } from '@angular/core';
import type * as Highcharts from 'highcharts';
import type HighchartsESM from 'highcharts/es-modules/masters/highcharts.src';
import { ChangeDetectionStrategy, Component} from '@angular/core';
import { HighchartsChartDirective } from './highcharts-chart.directive';

@Component({
selector: 'highcharts-chart',
template: ''
})
export class HighchartsChartComponent implements OnDestroy, OnChanges {
@Input() Highcharts: typeof Highcharts | typeof HighchartsESM;
@Input() constructorType: string;
@Input() callbackFunction: Highcharts.ChartCallbackFunction;
@Input() oneToOne: boolean; // #20
@Input() runOutsideAngular: boolean; // #75
@Input() options: Highcharts.Options | HighchartsESM.Options;
@Input() update: boolean;

@Output() updateChange = new EventEmitter<boolean>(true);
@Output() chartInstance = new EventEmitter<Highcharts.Chart | null>(); // #26

private chart: Highcharts.Chart | null;

constructor(
private el: ElementRef,
private _zone: NgZone // #75
) {}

ngOnChanges(changes: SimpleChanges): void {
const update = changes.update?.currentValue;
if (changes.options || update) {
this.wrappedUpdateOrCreateChart();
if (update) {
this.updateChange.emit(false); // clear the flag after update
}
}
}

wrappedUpdateOrCreateChart() { // #75
if (this.runOutsideAngular) {
this._zone.runOutsideAngular(() => {
this.updateOrCreateChart()
});
} else {
this.updateOrCreateChart();
template: '',
hostDirectives: [
{
directive: HighchartsChartDirective,
inputs: ['Highcharts', 'constructorType', 'callbackFunction', 'oneToOne', 'runOutsideAngular', 'options', 'update'],
outputs: ['chartInstance', 'updateChange']
}
}

updateOrCreateChart() {
if (this.chart?.update) {
this.chart.update(this.options, true, this.oneToOne || false);
} else {
this.chart = this.Highcharts[this.constructorType || 'chart'](
this.el.nativeElement,
this.options,
this.callbackFunction || null
);

// emit chart instance on init
this.chartInstance.emit(this.chart);
}
}

ngOnDestroy() { // #44
if (this.chart) { // #56
this.chart.destroy();
this.chart = null;

// emit chart instance on destroy
this.chartInstance.emit(this.chart);
}
}
}
],
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class HighchartsChartComponent {}
Loading