We are happy to announce the release of version 3.4.19 of the WebSharper stack, which you can download here. This release is mainly dedicated to bug fixes and minor features.
Xamarin Studio / MonoDevelop addin on the main channel
The WebSharper addin is now available on the main Xamarin Studio channel. This means that you can now drop the
githubusercontent.com-based custom repository, and grab WebSharper directly from Xamarin instead! Simply check the "Web Development" category in the addin manager's gallery.
UI.Next Checked number inputs
The main new feature (and breaking change) is in UI.Next. The functions
Doc.FloatInput, which associate a
Var<float> to a
<input type="number"> element, took little care to check the correctness of the actual text entered by the user. This could result in awkward and even browser-inconsistent user experience, where mistakenly entering "1e" would return 1 on some browsers and 0 on others.
These combinators have therefore been modified to perform more input checking and bind the value to a
Var<CheckedInput<_>>, with the following definition:
1 2 3 4
type CheckedInput<'T> = | Valid of value: 'T * inputText: string | Invalid of inputText: string | Blank of inputText: string
This way, typing "1e" consistently sets the
The old behavior can still be achieved using
Doc.FloatInputUnchecked, but is not advised.
Full change log
Here are the minor changes and bug fixes to WebSharper and components since the previous release.
#402: Fix exception when compiling a WebSharper project that references a Roslyn-compiled assembly.
JS.CancelAnimationFrame, with a shim for IE9-.
#470: Fix the
printffamily of functions for union cases with
#471: Fix exception on mono when looking for a
[<Website>]if a dependent assembly is missing.
#473: Add server-side JSON serialization of the
Add missing proxy for
Doc.Verbatimto create a
Docfrom verbatim HTML. Be careful not to use it with user input data!
#33: camelCase on Expr-based events (eg.
FloatInputchecked (see above).
#36: Add attr.``data-`` combinator to
Doc.SelectOptional, which adds a first selectable option that sets the
Doc.SelectDynOptional, for which the list of available options comes dynamically from a
View.MapCached, which is identical to
View.Mapexcept that it doesn't call the mapping function again if the input value is equal to the previous input. Useful if the mapping function is computationally expensive. Note that the output is still marked obsolete, it is simply re-filled with the same cached value.
Doc.WebControl, which allows including a
WebSharper.Web.Controlinside a server-side
.With()method overloads for
Docs as holes.
#42: Add instance member versions of
Release on the main Xamarin channel (see above).
#3 on websharper.templates: duplicate
.fsprojfile when creating a project whose name isn't also a valid identifier.