Skip to content

Repo sync for protected CLA branch #9417

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

Merged
merged 8 commits into from
Jul 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions docs/javascript/TOC.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@
href: publish-nodejs-app-azure.md
- name: How-to Guides
items:
- name: Migrate from Node.js projects
href: migrate-nodejs-projects.md
- name: Editor
items:
- name: Write and edit code
Expand Down
2 changes: 1 addition & 1 deletion docs/javascript/javascript-in-visual-studio.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ The TypeScript SDK has been deprecated in Visual Studio 2022. Existing projects

## Project templates

Starting in Visual Studio 2022, there is a new JavaScript/TypeScript project type (.esproj) that allows you to create standalone Angular, React, and Vue projects in Visual Studio. These front-end projects are created using the framework CLI tools you have installed on your local machine, so the version of the template is up to you.
Starting in Visual Studio 2022, there is a new JavaScript/TypeScript project type (.esproj) that allows you to create standalone Angular, React, and Vue projects in Visual Studio. These front-end projects are created using the framework CLI tools you have installed on your local machine, so the version of the template is up to you. To migrate from existing Node.js projects to the new project system, see [Migrate Node.js projects](../javascript/migrate-nodejs-projects.md).

Within these new projects, you can run JavaScript and TypeScript unit tests, easily add and connect ASP.NET Core API projects and download your npm modules using the npm manager. Check out some of the quickstarts and tutorials to get started. For more information, see [Visual Studio tutorials | JavaScript and TypeScript](/visualstudio/javascript).

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
35 changes: 35 additions & 0 deletions docs/javascript/migrate-nodejs-projects.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
---
title: "Migrate Node.js projects"
description: Learn how to migrate a Node.js project to the JavaScript project system (.esproj)
ms.date: "07/10/2023"
ms.topic: "how-to"
ms.devlang: javascript
author: "mikejo5000"
ms.author: "mikejo"
manager: jmartens
ms.technology: vs-javascript
dev_langs:
- JavaScript
ms.workload:
- "nodejs"
monikerRange: '>= vs-2022'
---
# Migrate Node.js Projects in Visual Studio

[!INCLUDE [Visual Studio](~/includes/applies-to-version/vs-windows-only.md)]

The Node.js project system (*.njsproj*) in Visual Studio is on a deprecation path and will be replaced by the JavaScript project system (*.esproj*). Starting in Visual Studio 2022 version 17.7 Preview 1, we offer a convenient way to convert your existing Node.js project to the latest JavaScript project system. By migrating the project, you can benefit from the latest updates related to npm dependency management, unit testing support, launch config settings, et al.

To migrate from a Node.js project to a JavaScript project:

Right-click the project node for your Node.js project. You should see one of two options: **Convert to New JavaScript Project Experience** or **Convert to New TypeScript Project Experience**. Select the available option to migrate your project to the new project system.

:::image type="content" source="media/vs-2022/migrate-convert-to-js-project.png" alt-text="Screenshot of option to convert to a JavaScript project.":::

After you choose **Convert**, a conversion log text file gets created and then it opens. The log file details the steps that occurred during the migration.

:::image type="content" source="media/vs-2022/migrate-conversion-log.png" alt-text="Screenshot of conversion log.":::

If anything goes wrong during the migration, you can choose the **Revert Project to Old Experience** option so that the conversion will be reverted. If you encounter any problem during this process, please the [Report a problem](../ide/how-to-report-a-problem-with-visual-studio.md) feature in Visual Studio.

:::image type="content" source="media/vs-2022/migrate-revert-to-nodejs.png" alt-text="Screenshot of option to revert to a Node.js project.":::
5 changes: 5 additions & 0 deletions docs/profiling/beginners-guide-to-performance-profiling.md
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,11 @@ Use the search box to find a node that you are looking for, then use the horizon

## Next steps

In this tutorial, you've learned how to collect and analyze CPU usage data. If you already completed the [tour of the profiler](../profiling/profiling-feature-tour.md), you may want to read about a general approach to optimizing code using the profiling tools.

