This is a minor release for WebSharper and WebSharper.UI.
Install templates for .NET Core SDK: dotnet new -i WebSharper.Templates::4.2.9.232
Download templates for Visual Studio 2017: http://websharper.com/installers/WebSharper.4.2.9.232.vsix
WebSharper Core
Enhancement
- #921 Now JSON deserialization can handle the
System.Objecttype, implemented as follows:- deserializing on the client side just returns the parsed value (ie. one of:
null, a boolean, a string, a number, an array or a plain object). - deserializing on the server side produces a boxed value:
- null, boolean, string return a value of the corresponding type.
- number: returns a
float(System.Double) - array: returns a recursively parsed
obj[] - object: returns a recursively parsed
Dictionary<string, obj>
- serializing from
System.Objectis not supported. This is to avoid accidentally upcasting the argument ofJson.SerializetoSystem.Objectwhen a type annotation is missing.
- deserializing on the client side just returns the parsed value (ie. one of:
Fixes
- #935
Seq.chunkBySizeand other similar functions does not fail erroneously on some inputs. - #934 If for a website project, there is no
"outputdir"inws.configorWebSharperOutputDirin project properties or aweb.configfile in the project folder, an explicit error is given that the unpack output directory cannot be determined.
WebSharper UI
Enhancement
- Add
Router.InstallIntoandRouter.InstallHashInto, which are similar toRouter.InstallandRouter.InstallHashrespectively except that they take aVar<'EndPoint>as argument rather than creating and returning one.
Fixes
- #164 Remove
clickevent handler onDoc.Checkbox, only keepingchange, to avoid setting the Var twice. - #166 Add proxy for quotation-based
.OnXyz(...)event handlers. - #167 Fix initial value of
Var.Makewhenever an initial value is available from theView. - #168 Add
View.TryGet : View<'T> -> option<'T>which returns the current value of aViewif available, orNoneif not (eg if aView.MapAsynchasn't returned yet).
Happy coding!