SamProf / MatBlazor

Material Design components for Blazor and Razor Components
http://www.matblazor.com
MIT License
2.84k stars 386 forks source link

net-core-3-0-preview-9 breaks MatBlazor #232

Closed bnemetchek closed 5 years ago

bnemetchek commented 5 years ago

MS changed the API surface around a bit to separate the GUI and other minor changes. I believe most apps using MatBlazor will no longer compile.

unencode commented 5 years ago

Same here, it has to do with the announced breaking changes: https://devblogs.microsoft.com/aspnet/asp-net-core-and-blazor-updates-in-net-core-3-0-preview-9/

LuohuaRain commented 5 years ago

Severity Code Description Project File Line Suppression State Suppression State Error CS0234 The type or namespace name 'UIMouseEventArgs' does not exist in the namespace 'Microsoft.AspNetCore.Components' (are you missing an assembly reference?)108 Active

unencode commented 5 years ago

Severity Code Description Project File Line Suppression State Suppression State Error CS0234 The type or namespace name 'UIMouseEventArgs' does not exist in the namespace 'Microsoft.AspNetCore.Components' (are you missing an assembly reference?)108 Active

Check out the section that says:

Replace Microsoft.AspNetCore.Components.UIEventArgs with System.EventArgs and remove the “UI” prefix from all EventArgs derived types (UIChangeEventArgs -> ChangeEventArgs, etc.).

Here: https://devblogs.microsoft.com/aspnet/asp-net-core-and-blazor-updates-in-net-core-3-0-preview-9/

peterschleritzko commented 5 years ago

Thank you for a wonderful framework. Is there an ETA, for when a "Preview 9" version will be released?

SeppPenner commented 5 years ago

Same here, I can't run the project because of the UI events change. I can try to provide a pull request to fix this @SamProf.

SamProf commented 5 years ago

Already in pregress. Today will be release preview 9

SeppPenner commented 5 years ago

The main thing I don't understand yet if you try to upgrade a project from preview8 to preview9 is where I can get IComponentContext from or how to replace it. There is an issue on excatly that topic: https://github.com/aspnet/AspNetCore/issues/13711.

I've upgraded MatBlazor in my project locally to preview9 now (Check https://github.com/SeppPenner/MatBlazor/tree/preview9 as well) with these issues remaining:

Sebbstar commented 5 years ago

i've done the same :)

IComponentContext: MS removed the context they assume the use case is gone https://github.com/aspnet/AspNetCore/commit/1f7d59d8f1e7cd1bc8d816cb1e78f3c40ccc26e7

We don't believe that this is needed anymore. We no longer call OnAfterRender when you're prerendering, so the main use case of this type is gone.

SeppPenner commented 5 years ago

i've done the same :)

IComponentContext MS removed the context they assume the use context is gone aspnet/AspNetCore@1f7d59d

We don't believe that this is needed anymore. We no longer call OnAfterRender when you're prerendering, so the main use case of this type is gone.

So this should be simply removed? Ok, that's easy.

andean00 commented 5 years ago

Thank you so much for making this excellent project !! Since I migrated to preview9 I got some bugs in the beginning, but installing the latest preview9 templates will solve all the issues. If you then start from scratch with a dotnet new blazorwasm template (I create them with the --hosted flag) the MS sample project works. Getting MatBlazor nuget library 1.6.4 works as expected but:

I had a working prototype displaying a small sample form with a couple of MatTextField and MatNumericUpdownField fields working flawlessly with preview8. I bind mine to a very simple POCO class and I am getting this exception (the component does not even display anymore):

blazor.webassembly.js:1 WASM: System.TypeLoadException: Could not set up parent class, due to: Could not set up parent class, due to: Generic Type Definition failed to init, due to: Could not set up parent class, due to: Could not set up parent class, due to: Could not load type of field 'MatBlazor.BaseMatComponent:k__BackingField' (5) due to: Could not resolve type with token 0100001b from typeref (expected class 'Microsoft.AspNetCore.Components.IComponentContext' in assembly 'Microsoft.AspNetCore.Components, Version=3.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60') assembly:Microsoft.AspNetCore.Components, Version=3.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60 type:Microsoft.AspNetCore.Components.IComponentContext member:(null) assembly:MatBlazor.dll type:BaseMatComponent member:(null) assembly:MatBlazor.dll type:BaseMatDomComponent member:(null) assembly:MatBlazor.dll type:BaseMatInputComponent1 member:(null) assembly:MatBlazor.dll type:BaseMatInputComponent1 member:(null) assembly:MatBlazor.dll type:BaseMatTextField member:(null)

here is the markup:



Parameters class has a NodeX property of type int. I changed the type to be a string and I got the same exception. If I use a MatNumericUpDown instead I also get the same.

Can you guys please post a working example of these form controls inside an EditForm on the matblazor site ? Thanks a lot and best regards

bnemetchek commented 5 years ago

@andean00 I would suggest waiting until the developers of this project have had a chance to update their code to be preview9 compatible before attempting to use it. I'm sure they currently have a lot on their plate to do before providing new examples. I'm sure it won't be long...

SamProf commented 5 years ago

in Progress:

newdeal30 commented 5 years ago

Thanks for that fast release! Waiting for that, and now i can continue today! My program evening is saved ;-)

SamProf commented 5 years ago

MatBlazor 1.7.0 Released! Update to .NET Core 3.0 Preview 9

Maybe it's a little nit unstable. Please write issues if you you found something.

https://www.nuget.org/packages/MatBlazor/1.7.0

unencode commented 5 years ago

Thank you so much @SamProf! I will post any issues I find back.

SamProf commented 5 years ago

@SeppPenner @Sebbstar Wow, I read that you also working on upgrade to Preview 9. Thank you so much for your effort.

I really welcome any help to this project. But there are too much changes at one time and I prefere make it myself. But I am very pleasantly surprised that I am not the only one interested in such global things.

Thank you very much. If you do something - please make PRs. I will check and merge your contribution to main brunch.

unencode commented 5 years ago

For what it's worth I was able to successfully upgrade two server-side projects to preview 9 without too many problems.

Most relevant to this project was updating App.razor and MainLayout.razor for me. Thanks again!

andean00 commented 5 years ago

Yes I agree that MS made the p9 unstable with breakin changes. Serverside it should work. The problems I have are with client-side. I could not manage to get it working with a form bound to a poco class. I will wait a bit Thanks so much for the great effort !!

SamProf commented 5 years ago

@andean00 and all, After I will upgrade BlazorFiddle I can try to help you in your projects.

SeppPenner commented 5 years ago

@SeppPenner @Sebbstar Wow, I read that you also working on upgrade to Preview 9. Thank you so much for your effort.

I really welcome any help to this project. But there are too much changes at one time and I prefere make it myself. But I am very pleasantly surprised that I am not the only one interested in such global things.

Well, I was just trying to figure out some issues with the upgrade progress that might occur on your side as well.

andean00 commented 5 years ago

@SamProf : Many thanks once again for doing this and willing to help in the client-side/webassembly world. Just to let you know, a few minutes ago I saw the 1.7.0 version and I updated the package. Right before that, not even the MatProgressBar was working and now it does after upgrading, yeah ! I will keeping adding controls to my solution and see how it goes ! have an excellent weekend !