Skip to content

Commit

Permalink
build: update to latest Angular next version (#2405)
Browse files Browse the repository at this point in the history
BREAKING CHANGE: This updates our libraries to Angular 19. Code changes were made by an automatic migration.
  • Loading branch information
mhaertwig authored Oct 28, 2024
1 parent 4fafd29 commit fbce1d5
Show file tree
Hide file tree
Showing 55 changed files with 959 additions and 1,389 deletions.
54 changes: 27 additions & 27 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,37 +52,37 @@
"homepage": "https://angular.app.sbb.ch",
"schematics": "./tools/schematics/collection.json",
"dependencies": {
"@angular/animations": "18.2.9",
"@angular/cdk": "18.2.10",
"@angular/common": "18.2.9",
"@angular/core": "18.2.9",
"@angular/elements": "18.2.9",
"@angular/forms": "18.2.9",
"@angular/platform-browser": "18.2.9",
"@angular/platform-browser-dynamic": "18.2.9",
"@angular/platform-server": "18.2.9",
"@angular/router": "18.2.9",
"@angular/animations": "19.0.0-next.8",
"@angular/cdk": "19.0.0-next.8",
"@angular/common": "19.0.0-next.8",
"@angular/core": "19.0.0-next.8",
"@angular/elements": "19.0.0-next.8",
"@angular/forms": "19.0.0-next.8",
"@angular/platform-browser": "19.0.0-next.8",
"@angular/platform-browser-dynamic": "19.0.0-next.8",
"@angular/platform-server": "19.0.0-next.8",
"@angular/router": "19.0.0-next.8",
"@stackblitz/sdk": "1.11.0",
"maplibre-gl": "3.6.2",
"rxjs": "7.8.1",
"tslib": "2.7.0",
"zone.js": "0.14.3"
"zone.js": "0.15.0"
},
"devDependencies": {
"@actions/cache": "3.2.4",
"@angular-devkit/build-angular": "18.2.10",
"@angular-devkit/core": "18.2.10",
"@angular-devkit/schematics": "18.2.10",
"@angular-devkit/schematics-cli": "18.2.10",
"@angular-devkit/build-angular": "19.0.0-next.9",
"@angular-devkit/core": "19.0.0-next.9",
"@angular-devkit/schematics": "19.0.0-next.9",
"@angular-devkit/schematics-cli": "19.0.0-next.9",
"@angular/bazel": "https://github.com/angular/bazel-builds.git#9e6140d1eef8ddf7113d00738f603e9cc3c310f1",
"@angular/build-tooling": "https://github.com/angular/dev-infra-private-build-tooling-builds.git#b30ce317c1c6dd183258fff554777e8582d6f505",
"@angular/cli": "18.2.10",
"@angular/compiler": "18.2.9",
"@angular/compiler-cli": "18.2.9",
"@angular/language-service": "18.2.9",
"@angular/localize": "18.2.9",
"@angular/ng-dev": "https://github.com/angular/dev-infra-private-ng-dev-builds.git#978df41c469f0d853ec8cd7fc9289e67b001b38d",
"@babel/core": "7.26.0",
"@angular/cli": "19.0.0-next.9",
"@angular/compiler": "19.0.0-next.8",
"@angular/compiler-cli": "19.0.0-next.8",
"@angular/language-service": "19.0.0-next.8",
"@angular/localize": "19.0.0-next.8",
"@angular/ng-dev": "https://github.com/angular/dev-infra-private-ng-dev-builds.git#36946be4df61f6549ae3829c026022e47674eae2",
"@babel/core": "7.25.8",
"@babel/plugin-proposal-async-generator-functions": "^7.20.7",
"@babel/traverse": "7.25.9",
"@bazel/bazelisk": "1.22.1",
Expand All @@ -101,7 +101,7 @@
"@rollup/plugin-commonjs": "23.0.4",
"@rollup/plugin-node-resolve": "13.3.0",
"@rollup/plugin-typescript": "12.1.1",
"@schematics/angular": "18.2.10",
"@schematics/angular": "19.0.0-next.9",
"@types/browser-sync": "2.29.0",
"@types/events": "3.0.3",
"@types/fs-extra": "11.0.4",
Expand Down Expand Up @@ -169,13 +169,13 @@
"tslint-config-prettier": "1.18.0",
"tslint-consistent-codestyle": "1.16.0",
"tslint-plugin-prettier": "2.3.0",
"typescript": "5.5.2",
"typescript": "5.6.2",
"yargs": "17.7.2"
},
"resolutions": {
"@angular/build-tooling/typescript": "5.5.2",
"@angular/ng-dev/typescript": "5.5.2",
"dgeni-packages/typescript": "5.5.2"
"@angular/build-tooling/typescript": "5.6.2",
"@angular/ng-dev/typescript": "5.6.2",
"dgeni-packages/typescript": "5.6.2"
},
"standard-version": {
"types": [
Expand Down
1 change: 1 addition & 0 deletions packages.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ ANGULAR_PACKAGES_CONFIG = [
"overlay",
"platform",
"portal",
"private",
"scrolling",
"stepper",
"table",
Expand Down
25 changes: 24 additions & 1 deletion src/angular/autocomplete/autocomplete.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ const SIMPLE_AUTOCOMPLETE_TEMPLATE = `

@Component({
template: SIMPLE_AUTOCOMPLETE_TEMPLATE,
standalone: false,
})
class SimpleAutocomplete implements OnDestroy {
numberCtrl = new FormControl<{ name: string; code: string; height?: number } | string | null>(
Expand Down Expand Up @@ -143,7 +144,11 @@ class SimpleAutocomplete implements OnDestroy {
}
}

@Component({ template: SIMPLE_AUTOCOMPLETE_TEMPLATE, encapsulation: ViewEncapsulation.ShadowDom })
@Component({
template: SIMPLE_AUTOCOMPLETE_TEMPLATE,
encapsulation: ViewEncapsulation.ShadowDom,
standalone: false,
})
class SimpleAutocompleteShadowDom extends SimpleAutocomplete {}

@Component({
Expand All @@ -162,6 +167,7 @@ class SimpleAutocompleteShadowDom extends SimpleAutocomplete {}
}
</sbb-autocomplete>
`,
standalone: false,
})
class NgIfAutocomplete {
optionCtrl = new FormControl('');
Expand Down Expand Up @@ -204,6 +210,7 @@ class NgIfAutocomplete {
}
</sbb-autocomplete>
`,
standalone: false,
})
class AutocompleteWithoutForms {
filteredNumbers: any[];
Expand Down Expand Up @@ -238,6 +245,7 @@ class AutocompleteWithoutForms {
}
</sbb-autocomplete>
`,
standalone: false,
})
class AutocompleteWithNgModel {
filteredNumbers: any[];
Expand Down Expand Up @@ -267,6 +275,7 @@ class AutocompleteWithNgModel {
}
</sbb-autocomplete>
`,
standalone: false,
})
class AutocompleteWithNumbers {
selectedNumber: number;
Expand All @@ -286,6 +295,7 @@ class AutocompleteWithNumbers {
}
</sbb-autocomplete>
`,
standalone: false,
})
class AutocompleteWithOnPushDelay implements OnInit {
@ViewChild(SbbAutocompleteTrigger, { static: true })
Expand All @@ -311,6 +321,7 @@ class AutocompleteWithOnPushDelay implements OnInit {
}
</sbb-autocomplete>
`,
standalone: false,
})
class AutocompleteWithNativeInput {
optionCtrl = new FormControl('');
Expand All @@ -334,6 +345,7 @@ class AutocompleteWithNativeInput {

@Component({
template: `<input placeholder="Choose" [sbbAutocomplete]="auto" [formControl]="control" />`,
standalone: false,
})
class AutocompleteWithoutPanel {
@ViewChild(SbbAutocompleteTrigger) trigger: SbbAutocompleteTrigger;
Expand All @@ -358,6 +370,7 @@ class AutocompleteWithoutPanel {
}
</sbb-autocomplete>
`,
standalone: false,
})
class AutocompleteWithGroups {
@ViewChild(SbbAutocompleteTrigger) trigger: SbbAutocompleteTrigger;
Expand Down Expand Up @@ -398,6 +411,7 @@ class AutocompleteWithGroups {
}
</sbb-autocomplete>
`,
standalone: false,
})
class AutocompleteWithIndirectGroups extends AutocompleteWithGroups {}

Expand All @@ -415,6 +429,7 @@ class AutocompleteWithIndirectGroups extends AutocompleteWithGroups {}
}
</sbb-autocomplete>
`,
standalone: false,
})
class AutocompleteWithSelectEvent {
selectedNumber: string;
Expand All @@ -432,6 +447,7 @@ class AutocompleteWithSelectEvent {
<input [formControl]="formControl" [sbbAutocomplete]="auto" />
<sbb-autocomplete #auto="sbbAutocomplete"></sbb-autocomplete>
`,
standalone: false,
})
class PlainAutocompleteInputWithFormControl {
formControl = new FormControl('');
Expand All @@ -449,6 +465,7 @@ class PlainAutocompleteInputWithFormControl {
}
</sbb-autocomplete>
`,
standalone: false,
})
class AutocompleteWithNumberInputAndNgModel {
selectedValue: number;
Expand Down Expand Up @@ -483,6 +500,7 @@ class AutocompleteWithNumberInputAndNgModel {
}
</sbb-autocomplete>
`,
standalone: false,
})
class AutocompleteWithDifferentOrigin {
@ViewChild(SbbAutocompleteTrigger) trigger: SbbAutocompleteTrigger;
Expand All @@ -497,13 +515,15 @@ class AutocompleteWithDifferentOrigin {
<input autocomplete="changed" [(ngModel)]="value" [sbbAutocomplete]="auto" />
<sbb-autocomplete #auto="sbbAutocomplete"></sbb-autocomplete>
`,
standalone: false,
})
class AutocompleteWithNativeAutocompleteAttribute {
value: string;
}

