Skip to content

Releases: dotnet-websharper/core

WebSharper 4 (codename Zafir) beta-6

28 Feb 05:54
Compare
Choose a tag to compare
Pre-release

Version 4.0.155.24-beta6

Improvements

  • using FSharp.Compiler.Service 11.0.4. To have optimal compilation speeds, go to a folder in a solution at packages\Zafir.FSharp.4.0.155.11-beta6\tools and run ./runngen in PowerShell as administrator.

  • #650 Bindings to DOM have been updated to current ECMA specification

  • #652 Bindings to JQuery have benn updated to version 3.1.1

  • #660 Erased union and option types have been added to WebSharper.JavaScript namespace, named Union and Optional. These are similar to Choice and Option types of F#, but work as TypeScript's erased unions in the JS translation. Conversion functions are available under modules Optional and Union.

  • #651 output is using JavaScript strict mode

  • #550 custom structs can now be used in RPC calls

  • #644 F# unions with Constant null case can now be used in RPC calls

  • #642 Local generic functions in F# compile when the compiler does not need the type parameter for custom code generation (macros). If it does, you get an error "Macro [name] would use a local type parameter. Make the inner function non-generic or move it to module level and mark it with the Inline attribute"

  • #648 JavaScript code output optimizations:

    • Functions taking F# tupled or curried functions as parameters and only fully applying them (in the case of curried parameter) now translates to taking a flat JavaScript function. This means less closure creation and better performance when using functions like List.map2
    • Local F# tupled and curried functions are now converted to flat functions in JavaScript where possible
  • #649 Tail call optimization for F#:

    • let rec expressions with single or mutual recursion
    • Module or class (in default constructor) let rec expressions with single recursive function
    • Class members, calling itself but no other members of the same class annotated with JavaScript (so inlines do not opt-out of optimization). For instance members, the call must be on the current instance.
  • #655 Require and RemotingProvider attributes can take additional object parameters. These will be passed on to the constructors of the resource class and the client-side RemotingProvider instance respectively.

  • WebSharper.Resources.BaseResource is not an abstract class any more. This allows using it with the Require attribute without defining an extra type:

    [<Require(typeof<Resources.BaseResource>, "//myurl.com/mylib.js")>]

Fixes

  • #645 Name conflict in WebSharper.Sitelets.Content from C#
  • #657 Using Name attribute on properties with getter and setter now adds set_ to the name of the setter to disambiguate them.
  • #633 WIG-defined interfaces now can be inherited from with F#/C# code if they contain only method definitions without custom inline annotations. Calling interface members from .d.ts-based bindings now translate properly, but these interfaces can't be inherited from in your code (as they are using special call semantics).

Breaking changes

  • Macro API: MacroResult.MacroNeedsResolvedTypeArg now needs the offending type parameter as a field. You can decide if a type is a type parameter of any kind by using the new IsParameter property.

WebSharper 3.6.19

03 Feb 11:44
Compare
Choose a tag to compare

Fixes

  • #603 CSRF error response, fixes 403 Forbidden issue with RPC on Suave

WebSharper 4 (codename Zafir) beta-5 bugfix

03 Feb 11:44
Compare
Choose a tag to compare

Fixes

  • #603 CSRF error response, fixes 403 Forbidden issue with RPC on Suave
  • #622 Dom.Element.ScrollTop and ScrollLeft are mutable
  • #639 Dom.Event constructor arguments
  • #643 Constant null in ClientSideJson
  • #646 F# union with [<Constant(null)>] case
  • Add JS.Document.QuerySelector and JS.Document.QuerySelectorAll

Improvements

  • Enhance test runner composability

WebSharper 4 (codename Zafir) beta-5 bugfix

17 Jan 09:56
Compare
Choose a tag to compare

Version 4.0.152.29-beta5

Fixes

  • #635: Iterating with for .. in (F#) and foreach (C#) on Dictionary and HashSet
  • Fix Array.tryFindBack was not checking first item
  • #640: Fix Seq module function proxies for countBy, groupBy, except to not only rely on hash values

WebSharper 4 (codename Zafir) beta-5

07 Dec 21:11
Compare
Choose a tag to compare
Pre-release

Version 4.0.151.27-beta5

