Closed cheehongw closed 2 months ago
Loading service still works
https://github.com/CATcher-org/CATcher/assets/72195240/0988826f-38a3-469f-8384-54c768ea1bad
OS: macOS Sonoma 14.4.1 Browser: Safari Browser Version: Version 17.4.1 (19618.1.15.11.14) Local Angular Version: 12.2.18 node Version: v14.19.3 npm Version: 6.14.17
npm install
: success
npm run ng:serve:web
: - had to run npx browserslist --updatedb
for it to work
npm run test
: - had to delete package-lock.json
and node-modules
and re-run npm install
for it to work
npm run e2e
: success
No bugs found
Once we use Node 16 for the GitHub CI tests we need to update the branch protection to require linux-setup-and-tests (16.x)
instead of linux-setup-and-tests (14.x)
Finally got the CI working. This comment will detail the changes made to the environment for the Angular 13 upgrade:
Upgrade to Node 16, npm8
from Node14, npm6
@octokit/core
isn't used directly as a dependency in our project, but @octokit/rest
depends on it and npm8
installs the latest one (v6.1.2
), which doesnt support Node 16.
@octokit/core
at v4, which is the last version to support Node 16Manually install firefox for the macos-latest
runner. As of this comment, macos-latest
uses a macos 14 arm64 image, which doesnt include firefox. This seems to be a very recent change, since macos-latest
always pointed to a x64 image which came pre-installed with firefox.
OS: Windows 10 Browser: Chrome Browser Version: 124.0.6367.91 Local Angular Version: 13.4.0 node Version: 16.20.2 npm Version: 8.19.4
npm install
npm run ng:serve:web
npm run test
npm run e2e
All success
No bugs found
Finally got the CI working. This comment will detail the changes made to the environment for the Angular 13 upgrade:
- Upgrade to Node 16, npm8 from Node14, npm6
@octokit/core
isn't used directly as a dependency in our project, but@octokit/rest
depends on it andnpm8
installs the latest one (v6.1.2
), which doesnt support Node 16.
- As such, this PR includes a new dev dependency to freeze
@octokit/core
at v4, which is the last version to support Node 16- We should consider removing it once we upgrade to Angular 15, which supports Node 18.
- Manually install firefox for the
macos-latest
runner. As of this comment,macos-latest
uses a macos 14 arm64 image, which doesnt include firefox. This seems to be a very recent change, sincemacos-latest
always pointed to a x64 image which came pre-installed with firefox.
Thanks for the fix @cheehongw! I have some comments on the octokit dependency.
@octokit/core
into devDependencies should not break stuff, but I think the best practice is to put it into the dependencies instead.@octokit/rest
to ^18.12.0
, but this can cause some breaking changes (we need to change some parts of our code).Thanks for the review @chunweii
octokit/core
to dependenciesoctokit/rest@18.12.0
? I am unable to find anything in the octokit/rest
release notes about changing how octokit/core
is depended upon.
octokit/rest
has alot of breaking changes. Going from v16 -> v17 alone seems to introduce quite a bit of breaking changes. As such, I think this is better off as a separate PR since it is not related to Angular 13.OS: Ubuntu 22.04 Browser: Chrome Browser Version: 123.0.6312.122 Local Angular Version: 13.4.0 node Version: 16.20.2 npm Version: 8.19.4
npm install
npm run ng:serve:web
npm run test
npm run e2e
All success
No bugs found
Any reason for targeting
octokit/rest@18.12.0
? I am unable to find anything in theoctokit/rest
release notes about changing howoctokit/core
is depended upon.
- Either way and as you mentioned, the task of upgrading
octokit/rest
has alot of breaking changes. Going from v16 -> v17 alone seems to introduce quite a bit of breaking changes. As such, I think this is better off as a separate PR since it is not related to Angular 13.
This old version of octokit (v16) does not support the use of ESM imports (I don't see it in the documentations), which imo makes the type checking better.
Furthermore, one of the dependencies in octokit/rest is causing the problem of installing an incompatible version of octokit/core. I tried installing v18 and there were no issues with installation afterwards (but I could also have tried 17, or some other version)
But I agree we should not upgrade octokit in this PR
Summary:
Upgrade to Angular 13 and Node 16 This pull request addresses some of the outdated packages in our application.
Partially addresses #1192
Changes Made:
Upgrade to Angular 13 using ng update
See: https://update.angular.io/?l=3&v=12.0-13.0
tslint config got removed in
angular.json
due to it being deprecated.Upgrade dependency
ngx-markdown@13.1.0
from12.0.1
to support Angular 13ComponentFactory
andComponentFactoryResolver
got removed in Angular 13. UpdatedLoadingService
and its spec file to use the component directly.MatSpinner
got renamed toMatProgressSpinner
in Angular 13Upgrade
apollo-angular@2.6.0
to3.0.1
to support Angular 13ApolloModule
under AppModuleUpdated
karma.conf.js
because tests with--code-coverage
were failing. Fix was found hereProposed Commit Message:
Some of our packages are old and outdated. We should actively maintain and keep these packages up-to-date so it is easier to maintain in the future.
Let's upgrade to Angular 13 to keep our packages up-to-date.