Skip to content

Releases: dotnet-websharper/core

WebSharper 4.1.5.205

01 Feb 16:15
Compare
Choose a tag to compare

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

01 Feb 16:13
Compare
Choose a tag to compare

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

24 Jan 10:16
Compare
Choose a tag to compare

4.1.4.189

Enhancements

  • #889 Extending DateTimeOffset proxy, custom serialization (both RPC and client-side JSON) for DateTimeOffset values, which is also cross-compatible with serialized DateTime values.

WebSharper 4.1.3

17 Jan 16:19
Compare
Choose a tag to compare

4.1.3.184

Fixes

  • #885 Fix regression in Map.remove sometimes returning an empty map.

WebSharper 4.1.2

16 Jan 14:52
Compare
Choose a tag to compare

WebSharper 4.1.2.178

New features

  • #874 WebSharper for C# now supports syntax introduced in C# 7.2: in arguments and ref 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 a Remote function.
  • #883 Map and Set values with any key type can now be serialized into JSON with Json.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 like EndPoint("POST /post")
  • #871 Multiple EndPoint attributes can be used on types and members. Equivalently, the EndPoint attribute can be passed multiple string arguments. In the case of multiple attributes, they can be ordered by setting the order parameter of the EndPoint 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 an EndPoint 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 (and Router.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

09 Jan 14:59
Compare
Choose a tag to compare

WebSharper 4.1.1.175

New features

  • #853 Server-side event handlers (on.*) and ClientSide 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 in WebSharper.UI is now available again within client-side code. So a div [] [ client <@ div [] [] @> ] in server side-code will create the internal div on the client (the server returning a placeholder) while fully running on the it just creates the internal div basically as if client <@ @> 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 package WebSharper.UI.Next work the same as in WebSharper 4.0.

WebSharper 4.1

23 Dec 11:26
Compare
Choose a tag to compare

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> in web.config, now local script links are correct for any sub-page.
  • #864 Expanded WebSharper.Testing to expose more equality test alternatives provided by QUnit.
  • #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 in WebSharper namespace and in WebSharper.Core.dll.
  • A Sitelet's Router field is now of type IRouter, compatible in capabilities with the old Router record. The new Router type offers more combinators and is implementing IRouter.
  • Also with the WebSharper 4.1, WebSharper.UI.Next has been renamed to WebSharper.UI, affecting both package and namespace naming. For C# projects, an additional package reference for WebSharper.UI.CSharp is needed, and .CSharp has been removed from all namespace names, so now no extra usings are needed to get the C#-oriented extension methods. A compatibility package WebSharper.UI.Next 4.1 still exists for immediate back-compatibility, switching to WebSharper.UI is recommended for new features and fixes.

WebSharper 4.0.196

27 Nov 19:36
Compare
Choose a tag to compare

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).
  • #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 and TimeSpan now translate correctly from C#.
  • Content.Ok is available to return a 200 OK http response without a content body.

WebSharper 4.0.195

18 Oct 15:44
Compare
Choose a tag to compare

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<_>. Also LinkedList<_> is supported for JSON serialization.

WebSharper 4.0.194

11 Oct 14:04
Compare
Choose a tag to compare

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.