gbtb16 / kiwi

A simple compile-time dependency injection library for Dart and Flutter

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Dart 1 support

maxwellpeterson-wf opened this issue · comments

Thank you for creating this great library! The organization I work for has been looking for DI solutions in Dart, but have been disappointed by the existing options due to the reasons you outlined in your Medium post.

We have a lot of Dart code and as a result we are still at least a few months away from transitioning our entire codebase to Dart 2. I notice the README states this library requires Dart 2, but I was wondering if there were any limitations in Dart 1 that prevent this from working properly?

It seems that if I add the missing new keywords, the rest of the syntax passes the analyzer just fine. Is there anything else we should be concerned about? If not I'm thinking we might maintain a fork of this that works on Dart 1 until we have finished our codebase migration to Dart 2, at which point we will switch back to the mainline.

Thanks for the great work here!

Hi @maxwellpeterson-wf,

Thank you for your interest in this library 😊 .

Since I didn't test this library with Dart 1, I don't know if there are limitations (beside new keyword), but I would be extremely careful about types.
I don't remember the details, but I know that I had issues in Dart 1 when I wanted to store an object in a Map<Type, Object> through a generic method, like in the kiwi container.

The fork is a great idea, let me know if you have any trouble, I would be happy to help if I can.
I'm also interested by any feedback you can give to make this library better, so don't hesitate 😃 !

Thank you.

@maxwellpeterson-wf because Dart 2 offers a lot of good features. With nullability coming in the future I think we should focus only on Dart 2. If there still is a big interest in Dart 1, please let me know so we can add it to the roadmap. For now I will close this issue

@vanlooverenkoen sounds good, we have switched to Dart 2.