Skip to content
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

Sample request - BlazorWorker interacting with in-page JavaScript #74

Open
yoDon opened this issue May 12, 2022 · 1 comment
Open

Sample request - BlazorWorker interacting with in-page JavaScript #74

yoDon opened this issue May 12, 2022 · 1 comment
Labels
documentation Improvements or additions to documentation

Comments

@yoDon
Copy link

yoDon commented May 12, 2022

BlazorWorker looks like a great way to incrementally add some .NET to an existing React/Angular/Vue/jQuery/whatever page or site.

Is there any chance of a tiny Demo where some JS in a page calls a method on a Blazor worker and the Blazor worker calls a JS method on the page?

I see for example BlazorWorker.WorkerCore.MessageService so I'm thinking this is stuff you've already built into BlazorWorker at least at some level, but I'm not spotting how to pull it together into a little sample app.

@Tewr
Copy link
Owner

Tewr commented May 19, 2022

Hello. Blazorworker works primarily with Blazor ( as opposed to React/Angular/Vue/jQuery/whatever) and all examples in the demo apps.

That said, you're not the first person who had this idea, and it's doable. The current code assumes a Blazor frontend, but using the " core example" you should be able to debug and see what kind of messages are being sent to the worker, and the could be constructed using vanilla JavaScript (or React/Angular/Vue/jQuery/whatever).

The build process is based on whatever the Blazor tool chain produces, so in any case a basic Blazor app would have to be built to be able to take advantage of it.

@Tewr Tewr added the documentation Improvements or additions to documentation label Jan 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

2 participants