You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if decimals are not used in the client, WS will miss the client-side dependency on it currently. When translating an RPC call, a type dependency is added for the result which has dependencies in turn on field types, so the dependency graph should tie the use of TradeResponse to needing decimals on the client side, but only if WebSharper has metadata for the types involved. If an F# record or union does not have the [<JavaScript>] attribute, WS still provides some basic translation support, translating them to plain objects. So currently there is no compile-time error or warning, but project can fail because of the math.js dependency is not auto-discovered.
A general and non-breaking solution, that would help uncover similar issues: add a warning at each call when an RPC is returning a type without full WS metadata, suggesting to use JS attribute or proxy for them.
If a
TradeResponse
value is returned from an RPC where it is:if decimals are not used in the client, WS will miss the client-side dependency on it currently. When translating an RPC call, a type dependency is added for the result which has dependencies in turn on field types, so the dependency graph should tie the use of
TradeResponse
to needing decimals on the client side, but only if WebSharper has metadata for the types involved. If an F# record or union does not have the[<JavaScript>]
attribute, WS still provides some basic translation support, translating them to plain objects. So currently there is no compile-time error or warning, but project can fail because of themath.js
dependency is not auto-discovered.A general and non-breaking solution, that would help uncover similar issues: add a warning at each call when an RPC is returning a type without full WS metadata, suggesting to use JS attribute or proxy for them.
See https://forums.websharper.com/topic/87068
The text was updated successfully, but these errors were encountered: