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

Update the Angular wrapper to work with Angular@16. #10396

Merged
merged 38 commits into from
Jun 12, 2023

Conversation

jansiegel
Copy link
Member

@jansiegel jansiegel commented Jun 5, 2023

Context

The main changes made in this PR:

  1. Since the release of angular@16 the @handsontable/angular package was no longer compatible with the latest Angular release. This PR aims to change that.
    I moved the current wrapper logic to a new library template based on @angular/cli@12. The new wrapper build uses the Ivy compiler, and being built with angular@12 makes it compatible with Angular versions 12 up to 16 (currently the latest release).

    Unfortunately, it breaks the compatibility with Angular versions 11 and earlier.
    It's worth noting, that Angular currently provides active support only for versions 14+.

  2. Currently, the examples workflow does not test the angular-based examples properly.
    When building the /next/ section of the examples only handsontable is being symlinked in the examples' node_modules. What's even worse, the wrapper version being used in the build and testing process is not latest, but 12.0.1.

    After the changes made in this PR, both handsontable and @handsontable/angular should be linked properly in the examples build/test workflow.

  3. I removed the Angular 9-11 examples, as these versions are no longer compatible with the wrapper.

  4. I added Angular 14-16 examples + created an angular-next section which builds and tests the wrapper against the version of Angular tagged as next.

  5. While rewriting the wrapper to later versions of Angular (mostly 16 and 12), I had to make some corrections regarding the typescript typing. There are places in the wrapper logic that would benefit from a bigger refactor, but I did not make any major changes as it was not in the scope of this task.

  6. For the same reason as above, I had to make some changes to Handsontable, namely, adding some missing type definitions that were not tested with the wrapper based on Angular@9.

  7. I reverted the temporary changes done in the release process of 12.4.0, which purpose was to prevent the workflows from using the latest angular version.

  8. I modified the code-examples workflow to utilize the actions/setup-node's caching mechanism instead of actions/cache. The latter would break the new angular wrapper build + it makes sense to use the pre-built caching that is already being used in our other workflows.

  9. I had to make some modifications to other workflows, as the new set of dependencies being introduced with @angular/cli@12 broke some things, like the documentation linter. This is a bigger issue regarding dependency management in the monorepo, which will have to be tackled at some point in the future.

  10. For the same shared-dependency-based reasons, I had to modify the vue3 wrapper tests, as some of them no longer passed. (The changes make sense, as the types were mismatched in one of the tests, but it was not being analyzed before)

How has this been tested?

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature or improvement (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Additional language file or change to the existing one (translations)

Related issue(s):

  1. handsontable/dev-handsontable#1292
  2. Angular v16 (Ivy support) #10349

Affected project(s):

  • handsontable
  • @handsontable/angular
  • @handsontable/react
  • @handsontable/vue
  • @handsontable/vue3

Checklist:

- Remove examples for angular@<12
- Add examples for angular@14-16
- Add examples for angular@next
- Add missing types to Handsontable
- Modify the helper scripts and GHA workflows
- Regenerate package-lock
@krzysztofspilka krzysztofspilka linked an issue Jun 5, 2023 that may be closed by this pull request
@krzysztofspilka krzysztofspilka added Breaking change Angular Issues regarding the @handsontable/angular wrapper. labels Jun 5, 2023
jansiegel and others added 21 commits June 6, 2023 08:23
…dd changelog, correct a problem found by the code quality workflow.
…ions/setup-node in the code examples workflow.
@jansiegel jansiegel marked this pull request as ready for review June 7, 2023 08:29
@jansiegel jansiegel requested a review from budnix June 7, 2023 08:30
@budnix budnix self-requested a review June 7, 2023 11:51
budnix
budnix previously approved these changes Jun 7, 2023
Copy link
Member

@budnix budnix left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good 👌 I tested the bundle 0.0.0-next-44d778b-20230607 with simple apps that use Angular 12 and Angular 16, and I didn't find any issues.

@github-actions
Copy link

github-actions bot commented Jun 12, 2023

Launch the local version of documentation by running:

npm run docs:review 80e131154ff3019cb77253b21135f08eb1a08317

@jansiegel jansiegel requested a review from budnix June 12, 2023 08:50
Comment on lines 21 to 28
"@angular/animations": "^16.0.0",
"@angular/common": "^16.0.0",
"@angular/compiler": "^16.0.0",
"@angular/core": "^16.0.0",
"@angular/forms": "^16.0.0",
"@angular/platform-browser": "^16.0.0",
"@angular/platform-browser-dynamic": "^16.0.0",
"@angular/router": "^16.0.0",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For /next/ examples, shouldn't the "latest" tag be used here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup 9cab13b

@@ -92,12 +92,13 @@ const buildDependencyGetter = (version) => {
rxjs: ['https://cdn.jsdelivr.net/npm/rxjs@6/bundles/rxjs.umd.js', [/* todo */]],
'core-js': ['https://cdn.jsdelivr.net/npm/core-js@2/client/core.min.js', [/* todo */]],
zone: ['https://cdn.jsdelivr.net/npm/zone.js@0.9/dist/zone.min.js', [/* todo */]],
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WDYT to bump the zonejs deps? I am thinking of bumping to the same version as in the wrapper deps ~0.11.4.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like a good idea 👍 80e1311

Copy link
Member

@budnix budnix left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Also, I've checked the Docs by deploying the latest changes to the staging, and it also looks good.

@jansiegel jansiegel merged commit a81dd9e into develop Jun 12, 2023
24 checks passed
@jansiegel jansiegel deleted the feature/dev-issue-1292 branch June 12, 2023 09:26
Copy link
Contributor

@aninde aninde left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have verified that the build process using npm run all build successfully builds the correct version and examples, including Angular 16.0.3 (angular-16 and currently angular-next).
Screenshot 2023-06-12 at 14 24 25

The Handsontable-Angular integration is functional in environments built with Angular versions 12, 13, 14, 15 and 16. Tested with 0.0.0-next-44d778b-20230607.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Angular Issues regarding the @handsontable/angular wrapper. Breaking change Status: Released Verified by QA
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Angular v16 (Ivy support)
5 participants