dartis icon indicating copy to clipboard operation
dartis copied to clipboard

Is there a plan to migrate to dart null safety?

Open springeye opened this issue 4 years ago • 18 comments

springeye avatar Jun 21 '21 09:06 springeye

Some work was done here: https://github.com/jcmellado/dartis/issues/34

I tried using the automated tools provided by Google, but resulting code still need some major refactoring.

jcmellado avatar Jun 22 '21 09:06 jcmellado

I tried using the automated tools provided by Google, but resulting code still need some major refactoring.

I've briefly looked at the code, and I think the most difficult part is where you decide which codec to use based on the runtime type, but then nullable and non-nullable types do get washed up. If that part is refactored, then the rest will be easier to migrate.

isoos avatar Jun 22 '21 09:06 isoos

hi, this has any updates?

Silentdoer avatar Jul 09 '21 23:07 Silentdoer

No, there are some open pull requests, but they still need a bit of love

jcmellado avatar Jul 15 '21 17:07 jcmellado

what does it need to solve in the PR so we can have null safety?

jodinathan avatar Oct 21 '21 15:10 jodinathan

Note: if you need only key-value cache and nothing more, we ended up re-implementing the protocol bits in package:neat_cache.

isoos avatar Oct 21 '21 15:10 isoos

Note: if you need only key-value cache and nothing more, we ended up re-implementing the protocol bits in package:neat_cache.

we need INCR and other Redis commands. But thanks for the link, seems a nice and simple KV package

jodinathan avatar Oct 21 '21 15:10 jodinathan

There are still some conflicts there: https://github.com/jcmellado/dartis/pull/41

jcmellado avatar Oct 21 '21 15:10 jcmellado

fixed the conflicts here https://github.com/jcmellado/dartis/pull/44/

jodinathan avatar Oct 27 '21 22:10 jodinathan

@jcmellado do we need any changes to merge the PR?

jodinathan avatar Nov 07 '21 23:11 jodinathan

No, thanks

jcmellado avatar Nov 10 '21 09:11 jcmellado

Looks like there's been some additions here for null safety. How far are we from a release that incorporates?

kevinelliott avatar Dec 10 '21 23:12 kevinelliott

I tried the different provided solution (thanks all for the effort), but none of them worked properly.

To detect the correct types at runtime is the hard part.

jcmellado avatar Dec 18 '21 10:12 jcmellado

@jcmellado I appreciate all your efforts on the original package and ongoing migration to null safety. What are your thoughts/plans on completing the migration to null safety?

DaleBeckles avatar Jan 26 '22 22:01 DaleBeckles

I tried the different provided solution (thanks all for the effort), but none of them worked properly.

To detect the correct types at runtime is the hard part.

would you please clarify what needs to be done maybe we can help =]

jodinathan avatar Jan 26 '22 22:01 jodinathan

Ok, I'll try to explain it.

  • The code is in the develop branch.
  • All the classes in the commands folder must be modified. All the methods must return a nullable type. For example: Future<int> must be replaced with Future<int?>.
  • I already modified the cluster, connection, geo, hash and hyperloglog commands. But it's still work in progress. I started to modify them just for testing the library. I wouldn't modify any commands more until the tests pass for those commands.
  • If you run the tests then you will get the "Unexpected value of type "ArrayReply" error for the modified commands.
  • The problem is caused by the classes in the protocol/codec.dart file. The code doesn't work with the new nullable type system. It's necessary to redesign that part.

jcmellado avatar Jan 28 '22 16:01 jcmellado

@jodinathan are you intending to work on dartis migration to null safety? Perhaps I could assist. Please advise.

DaleBeckles avatar Feb 11 '22 20:02 DaleBeckles

dedis may be a alternative

Silentdoer avatar Mar 13 '22 02:03 Silentdoer