Comments (18)
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.
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.
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.
BlazorWorker/src/BlazorWorker/BlazorWorker.js
Line 152 in eef6220
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.
@Tewr Could you please attempt to upgrade the sample to .Net 5 and advise what changes are to be made? Thanks
from blazorworker.
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.
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.
@Tewr any ETA when you might have something? I understand that it's a lot of work. Thank you for your efforts :)
from blazorworker.
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.
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.
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.
Rumor has it, planned for .net 6
dotnet/aspnetcore#17730 (comment)
from blazorworker.
Looking forward to this :)
from blazorworker.
When do you plan a release? I do really need your library for my project ;)
from blazorworker.
@adambajguz clone the .net 5 branch, it works fine.
from blazorworker.
from blazorworker.
Fixed in release 2.0.0
from blazorworker.
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)
- BlazorWorkerJSRuntime JS to .NET Interop HOT 5
- Add to documentation: Method called via LINQ expression must not be internal HOT 3
- CreateBackgroundServiceAsync HOT 2
- Early .net9 support
- WASM-WORKER: BlazorWorker.WorkerCore.SimpleInstanceService.SimpleInstanceService: 'WebAssembly.Client, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' is requesting missing assembly 'Microsoft.AspNetCore.Components, Version=6.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'). See https://github.com/Tewr/BlazorWorker#setup-dependencies for common solutions to this problem. HOT 2
- BlazorWorker does not work in net6 with published release HOT 11
- Odd exception thrown in WASM-WORKER when instantiating worker service: Missing Assembly System.Net.Http HOT 4
- SerializeLinqExpressionSerializer.cs - no matching element HOT 8
- Sample request - BlazorWorker interacting with in-page JavaScript HOT 1
- Webworker with stimulsoft HOT 2
- Any nuget-released planned including environment variable for culture? HOT 1
- Worker filesystem access HOT 1
- System.ArgumentException: The object must be a runtime Reflection object. -On Simple Service creation HOT 1
- Non-RPC Access HOT 1
- Cannot be initialized when not on `/` HOT 6
- .NET 7 Support? HOT 27
- nuget.org releases missing? HOT 3
- Net8 Support -- BlazorWorker: Unable to locate dotnetjs file in blazor boot HOT 10
- Understanding Worker and BackgroundService instances HOT 7
- Can I pass structured data to Worker? HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from blazorworker.