Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
3cb9e1d
Add section in MigrationGeneral.md
AClerbois Jan 18, 2025
c81e187
And how to add instructions
AClerbois Jan 18, 2025
5ec23a1
Add instructions for enabling custom instructions in Visual Studio an…
AClerbois Jan 18, 2025
ef234de
Add base file and include the first step with FluentButton
AClerbois Jan 18, 2025
5125c0a
Update CopilotInstructionsContent.md to reflect property renaming for…
AClerbois Jan 18, 2025
3d10531
Update CopilotInstructionsContent.md to include changes for FluentLab…
AClerbois Jan 18, 2025
a40bf6b
Update CopilotInstructionsContent.md to document migration steps for …
AClerbois Jan 18, 2025
543e55a
Fix typo and inject the file into the right markdown container
AClerbois Jan 18, 2025
5dde3d6
Changed base on the improvement request by @dvoituron
AClerbois Jan 18, 2025
9ce43ce
Change the file name to follow the current convention
AClerbois Jan 18, 2025
ebfc299
Update CopilotInstructionsContent.md to add usage instructions for cu…
AClerbois Jan 18, 2025
e53bfef
Fix grammatical error in CopilotInstructionsContent.md for clarity
AClerbois Jan 18, 2025
5e62c46
Refactor Copilot instructions in documentation for clarity and consis…
AClerbois Jan 18, 2025
69fddbe
Remove outdated Copilot migration instructions and update documentati…
AClerbois Jan 21, 2025
030308e
Update Copilot instructions and remove outdated file references for F…
AClerbois Jan 21, 2025
86a25ba
Remove outdated Copilot instructions from project file
AClerbois Jan 21, 2025
ecdb10b
Update Copilot instructions for clarity and consistency in migration …
AClerbois Jan 21, 2025
0776c4a
Update Copilot instructions for FluentGridItem and FluentLabel compon…
AClerbois Jan 21, 2025
b0d29e8
Update Copilot instructions for FluentButton property value changes
AClerbois Jan 21, 2025
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
---
title: GitHub Copilot custom instructions
route: /Migration/gh-copilot-custom-instructions
hidden: true
---

To streamline your migration process, we provide custom instructions for GitHub Copilot in the `copilot-instructions.md` file. These instructions help Copilot understand our codebase conventions, naming patterns, and migration requirements.

By importing these custom instructions into your GitHub Copilot settings, you'll get more accurate and context-aware suggestions specifically tailored to FluentUI Blazor migration tasks.

Example benefits:
- Migrate complete file following new namespacing and new parameters
- Renaming old names from v3-v4 to v5

> ⚠️ Note
>
> - This feature is currently in public preview and is subject to change.
> - Custom instructions are currently only supported for **Copilot Chat** in **VS Code** and **Visual Studio**.

