Releases: dotnet-websharper/core
WebSharper 4 (codename Zafir) beta-6
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 atpackages\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, namedUnion
andOptional
. These are similar toChoice
andOption
types of F#, but work as TypeScript's erased unions in the JS translation. Conversion functions are available under modulesOptional
andUnion
. -
#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
- 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
-
#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
andRemotingProvider
attributes can take additional object parameters. These will be passed on to the constructors of the resource class and the client-sideRemotingProvider
instance respectively. -
WebSharper.Resources.BaseResource
is not an abstract class any more. This allows using it with theRequire
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 addsset_
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 newIsParameter
property.
WebSharper 3.6.19
Fixes
- #603 CSRF error response, fixes 403 Forbidden issue with RPC on Suave
WebSharper 4 (codename Zafir) beta-5 bugfix
Fixes
- #603 CSRF error response, fixes 403 Forbidden issue with RPC on Suave
- #622
Dom.Element.ScrollTop
andScrollLeft
are mutable - #639
Dom.Event
constructor arguments - #643 Constant
null
inClientSideJson
- #646 F# union with
[<Constant(null)>]
case - Add
JS.Document.QuerySelector
andJS.Document.QuerySelectorAll
Improvements
- Enhance test runner composability
WebSharper 4 (codename Zafir) beta-5 bugfix
WebSharper 4 (codename Zafir) beta-5
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, overridableAsyncBase
andEndpoint
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, addedKey
andValue
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 aWebSharper.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 JavaScriptfunction
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 WIGGeneric
helper operators which can be used to construct generic types and members to have different character lengts based on arity: for example useGeneric -- fun t1 t2 -> ...
instead of justGeneric - 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 usingmatch dict.TryGetValue x with ...
can throw an error ifdict
has a generic value type, as the F# compiler is implicitly creating a default value to pass to the out parameter ofTryGetValue
. You can get around it by wrapping the expression in the new helperDefaultToUndefined
which allows translating default values inside to justundefined
:match DefaultToUndefined(dict.TryGetValue x) with ...
WebSharper 4 (codename Zafir) beta-4
Version 4.0.133.15-beta4
Improvements
- #614:
printf
andJson.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 andmap
family of functions.
Deprecated
Json.SerializeWith
and similar functions taking a custom serializer object have been removed
WebSharper 4 (codename Zafir) beta-3 bugfix
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
- #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
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
WebSharper 4 (codename Zafir) beta-2
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 ofvar x = function() {...}
. 2-case F# match expressions are simplified, as is matching against constants. - #600:
JS.Inline
helper insideWebSharper.JavaScript.Pervasives
(auto-open module in F#). Parses a JavaScript expression at compile-time, for exampleJS.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.