Skip to content

feat(angular): provide angular standalone components #1325

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 53 commits into from
Sep 4, 2024
Merged
Show file tree
Hide file tree
Changes from 21 commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
bfb3881
feat(core): replace with ix-icons v3
danielleroux Apr 21, 2024
904f5d1
fix: use esm loader
danielleroux Apr 22, 2024
c60aa0b
revert setup changes
danielleroux Apr 22, 2024
fa16cef
fix: use ix-icons preview snapshot
danielleroux Apr 22, 2024
2727e9b
Merge remote-tracking branch 'origin/main' into v3-icon-performance
danielleroux Apr 24, 2024
5e22dd4
docs: add steps
danielleroux Apr 24, 2024
1c2b58b
chore: add changeset
danielleroux Apr 24, 2024
a6fc699
feat(angular): standalone components
danielleroux Apr 24, 2024
7ff2c76
feat: add standalone putput
danielleroux Apr 24, 2024
3a0c800
feat: add angular standalone test app
danielleroux Apr 24, 2024
a46c9e4
Merge branch 'release-3.0.0' into v3-angular-standalone
danielleroux Jun 14, 2024
c7b58b0
Merge branch 'release-3.0.0' into v3-angular-standalone
danielleroux Jun 14, 2024
f35d68b
fix: remove pollyfills
danielleroux Jun 14, 2024
f54f30a
Merge remote-tracking branch 'origin/release-3.0.0' into v3-angular-sโ€ฆ
danielleroux Jun 21, 2024
5b8f003
feat: add new test app
danielleroux Jun 24, 2024
62c7822
feat: migrate preview examples
danielleroux Jul 10, 2024
5bd85a3
fix: replace test app ng 13 with test app ng 17
danielleroux Jul 10, 2024
bf5cd85
Merge branch 'release-3.0.0' into v3-angular-standalone
danielleroux Jul 10, 2024
8743827
Merge remote-tracking branch 'origin/release-3.0.0' into v3-angular-sโ€ฆ
danielleroux Jul 29, 2024
d321372
fix: resolve errors
danielleroux Jul 29, 2024
c7b49c5
feat: implement legacy support
danielleroux Jul 29, 2024
7d6e67c
Update BREAKING_CHANGES.md
nuke-ellington Jul 29, 2024
b714cf4
Update packages/core/src/setup.ts
nuke-ellington Jul 29, 2024
6ab017e
fix: lint issue
danielleroux Jul 30, 2024
42ec87d
Merge remote-tracking branch 'origin/release-3.0.0' into v3-angular-sโ€ฆ
danielleroux Jul 31, 2024
218c33d
test: fix jest transform
danielleroux Jul 31, 2024
9b608a8
fix: resolve test function conflicts
danielleroux Jul 31, 2024
a19061c
fix(echarts): import path
danielleroux Jul 31, 2024
0b6d39f
Merge remote-tracking branch 'origin/release-3.0.0' into v3-angular-sโ€ฆ
danielleroux Aug 16, 2024
7677be9
Merge branch 'release-3.0.0' into v3-angular-standalone
danielleroux Aug 16, 2024
5c4dc79
fix: generate proxies
danielleroux Aug 16, 2024
51dccfc
fix: unit test scripts
danielleroux Aug 16, 2024
a5f313e
test: updatae snapshots
danielleroux Aug 16, 2024
fb665e0
fix: aggrid filter snapshots
danielleroux Aug 16, 2024
747f3c1
test: update snapshot
danielleroux Aug 16, 2024
03a7648
fix: blocking pipeline
danielleroux Aug 16, 2024
530f763
Merge remote-tracking branch 'origin/release-3.0.0' into v3-angular-sโ€ฆ
danielleroux Aug 23, 2024
8dddcd1
fix: refactor angular package
danielleroux Aug 26, 2024
06b5d63
fix: move dropdown directive to base folder
danielleroux Aug 26, 2024
4760e38
fix: adapt import path to v3 icons
danielleroux Aug 27, 2024
a24d7bc
Merge remote-tracking branch 'origin/release-3.0.0' into v3-angular-sโ€ฆ
danielleroux Aug 27, 2024
9be2d66
fix: echarts dependency
danielleroux Aug 28, 2024
df9a699
docs: split icons
danielleroux Aug 28, 2024
100e04e
fix: update snapshots
danielleroux Aug 28, 2024
fbb596f
Create clean-squids-retire.md
danielleroux Aug 29, 2024
138919c
Create fresh-maps-ring.md
danielleroux Aug 29, 2024
ace4c67
chore: add standalone test package to ignore
danielleroux Aug 29, 2024
33d7df0
fix: improve v3 and documentation text
matthiashader Aug 29, 2024
279c1b2
fix: formatting
matthiashader Sep 3, 2024
cec2982
Update BREAKING_CHANGES/v3.md
nuke-ellington Sep 4, 2024
adcba64
Update BREAKING_CHANGES/v2.md
danielleroux Sep 4, 2024
68ccaa6
Update BREAKING_CHANGES/v2.md
danielleroux Sep 4, 2024
493a077
docs: do some stuuff
danielleroux Sep 4, 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
12 changes: 11 additions & 1 deletion BREAKING_CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ React/Vue:

