WebSharper 4 (codename Zafir) beta-5
Pre-release
Pre-release
Jand42
released this
07 Dec 21:11
·
1933 commits
to master
since this 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, 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 ...