DelphiMVCFramework 3.2.3-radium
What's New in 3.2.3-radium
-
⚡ Default error responses contains the official "reason string" associated to the HTTP status code (this can be a breaking change for some generic client which doesn't correctly interpret the http status code)
-
⚡ Added static method
HTTP_STATUS.ReasonStringFor(HTTPStatusCode)
wich returns the standardReasonString
for a given HTTP status code. -
⚡ Improved handling of
TMVCErrorResponse
information -
⚡ mid-air-collision handling now uses SHA1 instead of MD5
-
⚡ Added
MVCFramework.Commons.MVC_HTTP_STATUS_CODES
const array containing all the HTTP status codes with itsReasonString
. -
⚡ Support for
TObject
descendants in JSONRPC APIs (not only for JSONObject and JSONArray). -
⚡ New global configuration variable
MVCSerializeNulls
.- When MVCSerializeNulls = True (default) empty nullables and nil are serialized as json null.
- When MVCSerializeNulls = False empty nullables and nil are not serialized at all.
-
⚡ Nullable types now have
Equal
method support, the new methodTryHasValue(out Value)
works likeHasValue
but returns the contained value if present. Also there is a better "equality check" strategy. -
⚡ Unit tests now are always executed for Win32 and Win64 bit (both client and server).
-
⚡ Added
TMVCActiveRecord.Refresh
method -
⚡ Unit test suites generates one NUnit XML output file for each platform
-
⚡ New built-in profiler (usable with Delphi 10.4+) - to profile a block of code, write the following
procedure TMyController.ProfilerSample1; begin NotProfiled(); //this line is not profiled //the following begin..end block will be profiled //timing will be saved in a "profiler" log begin var lProf := Profiler.Start(Context.ActionQualifiedName); DoSomething(); DoSomethingElse(); Render('Just executed ' + Context.ActionQualifiedName); end; // profiler writes automatically to the log NotProfiled(); //this line is not profiled end; procedure TMyController.DoSomething; begin begin var lProf := Profiler.Start('DoSomething'); Sleep(100); end; end; procedure TMyController.DoSomethingElse; begin begin var lProf := Profiler.Start('DoSomethingElse'); Sleep(100); DoSomething(); end; end; procedure TMyController.NotProfiled; begin Sleep(100); end;
The log contains the following lines - check the caller/called relationship shown using
>>
and<<
and the deep level[>>][ 1][MainControllerU.TMyController.ProfilerSample1] [profiler] [ >>][ 2][DoSomething] [profiler] [ <<][ 2][DoSomething][ELAPSED: 00:00:00.1088214] [profiler] [ >>][ 2][DoSomethingElse] [profiler] [ >>][ 3][DoSomething] [profiler] [ <<][ 3][DoSomething][ELAPSED: 00:00:00.1096617] [profiler] [ <<][ 2][DoSomethingElse][ELAPSED: 00:00:00.2188468] [profiler] [<<][ 1][MainControllerU.TMyController.ProfilerSample1][ELAPSED: 00:00:00.3277806] [profiler]
To get more info check the "profiling" example.
All profiler logs are generated with a log level
info
. If measured time is greater thanWarningThreshold
the log level iswarning
.WarningThreshold
is expressed in milliseconds and by default is equals to 1000. -
⚡ New
Context
property namedActionQualifiedName
which contains the currently executed action in the formUnitName.ClassName.ActionName
. It is available where theContext
property is available. Obviously is not available in theOnBeforeRouting
middleware events. -
⚡ Added ObjectPool and IntfObjectPool (and related unit tests). Thanks to our sponsor Vivaticket S.p.A.
-
⚡ Method
procedure Render(const AErrorCode: Integer; const AErrorMessage: string = '' ...
has been renamed toRenderStatusMessage
with a better parameter names. -
⚡
IMVCJSONRPCExecutor
supports async call. Thanks to our sponsor Orion Law. Check the new Async sample insamples\jsonrpc_with_published_objects\
. -
⚡ Removed
foTransient
ifTMVCActiveRecord
FieldOptions
. It became obsolete after introduction offoReadOnly
andfoWriteOnly
. -
⚡ Improved
TMVCActiveRecordMiddleware
. Now it can handle multiple connections for the same request. Also, you can completely omit the 'default' connection and just specify wich connection you want to use before starting to create yourTMVCActiveRecord
inherited entities.
Bug Fix in 3.2.3-radium
- Fixed a rendering problem in swagger interface format in case of specific JSON structure
- Fix issue 594 (Thanks to biware-repo)
- Fix issue 595
- Fix issue 590
- Fix issue 490
- Fix Issue 583 (Thanks to Marcelo Jaloto)
- Fix Issue 585
More details about dmvcframework-3.2.3-radium fixes here