TODO: Rewrite this section to be more precise about what has to be adapted

- To use imports by name (e.g. `<ix-icon name="star"></ix-icon>`) an additional configuration entry is required inside of `angular.json`:
To use imports by name (e.g. `<ix-icon name="star"></ix-icon>`) an additional configuration entry is required inside of `angular.json`:

```json
"assets": [
Expand All @@ -45,6 +45,16 @@ TODO: Rewrite this section to be more precise about what has to be adapted
],
```

To re-enable the preloaded icons you can provide the `preloadIcons` function as configuration to the module import.

```ts
IxModule.forRoot({
preloadIcons,
}),
```

This will preload all icons without providing the svg's as assets. Downside of this way is the increased bundle size. **not recommended**

## v2.0.0

### `input[class="form-control"]` and `textarea[class="form-control"]` are deprecated
Expand Down
26 changes: 13 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,24 +37,24 @@
},
"dependencies": {
"commander": "^12.1.0",
"tslib": "^2.3.0"
"tslib": "^2.6.3"
},
"devDependencies": {
"@actions/core": "^1.10.1",
"@changesets/changelog-github": "^0.4.8",
"@changesets/cli": "^2.26.2",
"@commitlint/cli": "^17.1.2",
"@commitlint/config-conventional": "^17.1.0",
"dotenv-cli": "^7.3.0",
"eslint": "^8.28.0",
"eslint-config-prettier": "^8.5.0",
"@changesets/cli": "^2.27.7",
"@commitlint/cli": "^17.8.1",
"@commitlint/config-conventional": "^17.8.1",
"dotenv-cli": "^7.4.2",
"eslint": "^8.57.0",
"eslint-config-prettier": "^8.10.0",
"execa": "^5.1.1",
"husky": "^8.0.1",
"prettier": "^2.6.2",
"prettier-plugin-organize-imports": "^3.2.1",
"tsx": "^4.15.4",
"turbo": "^2.0.4",
"typescript": "^5.4.5"
"husky": "^8.0.3",
"prettier": "^2.8.8",
"prettier-plugin-organize-imports": "^3.2.4",
"tsx": "^4.16.2",
"turbo": "^2.0.9",
"typescript": "^5.5.4"
},
"config": {
"commitizen": {
Expand Down
18 changes: 9 additions & 9 deletions packages/aggrid/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,25 +20,25 @@
"host-root": "http-server -a 127.0.0.1"
},
"devDependencies": {
"@playwright/test": "^1.32.1",
"@playwright/test": "^1.45.3",
"@siemens/ix": "workspace:*",
"@siemens/ix-icons": "v3-preview",
"@types/gulp": "^4.0.14",
"@types/gulp-postcss": "^8.0.4",
"@types/gulp-sass": "^5.0.2",
"@types/gulp": "^4.0.17",
"@types/gulp-postcss": "^8.0.6",
"@types/gulp-sass": "^5.0.4",
"ag-grid-community": "30.2.0",
"autoprefixer": "10.4.5",
"cssnano": "^6.0.1",
"cssnano": "^6.1.2",
"gulp": "^4.0.2",
"gulp-postcss": "^9.0.1",
"gulp-sass": "^5.1.0",
"http-server": "^14.1.1",
"rimraf": "^5.0.5",
"sass": "^1.68.0",
"ts-node": "^10.9.1"
"rimraf": "^5.0.9",
"sass": "^1.77.8",
"ts-node": "^10.9.2"
},
"dependencies": {
"@siemens/ix": "~2.4.0"
"@siemens/ix": "workspace:~"
},
"peerDependencies": {
"ag-grid-community": "^28 || ^29 || ^30"
Expand Down
16 changes: 16 additions & 0 deletions packages/angular-standalone-test-app/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Editor configuration, see https://editorconfig.org
root = true

[*]
charset = utf-8
indent_style = space
indent_size = 2
insert_final_newline = true
trim_trailing_whitespace = true

[*.ts]
quote_type = single

[*.md]
max_line_length = off
trim_trailing_whitespace = false
42 changes: 42 additions & 0 deletions packages/angular-standalone-test-app/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# See http://help.github.com/ignore-files/ for more about ignoring files.

# Compiled output
/dist
/tmp
/out-tsc
/bazel-out

# Node
/node_modules
npm-debug.log
yarn-error.log

# IDEs and editors
.idea/
.project
.classpath
.c9/
*.launch
.settings/
*.sublime-workspace

# Visual Studio Code
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
.history/*

# Miscellaneous
/.angular/cache
.sass-cache/
/connect.lock
/coverage
/libpeerconnection.log
testem.log
/typings

# System files
.DS_Store
Thumbs.db
27 changes: 27 additions & 0 deletions packages/angular-standalone-test-app/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# AngularStandaloneTestApp

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

## Development server

Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The application will automatically reload if you change any of the source files.

## Code scaffolding

Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module`.

## Build

Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory.

## Running unit tests

Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io).

## Running end-to-end tests

Run `ng e2e` to execute the end-to-end tests via a platform of your choice. To use this command, you need to first add a package that implements end-to-end testing capabilities.

## Further help

To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI Overview and Command Reference](https://angular.io/cli) page.
96 changes: 96 additions & 0 deletions packages/angular-standalone-test-app/angular.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
{
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"version": 1,
"newProjectRoot": "projects",
"projects": {
"angular-standalone-test-app": {
"projectType": "application",
"schematics": {},
"root": "",
"sourceRoot": "src",
"prefix": "app",
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:application",
"options": {
"outputPath": "dist/angular-standalone-test-app",
"index": "src/index.html",
"browser": "src/main.ts",
"polyfills": [
"zone.js"
],
"tsConfig": "tsconfig.app.json",
"assets": [
"src/favicon.ico",
"src/assets"
],
"styles": [
"node_modules/@siemens/ix/dist/siemens-ix/siemens-ix.css",
"src/styles.css"
],
"scripts": []
},
"configurations": {
"production": {
"budgets": [
{
"type": "initial",
"maximumWarning": "500kb",
"maximumError": "1mb"
},
{
"type": "anyComponentStyle",
"maximumWarning": "2kb",
"maximumError": "4kb"
}
],
"outputHashing": "all"
},
"development": {
"optimization": false,
"extractLicenses": false,
"sourceMap": true
}
},
"defaultConfiguration": "production"
},
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
"configurations": {
"production": {
"buildTarget": "angular-standalone-test-app:build:production"
},
"development": {
"buildTarget": "angular-standalone-test-app:build:development"
}
},
"defaultConfiguration": "development"
},
"extract-i18n": {
"builder": "@angular-devkit/build-angular:extract-i18n",
"options": {
"buildTarget": "angular-standalone-test-app:build"
}
},
"test": {
"builder": "@angular-devkit/build-angular:karma",
"options": {
"polyfills": [
"zone.js",
"zone.js/testing"
],
"tsConfig": "tsconfig.spec.json",
"assets": [
"src/favicon.ico",
"src/assets"
],
"styles": [
"src/styles.css"
],
"scripts": []
}
}
}
}
}
}
41 changes: 41 additions & 0 deletions packages/angular-standalone-test-app/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{
"name": "angular-standalone-test-app",
"version": "0.0.0",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"watch": "ng build --watch --configuration development",
"test": "ng test"
},
"private": true,
"dependencies": {
"@angular/animations": "^17.3.12",
"@angular/common": "^17.3.12",
"@angular/compiler": "^17.3.12",
"@angular/core": "^17.3.12",
"@angular/forms": "^17.3.12",
"@angular/platform-browser": "^17.3.12",
"@angular/platform-browser-dynamic": "^17.3.12",
"@angular/router": "^17.3.12",
"@siemens/ix": "workspace:*",
"@siemens/ix-angular": "workspace:*",
"@siemens/ix-icons": "v3-preview",
"rxjs": "~7.8.1",
"tslib": "^2.6.3",
"zone.js": "~0.14.8"
},
"devDependencies": {
"@angular-devkit/build-angular": "^17.3.8",
"@angular/cli": "^17.3.8",
"@angular/compiler-cli": "^17.3.12",
"@types/jasmine": "~5.1.4",
"jasmine-core": "~5.1.2",
"karma": "~6.4.3",
"karma-chrome-launcher": "~3.2.0",
"karma-coverage": "~2.2.1",
"karma-jasmine": "~5.1.0",
"karma-jasmine-html-reporter": "~2.1.0",
"typescript": "~5.4.5"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<ix-button>Test</ix-button>
29 changes: 29 additions & 0 deletions packages/angular-standalone-test-app/src/app/app.component.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import { TestBed } from '@angular/core/testing';
import { AppComponent } from './app.component';

describe('AppComponent', () => {
beforeEach(async () => {
await TestBed.configureTestingModule({
imports: [AppComponent],
}).compileComponents();
});

it('should create the app', () => {
const fixture = TestBed.createComponent(AppComponent);
const app = fixture.componentInstance;
expect(app).toBeTruthy();
});

it(`should have the 'angular-standalone-test-app' title`, () => {
const fixture = TestBed.createComponent(AppComponent);
const app = fixture.componentInstance;
expect(app.title).toEqual('angular-standalone-test-app');
});

it('should render title', () => {
const fixture = TestBed.createComponent(AppComponent);
fixture.detectChanges();
const compiled = fixture.nativeElement as HTMLElement;
expect(compiled.querySelector('h1')?.textContent).toContain('Hello, angular-standalone-test-app');
});
});
14 changes: 14 additions & 0 deletions packages/angular-standalone-test-app/src/app/app.component.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { Component, TemplateRef, ViewChild } from '@angular/core';
import { RouterOutlet } from '@angular/router';
import { IxButton } from '@siemens/ix-angular/standalone';

@Component({
selector: 'app-root',
standalone: true,
imports: [RouterOutlet, IxButton],
templateUrl: './app.component.html',
styleUrl: './app.component.css',
})
export class AppComponent {
title = 'angular-standalone-test-app';
}
8 changes: 8 additions & 0 deletions packages/angular-standalone-test-app/src/app/app.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { ApplicationConfig } from '@angular/core';
import { provideRouter } from '@angular/router';

import { routes } from './app.routes';

export const appConfig: ApplicationConfig = {
providers: [provideRouter(routes)]
};
3 changes: 3 additions & 0 deletions packages/angular-standalone-test-app/src/app/app.routes.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import { Routes } from '@angular/router';

export const routes: Routes = [];
Empty file.
Binary file not shown.
13 changes: 13 additions & 0 deletions packages/angular-standalone-test-app/src/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>AngularStandaloneTestApp</title>
<base href="/">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/x-icon" href="favicon.ico">
</head>
<body>
<app-root></app-root>
</body>
</html>
Loading
Loading