Skip to content

Releases: dotnet-websharper/ui

WebSharper.UI 4.2.6.119

17 May 15:07
Compare
Choose a tag to compare

This is a bugfix release for WebSharper.UI 4.2. See the associated WebSharper release.

Fixes

WebSharper.UI 4.2.6

04 May 18:20
Compare
Choose a tag to compare

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

  • #170 Templating: Fix issue that prevented applying <ws-*> instantiation for a template declared later in the file in ClientLoad.FromDocument mode.
  • #176 Routing: Recognize relative href path when parsing clicked links to apply client-side routing.
  • #177 Fix code output when using .V on a Var<Doc>.

WebSharper UI 4.2.5

17 Apr 12:47
Compare
Choose a tag to compare

This is a feature release for WebSharper.UI 4.2. See the associated WebSharper release.

Enhancements

  • Add Router.InstallInto and Router.InstallHashInto, which are similar to Router.Install and Router.InstallHash respectively, except that they take a Var<'EndPoint> as argument rather than creating and returning one.

Fixes

  • #164 Remove click event handler on Doc.Checkbox, only keeping change, 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 the View.
  • #168 Add View.TryGet : View<'T> -> option<'T> which returns the current value of a View if available, or None if not (eg if a View.MapAsync hasn't returned yet).

WebSharper.UI 4.2.4

29 Mar 19:48
Compare
Choose a tag to compare

This is a minor feature release of WebSharper.UI, out-of-band from WebSharper.

Features

  • #163 Allow using the on.afterRender attribute, the Elt.OnAfterRender() method and the ws-onafterrender template hole from the server side just like other event handlers.

  • #165 Add variadic overload for Attr and Doc-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 to ServerLoad.WhenChanged.

WebSharper.UI 4.2.3

26 Mar 09:03
Compare
Choose a tag to compare

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 with ClientLoad.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

12 Mar 12:49
Compare
Choose a tag to compare

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

WebSharper.UI 4.2.1

27 Feb 13:22
Compare
Choose a tag to compare

This is the first stable release of WebSharper.UI 4.2. See the associated WebSharper release

Improvements

  • #157 Add Attr.ClassPred and Attr.DynamicClassPred for adding CSS classes conditionally. ClassPred also supports the .V syntax: Attr.ClassPred "hidden" (currentPage.V = "home").
  • #153 Add View.WithInit and WithInitOption.
    View.WithInit init view is equivalent to view, except that if view is in a waiting state, its initial value is init instead.
    Similarly, View.WithInitOption view is equivalent to View.Map Some view, except that if view is in a waiting state, its initial value is None instead.

Fixes

  • #152 If a template only specifies one of styles and meta holes, write the content for both at that location.
  • #155 Fix filling ws-on* event handlers from the server side.

WebSharper.UI v4.1.1

01 Feb 16:16
Compare
Choose a tag to compare

Enhancements

  • #144 Reinstate on.event (Element -> #Event -> unit) handlers in WebSharper.UI.Client, instead of always using on.event (Expr<Element -> #Event -> unit>) from WebSharper.UI.Html, to avoid the limitations of quotations.

    It is available when open WebSharper.UI.Client is called after open WebSharper.UI.Html.

WebSharper.UI v4.1.0.38

09 Jan 11:50
Compare
Choose a tag to compare

New features

  • #145 Add Lens function to lens into a Var 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 their ListModel 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.