Releases: dotnet-websharper/core
Releases · dotnet-websharper/core
WebSharper 4.1.5.205
Fixes
- #894: in BundleOnly mode, do still output a dummy empty DLL to avoid trouble with outside tools (like MSBuild) that expect it as output.
WebSharper 4.1.5
Enhancements
- #891 Bundle project output is now generated quicker.
- #891 Also, if you have source mapping turned off (as default) and dead code elimination too (with
<WebSharperDeadCodeElimination>False</WebSharperDeadCodeElimination>
) then bundling will just concatenate already compiled JavaScript output for referenced assemblies instead of rewriting to a single scope, resulting in faster compilation speed. - #892 You can use the new project type value
<WebSharperProject>BundleOnly</WebSharperProject>
to have only the.js
/.css
/.html
output for bundle projects. In the case of F#, this means that no.dll
is created. For C#, the.dll
is just not touched, it will contain no WebSharper-specific resources. This allows faster iterative development on bundle projects. Most time is gained if that project itself (and not just references) contain large amount of code.
WebSharper 4.1.4
4.1.4.189
Enhancements
- #889 Extending
DateTimeOffset
proxy, custom serialization (both RPC and client-side JSON) forDateTimeOffset
values, which is also cross-compatible with serializedDateTime
values.
WebSharper 4.1.3
WebSharper 4.1.2
WebSharper 4.1.2.178
New features
- #874 WebSharper for C# now supports syntax introduced in C# 7.2:
in
arguments andref readonly
returns, non-trailing named arguments, numeric literals with leading underscores,private protected
.
Fixes/improvements
- #884 WebSharper build errors and warnings in F# projects now show up correctly in Errors window and as squiggly underlines.
- #883 Fixed deserializing an empty
Set
value sent to aRemote
function. - #883
Map
andSet
values with any key type can now be serialized into JSON withJson.Serialize
. Maps are stored as a flat list of key/value pairs.Map<string>
still serializes to a single JSON object. - #871 C# inferred routers now respect HTTP methods same as F#: declared either by the
Method
attribute or likeEndPoint("POST /post")
- #871 Multiple
EndPoint
attributes can be used on types and members. Equivalently, theEndPoint
attribute can be passed multiple string arguments. In the case of multiple attributes, they can be ordered by setting theorder
parameter of theEndPoint
attibute contructor. - #871 C# subclasses used in inferred routers have the option to declare the full route to parse/write, not inheriting from base class by having
inheritRoute: false
on anEndPoint
attribute, - #870
EndPoint "/"
can be used on a union case with fields (for example another union, allowing breaking up a big endpoint definition into multiple union types) - #873 Decoding/encoding string values by
Router.Infer
(andRouter.rString
) are now using the same logic as WebSharper 4.0: any non-alphanumeric character replaced to~xx
or~uxxxx
. This ensures that string values are recovered properly and are passing standard URL correctness checks.
WebSharper 4.1.1
WebSharper 4.1.1.175
New features
- #853 Server-side event handlers (
on.*
) andClientSide
can take any fixed F# quotation now and translates it to JavaScript. (Announced for 4.1 erroneously, now included)
div [] [ text "div created on the server" ]
client
<@ JavaScript.Console.Log "running client-side code"
div [] [ text "div created on the client" ]
@>
- #730 The
IsClient
value (WebSharper.Pervasives.IsClient
from C#) and their negations (not IsClient
and!Pervasives.IsClient
) can be used as a condition in branching logic in shared client-server code to make the JavaScript compiler skip the false branch entirely.
// using WebSharper;
if (Pervasives.IsClient) { ClientSideMethod(); } else { ServerSideMethod(); }
var res = Pervasives.IsClient ? ClientSideMethod() : ServerSideMethod();
if IsClient then ClientSideMethod() else ServerSideMethod()
Fixes/improvements
- #869 an empty F#
Map
passed to an RPC function is deserialized correctly. - #879 The behavior of the
Stub
attribute on constructors and static methods are now consistent with the documented translation logic since WebSharper 3.0. - #875 Multiple server-side event handlers and
ClientSide
having captured arguments within the same method do not interfere with each other. - #880 The
client
helper inWebSharper.UI
is now available again within client-side code. So adiv [] [ client <@ div [] [] @> ]
in server side-code will create the internaldiv
on the client (the server returning a placeholder) while fully running on the it just creates the internaldiv
basically as ifclient <@ @>
wrapper was not there. - #881 Server-side event handlers and
ClientSide
do not create extra functions in translated JavaScript code if their expression is containing a single static method call. These functions in back-compatibility packageWebSharper.UI.Next
work the same as in WebSharper 4.0.
WebSharper 4.1
WebSharper 4.1.0.171
New features
- #853 Server-side event handlers and
ctx.ClientSide
can take any fixed F# quotation now and translates it to JavaScript (auto-quoted in both languages, so straight lambda function syntax is enough). - #865 New implementation for
WebSharper.Sitelets.Router
type, fully composable and also working on the client-side.WebSharper.UI
adds helpers to use it for client-side routing. This allows generating safe links on the client for server-side endpoints, also on the server to states handled by the client.
Fixes/improvements
- #862 Fix using
<UseDownloadedResources>True</UseDownloadedResources>
inweb.config
, now local script links are correct for any sub-page. - #864 Expanded
WebSharper.Testing
to expose more equality test alternatives provided byQUnit
. - #854 Better handling of F# trait calls (using a member constraint inside an
inline
function). Now an overloaded method is resolved based on signature. - #858 Optimization of remoting protocol: array of types are not included when it is empty.
Breaking changes
- #857 Attributes previously in
WebSharper.Sitelets
namespace and assembly are now inWebSharper
namespace and inWebSharper.Core.dll
. - A
Sitelet
'sRouter
field is now of typeIRouter
, compatible in capabilities with the oldRouter
record. The newRouter
type offers more combinators and is implementingIRouter
. - Also with the WebSharper 4.1,
WebSharper.UI.Next
has been renamed toWebSharper.UI
, affecting both package and namespace naming. For C# projects, an additional package reference forWebSharper.UI.CSharp
is needed, and.CSharp
has been removed from all namespace names, so now no extrausing
s are needed to get the C#-oriented extension methods. A compatibility packageWebSharper.UI.Next 4.1
still exists for immediate back-compatibility, switching toWebSharper.UI
is recommended for new features and fixes.
WebSharper 4.0.196
WebSharper.4.0.196.147
Fixes
- #847 Fixes for C#
catch
clauses:- filtering on type but not specifying a variable, for example
catch (ArgumentException)
no longer fails to translate, - not having a type check but having a filter includes the filter correctly, for example
catch when (isCatching)
.
- filtering on type but not specifying a variable, for example
- #859 a variable set is always correctly treated as a side-effecting operation when optimizing code. Previously some expressions defined with an F#
let
could have been moved to their point of use incorrectly, switching the evaluation order with a variable setter, on which the expression value could depend.
Enhancements
- #856 Operators on
DateTime
andTimeSpan
now translate correctly from C#. Content.Ok
is available to return a200 OK
http response without a content body.
WebSharper 4.0.195
WebSharper.4.0.195.127
Fixes
- #832 Fix object reference equality not working in bundles. Dead-code elimination now includes default
Equals
/GetHashCode
implementations, missing these caused the behavior change. - #836 C# implicit constructors now call the default constructor of the base class.
- #835 C# virtual methods and implicit interface implementations are represented correctly in the dependency graph, so dead-code elimination do not miss to include them.
Enhancements
- #834 The following collection types are now supported by RPCs and JSON serialization:
List<_>
,Queue<_>
,Stack<_>
. AlsoLinkedList<_>
is supported for JSON serialization.
WebSharper 4.0.194
WebSharper.4.0.194.126
Fixes
- #817 Unrecognized option: '--preferreduilang'. This is now removed from FCS args until it can support it.
- Updating to
FSharp.Compiler.Service 16.0.2
, this can fix some F# bugs.