-
Notifications
You must be signed in to change notification settings - Fork 373
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
Improved Angular compatibility #2229
Improved Angular compatibility #2229
Conversation
✅ Deploy Preview for jsonforms-examples ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
(Follow up of #2212) |
Edit: I went with pnpm.overrides |
@JBBianchi really appreciate your efforts! |
We could actually use Angular v16 for the build process, which will allow to be compliant with #2224 . Should I add this to this PR as well ? It's basically just changing the pnpm.overrides and removing the @sdirix @lucas-koehler WDYT ? Edit: FYI, in the meanwhile, I pushed those changes to https://github.com/JBBianchi/jsonforms/tree/angular-v16 so you can compare both branches. (the pipeline runs successfully https://github.com/JBBianchi/jsonforms/actions/runs/7220751941 ) |
Hi @JBBianchi, |
For ng16, I'll hold my horses because the example doesn't seem to run. I'll need to investigate a bit more even though all lights seemed green at first. Edit: For the record, I have no idea why but there is a "glitch" in the rollup output of the example with Angular 16. In
But in the rollup output, the static bit is messed up:
Edit 2: the fix was simply to update rollup, I should have thought about that faster. |
@lucas-koehler @sdirix the PR should be ready for review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi thanks again for the PR ❤️
The changes already look pretty good to me :)
I have some minor comments/questions inline.
- readded angularCompilerOptions in tests tsconfig - removed empty imports array in tests - applied flex to divs only in group-layout renderer - removed html comment in range renderer
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi the code changes LGTM. I had a look at the example. It looked pretty good to me. I only noticed that the group layout is now a bit cramped due to missing padding.
@JBBianchi Thanks for the update. Do you know whether the code will still work for Angular 15 when it's built with Angular 16 ? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the seed, I tested the changes with 15, 16 and 17. The seed did not compile with 15 but worked with 16 and 17. Thus, I suggest removing compatibility to 15. It is end of life in less than half a year anyway.
Also I noticed another bug, the packages/angular-material/src/controls/range.renderer.ts
does no longer have functioning data binding. I think this might already have been introduced with the Angular 15 support PR when the value and onChange properties were removed in packages/angular-material/src/controls/range.renderer.ts
Thanks for testing in the seed v15, that's unfortunate but indeed, support could be dropped. I'll try to have look during next week if I have some time. |
It seems indeed that a library built with ng 16 is not compatible with ng 15 because the signature of the For the range control, the binding of the change event was "cleaned out" by mistake in this commit. Next commit will remove compatibility with ng 15 and rebind a the event to the range control. |
…nchi/jsonforms into angular-v15-no-flex-layout
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @JBBianchi thanks for the updates :) Changes look pretty good to me now. I have just one question regarding the pnpm overrides inline.
I also updated the lock file.
package.json
Outdated
"overrides": { | ||
"@angular/animations": "^16.0.0", | ||
"@angular/cdk": "^16.0.0", | ||
"@angular/common": "^16.0.0", | ||
"@angular/core": "^16.0.0", | ||
"@angular/forms": "^16.0.0", | ||
"@angular/material": "^16.0.0", | ||
"@angular/platform-browser": "^16.0.0", | ||
"@angular/router": "^16.0.0", | ||
"@angular-devkit/build-angular": "^16.0.0", | ||
"@angular-eslint/eslint-plugin": "^16.0.0", | ||
"@angular-eslint/eslint-plugin-template": "^16.0.0", | ||
"@angular-eslint/schematics": "^16.0.0", | ||
"@angular-eslint/template-parser": "^16.0.0", | ||
"@angular/compiler": "^16.0.0", | ||
"@angular/compiler-cli": "^16.0.0", | ||
"@angular/platform-browser-dynamic": "^16.0.0", | ||
"@ngtools/webpack": "^16.0.0", | ||
"ng-packagr": "^16.0.0", | ||
"zone.js": "^0.13.0" | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we still need these overrides now that we removed Angular 15 compatibility?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not 100% sure. If I'm not mistaken, as the packages declare a compatibility with Angular 16 and 17 (and maybe 18 in the future), pnpm will install the highest version compatible by default, so v17. So we need the overrides to say "build with v16 even if the lib is compatible with v17".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we use Angular 16
in the devDependencies
and not 16 || 17
? As we don't bundle Angular the peerDependencies
version is the important one for the consumer and could still be 16 || 17
even if the devDependencies
only declare 16
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sdirix thanks for your input, that's better indeed.
This reverts commit fe5f906.
Update the pnpm lock file and override vue and @vue/compiler-sfc dependencies to ~3.3.13 because vue-vanilla tests currently fail when updating to vue 3.4.x.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @JBBianchi , the PR looks good to me now. I updated all dependencies and added overrides for vue because its latest version doesn't work. I added issue #2234 to fix this later.
Thanks again for your effort on the Angular packages ❤️
@@ -140,9 +143,6 @@ export const removeSchemaKeywords = (path: string) => { | |||
top: 0; | |||
right: 0; | |||
} | |||
.hide { | |||
display: none; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this deleted?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It might be an error when factoring out @angular/flex-layout
with [ngStyle]="{ display: hidden ? 'none' : '' }"
instead of [fxHide]="hidden"
. Do you encounter any problem ?
Edit:
It is mistake indeed. The delete button should be displayed only when an item is hovered and hidden (via the hide
class) by default. Removing the hide class made the delete button always visible.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah right, that's why I am writing. The delete button is always shown. We created a custom listWithDetail renderer to counter this problem. Is there a better solution? Or can you restore the deleted CSS class?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not a maintainer of this repo but I'd assume you can open an issue explaining the problem and them submit a PR to solve it. Then maintainers can maybe accept the PR and push it in the next release.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Happy to review and merge a PR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've created the issue: #2327
Should you give me permission in order to open a MR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@stanisev Thanks for creating the issue :) You can gladly open a MR anytime you want.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@lucas-koehler It seems that I cannot create branch/open MR, can you please help me it seems to be permission issue
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @stanisev , did you try to push the branch directly to this repository? This is not possible because you do not have write permissions. You need to fork the repository and push the branch to your fork. Then, you should be able to open a MR against this repository.
In the current stage,
@jsonforms/angular-material
still relies on@angular/flex-layout
.This package has been deprecated and isn't compatible with Angular v16+, therefore
@jsonforms/angular-material
would be stuck to Angular v15.This PR removes the dependency to
@angular/flex-layout
by replacing the attributes with plain CSS instead.Doing so,
@jsonforms/angular-material
becomes compatible with Angular v16 and v17 (at first sight).For testing purposes, I forced upgrade the
jsonforms-angular-seed
projects to both v16 and v17:I tried building the packages as submitted in this PR and running them in the above projects and it seems to work fine (it displays, I can remove one of the two items and I can update a text field. I didn't test more than that).
Related to