Replies: 1 comment
-
So for those that come through here. Since discussions are next to dead in this repo. I decided to build a JavaScript interop pipeline that follows a pup/sub method to transfer really any data around between mixed Server and Wasm components. Not the most desirable but the JS is really quite minimal and most work is still done in C#. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
This is more of a question seeking ideas - that may turn into a feature request. However, I'm having some challenges coming up with a good pattern to have an open bi-directional communication pipeline between both InteractiveServer and InteractiveWebAssembly components.
This actually has come about as a result of trying to get a good pattern of interactivity working with the MudBlazor component library with a simple Light/Dark mode implementation.
Traditionally I handled this through a ThemeStateProvider that exposed lifecycle events to a button in a NavBar that when clicked executed a call to a subscribing MudThemeProvider. This is still very possible when both components are currently both operating in the same Interactivity runtime. However let's say that for the NavBar I only have this one button and keeping a websocket open is kind of silly just to handle this click event - so I want to drop that down to Wasm.
Now that the NavBar is no longer operating in the same runtime it cannot cross communicate back to the MudThemeProvider and there are two instances of ThemStateProvider actually loaded at this time - one in the Wasm Runtime and one in the Server runtime.
I won't ramble much more here but I'm looking for thoughtful patterns of bi-directional communication between the runtimes here. I may not know of something that already exists or maybe this could get into a deeper discussion.
Right now I have my eyes set on some sort of JS shim that handles this. Let me know your thoughts.
Beta Was this translation helpful? Give feedback.
All reactions