Developers

We are thrilled to announce the availability of WebSharper 3.2, paving the road to further upcoming enhancements to streamline developing and deploying WebSharper apps, and also shipping several key changes summarized here.

Dot-syntax for chained event handlers

This syntax is more familiar to many developers, eliminates the need for a special operator (|>!), and makes code more discoverable by having API comments and code completion choices available when attaching the event handler.

Server-side templating enhancements

Traditionally, in sitelet templates you had the following line in the <HEAD> section to stand for the placeholder for including generated page dependencies (e.g. all the CSS, JS, etc. files that are implicitly referenced in your page):

1

<meta name="generator" content="websharper" data-replace="scripts" />

With 3.2, you can now refine how these dependencies are inserted if you provide additional placeholders:

styles: output the generated stylesheets only. Usually, you will want to put this placeholder in the <HEAD> section.

meta: output the client-server integration (arguments to server-side controls, etc.) bits only. You will want this in <HEAD>

When either of these are present, scripts only outputs the JavaScript dependencies, making it possible to place this placeholder anywhere else, away from the other bits, say, to the tail of the <BODY> element.