This is a minor release for WebSharper and WebSharper.UI.
Install templates for .NET Core SDK: dotnet new -i WebSharper.Templates::4.4.1.261
Download templates for Visual Studio 2017: http://websharper.com/installers/WebSharper.4.4.1.261.vsix
#988 Add proxy for the JavaScript fetch API.
#988 Add Router.Fetch as a fetch-based equivalent to Router.Ajax.
type EndPoint =
| [<EndPoint "GET /article-data">] GetArticleData of id: int
type ArticleData = { id: int; (* ... *) }
let router = Router.Infer<EndPoint>()
promise {
// Fetch /article-data/12...
let! resp = Router.Fetch router (GetArticleData 12)
// ... get its body as JSON...
let! respJson = resp.Json()
// ... and decode it as an instance of ArticleData.
let article = Json.Decode<ArticleData> respJson
Console.Log(article)
}
runngen.ps1 scripts in the tools folder in both WebSharper.FSharp and WebSharper.CSharp packages now correctly installs the compiler tools in the net461 folder. Run this script in administrator mode to speed up WebSharper compilation.Instance member name conflict errors.jQuery.on('ready', ...) for the web control activator. This removes the dependency on jQuery for many sitelets.Printf.kprintf.<meta> tag; this is now fixed.Elt.WithAttrs is no longer public, it was intended to be internal.Elt.RemoveClass removes unneeded spaces from class attribute value.jQuery is now not used internally for Elt.AddClass/RemoveClass and Router.Install/InstallInto.ClientLoad.FromDocument, when outputting a ws-replace tag, make the tag name depend on the parent tag (eg. if the parent is <tbody>, output <tr>) instead of always <div>, so that the HTML is parsed correctly.Happy coding!
Can’t find what you were looking for? Drop us a line.