ra1u / redis-dart

fast redis protocol parser and client
MIT License
84 stars 35 forks source link

Migration to dart 2.12 #28

Closed ghost closed 3 years ago

ghost commented 3 years ago

Since I am using this library in my application and did not want to renounce using sound-null-safety, I tried to do the migration myself. I have been able to use this new version for my use case, and after a bit of struggle I manage to have all the test succeed.

I mostly implemented the recommended changes of the dart migration tool, with a few notable changes. redisparser::parseArray could return null values, but it seems it is not compatible with the async library, which at some point try a cast to a non-null type. So I had made parseArray return [null] and catch that specific value in transaction::exec

The PR also includes auto formatting by my IDE, the removal of new keyword and the assign to then unused variables.

ra1u commented 3 years ago

Great.

I noticed that dart version needs to be >= 2.12 . Is this necessary and can we relax this restriction?

ghost commented 3 years ago

Great.

I noticed that dart version needs to be >= 2.12 . Is this necessary and can we relax this restriction?

Yes, it is specifically this version that introduces null-safety

ghost commented 3 years ago

23

Silentdoer commented 3 years ago

hi, this can be migrate?

ra1u commented 3 years ago

Thank you for your work. This generated new release v2.0.0