-
Notifications
You must be signed in to change notification settings - Fork 301
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
Development
: Update to Angular 16 and speedup the build process
#6546
Conversation
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.
Tested again locally, running tests on windows works now flawlessly without any workaround
src/main/webapp/app/entities/participation/participation.model.ts
Outdated
Show resolved
Hide resolved
…r properly changing it
… underlying problem
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.
Code looks good
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.
Tested locally and on TS2.
Code changes look good as well
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.
Tested locally and on ts2. Everything, especially navigating works.
Latest code changes look good.
Development
: Fast Angular 16 buildDevelopment
: Update to Angular 16 and speedup the build process
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.
Code looks good 👍
based on #6544
Checklist
General
Client
Motivation and Context
Angular 16 is here! With it it brings a new Vite development server. This development server is much faster than the current one - which will drastically increase developer productivity! 🚀
Description
First of all, this PR updates Angular to version 16.
Also, we drop BrowserSync because of low usage among developers. Routes in the navbar are now coded as absolute paths, because otherwise they didn't work.
To be able to leverage the new Angular Build capabilities, I had to remove the current Webpack configuration because well, it's specific to Webpack. Instead, now all configuration should happen in
angular.json
. This was not possible forBecause of this, I introduced a
prebuild.mjs
script. It creates the merged i18n json files as well as anenvironment.override.ts
file to customize some variables.Because the webpack bundle size analyzer is now dropped from the webpack config (which doesn't exist anymore), I integrated it as a separate step of the production build.
Steps for Testing
npm install
(you might have to delete node_modules first if it errors)Running the tests locally on Windows
Does not apply any more, it should work just fine!
Currently, there is an issue with jest-preset-angular which causes the tests to fail on Windows. Until a proper fix is generally available, you can manually replacenode_modules/jest-preset-angular/build/utils/ngcc-jest-processor.js
before running the test commands with this file: https://gist.github.com/pal03377/a3d85176de1b2ac54a0679283e084fe9Client test justification
Usually, you would expect an update to roughly keep all tests intact. However, ~60 of 5400 client tests broke with this update. Because of this, this PR includes a bunch of in-part random-looking changes to client tests. There are good reasons behind those changes, but they might not be immediately obvious. The following table helps explaining. Use it to look up the reason for a change when you don't understand it from the code.
You don't have to read it all, just look up the file when you are wondering about it in code review.
Here is a table of the changes (pdf): Angular 16 Build Client Test Table.pdf
Review Progress
Code Review
Manual Tests
Screenshots
Screen recording of me removing and re-adding the refresh button on the course page. Previously, my build times were around 16x as long (4x with some build speed improvement tricks):
artemis-client-build-angular-vite.mp4