Coder Social home page Coder Social logo

.NET 8 (Blazor) support about mapsui HOT 13 OPEN

jirisykora83 avatar jirisykora83 commented on June 11, 2024
.NET 8 (Blazor) support

from mapsui.

Comments (13)

inforithmics avatar inforithmics commented on June 11, 2024 2

Pull Request to Add .NET 8 To Blazor in 4.1 Branch
#2329

from mapsui.

p2pbsh avatar p2pbsh commented on June 11, 2024 1

@pauldendulk Can confirm, Mapsui 4 does work in a Blazor 8 project, based on the new webapp auto rendering template.

@jirisykora83 Sorry, was a long day, gave you duff advice, install 'Microsoft.AspNetCore.Components.Web 8.0.0' nuget into your wasm client project, not 'Microsoft.AspNetCore.Components.WebAssembly'

One thing though...Mapsui works great in Blazor, thanks again @inforithmics, but have discovered if I publish the wasm client with AOT enabled, the map fails to load. I don't get any exceptions, no trim warnings during publish, nothing, AOT just seems to break something. Curious if that's a known issue or something to do with the dotnet 7 dependencies?

from mapsui.

jirisykora83 avatar jirisykora83 commented on June 11, 2024 1

@pauldendulk Can confirm, Mapsui 4 does work in a Blazor 8 project, based on the new webapp auto rendering template.

@jirisykora83 Sorry, was a long day, gave you duff advice, install 'Microsoft.AspNetCore.Components.Web 8.0.0' nuget into your wasm client project, not 'Microsoft.AspNetCore.Components.WebAssembly'

One thing though...Mapsui works great in Blazor, thanks again @inforithmics, but have discovered if I publish the wasm client with AOT enabled, the map fails to load. I don't get any exceptions, no trim warnings during publish, nothing, AOT just seems to break something. Curious if that's a known issue or something to do with the dotnet 7 dependencies?

Thank you adding Microsoft.AspNetCore.Components.Web fix build. There are still some warnings but at least build works.

I do not use AOT but there was LinkerConfig not sure if it is still supported.

from mapsui.

pauldendulk avatar pauldendulk commented on June 11, 2024 1

I have not investigated AOT at all so far. Guess it is time to start to think about it, but I don't think we will support it in v5. A quick search shows we use System.Reflection in a couple of places. It seems superficial though, not unfixable. Further it is important that SkiaSharp support AOT, did not look at that at all.

About showing an error to the user. If it writes something to the logger this would be enough for me (perhaps that already happens). We are working on ways to make the logging more visible to developers.

from mapsui.

p2pbsh avatar p2pbsh commented on June 11, 2024

As a workaround, add nuget package Microsoft.AspNetCore.Components.WebAssembly 8.0.0 to your project.

from mapsui.

jirisykora83 avatar jirisykora83 commented on June 11, 2024

Microsoft.AspNetCore.Components.WebAssembly

I do not understand blazor project (which reference Mapsui,Blazor already have Microsoft.AspNetCore.Components.WebAssembly reference (as i think it is included by default in blazor client project)

from mapsui.

pauldendulk avatar pauldendulk commented on June 11, 2024

I can not give a lot of attention to these platform specific issues. The issue you face is caused by the upper limit we set in our nuget. It is easy to remove that limit but it still may not function. I am not sure how Blazor compatibility works. We are building with Blazor 7 and I would think you really need to build with Blazor 8 to deal with breaking changes. If so, you need to wait for Mapsui v5.

@p2pbsh did you get Mapsui 4 to work in Blazor 8?

from mapsui.

jirisykora83 avatar jirisykora83 commented on June 11, 2024

I can not give a lot of attention to these platform specific issues. The issue you face is caused by the upper limit we set in our nuget. It is easy to remove that limit but it still may not function. I am not sure how Blazor compatibility works. We are building with Blazor 7 and I would think you really need to build with Blazor 8 to deal with breaking changes. If so, you need to wait for Mapsui v5.

@p2pbsh did you get Mapsui 4 to work in Blazor 8?

Yes, I am building with (migrating to) .net 8. As for all projects we have it was just updating nuget (or wait for nuget to update if their use upper limit as for us it was just npgsql and mapsui) & change version basically. I am not too familiar with MAUI & android/ios developing but I guess there is lot more works between version. If blazor isn't priority maybe you can remove the upper limit as if it isn't working then we still have to wait for new major release anyway and if it works then it is fine.

from mapsui.

pauldendulk avatar pauldendulk commented on June 11, 2024

AOT can not be used in all situations. Mapsui has a lot of dependencies so it is likely there is something in there which is not compatible with AOT. I think this is a problem Blazor 8 as well. It would be nice if we could support AOT though.

from mapsui.

p2pbsh avatar p2pbsh commented on June 11, 2024

Ok, cheers Paul. I'm guessing there's something in there that needs reflection, which seems to be the primary crusher of aot dreams.

Hardly a high priority, but currently mapsui will happily build in aot then silently fail, not sure how to do it, but would be handy to propogate an aot compatability behaviour warning to the user like you see in the dotnet libs.

from mapsui.

p2pbsh avatar p2pbsh commented on June 11, 2024

dotnet AOT is a bit wild west at the moment so I imagine the migration path will be a little smoother further down the road. That said, basic dotnet performance on wasm is not particularly great, being able to AOT buys huge performance gains, so Mapsui support would be pretty cool :)

I did check on Skia out of curiosity, apparently its used in AOT on UNO, but don't quote me on that, haven't ran it personally.

from mapsui.

pilotshamn avatar pilotshamn commented on June 11, 2024

I have a quite complicated blazor component with a SKGLView and a lot of skiasharp in the code and it works in wasm AOT but no map in a mapsui component. If this can be of any help

from mapsui.

pauldendulk avatar pauldendulk commented on June 11, 2024

@pilotshamn So SkiaSharp support AOT, good. That is one requirement checked.

from mapsui.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.