The complete documentation is available here [Adding custom instructions for GitHub Copilot](https://docs.github.com/en/copilot/customizing-copilot/adding-custom-instructions-for-github-copilot)

Once your migration is done, you can remove the file or the part of the FluentUI migration.

### How to enable custom instruction
Comment thread
dvoituron marked this conversation as resolved.
Resolved

1. In the root of your repository, create a file named `.github/copilot-instructions.md`.
Create the `.github` directory if it does not already exist.

2. Click on the following link to view and copy the content of this **migration instruction**
inside the `copilot-instructions.md` file.

πŸ“₯ <a href="/copilot-instructions.md" target="_blank">copilot-instructions.md</a>

3. In your existing project, after adding the new FluentUI-Blazor v5,
you can start using the custom instructions to help you migrate your code.

Example of Copilot instructions: "Can you migrate this file to the new FluentUI-Blazor v5?

### Enable custom instruction in Visual Studio or Visual Studio Code.

GitHub's team has a perfect step-by-step void to enable : [Enabling or disabling custom instructions](https://docs.github.com/en/copilot/customizing-copilot/adding-custom-instructions-for-github-copilot#enabling-or-disabling-custom-instructions).
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,7 @@ component changes (flagged with πŸ”ƒ) or Breaking Changes (flagged with πŸ’₯).
## FluentLayout and FluentMainLayout

{{ INCLUDE MigrationFluentLayout }}

## Migrate to v5 with help from GitHub Copilot chat

{{ INCLUDE CopilotInstructionsContent }}
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
<ItemGroup>
<EmbeddedResource Include="**\*.md" />
<EmbeddedResource Remove="DebugPages\_README.md" />
<EmbeddedResource Remove="wwwroot\copilot-instructions.md" />
<AdditionalFiles Include="$(ProjectDir)/*.xml" />
</ItemGroup>

Expand All @@ -54,11 +55,6 @@
<!-- Embedd other languages under root resx file -->
<ItemGroup>
<None Include="**\*.*.resx" />
<None Remove="documentation\getstarted\migration\MigrationColor.md" />
<None Remove="documentation\getstarted\migration\MigrationFluentButton.md" />
<None Remove="documentation\getstarted\migration\MigrationFluentGridItem.md" />
<None Remove="documentation\getstarted\migration\MigrationFluentLayout.md" />
<None Remove="Documentation\GetStarted\Migration\MigrationGeneral.md" />
<None Update="**\*.*.resx">
<ParentFile>$([System.String]::Copy('%(FileName)').Split('.')[0])</ParentFile>
<DependentUpon>%(ParentFile).resx</DependentUpon>
Expand Down
74 changes: 74 additions & 0 deletions examples/Demo/FluentUI.Demo.Client/wwwroot/copilot-instructions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
You are an agent who helps wonderful blazor developers to migrate the Microsoft.FluentUI Blazor in versions V3 and V4 to the V5.
Comment thread
AClerbois marked this conversation as resolved.
Resolved

You have access to a list of all manual migrations that a developer must do to migrate to the new version and this is covered by a component section.

# FluentButton component

The following properties of the FluentButton have been renamed :
- `Action` to `FormAction`
- `Enctype` to `FormEncType`
- `Method` to `FormMethod`
- `NoValidate` to `FormNoValidate`
- `Target` to `FormTarget`

Special attention is required for the Appearance property.
This is only valid for FluentButton.
The name stays the same but the value has changed as follows:

`Appearance.Neutral` to `ButtonAppearance.Default`
`Appearance.Accent` to `ButtonAppearance.Primary`
`Appearance.Lightweight` to `ButtonAppearance.Transparent`
`Appearance.Outline` to `ButtonAppearance.Outline`
`Appearance.Stealth` to `ButtonAppearance.Default`
`Appearance.Filled` to `ButtonAppearance.Default`

Warn about the use of `CurrentValue` property,

> The `CurrentValue` property has been removed. Use `Value` instead.

# FluentGridItem component

These properties have been renamed only for the `FluentGridItem` component:
- `xs` to `Xs`
- `sm` to `Sm`
- `md` to `Md`
- `lg` to `Lg`
- `xl` to `Xl`
- `xxl` to `Xxl`

# FluentLabel component

Warm the user that the property `Weight` is now used to determine if the label text is shown regular or semibold
Remove the following properties :
- `Alignment`
- `Color`
- `CustomColor`
- `MarginBlock`
- `Typo`

In case where the FluentLabel component is used, write the following comment:
- Label is now exclusivly being used for labeling input fields.
- If you want to use a component that shows text using Fluent's opinions on typography and is more compatible with what was used in v4, you can use the new `Text` component instead.

# FluentLayout component

- The `FluentHeader` component has been replaced by the `FluentLayoutItem` component. It uses the parameter `Area` with the value `LayoutArea.Header`

- The `FluentFooter` component has been replaced by the FluentLayoutItem component. It uses the parameter `Area` with the value `LayoutArea.Footer`

- The `FluentBodyContent` component has been replaced by the FluentLayoutItem component. It uses the parameter `Area` with the value `LayoutArea.Content`


# FluentMainLayout component

If the code contains the FluentMainLayout component, follow these next steps to migrate the component in a correct way the:

- Change the `FluentMainLayout` component to a `FluentLayout` component.

- Change the `Header` parameter to a `FluentLayoutItem` component and add a parameter `Area` with value `LayoutArea.Header`

- Change the `Body` parameter to a `FluentLayoutItem` component and add a parameter `Area` with value `LayoutArea.Content`

- Change the `NavMenuContent` parameter to a `FluentLayoutItem` component and add a parameter `Area` with value `LayoutArea.Menu`. If the NavMenuContent parameter does not exist, then create a new FluentLayoutItem with its `Area` parameter set to `LayoutArea.Menu.

- Change the `SubHeader` parameter to a `FluentLayoutItem` component with its `Area` parameter set to `LayoutArea.Header`. Remove the SubHeader.