Giter VIP home page Giter VIP logo

Comments (18)

Tewr avatar Tewr commented on August 15, 2024 6

I have a working version but its currently not deliverable. I need a few more hours of work to push a release, bear with me.

from blazorworker.

Tewr avatar Tewr commented on August 15, 2024 1

no ETA yet, but I can give a status update. I've managed to get up .NET and running in the worker process, but not WebAssembly.Bindings as it's not compiled against .NET5 and won't load. So I either have to find the source code of that dll, or try to decompile-recompile the bytecode against .NET5. Another more sane alternative would be loading the blazor dlls like @marcussacana did in the past when that thing was broken. But its not as easy as back then, because it now need additional blazor javascript to work, and loading the entire blazor js probably wont fly in the worker context, not to mention it's a huge bloat of code to load into memory just to do some interop. But for now I'm trying something down that road...

from blazorworker.

Tewr avatar Tewr commented on August 15, 2024 1

Mostly some notes for myself, but I've made a small breakthrough: I've found the .NET5 version of WebAssembly.Bindings -- it's hidden inside System.Private.Runtime.InteropServices.JavaScript. All in theory, but what should be left is re-routing calls to this assembly instead, and then start cleaning up the dependency graph, as currently I've brute-forced the runtime by loading the entire contents of the blazor bootloader.

from blazorworker.

Tewr avatar Tewr commented on August 15, 2024

self.importScripts(`${initConf.appRoot}/${initConf.wasmRoot}/${dotnetjsfilename}`);

The blazor js folder might have changed in 5rc1. I just read the filename from blazorboot, but there is no directory information in there iirc, so the path is hard-coded.

from blazorworker.

bancroftway avatar bancroftway commented on August 15, 2024

@Tewr Could you please attempt to upgrade the sample to .Net 5 and advise what changes are to be made? Thanks

from blazorworker.

marcussacana avatar marcussacana commented on August 15, 2024

why support a not stable release?
I know how the .net 5 is promising but if they change again in the last release will just break again soon, let's wait some few days.

from blazorworker.

Tewr avatar Tewr commented on August 15, 2024

If I release a package I'll do pre-release and tag it 5rc1.

However, I spent some time updating the project yesterday. yes they changed the paths but a lot more has changed. lot of runtime problems, so won't be able to release immediately, not a quick update.

from blazorworker.

Epictek avatar Epictek commented on August 15, 2024

@Tewr any ETA when you might have something? I understand that it's a lot of work. Thank you for your efforts :)

from blazorworker.

Epictek avatar Epictek commented on August 15, 2024

Here's the source code for webassembly.binding, hope it helps https://github.com/mono/mono/tree/master/sdks/wasm/framework/src/WebAssembly.Bindings

from blazorworker.

Tewr avatar Tewr commented on August 15, 2024

I have spent a few more minutes on this and apparently the method that was called to get a js object reference that was used by WebAssembly.Bindings no longer exists -- or at least it wont bind like it did before. It might be bound to a static memory address, so maybe a specific version. I'm not an expert on internal calls.... I'm trying to call the following method, that looks like it's defined in the current version here: https://github.com/mono/mono/blob/2966c71ebf2445a5d18e5865ee6728b30f260e74/sdks/wasm/src/driver.c#L353

this is the exception that I get:

WASM-WORKER: Your mono runtime and class libraries are out of sync.
WASM-WORKER: The out of sync library is: data-0x2c15238
WASM-WORKER: 
WASM-WORKER: When you update one from git you need to update, compile and install
WASM-WORKER: the other too.
WASM-WORKER: Do not report this as a bug unless you're sure you have updated correctly:
WASM-WORKER: you probably have a broken mono install.
WASM-WORKER: If you see other errors or faults after this message they are probably related
WASM-WORKER: and you need to fix your mono install first.

Uncaught (in promise) Error: System.MissingMethodException:  assembly:<unknown assembly> type:<unknown type> member:(null)
   at WebAssembly.Runtime.InvokeJS(String str)
   at BlazorWorker.WorkerCore.WebAssemblyBindingsProxy.Runtime.InvokeJS(String js)
(...)

Same error if I use the nuget version or if I recompile WebAssembly.Runtime against .NET5, so I dont think this is the actual problem, or at least recompiling is far from the solution. But I can't figure out what changed in .NET5, the driver looks quite similar. So alas, something is missing. Probably some fundamental understanding of this code on my part.

I'll have to get a second look on using the blazor dlls for now.

from blazorworker.

Epictek avatar Epictek commented on August 15, 2024

https://github.com/unoplatform/Uno.Wasm.Bootstrap/blob/dev/jela/net5/src/Uno.Wasm.Bootstrap/WasmScripts/uno-bootstrap.js

Might give some hints?

In looking at Uno I discovered that it supports multithreading, so maybe Blazor support for true Multithreading is not too far away?!
https://platform.uno/blog/webassembly-threading-in-net/

from blazorworker.

Tewr avatar Tewr commented on August 15, 2024

Rumor has it, planned for .net 6

dotnet/aspnetcore#17730 (comment)

from blazorworker.

ivan-prodanov avatar ivan-prodanov commented on August 15, 2024

Looking forward to this :)

from blazorworker.

adambajguz avatar adambajguz commented on August 15, 2024

When do you plan a release? I do really need your library for my project ;)

from blazorworker.

ivan-prodanov avatar ivan-prodanov commented on August 15, 2024

@adambajguz clone the .net 5 branch, it works fine.

from blazorworker.

adambajguz avatar adambajguz commented on August 15, 2024

@ivan-prodanov ok

from blazorworker.

Tewr avatar Tewr commented on August 15, 2024

Fixed in release 2.0.0

from blazorworker.

rootflood avatar rootflood commented on August 15, 2024

hi I had same problem with WASM and it fixed
you can use https://github.com/monsajem/Incs/tree/main/Others/WASM for better workaround

from blazorworker.

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.