Fixes

  • Pattern matching on arrays when also matching against null
  • #616: Handle MSBuild variables ending with \
  • #618: Recursive F# values which use functions defined after work properly, for example let rec answer = ask() and ask() = 42
  • Fix AjaxRemotingProvider, allow inheriting, overridable AsyncBase and Endpoint members
  • #623: @file command line argument supported, needed for large projects
  • F# Set constructor proxy erases duplicate elements
  • Dictionary proxy supports multiple items with the same hash, added Key and Value properties (currently not lazy evaluating, see #630)
  • Fixed Enum.HasFlag proxy
  • #629: trait calls on iterfaces compiling (For example using the WebSharper.UI.Next.Notation operators on a WebSharper.UI.Next.IRef)
  • #631: don't CSRF-check allowed CORS origins
  • Client-side JSON serialization fixes:
    • 621: Dictionary<string,> and Map<string,> JSON deserialization
    • generating type dependencies correctly for use in SPA projects (which use dead-code elimination)
    • fix optional fields in unions
  • #633: Interface members defined with WIG use wrong name when translated

Improvements

  • Updated to FSharp.Compiler.Service version 8.0 which has improvements to compilation speed and new features coming with F# 4.1
  • Code output organization: local let function declarations that translate into a local JavaScript function are not moved to top of code block
  • Immutable struct declarations now usable in client-side code, not yet for remoting
  • System.Lazy proxy now releases reference to function argument when evaluated
  • Static constructors erasing themselves from global JavaScript value after running

Breaking changes

  • Type inference changes introduced by latest FSharp.Compiler.Service can be breaking. We have changed WIG Generic helper operators which can be used to construct generic types and members to have different character lengts based on arity: for example use Generic -- fun t1 t2 -> ... instead of just Generic - fun t1 t2 -> ...
  • Constructing a default value for example Unchecked.defaultof now always uses compile-time type information. This can be problematic if the type is a generic parameter. For example using match dict.TryGetValue x with ... can throw an error if dict has a generic value type, as the F# compiler is implicitly creating a default value to pass to the out parameter of TryGetValue. You can get around it by wrapping the expression in the new helper DefaultToUndefined which allows translating default values inside to just undefined: match DefaultToUndefined(dict.TryGetValue x) with ...

WebSharper 4 (codename Zafir) beta-4

06 Oct 15:01
Compare
Choose a tag to compare
Pre-release

Version 4.0.133.15-beta4

Improvements

  • #614: printf and Json.Serialize/Deserialize now create global helper functions for each type only once.
    This required: new macro functionality to create top level functions, custom key/value dictionary in assembly metadata accessible by macros.
  • #615: Fixed Json.Serialize issue with using generic unions with both simple value and inlinable record type
  • #582: Improvements to client-side implementations (proxies) to a number of List/Seq/Array module functions. Includes better sorting, List.append does not iterate through second list, more specialized conversions and map family of functions.

Deprecated

  • Json.SerializeWith and similar functions taking a custom serializer object have been removed

WebSharper 4 (codename Zafir) beta-3 bugfix

28 Sep 15:40
Compare
Choose a tag to compare

Version 4.0.131.14-beta3

Fixes

  • #608 and #613: Code dependency missing for methods using C# async and delegate creation, causing problems in SPA projects which use dead code elimination.
  • #610: C# auto-implemented properties was causing errors in RPC calls
  • #611: C# fields were not initialized to default value
  • #612: C# chained assignment on properties failed to set value after the rigthmost one
  • #530: parse sitelet endpoint "/" with arguments
  • added proxy (client-side support) for DateTime.TryParse

WebSharper 3.6.18

28 Sep 09:27
Compare
Choose a tag to compare
  • #531 Client-side JSON: [<Name>] fields on record inlined in union case
  • #532 Provide server-side implementation for Json.(De)Serialize
  • #534 Server-side JSON deserialization: support unquoted field names
  • #579 Empty string at end of Sitelet endpoint
  • #597 Include the handler type in Remoting.InvalidHandlerException
  • Fix metadata loading for RPCs when outside ASP.NET
  • #603 Percent-decode the CSRF token
  • #530 parse sitelet endpoint "/" with arguments

WebSharper 4 (codename Zafir) beta-3

16 Sep 20:57
Compare
Choose a tag to compare
Pre-release

Improvements and new features

  • #604: Source mapping is now available for bundle (Single Page Application) projects.
  • #607: Client-side JSON serializer reports immediately when a mandatory field of a record is missing instead of propagating the error.
  • Name attribute now works on interface types. See documentation.
  • You can now use CDN for WebSharper 4 base library scripts. See documentation.
  • Sitelet runtime resource writer uses caches for faster page serves.

Fixes

  • #605: Fixed a concurrency issue in initializing server-side JSON serialization for RPCs and Web.Controls.
  • #606: Optimizer sometimes erroneously removed a call to a virtual method when the default implementation was had no side effects.

WebSharper 4 (codename Zafir) beta-2

14 Sep 09:27
Compare
Choose a tag to compare
Pre-release

Improvements and new features

  • #599: Improve error on an invalid annotation for an abstract method.
  • #601: JS output improvements: local named functions are defined by function X() {...} instead of var x = function() {...}. 2-case F# match expressions are simplified, as is matching against constants.
  • #600: JS.Inline helper inside WebSharper.JavaScript.Pervasives (auto-open module in F#). Parses a JavaScript expression at compile-time, for example JS.Inline("1 + 2"). You can also add parameters by using $0... for holes: JS.Inline("$0 + $1", 1, 2).
  • #598: RPC functions are now identified by assembly, full name, and a hash of the signature instead of a generated identifier. This means reordering or adding RPC methods are not breaking against previous builds of client-side. Unrecognized incoming RPC request or non-maching signature errors are reported with specific errors.

Fixes

  • #594: Enabled the use of Json.Serialize outside ASP.NET.
  • Support for translating from F# ReflectedDefinition correctly, accounting for tupling/currying added by the F# compiler.