> [!div class="nextstepaction"]
> [Reduce compute costs by using profiling tools](../profiling/optimize-code-using-profiling-tools.md)

In this tutorial, you've learned how to collect and analyze CPU usage data while debugging. You may want to find out more about profiling release builds using the Performance Profiler.

> [!div class="nextstepaction"]
Expand Down
2 changes: 1 addition & 1 deletion docs/profiling/choose-performance-tool.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ ms.workload:

[!INCLUDE [Visual Studio](~/includes/applies-to-version/vs-windows-only.md)]

Visual Studio provides a variety of profiling tools to help you diagnose different kinds of app performance issues depending on your app type. In this article, we provide information to help you find the right tool for your scenario and application type.
Visual Studio provides a variety of profiling tools to help you diagnose different kinds of app performance issues depending on your app type. In this article, we provide information to help you find the right tool for your scenario and application type. For a general approach to optimizing code using the profiling tools, see [Reduce compute costs by using profiling tools](../profiling/optimize-code-using-profiling-tools.md).

## Which tool should I use?

Expand Down
18 changes: 8 additions & 10 deletions docs/profiling/memory-usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -260,22 +260,20 @@ To analyze memory usage, click one of the links that opens up a detailed report

::: moniker-end

::: moniker range=">=vs-2022"
::: moniker range=">=vs-2022"
### Memory Usage Insights

Memory Analysis tool also gives multiple powerful built-in auto insights, select the **Insights** tab in the Managed types reports and it shows the applicable auto insights like **Duplicate strings** and **Sparse arrays**.

