delphimvcframework/3_0_0_breaking_changes.md

53 lines
3.2 KiB
Markdown
Raw Normal View History

2017-02-09 08:55:38 +01:00
# 3.0.0 breaking changes
- ```RenderListAsProperty<T>``` has been removed from TMVCController. You can set such kind of specialized serializations in your custom base controller.
2017-02-09 09:05:45 +01:00
- ```RenderJSONArrayAsProperty``` has been removed from TMVCController. You can set such kind of specialized serializations in your custom base controller.
- ```Render``` has been removed from TMVCController (was deprecated).
2017-02-22 19:50:37 +01:00
- ```Render(TJSONValue)``` has been removed from TMVCController (use Render(TObject)).
2017-02-09 19:04:25 +01:00
- Trying to deserialize a ```TJSONNull``` the target instance will not be freed anymore (consistency with serialize).
- ```Context.Request.BodyAsJSONObject``` dosen't exist any more. Use BodyAs<T> or the following pattern to migrate:
```
JSON := TJSONObject.ParseJSONValue(Context.Request.Body) as TJSONObject;
try
if not Assigned(JSON) then
2017-03-30 17:00:04 +02:00
raise EMVCException.Create('Invalid JSON');
// do something here
finally
JSON.Free;
end;
```
- ```TMVCConfigKey``` moved to unit ```MVCFramework.Commons```.
- ```TMVCMimeType``` was renamed to ```TMVCMediaType```.
- ```TMVCController.Render;``` no parameter method do not exist anymore. If the return is a ResponseStream, use the ```RenderResponseStream;```.
- ```TMVCController.PushJSONToView;``` was renamed to ```PushToView```and Removed SystemJSON dependency, use the ToJSON method if necessary.
- There is no more a default view engine for Server Side Views (before 3.0 there was mustache).
- Mustache engine is no more the only view engine available. Now you can implement all the view engines you need (check the serversideviewsprimer).
- On Linux there is no built-in available view engine available. In other words, using only the built-in classes, you cannot use server side views on linux (dmustache is not compatible on linux).
- HTTP File Upload doesn't work on Linux because of a bug in Delphi 10.2 (https://quality.embarcadero.com/browse/RSP-17216).
- ```[MapperJSONNaming(TJSONNameCase.JSONNameLowerCase)]``` now must be changed in ```[MVCNameCase(ncLowerCase)]```
- ```[MapperJSONNaming(TJSONNameCase.JSONNameUpperCase)]``` now must be changed in ```[MVCNameCase(ncUpperCase)]```
2017-04-26 14:39:18 +02:00
## TRESTClient
Every reference to TJSON* has been removed from the TRESTClient public interface. To port the existing code, you have to include ```MVCFramework.RESTClient.SystemJSONUtils``` and change your code as following:
Before
```lMyJSONObject := Response.BodyAsJsonObject.Clone as TJSONObject;```
After
```delphi
lMyJSONObject := TSystemJSON.BodyAsJsonObject(Response) as TJSONObject;
try
//use the object
finally
lMyJSONObject.Free;
end;
```
The memory allocated for the TJSONValue descendant (e.g. TJSONObject, TJSONArray and so on) *is no more managed by the TRESTClient itself* but must be feed by the calling code.
2017-05-09 13:37:46 +02:00
- DelphiStompClient has been removed from the core. The following method is no more available in TMVCController.
```delphi
function GetNewStompClient(const AClientId: string = ''): IStompClient;
2017-06-22 16:18:58 +02:00
```
- ```TMVCConfigKey.ISAPIPath``` has been substituted with ```TMVCConfigKey.PathPrefix``` and now is applicated to all kind of projects (not only ISAPI);
- ```MapperSerializeAsString``` attribute is now ```MVCSerializeAsString```