@Component({
template: '<input [sbbAutocomplete]="null" sbbAutocompleteDisabled>',
standalone: false,
})
class InputWithoutAutocompleteAndDisabled {}

Expand All @@ -519,6 +539,7 @@ class InputWithoutAutocompleteAndDisabled {}
}
</sbb-autocomplete>
`,
standalone: false,
})
class AutocompleteWithActivatedEvent {
states = ['California', 'West Virginia', 'Florida'];
Expand All @@ -540,6 +561,7 @@ class AutocompleteWithActivatedEvent {
</sbb-option>
}
</sbb-autocomplete>`,
standalone: false,
})
class AutocompleteLocaleNormalizer {
@ViewChild(SbbAutocompleteTrigger, { static: true })
Expand Down Expand Up @@ -570,6 +592,7 @@ class AutocompleteLocaleNormalizer {
<sbb-option-hint>hint</sbb-option-hint>
}
</sbb-autocomplete>`,
standalone: false,
})
class AutocompleteHint {
@ViewChild(SbbAutocompleteTrigger) trigger: SbbAutocompleteTrigger;
Expand Down
1 change: 1 addition & 0 deletions src/angular/autocomplete/autocomplete.zone.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ const SIMPLE_AUTOCOMPLETE_TEMPLATE = `

@Component({
template: SIMPLE_AUTOCOMPLETE_TEMPLATE,
standalone: false,
})
class SimpleAutocomplete implements OnDestroy {
numberCtrl = new FormControl<{ name: string; code: string; height?: number } | string | null>(
Expand Down
1 change: 1 addition & 0 deletions src/angular/chips/chip-input.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,7 @@ describe('SbbChipInput', () => {
</sbb-chip-list>
</sbb-form-field>
`,
standalone: false,
})
class TestChipInput {
@ViewChild(SbbChipList) chipListInstance: SbbChipList;
Expand Down
2 changes: 2 additions & 0 deletions src/angular/core/option/option.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import { SbbOptionModule } from './option.module';

@Component({
template: `<sbb-option [id]="id" [disabled]="disabled"></sbb-option>`,
standalone: false,
})
class BasicOption {
disabled: boolean;
Expand All @@ -26,6 +27,7 @@ class BasicOption {
<sbb-option>Option</sbb-option>
</sbb-optgroup>
`,
standalone: false,
})
class InsideGroup {}

Expand Down
1 change: 1 addition & 0 deletions src/angular/dialog/dialog.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2268,6 +2268,7 @@ class ComponentWithContentElementTemplateRef {
@Component({
template: '',
providers: [SbbDialog],
standalone: false,
})
class ComponentThatProvidesSbbDialog {
constructor(public dialog: SbbDialog) {}
Expand Down
1 change: 1 addition & 0 deletions src/angular/i18n/sbb-ch-patch.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ declare let $localize: any;
<span>{{ now | date: 'longTime' }}</span>
<span>{{ now | date: 'fullTime' }}</span>
`,
standalone: false,
})
class DateFormat {
now = new Date(2020, 0, 1, 0, 0, 0);
Expand Down
1 change: 1 addition & 0 deletions src/angular/icon/icon.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1206,6 +1206,7 @@ describe('SbbIcon without HttpClientModule', () => {

@Component({
template: `<sbb-icon [svgIcon]="iconName"></sbb-icon>`,
standalone: false,
})
class IconFromSvgName {
iconName: string | undefined = '';
Expand Down
Loading

0 comments on commit fbce1d5

Please sign in to comment.