Releases: dotnet-websharper/ui
WebSharper.UI 4.2.6.119
This is a bugfix release for WebSharper.UI 4.2. See the associated WebSharper release.
Fixes
- dotnet-websharper/core#948 Translation fix applied for erased unions used internally in UI for performance.
WebSharper.UI 4.2.6
This is a feature release for WebSharper.UI 4.2. See the associated WebSharper release.
Improvements
- #171 Templating: Support writing
<ws-*>
template instantiations from the server side with.Doc(keepUnfilled = true)
, so that these instantiations can be applied on the client side.
Fixes
WebSharper UI 4.2.5
This is a feature release for WebSharper.UI 4.2. See the associated WebSharper release.
Enhancements
- Add
Router.InstallInto
andRouter.InstallHashInto
, which are similar toRouter.Install
andRouter.InstallHash
respectively, except that they take aVar<'EndPoint>
as argument rather than creating and returning one.
Fixes
- #164 Remove
click
event 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.Make
whenever an initial value is available from theView
. - #168 Add
View.TryGet : View<'T> -> option<'T>
which returns the current value of aView
if available, orNone
if not (eg if aView.MapAsync
hasn't returned yet).
WebSharper.UI 4.2.4
This is a minor feature release of WebSharper.UI, out-of-band from WebSharper.
Features
-
#163 Allow using the
on.afterRender
attribute, theElt.OnAfterRender()
method and thews-onafterrender
template hole from the server side just like other event handlers. -
#165 Add variadic overload for
Attr
andDoc
-typed hole instantiation. For example, the following:MyTemplate() .Body( [ h1 [] [text "Hello!"] p [] [text "Welcome to my page."] ] )
can now be written as:
MyTemplate() .Body( h1 [] [text "Hello!"], p [] [text "Welcome to my page."] )
Fixes
- #138 Fix an exception thrown when editing a template file while the application is running and
serverLoad
is set toServerLoad.WhenChanged
.
WebSharper.UI 4.2.3
This is a feature release for WebSharper.UI 4.2. See the associated WebSharper release.
Enhancements
Templating type provider
- #161 Add
.Bind() : unit
template terminating method to directly bind holes to the current document. This is available on the client-side only if the template is declared withClientLoad.FromDocument
. - #161 Add optional argument
.Doc(keepUnfilled: bool)
for the server side to leave unfilled holes in the document, so that they can be used on the client side by.Bind()
.
WebSharper.CSharp
- #160 Add extension methods to bring C# in line with F#:
// Extensions on ListModel<K, T>: View<IEnumerable<V>> Map(Func<T, V> f); View<IEnumerable<V>> Map(Func<K, View<T>, V> f); View<IEnumerable<V>> MapLens(Func<K, Var<T>, V> f); Doc Doc(Func<T, Doc> f); Doc Doc(Func<K, View<T>, Doc> f); Doc DocLens(Func<K, Var<T>, Doc> f); ListModel<K, V> Wrap(Func<V, T> extract, Func<T, V> wrap, Func<V, T, V> update); // Extension on Var<FSharpList<T>>: Doc DocLens(Func<T, K> key, Func<K, Var<T>, Doc> f);
WebSharper.UI 4.2.2
This is a bugfix release for WebSharper.UI 4.2. See the associated WebSharper release
Enhancements
- Updated to use HtmlAgilityPack version
1.7.1
Fixes
- dotnet-websharper/core#919 C# analyzers for WebSharper errors and UI template code generation works as expected.
- dotnet-websharper/core#920 WebSharper binaries targeting .NET 4.6.1 are no longer depending on anything targeting .NET Standard.
WebSharper.UI 4.2.1
This is the first stable release of WebSharper.UI 4.2. See the associated WebSharper release
Improvements
- #157 Add
Attr.ClassPred
andAttr.DynamicClassPred
for adding CSS classes conditionally.ClassPred
also supports the.V
syntax:Attr.ClassPred "hidden" (currentPage.V = "home")
. - #153 Add
View.WithInit
andWithInitOption
.
View.WithInit init view
is equivalent toview
, except that ifview
is in a waiting state, its initial value isinit
instead.
Similarly,View.WithInitOption view
is equivalent toView.Map Some view
, except that ifview
is in a waiting state, its initial value isNone
instead.
Fixes
WebSharper.UI v4.1.1
Enhancements
-
#144 Reinstate
on.event (Element -> #Event -> unit)
handlers inWebSharper.UI.Client
, instead of always usingon.event (Expr<Element -> #Event -> unit>)
fromWebSharper.UI.Html
, to avoid the limitations of quotations.It is available when
open WebSharper.UI.Client
is called afteropen WebSharper.UI.Html
.
WebSharper.UI v4.1.0.38
New features
-
#145 Add
Lens
function to lens into aVar
using.V
syntax.Lens(myvar.V.MyField) // is equivalent to: myVar.LensAuto(fun x -> x.MyField)
-
#146 Add
Var<list<T>>.MapLens
and.DocLens
, similar in functionality to theirListModel
counterpart, although with linear-time complexity.
Fixes/enhancements
-
#148 Some quotation forms were missing when exploring for captured arguments inside server-side
on.*
event handlers, including tuple gets (used by F# implicitly when passing captured a tuple value to a client-side function taking a tuple, resulting in a runtime failure). This is now running correctly:let t = 1, 2 div [] [ button [ on.click (fun _ _ -> Client.TestTuple t) ] [ text "click me" ] ]
-
#150 Same as dotnet-websharper/core#881, server-side event handlers that are containing a single call to a static method now do not use a separate pre-compiled function in generated code.