Today we just pushed out our release candidate for WebSharper 3.0. This means that WebSharper 3.0 is now in feature freeze, and we will only be releasing bug fixes until the stable release of WebSharper. So if you were holding out on switching to 3.0 because of continuous breaking changes, now is the time to try it out!
WebSharper 3.0-rc1 is available for download right now.
We also made large enhancements to the online documentation; check out the sections on Sitelets, HTML combinators, WIG and UI.Next. More will be coming until the stable release.
Here is the list of changes:
Homogenize WebSharper.Html.Client
, WebSharper.Html.Server
and WebSharper.UI.Next.Html
: the HTML combinators are now generated from a list of standard HTML tag names and attributes, to ensure consistency between the client and server libraries.
#337: Exception when building WebSharper itself in debug mode.
Html.Client:
Event
field to access the underlying Dom.Event
.OnEvent
to bind a custom event by name.UI.Next:
Doc
now implements WebSharper.Web.IControlBody
. This means that it can be used directly as the Body
of a Web.Control
:type MyControl() =
inherit Web.Control()
[<JavaScript>]
override this.Body =
let rvText = Var.Create ""
Doc.Concat [
Doc.Input rvText
Label [] [Doc.TextView rvText.View]
]
:> _
JQuery:
.on()
, .off()
and .one()
more consistent with other event handlers such as .click()
, passing the element and the event to the callback and returning the JQuery
:JQuery.Of("#my-input")
.On("paste", fun el ev ->
JS.Alert ("Text pasted, value is now: " + JQuery.Of(el).Val()))
.Ignore
Event.AsDomEvent
.JQuery.GetJSON
inline.WebSharper.JavaScript:
Sitelets:
Remoting:
WIG:
Type.New()
. It was mainly used for two purposes:
TSelf
instead.let Chicken' = Class "Chicken"
let Egg =
Class "Egg"
|+> Instance [
"hatch" => T<unit> ^-> Chicken'
]
let Chicken =
Chicken'
|+> Instance [
"lay" => T<unit> ^-> Egg
]
Pattern.RequiredFields
, Pattern.OptionalFields
and Pattern.ObsoleteFields
to create configuration objects in a more compositional way:// Existing Pattern.Config:
let MyConfig : Class =
Pattern.Config "classname" {
Required =
[
"name", T<string>
]
Optional =
[
"width", T<int>
"height", T<int>
]
}
// New API:
let MyConfig : Class =
Class "classname"
|+> Pattern.RequiredFields [
"name", T<string>
]
|+> Pattern.OptionalFields [
"width", T<int>
"height", T<int>
]
This release candidate means that the 3.0 stable will be coming soon. In fact, unless a big issue holds us up, we will be releasing WebSharper 3.0 as early as next week.
After that, here is a peek at what you can expect from future releases:
.d.ts
declarations for generated JavaScript modules, which was an experimental feature so far.Happy coding!
Can’t find what you were looking for? Drop us a line.