WebSharper 2.5.134 released

Andras Janko

Andras Janko

Dec 02, 2014

Reading time:

2 mins

Share via:

A lot of useful functions from FSharp.Core are now translated by WebSharper.

Async cancellation

  • Proxies for CancellationTokenSource, CancellationToken, CancellationTokenRegistration.
  • Proxies for Async class members: DefaultCancellationToken, CancelDefaultToken, CancellationToken, OnCancel, TryCancelled
  • Async RPC calls are cancellable, the cancel continuation runs ASAP and the response are discarded.

MailboxProcessor

  • Proxy handles timeout arguments and cancellation
  • PostAndReply/TryPostAndReply methods are not supported as JS is single-threaded.

Printf

  • Proxies for sprintf, printfn, failwithf, Printf.kbprintf
  • %O uses JavaScript String(x) function
  • %A generates a recursive pretty-printer for F# types if type information is available. Currently supports lists, unions, tuples, records, 1 and 2 dimensional arrays. Other types are sent to a dynamic pretty-printer.
  • printfn prints to JavaScript console
  • Printf.sprintf is not supported, use ExtraTopLevelOperators.sprintf instead.
  • Printing as unsigned is not supported.

Fixes

  • Fix #300: Server-side runtime error in some regional settings (for example Turkish)
  • Fix #304: Converting string to char checks string length now
  • Async.FromContinuations ensures that continuation is called only once, throws an error otherwise.

Breaking changes

  • System.Web.HttpPostedFile type in Sitelets API have been changed to System.Web.HttpPostedFileBase to enable non-ASP.NET hosting (OWIN).

  • Indexed properties in WIG: Previously if a property was defined with name "item", it translated to a an indexer on the object. This is changed so that the empty string is usable for this (still will get .NET property name Item, the default indexer for the class).

    // generates default .NET indexer
    "" =@ T<obj> |> Indexed T<int> // has JavaScript inline "$this[$index]"
    

Read more from

Can’t find what you were looking for? Drop us a line.

Andras Janko
Found a typo?

This blog post is hosted on GitHub here. Feel free to file a ticket or send a PR.

Newsletter

We will not spam you or give your details to anyone.