Open fjoppe opened 9 years ago
Thanks for the report.
2D arrays currently have no RPC de/serializers. When using it as an RPC parameter it gives a compile warning, but not when used as a return type.
We will implement: RPC de/serializers for 2D arrays. Give compile warning on higher dimensional arrays not supported by WebSharper client side.
As a temp workaround, you can use double arrays ([][]
) to ship data between tiers.
As of WebSharper 3.1: compiler now gives warnings on unsupported multi-dimensional arrays used in RPC signatures.
But 2D array proxy hasn't been changed. it is a jagged JS array with an extra property which is not serializable to JSON, so converting it to [][]
is still necessary for client-server interaction.
Creating a client/server app with a grid, I'd like to fill an Array2D at the Server side (easier calculations, better support DateTime), request and visualize it at the client side.
Array2D is supported both at client and server, but it doesn't get transfered from server to client.
This code visualizes correctly:
This code compiles and runs, but doesn't display anything (I think it causes a Javascript exception):
Wrapping an Array2D in an F# Record displays the same problem. The client receives nothing at all.
Websharper version: 3.0.46.130-rc1,