Skip to content

v7 Migration Guide #371

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

Open
mckaragoz opened this issue Apr 13, 2024 · 12 comments
Open

v7 Migration Guide #371

mckaragoz opened this issue Apr 13, 2024 · 12 comments

Comments

@mckaragoz
Copy link
Contributor

mckaragoz commented Apr 13, 2024

This guide shows the migration basics.

Working only with Mud7

MudExtensions v7 works with Mud7 and after. No support for v6 and before versions.

.NET 6 Support Ended

MudExtensions v7 doesn't support .NET 6 any longer (the same on MudBlazor v7). Please migrate at least .NET 7 (.NET 8 is strongly recommended)

MudExtensions.Enums Namespace Removed

There will be no MudExtensions.Enums namespace, so you can use enums easier. If you have some @using MudExtensions.Enums statements, you need to remove them.

Stepper is now StepperExtended

MudBlazor core will have it's own Stepper component. So this extension component has Extended suffix into it's name.

General Parameter Name Changes

  • All DisableSomething parameters changed to ShowSomething or EnableSomething and values are inverted.
  • All ClassSomething and StyleSomething parameters changed to SomethingClass and SomethingStyle

Obsoleted Parameters Removed

Described parameters removed.

MudCodeInput

  • ClassInput (Use InputClass instead)

MudCsvMapper

  • Delimter (Use Delimiter instead)

MudListItemExtended

  • Command
  • CommandParameter

MudSelectExtended

  • Direction
  • OffsetX (Use AnchorOrigin and TransformOrigin instead)
  • OffsetY
  • ClearAsync (Use Clear instead)
  • DisableSelectedItemStyle (Use EnableSelectedItemStyle instead)
  • DisablePopoverPadding (Use EnablePopoverPadding instead)

MudSplitter

  • StyleContent (Use ContentStyle instead)
  • StyleBar (Use BarStyle)

MudStepper

  • PreventStepChange (Use PreventStepChangeAsync instead)
@mckaragoz mckaragoz pinned this issue Apr 13, 2024
@gabephudson
Copy link

I am testing converting our large application to MB v7 (prerelease 3) and MBE v7 (prerelease 2). I am receiving the following error. (I believe this is because MudButton now has a Title property):

The type 'MudExtensions.MudLoadingButton' declares more than one parameter matching the name 'title'. Parameter names are case-insensitive and must be unique.

@mckaragoz
Copy link
Contributor Author

I am testing converting our large application to MB v7 (prerelease 3) and MBE v7 (prerelease 2). I am receiving the following error. (I believe this is because MudButton now has a Title property):

The type 'MudExtensions.MudLoadingButton' declares more than one parameter matching the name 'title'. Parameter names are case-insensitive and must be unique.

AndForget changed on preview 3, we should also changed the method to new one.

Didn't see the change of Title parameter on latest preview, but will look ofc

@emuuu
Copy link
Contributor

emuuu commented May 16, 2024

Here's the change:
MudBlazor/MudBlazor#8630

Edit:
Tested just removing the property from MudLoadingButton and it worked perfectly fine. Opened a pull request #396

@gabephudson
Copy link

Just updated to prerelease 3 and the title issues is now resolved. In addition, the "AndForget" async issue is now resolved.

That said, some controls do not seem to be rendering correctly. Is this a known issue? Here is an example of the password text box...
Screenshot

@mckaragoz
Copy link
Contributor Author

@gabephudson thanks for info. This is a missing thing on first preview. This only occurs on Text variant, you can use other variants as workaround. Already fixed, will come with next preview.

@gabephudson
Copy link

@mckaragoz, just wanted to see if the extensions team had a release date in mind for v7?

Is the v7 RC1 release good to go with MB v7.0+?

@mckaragoz
Copy link
Contributor Author

mckaragoz commented Jul 11, 2024

@mckaragoz, just wanted to see if the extensions team had a release date in mind for v7?

Is the v7 RC1 release good to go with MB v7.0+?

Yes it completely compatible with Mud7, will only add little features and release the extension v7 in couple of days

@gabephudson
Copy link

@mckaragoz , we have completed our conversion to MB v7.2 using MudExtensions v7 RC1. :)

One issue we discovered is when using a MudLoadingButton as the "ActivatorContent" of the v7 MudBlazor file upload control, it will trigger a loop where the file upload dialog immediately shows again after selecting a file.

This was a known issue in MBv7 if one left the HtmlTag="label" in a MudButton, but this tag is not present in our code using a MudLoading Button.

@mckaragoz
Copy link
Contributor Author

This was a known issue in MBv7 if one left the HtmlTag="label" in a MudButton, but this tag is not present in our code using a MudLoading Button.

Doesn't understand, do we know how we can fix?

@gabephudson
Copy link

Apologize for the confusion. Basically, using a MudLoadingButton for a MudFileUpload activator worked in v6 and does not in v7. The button will trigger an upload dialog when clicked, but after selecting a file, the upload dialog will appear again instead of the upload event firing.

This is certainly caused by changes in how the FileUpload works in MudBlazor v7, however, I am not sure what the issue might be, since a LoadingButton is just a wrapper for a MudButton. Just wanted to point this out in case it can be fixed.

Works in MB v6

<MudFileUpload T="IBrowserFile" FilesChanged="UploadFiles">
    <ButtonTemplate>
          <MudLoadingButton  HtmlTag="label" for="@context.Id" @bind-Loading="_busy" ButtonVariant="ButtonVariant.Button" 
           Variant="Variant.Filled"  StartIcon="@Icons.Material.Filled.CloudUpload">Upload</MudLoadingButton>
    </ButtonTemplate>
</MudFileUpload>

Does not work in MB v7, Ext v7 RC1

<MudFileUpload T="IBrowserFile" FilesChanged="UploadFiles">
    <ActivatorContent>
               <MudLoadingButton  @bind-Loading="_busy" ButtonVariant="ButtonVariant.Button" 
           Variant="Variant.Filled"  StartIcon="@Icons.Material.Filled.CloudUpload">Upload</MudLoadingButton>
    </ActivatorContent>
</MudFileUpload>

@mckaragoz
Copy link
Contributor Author

@gabephudson try to set AutoDelay to 0 or null on loading button

@gabephudson
Copy link

@gabephudson try to set AutoDelay to 0 or null on loading button

Unfortunately, setting AutoDelay to any value (null, 0, 500) had no impact on this behavior. The button will trigger the file dialog, after a file selection occurs the file selection dialog will re-appear, and after one selects the file again, then the upload event will fire/proceed.

Again, this is likely an issue with the new MudBlazor v7 ActivatorContent logic, but I am not sure what (not sure what was changed in this regard) and if it can even be addressed directly by MudExtensions.

It's not critical, as one can just switch to a standard MudButton. Here is an example of working markup in MB v7...

<MudFileUpload Class="flex-grow-0 mb-4" T="IBrowserFile" FilesChanged="(IBrowserFile browserFile)=>Upload(browserFile)" Style="margin:0;">
	<ActivatorContent>
<MudButton Disabled="@_working" Variant="Variant.Filled" Color="Color.Primary" StartIcon="@Icons.Material.Filled.CloudUpload">
	@if (_working)
	{
		<span class="mr-2">Uploading</span>
		<MudProgressCircular Class="ms-n1" Size="Size.Small" Indeterminate />
	}
	else
	{
		<span>Upload</span>
	}
</MudButton>
	</ActivatorContent>
</MudFileUpload>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants