-
-
Notifications
You must be signed in to change notification settings - Fork 276
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
fix(connect): test install to use target ES2019 #16927
base: develop
Are you sure you want to change the base?
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.
yes, lets target the minimum required levels.
didn't you want to change
--lib ES2022,DOM,ES2022.error
to
--lib DOM,ES2022.error
?
18cb6f7
to
f62f260
Compare
I tested and ES2022 is required but |
It will also work with |
WalkthroughThe diff updates the TypeScript compilation settings in the 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
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.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
packages/connect/e2e/test-yarn-install.sh
(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (5)
- GitHub Check: Type Checking
- GitHub Check: Unit Tests
- GitHub Check: build-deploy
- GitHub Check: prepare_android_test_app
- GitHub Check: Analyze with CodeQL (javascript)
🔇 Additional comments (1)
packages/connect/e2e/test-yarn-install.sh (1)
25-25
: Verify library configuration and consider adding ES2022.error.The PR objectives mention that
ES2022.error
library is needed, but it's not included in the TypeScript compilation command. Additionally, let's verify if the typesnode
andw3c-web-usb
are still required.Consider updating the command to include the necessary libraries:
-yarn tsc ./index.ts --types node,w3c-web-usb --esModuleInterop --lib ES2022,DOM --target ES2019 --module commonjs +yarn tsc ./index.ts --types node,w3c-web-usb --esModuleInterop --lib ES2022,DOM,ES2022.error --target ES2019 --module commonjsLet's verify if the types are still needed:
✅ Verification successful
🏁 Script executed:
#!/bin/bash # Description: Check if the types are used in the codebase rg -l "w3c-web-usb|WebUSB" .Length of output: 3759
I'll search the repository for any existing references to
ES2022.error
in configuration files to determine if it's already used elsewhere or needed.
🏁 Script executed:
#!/bin/bash # Search for any tsconfig or files referencing ES2022.error rg "ES2022\.error" .Length of output: 22
Action: Update the compilation command to include ES2022.error, while keeping both node and w3c-web-usb types.
- Searches confirm that references to WebUSB (and by extension
w3c-web-usb
) appear in multiple parts of the codebase, so removing them is not advisable.- Although there’s no existing reference to
ES2022.error
in any configuration file, the PR objectives specify its need. This suggests the omission is likely an oversight, and the command should be updated as proposed.
@@ -22,5 +22,5 @@ echo import TrezorConnect from \"@trezor/connect\" >index.ts | |||
|
|||
# compile with typescript | |||
yarn add [email protected] |
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.
💡 Verification agent
🧩 Analysis chain
Verify the TypeScript version.
The TypeScript version 5.5.4 seems to be from the future. Let's verify the latest stable version.
🌐 Web query:
What is the latest stable version of TypeScript?
💡 Result:
As of February 2025, the latest stable version of TypeScript is 5.7.3[8]. This version includes performance improvements, enhanced type checking capabilities, and continued support for modern ECMAScript features while maintaining backward compatibility with previous releases[4][7].
The current beta release is TypeScript 5.8[2], which developers can test through npm using npm install -D typescript@beta
. However, for production environments, Microsoft recommends using the stable 5.7.x branch until 5.8 completes its testing phase[7][9].
Key details about recent versions:
- TypeScript 5.7 introduced isolated declaration generation and improved regular expression syntax checking[4]
- Version 5.6 added support for the ECMAScript
Set
methods proposal[2] - The package size has been optimized through tree-shaking and module system improvements since TypeScript 5.0[1]
To install the latest stable version:
npm install -D typescript
Developers can verify their installed version using:
tsc --version
Citations:
- 1: https://devblogs.microsoft.com/typescript/announcing-typescript-5-0/
- 2: https://github.com/microsoft/typescript/releases
- 3: https://devblogs.microsoft.com/typescript/announcing-typescript-5-4/
- 4: https://effectivetypescript.com/2024/07/02/ts-55/
- 5: https://en.wikipedia.org/wiki/TypeScript
- 6: https://www.npmjs.com/package/typescript/v/4.8.4
- 7: https://www.typescriptlang.org
- 8: https://www.npmjs.com/package/typescript
- 9: https://www.typescriptlang.org/download/
Update TypeScript version and align library configuration.
- The installation command pins TypeScript to version 5.5.4, which is behind the current stable release (5.7.3 as of February 2025). Consider updating to 5.7.3.
- Additionally, the library flags in the configuration differ from the PR objectives (the PR mentions using ES2022.error, yet the script uses ES2022,DOM). This inconsistency should be reviewed and corrected.
@mroz22 What do you think? should we do like this? |
Description
It looks like target
ES2022
was not required, havingES2019
withDOM,ES2022.error
lib was enough to satisfy typescript.