-
Notifications
You must be signed in to change notification settings - Fork 145
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
chore(ui): Upgrade TypeScript 5.6.2 plus types devDependencies in ui #12709
Conversation
ui-component-tests failure INFO: Mon Sep 16 16:18:51 UTC 2024: Will use junit2jira to create CSV for BigQuery input |
/test ui-component-tests |
Images are ready for the commit at 11d1347. To use with deploy scripts, first |
/test ocp-4-16-ui-e2e-tests |
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.
Although [...uniqueComponents] would be even clearer, TypeScript compiler sees "target": "es5" even though webpack and babel use "browserslist": ["Chrome >= 80"] from package.json file.
Agreed, and when I saw the diff before reading the PR description my initial thought was this would be more readable as:
const uniqueComponents = uniq(allVulnerableComponents.map((c) => c.name));
const affectedComponentsText =
uniqueComponents.length === 1
? uniqueComponents[0]
: `${uniqueComponents.length} components`;
so even as the original author I'm not crazy about the Set/Iterator approach here in hindsight.
Also, here is an item from the release notes I've been looking forward to as a DX enhancement:
@dvail Did the lack of Especially if yes, the compiler option seems like a worthwhile follow up. |
I honestly don't recall. I think in concept the |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #12709 +/- ##
==========================================
+ Coverage 48.15% 48.17% +0.02%
==========================================
Files 2434 2434
Lines 174159 174160 +1
==========================================
+ Hits 83864 83906 +42
+ Misses 83510 83475 -35
+ Partials 6785 6779 -6
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Description
https://devblogs.microsoft.com/typescript/announcing-typescript-5-6/
https://devblogs.microsoft.com/typescript/announcing-typescript-5-6/#disallowed-nullish-and-truthy-checks
https://devblogs.microsoft.com/typescript/announcing-typescript-5-6/#region-prioritized-diagnostics-in-editors
https://devblogs.microsoft.com/typescript/announcing-typescript-5-6/#granular-commit-characters
What’s next?
microsoft/TypeScript#59905
TypeScript 5.7 Final Release target is 2024-11-21 around sprint 4.7C
Errors
Apparently a side-effect for work on iterators (that I omitted from the high points).
Because
uniqueComponents.size === 1
addas string
type assertion.Although
[...uniqueComponents]
would be even clearer, TypeScript compiler sees"target": "es5"
even though webpack and babel use"browserslist": ["Chrome >= 80"]
from package.json file.Residue
downlevelIteration
option?https://www.typescriptlang.org/tsconfig/#downlevelIteration
Bonus
npm run tsc
toscripts
, becausenpm run build
takes several minutes and seems to stop at first compile error.Note: although
yarn tsc
was possible without need to add toscripts
, even better to make the command visible (beyond necessity to do so).Addendum
Thank you, David for insightful review comments.
Indeed,
"target": "es2020"
in tsconfig.json file is compatible with"browserslist": ["Chrome >= 80"]
in package.json file.Maybe reduced complications has achieved reduced confusion. I thought I had tried that multiple times without success in the past.
After I verified that
[...set]
worked with update totarget
I replaced the code with more readable suggestion.User-facing documentation
Testing and quality
Automated testing
How I validated my change
npm run lint
in ui/apps/platformnpm run build
in ui/apps/platform and then compute branch - master for the followingwc build/static/js/*.js
main.js -2043 = 4616822 - 4618865
total -1838 = 11699313 - 11701151
ls -al build/static/js/*.js | wc
files 0 = 177 - 177
npm run start
in ui/apps/platformManual testing
Visit /main/vulnerabilities/workload-cves, click Deployments, and then in table body, click deployment link:
Before change: see presence of TypeScript error and name if one component in Affected components
After change: see absence of TypeScript error and ditto in Affected components
Integration testing