Skip to content

Releases: jwaliszko/ExpressiveAnnotations

v2.6.0

12 Aug 19:20
Compare
Choose a tag to compare
  • enhancements:
  • fixes:
    • slight performance improvements,
    • minor cleanups.

v2.5.1

28 Jul 20:54
Compare
Choose a tag to compare
  • error related to different security accessibility of an overridden member - fixed,
  • undefined reference error, when dependencyTriggers was set to undefined - fixed,
  • paste event removed from default setup of dependencyTriggers (redundant because fires before field data is ready for being collected from within this event - custom event should be defined (e.g. see afterpaste in sample project)).

v2.5.0

29 Jun 20:48
Compare
Choose a tag to compare
  • 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 like Now(), Today() and Date(), instead of JavaScript Date 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 that Today() method at client-side returns milliseconds now, instead of JavaScript Date 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 to TimeSpan 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 some Date object to integer number, integer to integer will be added.

  • enhancements:
    • TimeSpan type handling added at client- and server- sides + respective toolchain TimeSpan(int, int, int, int) method created (client-side period is expressed in milliseconds, server-side is just a TimeSpan .NET type).
    • Execution priorities for attributes implemented (see Priority property) and new data annotations model validator provider created which respects such priorities (see ExpressiveAnnotationsModelValidatorProvider 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

07 May 18:18
Compare
Choose a tag to compare

minor changes related to client-side script only:

  • namespaced events introduced,
  • bind() method replaced by recommended on().

v2.4.4

11 Apr 18:26
Compare
Choose a tag to compare
  • 'use strict'; pragma applied,
  • false enum ambiguity detection fix.

v2.4.3

15 Feb 22:47
Compare
Choose a tag to compare
  • 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

23 Jan 16:30
Compare
Choose a tag to compare
  • additional types checking assertions with minor cleanups here and there,
  • synchronization improved,
  • parsing output fix.

v2.4.1

05 Jan 21:18
Compare
Choose a tag to compare
  • types incompatibility detection fixes (more detailed parsing errors output),
  • CA warnings satisfied, minor refactoring - no functional changes.

v2.4.0

28 Nov 22:51
Compare
Choose a tag to compare
  • 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 as change, keyup or custom event names) for which related fields validation is executed (check eventType 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 than datetime, numeric, string, bool or guid, exception was thrown) - if there are no json values stored in DOM fields, custom implementation to api.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).

v2.3.0

25 Nov 10:39
Compare
Choose a tag to compare
  • 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 to ea.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.