Upgrade from Angular 10 to Angular 12

Bug #1948035 reported by Bill Erickson
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Evergreen
Fix Released
Medium
Unassigned

Bug Description

Evergreen post-3.8

The guide: https://update.angular.io/?v=10.2-12.0

Bill Erickson (berick)
summary: - Upgrade from Angualr 10 to Angular 12
+ Upgrade from Angular 10 to Angular 12
Revision history for this message
Bill Erickson (berick) wrote :

Here's a branch:

https://git.evergreen-ils.org/?p=working/Evergreen.git;a=shortlog;h=refs/heads/user/berick/lp1948035-angular-12

Minimal changes required. "ng update" did most of the work. Initial UI testing looks good.

Beware of a few things:

1. A couple of tests are failing for DateRangeSelect and EgHelpPopoverComponent. It was not immediately clear to me how to fix them.

2. I could have updated ng-bootstrap to version 10, however v10 no longer supports NgbTabset (which is currently deprecated), so a number of our components break. Because of this, I stuck with version 7. We should migrate all ng-bootstrap tabs to navs before the next update. (Will open a new LP).

----

To update an existing server:

cd /tmp
wget 'https://nodejs.org/dist/v14.18.1/node-v14.18.1-linux-x64.tar.xz'
sudo tar -C /usr/local --strip-components 1 -xJf node-v14.18.1-linux-x64.tar.xz
sudo npm install -g @angular/cli@^12.2.0
cd $EVERGREEN/Open-ILS/src/eg2
rm -rf node_modules/
npm install
ng build # etc.

tags: added: pullrequest
Changed in evergreen:
assignee: Bill Erickson (berick) → nobody
Revision history for this message
Bill Erickson (berick) wrote :

Opened separate bug for NgbTabset replacement: https://bugs.launchpad.net/evergreen/+bug/1948693

Revision history for this message
Bill Erickson (berick) wrote :

Rebased to master:

https://git.evergreen-ils.org/?p=working/Evergreen.git;a=shortlog;h=refs/heads/user/berick/lp1948035-angular-12-v2

Prod/dev builds still working OK.

Note if 'npm install' takes longer than usual, there is an unresolved issue related to this. The build will eventually complete after several minutes. https://github.com/npm/cli/issues/2306

See previous comments for updating an existing server.

Changed in evergreen:
assignee: nobody → Jane Sandberg (sandbergja)
tags: added: signedoff
Changed in evergreen:
assignee: Jane Sandberg (sandbergja) → nobody
status: New → Fix Committed
importance: Undecided → Medium
Revision history for this message
Jane Sandberg (sandbergja) wrote :

Works well for me, Bill! Thanks for getting us up to date. I've pushed this to master.

I also added a follow-up commit to resolve the three failing tests. Tests have their own tsconfig, which was using commonjs module definitions rather than the default esnext ones. Something seems to have come to a head in Angular 12 that makes the commonjs option no longer work -- didn't have the chance to dig around much on this. Anywho, I removed that line from the config, and now the tests are passing.

Revision history for this message
Jane Sandberg (sandbergja) wrote :

Noting a follow-up bug report related to the deprecated linter: bug 1959048

Changed in evergreen:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.