Breaking changes in 0.9.20 #401
Replies: 3 comments 10 replies
-
i got this error after upgrade to serverpod 0.9.20 : The method 'wrapSerializationData' isn't defined for the type 'MyObject'. |
Beta Was this translation helpful? Give feedback.
-
Somebody Explain SERVERPOD version: 0.9.20 mode: development time: 2022-11-24 13:16:30.435003Z |
Beta Was this translation helpful? Give feedback.
-
Version 0.9.20 is the most significant update to Serverpod so far. We tried to bake all breaking changes into a single update ahead of the 1.0 release.
The protocol between the client and the server is now much cleaner and conforms to more traditional JSON code - all credit to Maximilian Fischer, who has done the larger bulk of the work on this update.
If you are running an app in production, your app will require an update to be compatible with this version of Serverpod. Therefore, you may want to continue to use an older version of Serverpod until you have a complete migration plan.
Update the protocol
There have been some changes in the protocol specification. If referencing other modules, you will need to add the
module:MODULE_NICKNAME:
prefix.Make sure to rerun
serverpod generate
.Cache
Cache.get('key') as DataClass
becomesCache.get<DataClass>('key')
. Specifying the type is not optional.Future calls
The type of the parameter invoke requires must now be set as an generic of
FutureCall
.New syntax:
DateTime
From now on, every
DateTime
handled by Serverpod is converted to UTC. This includes times returned from the database or which have been serialized.Enums
Enums are now serialized and stored in the database as integers.
You can migrate your database by running:
In case the enum detection does not work for your edge case you can add
enum
to your field specification.Runtime settings
Due to the change in how enums are serialized the
serverpod_runtime_settings
table needs to be recreated. It is safe to delete as it is automatically repopulated when the server starts. The following code will create a new table for the runtime settings:Beta Was this translation helpful? Give feedback.
All reactions