Releases: jwaliszko/ExpressiveAnnotations
v2.6.0
- enhancements:
- breaking change - redesigned approach to DOM fields values deserialization (settings options:
parseDate
andparseObject
removed from client script, in favor of newValueParser
attribute withaddValueParser()
method), - arrays (plus all collections declaring indexers) access support added to expressions parser,
- debug verbosity switch added to client script.
- breaking change - redesigned approach to DOM fields values deserialization (settings options:
- fixes:
- slight performance improvements,
- minor cleanups.
v2.5.1
- error related to different security accessibility of an overridden member - fixed,
- undefined reference error, when
dependencyTriggers
was set toundefined
- fixed, paste
event removed from default setup ofdependencyTriggers
(redundant because fires before field data is ready for being collected from within this event - custom event should be defined (e.g. seeafterpaste
in sample project)).
v2.5.0
- breaking changes:
-
Validators library name and namespace changed from ExpressiveAnnotations.MvcUnobtrusiveValidatorProvider to ExpressiveAnnotations.MvcUnobtrusive.
_Single migration step for most users:_
In Global.asax.cs file, replace the below line:
using ExpressiveAnnotations.MvcUnobtrusiveValidatorProvider.Validators;
with the following one:
using ExpressiveAnnotations.MvcUnobtrusive.Validators;
that's all. -
Compatibility fix (but also a possible breaking change) - since server-side
DateTime
property value, when used in expression, has been always parsed to return number of milliseconds (since 1970) at client-side, existing built-in methods likeNow()
,Today()
andDate()
, instead of JavaScriptDate
type object, are now also modified to return milliseconds at client-side, to keep consistency._Sample migration step for an arbitrary code using mentioned built-in methods:_
Let's say you have some custom function signature defined, like
DateTime AddYears(DateTime from, int years)
, and an exemplary expression which uses that function in the following manner -"AddYears(Today(), 1)"
. Due to the fact thatToday()
method at client-side returns milliseconds now, instead of JavaScriptDate
type object like before, possible current implementation of your custom method, e.g.ea.addMethod('AddYears', function(from, years) { var to = from.getFullYear() + years; from.setFullYear(to); return from; });
should be modified accordingly:
ea.addMethod('AddYears', function(from, years) { from = new Date(from); // <--- convert milliseconds to date firstly var to = from.getFullYear() + years; from.setFullYear(to); return from.getTime(); // <--- return milliseconds instead of Date });
The reason is that now you can write expressions which can add
DateTime
toTimeSpan
in a natural way (like in C#), e.g."Today() + TimeSpan(7, 0, 0, 0)"
, which will also be correctly understood at client-side - instead of adding someDate
object tointeger
number,integer
tointeger
will be added.
-
- enhancements:
TimeSpan
type handling added at client- and server- sides + respective toolchainTimeSpan(int, int, int, int)
method created (client-side period is expressed in milliseconds, server-side is just aTimeSpan
.NET type).- Execution priorities for attributes implemented (see
Priority
property) and new data annotations model validator provider created which respects such priorities (seeExpressiveAnnotationsModelValidatorProvider
type, and check Global.asax.cs in sample project for the usage manner - recommended over the previous approach).
- others:
- Full C# API documentation added (generated by Sandcastle with the support of SHFB).
v2.4.5
v2.4.4
v2.4.3
- naming collisions handling improved (client-side issue),
- minor change for default messages in attributes.
Symbol package pushed to SymbolSource.org.
(...) Visual Studio can be configured to automatically download PDB files associated with installed packages and allow the developer to use a debugger to step into source files on-demand from Visual Studio. This is a built-in feature of the IDE, that can also be used to debug .NET Framework code using Microsoft Reference Source servers. It is only required to add a new symbol source in the debugger configuration (see here for detailed instructions).
-- NuGet docs
v2.4.2
v2.4.1
v2.4.0
- changes related to client-side validation script mostly:
- dependency validation triggers configurability added:
api.settings.dependencyTriggers
- a string containing one or more DOM field event types (such aschange
,keyup
or custom event names) for which related fields validation is executed (checkeventType
parameter of jQuery bind), - DOM fields values designated to contain
object
types are going to be parsed using JSON parser (so far, when there was a type indication other thandatetime
,numeric
,string
,bool
orguid
, exception was thrown) - if there are no json values stored in DOM fields, custom implementation toapi.settings.parseObject
method can be provided, - breaking change to previous version:
api.settings.instantValidation
switch removed (entire form validation invoke for any event can be simply triggered manually from external scope, so built-in support seems redundant).
- dependency validation triggers configurability added:
v2.3.0
- changes related to client-side validation script only:
- validation triggered by default not only for currently modified field, but for all related ones (which state directly depends on current change) as well,
instantValidation
switch added toea.api.settings
(indicating whether entire form should be instantly validated when any field activity is detected i.e. change, paste or keyup event), off by default,- appropriate message thrown when custom date parsing fails.