[![Screenshot of the insight view in the Memory Usage tool.](../profiling/media/vs-2022/dbgdiag-mem-managed-insights.png "Memory Usage insight")](../profiling/media/vs-2022/dbgdiag-mem-managed-insights.png#lightbox)
The Memory Analysis tool also gives multiple powerful built-in auto insights. Select the **Insights** tab in the Managed types reports and it shows the applicable auto insights like **Duplicate strings** and **Sparse arrays**.

[![Screenshot of the insight view in the Memory Usage tool.](../profiling/media/vs-2022/dbgdiag-mem-managed-insights.png "Memory Usage insight")](../profiling/media/vs-2022/dbgdiag-mem-managed-insights.png#lightbox)

The **Duplicate Strings** section shows the list of strings that get allocated multiple times on the heap. In addition, this section shows the total wasted memory, that is, the (number of instances - 1) times the size of the string.

A Sparse Array is an array that is mostly filled with zero elements, which can be inefficient in terms of performance and memory usage. The memory analysis tool will automatically detect these arrays and show you how much memory is being wasted due to these zero values.

The **Sparse Arrays** section shows arrays that are mostly filled with zero elements, which can be inefficient in terms of performance and memory usage. The memory analysis tool will automatically detect these arrays and show you how much memory is being wasted due to these zero values.

Certain types are known to have fields that can be read to determine the size of the native memory they're holding onto. The **Insights** tab shows fake native memory nodes in the object graph, which are retained by their parent objects such that the UI will recognize them and display their size and reference graph.

[ ![Screenshot of the native insight view in the Memory Usage tool.](../profiling/media/vs-2022/dbgdiag-mem-native-insights.png "native insight view in the Memory Usage tool")](../profiling/media/vs-2022/dbgdiag-mem-native-insights.png#lightbox)
[![Screenshot of the native insight view in the Memory Usage tool.](../profiling/media/vs-2022/dbgdiag-mem-native-insights.png "native insight view in the Memory Usage tool")](../profiling/media/vs-2022/dbgdiag-mem-native-insights.png#lightbox)

::: moniker-end

Expand Down Expand Up @@ -319,7 +317,7 @@ The change report adds columns (marked with **(Diff)**) to the base report that

::: moniker range=">=vs-2022"

[ ![Screenshot of Native Types Diff View.](../profiling/media/vs-2022/dbgdiag-mem-native-types-view-diff.png "Native Types Diff View")](../profiling/media/vs-2022/dbgdiag-mem-native-types-view-diff.png#ligtbox)
[![Screenshot of Native Types Diff View.](../profiling/media/vs-2022/dbgdiag-mem-native-types-view-diff.png "Native Types Diff View")](../profiling/media/vs-2022/dbgdiag-mem-native-types-view-diff.png#ligtbox)

::: moniker-end

Expand All @@ -331,10 +329,10 @@ The change report adds columns (marked with **(Diff)**) to the base report that

## Next steps

In this tutorial, you've learned how to collect and analyze memory usage data. If you already completed the [tour of the profiler](../profiling/profiling-feature-tour.md), you may want to get a quick look at how to analyze CPU usage in your apps.
In this tutorial, you've learned how to collect and analyze memory usage data. If you already completed the [tour of the profiler](../profiling/profiling-feature-tour.md), you may want to read about a general approach to optimizing code using the profiling tools.

> [!div class="nextstepaction"]
> [Analyze CPU usage](../profiling/beginners-guide-to-performance-profiling.md)
> [Reduce compute costs by using profiling tools](../profiling/optimize-code-using-profiling-tools.md)

In this tutorial, you've learned how to collect and analyze memory usage data while debugging. You may want to find out more about analyzing memory usage in release builds using the Performance Profiler.

Expand Down
2 changes: 1 addition & 1 deletion docs/profiling/optimize-code-using-profiling-tools.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ SELECT "b"."Url", "b"."BlogId", "p"."PostId", "p"."Author", "p"."BlogId", "p"."C
FROM "Blogs" AS "b" LEFT JOIN "Posts" AS "p" ON "b"."BlogId" = "p"."BlogId" ORDER BY "b"."BlogId"
```

To see what's going on with the app in terms of memory usage, collect a trace using the .NET Object Allocation tool. The **Call Tree** view in the memory trace shows the hot path and helps you identify an area of high memory usage. No surprise at this point, the `GetBlogTitleX` method appears to be generating a lot of objects! Over 900,000 object allocations, in fact.
To see what's going on with the app in terms of memory usage, collect a trace using the .NET Object Allocation tool (For C++, use the Memory Usage tool instead). The **Call Tree** view in the memory trace shows the hot path and helps you identify an area of high memory usage. No surprise at this point, the `GetBlogTitleX` method appears to be generating a lot of objects! Over 900,000 object allocations, in fact.

:::image type="content" source="./media/optimize-code-dotnet-object-allocations.png" alt-text="Screenshot of Call Tree view in the .NET Object Allocation tool.":::

Expand Down
3 changes: 2 additions & 1 deletion docs/profiling/profiling-feature-tour.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ There are several ways to diagnose performance issues when you’re working with

In software engineering, a profiler is a tool used to help you analyze the performance of your applications to improve poorly performing code. Profiling and diagnostics tools help you diagnose memory and CPU usage and other application-level issues. With these tools, you can collect performance data while you run your application.

A profiler can help you make informed decisions quickly by providing a visual depiction of execution times and CPU usage for your application. It’s much easier and quicker to understand issues and fix them when you can see a graph of the execution times or the CPU usage. For information on using the tools to help optimize your code, see [Reduce compute costs by using profiling tools](../profiling/optimize-code-using-profiling-tools.md).
A profiler can help you make informed decisions quickly by providing a visual depiction of execution times and CPU usage for your application. It’s much easier and quicker to understand issues and fix them when you can see a graph of the execution times or the CPU usage. For a general approach to optimizing code using the profiling tools, see [Reduce compute costs by using profiling tools](../profiling/optimize-code-using-profiling-tools.md).

## Measure performance while debugging

Expand Down Expand Up @@ -308,4 +308,5 @@ In Visual Studio 2019, the legacy Performance Explorer and related profiling to
## See also

- [Which tool should I use?](../profiling/choose-performance-tool.md)
- [Reduce compute costs by using profiling tools](../profiling/optimize-code-using-profiling-tools.md)
- [Run profiling tools with or without the debugger](../profiling/running-profiling-tools-with-or-without-the-debugger.md)