News
Microsoft Tests Copilot-Powered Tool to Modernize JavaScript/TypeScript in VS Code
Microsoft is previewing a new AI-assisted tool for Visual Studio Code Insiders called the JavaScript/TypeScript Modernizer. It's designed to help developers modernize older JavaScript or TypeScript projects by upgrading npm dependencies and fixing resulting breaking changes, with GitHub Copilot doing much of the work through an interactive Chat workflow in the editor.
It comes with the preview version of the GitHub Copilot App Modernization VS Code Extension when installed in VS Code Insiders, Microsoft's preview/nightly build of VS Code where you get the newest features and experiments first, updated frequently, before they roll into the regular Stable release.
The tool is just about to hit 500,000 installs, having debuted in May and being updated just today.
[Click on image for larger view.] GitHub Copilot App Modernization (source: Microsoft).
"In a nutshell, it analyzes your project (looking at files like package.json), suggests an upgrade plan, and then automatically updates your npm packages to their latest versions," Microsoft said yesterday. "As it upgrades libraries, it also helps apply any necessary code changes to accommodate breaking changes or new APIs."
The announcement on Microsoft's DevBlogs site details how to get set up, which involves using VS Code Insiders with Node.js/npm and GitHub Copilot enabled, installing the extension, turning on the "appmod.experimental.task.typescript.upgrade": true experimental setting in VS Code, and restarting the editor. It also lists step-by-step guidance to modernize a JS/TS app, which involves opening a project with a package.json in VS Code Insiders, launching the GitHub Copilot App Modernization panel, clicking "Upgrade npm Packages," following the Copilot Chat agent's prompts as it updates dependencies and fixes breaking changes, and then reviewing, testing, and committing the resulting changes. The guidance says the preview is best used for one project at a time and warns of common issues that might arise in any preview.
"You might encounter some rough edges or cases where the tool can't fully modernize a complex app," Microsoft said. "If the tool gets stuck or something isn't working as expected please let us know."
About the Author
David Ramel is an editor and writer at Converge 360.