Releases: dotnet-websharper/core
WebSharper 4.3
This is a major release for WebSharper 4. See the associated WebSharper UI release.
Templates for .NET Core SDK: dotnet new -i WebSharper.Templates::4.3.0.248
Templates for Visual Studio 2017: http://websharper.com/installers/WebSharper.4.3.0.248.vsix
Features
-
#941: Run the compiler on .NET Core.
Both the F# and C# compilers are now compiled for .NET Core 2.0, in addition to the existing .NET Framework 4.6.1 versions. This means that it is not necessary anymore to have mono installed to compile a WebSharper project on Linux or OSX.
By default, compiling a .NET Framework project uses the .NET Framework version of the compiler, and compiling a .NET Core or .NET Standard project uses the .NET Core version of the compiler. To override this default, you can set the project property
<WebSharperUseNetFxCompiler>
toTrue
(to use the .NET Framework compiler) orFalse
(to use the .NET Core compiler). -
#964: Add proxies for the new functions in F# 4.5:
Async.StartImmediateAsTask
Seq/List/Array.transpose
ValueOption
typeMap.TryGetValue
FuncConvert.FromFunc/FromAction
-
#965: Add support for C# 7.3 language features:
ref
local reassign- Expression variables in initializers
Known missing C# 7.3 feature, upcoming in WebSharper 4.3.1:
==
and!=
for tuple types
-
#929: The
WebSharper.Compiler
NuGet package, which provides the WebSharper compilers as a library, has been split in order to better handle the specific F# and C# use cases.WebSharper.Compiler.Common
contains the common compiler libraries.WebSharper.Compiler.FSharp
andWebSharper.Compiler.CSharp
contain the compilers for their respective languages. In addition to both depending onWebSharper.Compiler.Common
, they also have properly versioned dependencies on the F# Compiler Service and Roslyn, respectively.WebSharper.Compiler
still exists, but it is now a meta-package with no content of its own but which depends on bothWebSharper.Compiler.FSharp
andWebSharper.Compiler.CSharp
. If you were usingWebSharper.Compiler
to compile only one language, then you are encouraged to switch to the corresponding language-specific package.
Note that although the core WebSharper libraries are compatible with F# 4.1, the compiler requires the latest FSharp.Core 4.5.
-
#938: Allow macros to resolve
let
-bound variables.In an expression like
let y = x + 1 in macroedFunction y
, this allows the macro to retrieve and manipulate the expressionx + 1
, rather than just seeingy
.
Fixes
-
#963 Add missing proxies for F# numeric conversion functions:
int8
,byte
,int16
,uint16
,uint32
,uint64
,double
. -
#966: Support the
Method
sitelet endpoint attribute on a class. -
#968:
Task.Result
throws if accessed before the task is completed. -
#969: Include inherited C# auto-property backing field in remoting.
WebSharper 4.2.14
This is a bugfix release for WebSharper 4.2.
Templates for .NET Core SDK: dotnet new -i WebSharper.Templates::4.2.14.240
Templates for Visual Studio 2017: http://websharper.com/installers/WebSharper.4.2.14.240.vsix
Fixes
- #951 Virtual methods do not cause compiler to fail with a duplicate key error if the class also has a static constructor. Also abstract/virtual methods have better name resolution logic, if a subclass defines a member with a fixed name (with the
Name
attribute), and the abstract/virtual method does not have a fixed name, it will be resolved to avoid naming conflicts in JavaScript translation automatically. - #959 A specific error is given if a method marked with the
SPAEntryPoint
attribute is non-static or has arguments. - #961 C# proxy types do not incorrectly warn that they should not be public when they are not public. Also, proxy method resolution has been improved, the member signature can use the proxy type as equivalent to the target type, making casts unnecessary.
Example
This is now a working minimal proxy for StringBuilder
:
[Proxy(typeof(StringBuilder))]
internal class StringBuilderProxy
{
private List<string> b = new List<string>();
public StringBuilderProxy Append(string s)
{
b.Add(s);
return this;
}
public override string ToString()
{
var s = String.Concat(b);
b.Clear();
b.Add(s);
return s;
}
}
Previously the Append
method would have needed to return StringBuilder
, using an unsafe JavaScript cast (WebSharper.JavaScript.Pervasives.As<StringBuilder>
) on the return value.
WebSharper 4.2.13
This is a feature release for WebSharper 4.2.
Templates for .NET Core SDK: dotnet new -i WebSharper.Templates::4.2.13.239
Templates for Visual Studio 2017: http://websharper.com/installers/WebSharper.4.2.13.239.vsix
Enhancements
- #954 More support for
decimal
, numeric conversions,abs
,sign
all work as expected on client-side. Referencing theWebSharper.MathJS
nuget package is still needed for using decimals (as well asComplex
andBigInteger
), which is now have a version that is matchingWebSharper
package version because of tighter coupling. - #956 Added client-side support for
DateTime.DaysInMonth/IsLeapYear
. - #900 Added a new attribute called
JavaScriptExport
. This can be used to mark parts of code (members or whole types, files or assemblies) to be always included in JavaScript output forBundle
/BundleOnly
projects (serving additional starting points for dead-code elimination next toSPAEntryPoint
). AlsoSPAEntryPoint
is now optional. See ticket #900 for full specification. - The
JavaScript
attribute has also got enhancements, same asJavaScriptExport
:- You can now have multiple
JavaScript
attributes, this is useful on assembly-level for annotating multiple types/files remotely. - You can use a type as argument, for example
[<JavaScript(typeof<MyType>)>]
. This is equivalent to marking the type named with[<JavaScript>]
. The attribute must be on the assembly or on a type/module that is containing the targeted type as a nested type.
- You can now have multiple
Fixes
- #953
Dictionary
methods do not returnundefined
instead offalse
.
WebSharper 4.2.12
This is a feature release for WebSharper 4.2.
Templates for .NET Core SDK: dotnet new -i WebSharper.Templates::4.2.12.237
Templates for Visual Studio 2017: http://websharper.com/installers/WebSharper.4.2.12.237.vsix
Enhancements
- #945 The
System.Decimal
type now can be used as RPC arguments or return value. Using it on the client side still requires theWebSharper.MathJS
package, so it is also needed for remoting.
WebSharper 4.2.11
This is a bugfix release for WebSharper 4.2. See the associated WebSharper.UI release.
Templates for .NET Core SDK: dotnet new -i WebSharper.Templates::4.2.11.236
Templates for Visual Studio 2017: http://websharper.com/installers/WebSharper.4.2.11.236.vsix
Fixes
- #945 WebSharper's build tools accept non-numeric
nowarn
arguments. This fixes compatibility with Visual Studio 15.7 and associated C#/F# build tools. - #947 Resources using
BaseResource
and an URL starting with//
are correctly downloaded during build whenUseDownloadedResources
is on. - #946 Union cases with a
Wildcard
attribute used for inferred routing has improved behavior: if another case can be fully matched, then that takes precedence over theWildcard
one. - #948 An erased union where one type argument is a union with a possible null value (either using WebSharper's
[<Constant "null">]
attribute or[<CompilationRepresentation(CompilationRepresentationFlags.UseNullAsTrueValue)>]
) is now translating case checks with the proper null check included. - #944 when translating a check against an interface type, an "object" type check is also added to prevent runtime errors.
WebSharper 4.2.10
This is a bugfix release for WebSharper 4.2. See the associated WebSharper.UI release.
Templates for .NET Core SDK: dotnet new -i WebSharper.Templates::4.2.10.234
Templates for Visual Studio 2017: http://websharper.com/installers/WebSharper.4.2.10.234.vsix
Improvements
- #943 New option for
DownloadResources
:WarnOnly
.true
tries to download resources, and throws an error if it fails.WarnOnly
tries to download resources, and shows a warning if it fails.false
does not download resources.
Fixes
- #940 Inferred sitelet: "GET /" union case prevents other cases from being parsed
WebSharper 4.2.9
This is a bugfix release for WebSharper 4.2. See the associated WebSharper.UI release.
Templates for .NET Core SDK: dotnet new -i WebSharper.Templates::4.2.9.232
Templates for Visual Studio 2017: http://websharper.com/installers/WebSharper.4.2.9.232.vsix
Enhancement
- #921 Now JSON deserialization can handle the
System.Object
type, implemented as follows:- deserializing on the client side just returns the parsed value (ie. one of:
null
, a boolean, a string, a number, an array or a plain object). - deserializing on the server side produces a boxed value:
- null, boolean, string return a value of the corresponding type.
- number: returns a
float
(System.Double
) - array: returns a recursively parsed
obj[]
- object: returns a recursively parsed
Dictionary<string, obj>
- serializing from
System.Object
is not supported. This is to avoid accidentally upcasting the argument ofJson.Serialize
toSystem.Object
when a type annotation is missing.
- deserializing on the client side just returns the parsed value (ie. one of:
Fixes
- #935
Seq.chunkBySize
and other similar functions does not fail erroneously on some inputs. - #934 If for a website project, there is no
"outputdir"
inws.config
orWebSharperOutputDir
in project properties or aweb.config
file in the project folder, an explicit error is given that the unpack output directory cannot be determined.
WebSharper 4.2.8
This is a bugfix release for WebSharper 4.2. See the associated WebSharper.UI release
Templates for .NET Core SDK: dotnet new -i WebSharper.Templates::4.2.8.227
Templates for Visual Studio 2017: http://websharper.com/installers/WebSharper.4.2.8.227.vsix
Fixes
- #931 Add downwards assembly redirects. This fixes an assembly load failure when a non-WebSharper-compiled referenced assembly uses FSharp.Core > 4.4.1.0.
WebSharper 4.2.7
Improvements
-
WebSharper.Web.RpcModule
andWebSharper.Sitelets.HttpModule
do not get overridden anymore by external modules callingHttpContext.RemapHandler
within theHttpApplication.PostResolveRequestCache
event handler. Notably, ASP.NET MVC does this. -
The mutable static property
WebSharper.Sitelets.HttpModule.OverrideHandler
was added to customize this behavior forWebSharper.Sitelets.HttpModule
.
WebSharper 4.2.6
This is a bugfix release for WebSharper 4.2 (core libraries and compiler only).
Templates for Visual Studio 2017: http://websharper.com/installers/WebSharper.4.2.6.224.vsix
Fixes
runngen.ps1
script inWebSharper.FSharp/tools
folder runs without warnings and is included again correctly inWebSharper.CSharp/tools
.- #928 Sitelet definitions are instantiated only once for ASP.NET applications running in IIS.
- #927
Sitelet.Infer
does not fail and correctly handle theDateTimeFormat
attribute.