Skip to content

DotVVM 3.1

Compare
Choose a tag to compare
@quigamdev quigamdev released this 07 Jul 11:48

New features

Added automatic detection for lambda parameter types

#936
DotVVM is now able to infer types of lambda parameters from the context the lambda function was specified in. This makes it possible to specify more concise lambda expressions. For example instead of a Customers.Where((CustomerDto c) => c.Id > 0) it is now possible to write Customers.Where(c => c.Id > 0).

Added support for custom extension methods

#946
We have extended the capabilities of the @import directive to also search for available extension methods within provided namespaces. This feature allows users to use their custom extension methods inside data-binding.

Added more JavaScript translations

#965, #1009, #1029, #1039
We added a lot of new JavaScript translations for common .NET methods and some custom extensions. You can use these methods inside data-binding to express more complex operations and have them evaluated on the client's side.

  • Enumerable methods, string methods and Math methods
  • List<T> methods
  • Dictionary<K,V> methods

For a full list of supported .NET methods inside data-binding, see the following page from the documentation: Supported expressions.

Added support for string interpolation

#987
String interpolation is a well-known feature from C# that allows specifying a string prefixed with a '$' sign together with some interpolated expressions to be evaluated during runtime. Additionally, you can alter the way your interpolated expressions are converted into strings by providing optional formatting options. In DotVVM this is always a syntax sugar for calling string.Format(...).

Added support for dictionaries in viewmodels

#1014
It is now possible to use dictionaries in viewmodels. DotVVM now supports the usage of indexer in data-binding so that you can read values, change existing values, but also create new key-value pairs using the indexer on dictionaries.

Added support for passing AbortSignal into the postback

#1021
It is now possible to abort an in-progress postback. This can be useful to signalize if you already know that the result of postback is no longer needed.

HtmlGenericControl supports numeric and boolean values for attributes

#1028
Resource bindings previously supported only string values and collections of string in attributes. We extended this by supporting also: numeric types, bools, enums and Guids. DotVVM interprets booleans as indications whether a specific attribute exists or not. This means that an attribute is omitted when it is false.

Improvements and fixes

Fixed issues with assigning lambda functions to some known delegates

#936
Lambda functions can now be assigned to System.Actions and System.Predicates alongside with already supported System.Funcs.

Improved error reporting when a master page is corrupted

#976
Whenever a user makes a mistake while specifying a viewmodel for a specific master page, the error page no longer shows its type to be an UnknownTypeSentinel. Users now get a more descriptive error message that provides hints on how to resolve this issue.

Fixed generics resolving and method overloads search

#978
It is now possible to call more complex generic methods. Previously there were issues with matching generic parameters owned by types instead of methods, but also applying implicit conversions in some places.

FileUpload control does not need an iframe

#988
We have got rid of the iframe for FileUpload control. This makes it possible to use this control under more environments as we are aware that iframes can be discouraged by certain configurations.

Added helper functions for working with type metadata

#1013
We introduced a few utility functions to improve the experience when working with type metadata. You can find these functions under dotvvm.metadata when working with JS/TS.

Fixed serialization of byte[]

#1015
Byte arrays are no longer serialized as base64-encoded strings as this caused issues with coercing during deserialization.

Fixed RouteLink control with targets in SPA

#1016
SPA-routing logic is no longer applied on RouteLinks with targets that are specified within a SpaContentPlaceHolder. This makes it possible to use, for example target="_blank" to open a new tab from a SPA.

Updating non-existing array element should do nothing

#1020
Updating an array element from staticCommand after it was removed from viewmodel now does nothing. Previously it caused various issues when updating array elements with undefined values.

Warn when an uppercase attribute is used

#1022
Usage of uppercase attributes now generates a warning as it is likely a reference to a non-existing property. To silence these warnings, make sure to use all lowercase letters for standard HTML attributes.

Fixed issue with array and nullable types in lambda parameters

#1031
DotVVM compiler no longer throws whenever a user tries to create a lambda function with either a nullable type or an array type as one of its parameters.

Fixed compiler deadlock when building controls

#1035
We fixed an issue that made it possible to deadlock DotVVM compiler under special circumstances when building controls.

Better error messages for invalid resource name in @js directive

#1041
DotVVM no longer throws a NullReferenceException when the specified JS module is not found. We also improved error message for the case when the referenced module is not of ScriptModuleResource type.

Fixed issue with assigning to arrays and lists

#1052
DotVVM now correctly translates staticCommands that used indexer to change an element under a specific index.

Removed usage of culture-sensitive string operations

#1054
We replaced all occurrences of .ToUpper() and ToLower() calls with their culture-invariant alternatives. This previously caused some issues with, for example Turkish language.

Fixed compilation issues with extension methods

#1058
Repeated importing of the same namespace no longer ends with a compilation exception "Found ambiguous overloads of method ...". Additionally, DotVVM now correctly compiles extension methods that use default parameter values.

Fixed issue with assigning values to nullable types

#1071
Nullable properties can be assigned using either a nullable value or a non-nullable value (an implicit conversion should be used). We added the missing conversion that fixes compilation of the second case.

Tooling

Command-line interface

#872
Major rewrite of command-line interface and the stand-alone compiler executable. The compiler executable is no longer embedded in DotVVM NuGet package, but instead we introduced the DotVVM.CommandLine NuGet package.