-
Notifications
You must be signed in to change notification settings - Fork 215
Angular 18 update #441
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
Comments
We just released a beta release, please test it and provide us with feedback. |
I've just tested the beta version. The property "order" seems to be missing in "as-split-area" since I get the following error message:
Moreover, the member "IOutputData" does no longer exist:
Since the changes of version 18 have not been documented yet, I don't know what to change right there. Have the property/member names been changed? All I did was simply upgrading to the beta version. Version 17 is working perfectly fine if being installed with "npm i --legacy-peer-deps" in order to ignore the dependencies errors, though. |
I tested the beta version and it is not working on Firefox.
That being said, it works fine on Chrome. According to this Stackoverflow it needs an additional check: https://stackoverflow.com/questions/27313488/touchevent-not-working-in-firefox-and-other-website-browser See https://stackblitz.com/edit/stackblitz-starters-6ytofo?file=src%2Fmain.html |
After upgrading, I now get this error on all of my unit tests. FAIL src/app/shipping/components/shipment-report/shipment-report.component.spec.ts |
@MelanieW97 There were some breaking changes indeed. They are currently not yet documented unfortunately. You can read the PR message for now: #444. In your specific use case - @KBroichhausen Thanks for pointing it out! You can create a PR that fixes it if you want or I will do it in the following days. @r2musings Please provide a reproduction so we can check what the problem is. |
Alright, thank you. I got it to work with these changes. |
We get the same error as @r2musings after upgrading to Angular 18 when running our unit tests (
If I remove the From what I've read, this error occurs most often when there are circular dependencies in the project. These can be shown using the package "madge":
After entering newer versions of the dependencies in the Stackblitz Demo's |
Thanks @Xorok for the confirmation and the stackblitz. I had an investor demo and ended up just rolling back versions of angular-split as I couldn't risk the unit tests failing my build pipelines. |
@Xorok which test runner are you using? |
@Harpush The project uses Jest via @angular-builders/jest |
@Harpush My team is using angular-split together with Example: <ng-container>
<as-split>
<!-- Left-to-right -->
<ng-container *ngIf="leftToRight; else rightToLeft">
<ng-container *ngTemplateOutlet="areaOneTemplate; context: { order: 0 }"></ng-container>
<ng-container *ngTemplateOutlet="areaTwoTemplate; context: { order: 1 }"></ng-container>
</ng-container>
<!-- Right-to-left -->
<ng-template #rightToLeft>
<ng-container *ngTemplateOutlet="areaTwoTemplate; context: { order: 0 }"></ng-container>
<ng-container *ngTemplateOutlet="areaOneTempalte; context: { order: 1 }"></ng-container>
</ng-template>
<ng-template #areaOneTemplate let-order="order">
<as-split-area [order]="order">
Area One
</as-split-area>
</ng-template>
<ng-template #areaTwoTemplate let-order="order">
<as-split-area [order]="order">
Area Two
</as-split-area>
</ng-template>
</as-split>
</ng-container> angular-split v18.0.0 (after removing |
I am not sure I understand... The order in the template is flipped but the order property is the same - so just don't flip it? I would be happy with a stackblitz to reproduce the problem. |
We can't "just don't flip it", a consumer being able to flip it is a part of intended functionality I pasted my example into StackBlitz as requested: https://stackblitz.com/edit/angular-split-demo-1kyyj4 You can change When doing this with v18.0.0-beta.0, nothing happens when changing |
That's interesting. I would bet on an angular bug here. The old way worked as order took precedence over DOM order but this is unexpected from angular. I will open an issue and see how it goes. If that is by design on the angular side the order property might need to be added back or maybe there is some workaround. |
@kainiedziela Anyway I would recommend this pattern instead for your requirement: <as-split>
<as-split-area>
<ng-container *ngTemplateOutlet="leftToRight ? areaOneTemplate : areaTwoTemplate"></ng-container>
</as-split-area>
<as-split-area>
<ng-container *ngTemplateOutlet="leftToRight ? areaTwoTemplate : areaOneTemplate"></ng-container>
</as-split-area>
</as-split>
<ng-template #areaOneTemplate> Area One </ng-template>
<ng-template #areaTwoTemplate> Area Two </ng-template> Or if you really need a different <as-split>
@for (area of ['area2', 'area1']; track area) {
@switch (area) {
@case ('area1') {
<as-split-area> Area One </as-split-area>
}
@case ('area2') {
<as-split-area> Area Two </as-split-area>
}
}
}
</as-split> and change the areas array order as required and everything will work. This pattern also gives you the best control and performance. |
@Harpush Thanks! Worked like a charm |
For anyone interested we opened an RFC for a snap feature to replace expand/collapse. |
Version 18 is up and we are working on adding some easier transition between breaking changes. I'm closing this for now but feel free to reopen it when there are questions |
Angular 18 was just released today. Is it possible to update this package?
Thank you!
The text was updated successfully, but these errors were encountered: