-
Notifications
You must be signed in to change notification settings - Fork 66
Fix/vscode azext utils 4.0.0 #1690
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
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.
Pull Request Overview
This PR upgrades @microsoft/vscode-azext-utils to v4.0.0 and addresses breaking changes in its type definitions. Additionally, it fixes React hooks lint violations across multiple webview components by ensuring useEffect hooks properly manage state updates and dependencies.
Key Changes:
- Updated
@microsoft/vscode-azext-utilsfrom ^3.5.1 to ^4.0.0 with corresponding type-safe implementation for authentication scope handling - Fixed React hooks violations by deferring synchronous state updates within effect bodies using
setTimeout - Upgraded
eslint-plugin-react-hooksto ^7.0.0 to enforce stricter React hooks rules
Reviewed Changes
Copilot reviewed 10 out of 12 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| package.json | Upgraded @microsoft/vscode-azext-utils to ^4.0.0 |
| webview-ui/package.json | Upgraded eslint-plugin-react-hooks to ^7.0.0 |
| src/tree/azureAccountTreeItem.ts | Added type-safe handling for authentication scope requests accepting either string arrays or AuthenticationWwwAuthenticateRequest objects |
| webview-ui/src/components/TextWithDropdown.tsx | Deferred state update using setTimeout to prevent synchronous setState calls within useEffect |
| webview-ui/src/components/Dialog.tsx | Refactored to use refs for latest prop values and added empty dependency arrays to prevent effect re-runs |
| webview-ui/src/components/CustomDropdown.tsx | Deferred state update using setTimeout to prevent synchronous setState calls within useEffect |
| webview-ui/src/TestStyleViewer/TestStyleViewer.tsx | Added dependency array and moved helper functions inside useEffect to run once on mount |
| webview-ui/src/Periscope/Periscope.tsx | Added empty dependency array to useEffect to run once on mount |
| webview-ui/src/InspektorGadget/Traces.tsx | Deferred state update using setTimeout to prevent synchronous setState calls within useEffect |
| webview-ui/src/InspektorGadget/InspektorGadget.tsx | Deferred state update using setTimeout to prevent synchronous setState calls within useEffect |
Files not reviewed (1)
- webview-ui/package-lock.json: Language not supported
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Signed-off-by: Tatsat Mishra <tamishra@microsoft.com>
399d796 to
7cac264
Compare
Signed-off-by: Tatsat Mishra <tamishra@microsoft.com>
tejhan
left a comment
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, LGTM.
Hiya, This PR should fixes #1681 which is a major upgrade and require some code changes, definitely need a good eyes @tejhan if you can please take a look and do bit of a testing as well please.
Explanation:
This PR updates the extension dependency
@microsoft/vscode-azext-utils to ^4.0.0. The new azext-utils version includes typing and API changes that required a small fix in our createCredentialsForScopes implementation on the Azure account tree item. The change ensures correct type-safe handling of authentication scope requests that can be either an array of scopes or an AuthenticationWwwAuthenticateRequest object.Background / Why
@microsoft/vscode-azext-utilskeeps us current with upstream improvements and bug fixes.4.0.0introduces stricter typings and minor API changes; without the fix, TypeScript type errors or runtime issues could occur when constructingTokenCredentialwrappers for Cloud Explorer interactions.createCredentialsForScopeshandler previously assumed certain properties may exist and needed more robust type-checking and clearer error messages.What changed
@microsoft/vscode-azext-utils → ^4.0.0azureAccountTreeItem.tsthat:string[]orAuthenticationWwwAuthenticateRequest(from VS Code)sessionProvider.getAuthSession({ scopes })and throws a localized error when auth session is missingTokenCredential-likeobject with agetTokenimplementation to satisfy callers.