Closed pkese closed 3 years ago
In case you're wondering what the hell I was doing in server/Program.fs:
(the bug not related to that).
I'm trying to fiddle with some hardware on a Raspberry PI
and there's some impedance mismatch with Elmish.Bridge, because
So I somehow hacked a way to get dispatch
from Global app and then I proxy client messages to global app using this stolen dispatch
.
In the other direction I'm using Hub to dispatch state to all connected clients.
... I'm not sure how to better express that.
Inside the Bridge Hub, there probably is some similar "global singleton" state & logic, but unfortunately I can't plug into that.
Fable 3 should use Json.serialize instead of JSON.stringify
Thanks, @Zaid-Ajaj! I'll replace it with serialize
and upload a new package in a moment
The rc-3 version should be listed in a moment. Can you check if that fixes the issue, @pkese?
@Nhowka please also add an Exclude="*.fs.js" to your Fable client package. See tempting client for reference
@Nhowka yes, now it works like a charm.
Thanks for the update.
@Nhowka please also add an Exclude="*.fs.js" to your Fable client package. See tempting client for reference
@Zaid-Ajaj, I saw that in Feliz there is also an inclusion for *.js
, should I need to add it? Should I need to exclude the *.fs.js
files if I don't have an include for *.js
?
... oh and I've noticed that I was testing with an old Elmish.Bridge.Client when I found that bug (apparently I only upgraded the server side Elmish.Bridge.Giraffe to 5.0.0-rc2 but not the client).
So now it works with 5.0.0-rc3, but I never really tested the client with 5.0.0-rc2.
I hope it wasn't a bogus bug report all along.
@Nhowka Feliz only includes .js files because it uses a couple of them for interop. The idea behind excluding .fs.js file is because users get weird issues where the source files of your package aren't being compiled
@Zaid-Ajaj I added for the next version, it's harmless and it could prevent disaster. 😗
@pkese I was testing with BridgeChat and it was working, but I probably should be using serialize
anyway! 😅
@pkese just in case, try dotnet fable clean --yes
before restarting the application to delete build artifacts
Cmd.bridgeSend
appears to trigger a runtime error:I have published a repo that makes bug reproducible at: https://github.com/pkese/Elmish.Bridge.Test
To run:
While processing
Welcome
message it fails to serializeCmd.bridgeSend UpstreamMsg.GetState