r/FlutterDev • u/PostMaloy • Apr 23 '20
Discussion PLEASE contributors - consider contributing to official packages or well known ones instead of making your own with small improvements.
We're ending up in a situation where everyone in their grandmother is making a package and uploading it to pub.dev instead of just helping improve the existing ecosystem. It's bloating the package ecosystem and doesn't help very much, if at all. People are more likely to benefit from your work if it exists in well known places. None of us have time to search every package and weigh benefits of packages that do similar things.
33
16
23
u/troytirebiter Apr 23 '20
Well, its a public registry and we are talking open source here. Any one can and should be able to publish. I think the real issue is that ATM its hard to distinguish the quality ones from the crappy ones.
2
u/davidwparker Apr 23 '20
I work as a Ruby dev in my day job.
Flutter really needs something like the Ruby Toolbox.
It shows which gems (packages in Dart) are the most active/etc by a bunch of criteria:
https://www.ruby-toolbox.com/categories/e_mail
^ email as an example category.
It's great because I don't have to waste a lot of time to decide which gem to use in a given category.
1
u/troytirebiter Apr 23 '20
Agree, I am a Frontend Engineer by day and NPM does a ok job at this as well. Helps make an educated decision also helps the community promote and find quality work.
0
u/PinkFrojd Apr 23 '20
I agree with you. Someone will try to create small package (I created one for exercise and because I wanted to contribute somehow https://pub.dev/packages/mock_data) and that's OK. But some complex libraries that require more time and research to develop will only come in few packages. That's where you can distinguish by quality of package, because there will be only few.
6
u/kgainz Apr 23 '20
I agree with the general idea for sure. We don't want pub dev littered with abandoned packages. However, there is the reality that many people develop a useful package, release 2 or 3 versions then disappear. Multiple people post issues, and pull requests but the maintainer simply doesn't respond. This even happens on the official flutter plugins. There are PRs in there from 2 years ago. I understand people are busy, but come on, don't pump and dump.
This is what causes people to fork or create their own packages. I see many packages that say, "this is like X but with Y feature"
4
u/remirousselet Apr 23 '20
Flutter plugins excluded, people are not paid.
I get your frustration. But it's unreasonable to ask people to work more for free. If they don't want to do it anymore, it shouldn't be a problem
6
u/dancovich Apr 23 '20
Are the FlutterFire plugin maintained by developers on their free time?
Just as an example, firebase_messaging has literally a changelog (on their 6.0.10 version) that says they updated the README to teach how to handle background messages on embedding v2 but that's a lie. If you just follow the example you'll get a compile error because on embedding v2 the method signature of
GeneratedPluginRegistrant.registerWithchanged and no longer accepts aPluginRegistry.That's not even a bug, it's literally just an outdated README, but the issues related to this are still open and you still need to go to Stack Overflow to find the correct way to handle this.
Keep in mind they're already on 6.0.13. They had 3 versions to update a section of a README file.
I'm used now to just fork any plugin that gives me issues I can solve. If my solution isn't too hacky I'll create a pull request, but these tend to be ignored as well.
2
u/remirousselet Apr 23 '20
Did you make an issue about it? If they don't know about the problem, there's no way they'll fix it. And if it's a simple documentation fix like this, make a PR
3
u/dancovich Apr 23 '20
... but the issues related to this are still open and you still need to go to Stack Overflow to find the correct way to handle this.
I didn't open the issues but they are there.
This issue talks about the fact the plugin still doesn't fully support embedding v2 because it has no way in it's API to register the background notification handler with a FlutterEngine. There is a way but it requires some workaround and the README doesn't mention this workaround at all even though the changelog says they updated it to handle embedding v2.
https://github.com/FirebaseExtended/flutterfire/issues/2017
Everyone on this issue just points to the same StackOverflow post teaching how to implement the workaround.
This one is more recent and directly complains about the fact the README is outdated.
https://github.com/FirebaseExtended/flutterfire/issues/2410
Again, everyone just posts the workaround. At this point the workaround might as well be the official way to do it.
And if it's a simple documentation fix like this, make a PR
I considered it but the StackOverflow answer is super popular and hasn't been made official yet. Also no one mentions this but on Android when you use Hot Restart there is an Isolate (which probably handles the background messages) that gets duplicated. Every new Hot Reload spawns a new Isolate.
This made me think that maybe the StackOverflow workaround isn't perfect. Since it's the only one I know I ended up not creating the PR.
1
u/remirousselet Apr 24 '20
A PR would make the team react faster
Even if your fix is incorrect, during review they will fix it
3
u/kgainz Apr 23 '20
I agree, it's voluntary but if someone loses interest or simply would not like to continue putting time maybe they should mark the repo as in-active. Better yet, I see multiple instances where someone else is willing to carry the project forward but the original maintainer doesn't respond to requests for giving write access to the repo. I recognize they are not obligated to do so, but it's a small amount of effort that can go a long way.
I just think we could do a bit more to improve the situation.
4
u/codemasonry Apr 23 '20
This is what you get when you allow everyone to create and publish packages without any control or restrictions. Look at Node (npm), for example. There's over a million packages with a lot of overlap and very little collaboration.
2
u/EMCoupling Apr 23 '20
And absolutely no guarantee of quality. Having to depend on 3rd party plugins for certain tasks in production code honestly makes me feel uneasy.
3
9
Apr 23 '20
When you see a package in pub.dev there is a score inside a blue circle that indicates analysis of that package based on popularity, health and maintenance. If you are having trouble with which package to use, chose the one with better score.
10
u/Exar777 Apr 23 '20
I think that the message here is more : if you want to really contribute to the community, the best way to do it is to help improving packages ALREADY used by it.
Doing its own small package is fun and all, but not super useful if the subject is already covered elsewhere.
And as you have indicated it, most used packages are the ones with the highest score, so needs to contribute it.
4
Apr 23 '20
Yeah thats all just kids not getting the spirit of open source but being so proud of having done "something themselves" which most of the time is just a small improvement.
3
u/Kounex Apr 23 '20
I generally agree - it kinda sucks that you have various packages which try to achieve the same with different pros and cons and it would be great to have them unified to sum up their pros and work out their cons
Main problem for that is, that in order to contribute to existing packages instead of making your own, you have to actively work yourself into the code of other people which may be very different of your code style, common practices, good practices and preference. You will often find yourself questioning if contributing is even worth it since, in your opinion, the code would need so much fundamental change in order to get better or you would have to write strange / different code just so it fits the way the package has been programmed. Sometimes you may think that you have a better approach for something like the code structure / project structure which is something so fundamental that you can’t do that by contributing - the author might not think the same.
Many factors favour the creation of your own package since it allows you to make your idea and your way of achieving it real.
People are contributing to existing ones, but most likely to the bigger ones since they have a lot of drive and are generally on a good level. What I am referencing to are the „smaller“ packages where there are several of them (often because the use case of them is pretty rare which makes it even harder)
2
u/_HEATH3N_ Apr 23 '20
Main problem for that is, that in order to contribute to existing packages instead of making your own, you have to actively work yourself into the code of other people which may be very different of your code style, common practices, good practices and preference.
You mean what the majority of software developers do on a daily basis? I'm lucky that I get to write a lot of new code at my job but there's not a single day where I don't have to at least read through a bunch of pre-existing stuff. People who create their own package just so that it can be "their" code are juvenile unless the original package truly does have serious architectural flaws that make it difficult to work on and extend.
1
u/Kounex Apr 23 '20
Well since Flutter has a very low structure itself, it results in very different code. When I look through different Angular projects at work i will see same basic approaches since Angular has a more strict structure and guides developers thorough existing patterns. Flutter obviously also has a lot of stuff to use but you can more easily do it in a bad way. As I have been looking through many different source codes of some flutter packages I have been using, I found so many different approaches for stuff - good as bad! The UI rebuild logic itself is being handled in so many ways - it is understandable that not everyone agrees on a given approach and would not like to contribute and so rather create their vision.
As other already pointed out: that’s what an open ecosystem like that is for - people being able to contribute in the way they like and despite that: not being in a team together and doing it for free.
1
u/esDotDev Apr 23 '20
Or they just want to learn something, or have a much more focused use case and dont want to screw around with the over architecting and generalization that always manifests in packages that try and do too much. Not to mention, vastly easier to debug code you've originally written.
Imo, the best packages are the ones that do a single thing, you would never go into the src, cause you should never care. In general these seem to not be widgets at all, but utility functions, parsers, syntactic sugar etc.
Flutter makes building custom components so easy that its often faster to just roll your own focused component rather than trying to use, style and tweak some other persons general usage monstrosity.
3
u/_HEATH3N_ Apr 23 '20
And that's perfectly fine. I've copied a couple plugins into my project and tweaked the code to work better with my application. But what I didn't do is then go create a package in Pub that was virtually identical to the one I copied with the addition of some minor feature I needed. I filed a feature request with the maintainer and if I clean up my code enough I'll even submit the PR myself.
1
u/esDotDev Apr 24 '20
I agree creating 'virtually identical' anything is ridiculous. But if you have a unique take/spin on the implementation, I see no reason not to put it out and see if people like it.
I agree that 99% of the "widgets" on pubdev should probably not exist, but the ranking system seems to be working well here.
3
2
1
u/eyedea32 Apr 24 '20
Yea same thing happened with the package I created. I made the flutter_tts package and now there are a couple of packages that are literally the same code base or just an added feature.
1
u/nikesh03 Apr 27 '20
What can one do , I posted a important feature request on github in January still no one has taken action on it .
1
u/remirousselet Apr 23 '20
Let's be realistic here, that's not possible and probably not a good idea either.
The package system is here to introduce competition. If we truly wanted a single official standard, then these standards should be merged directly into Dart/Flutter instead of a package.
It's both more rewarding and more flexible to make a new package.
As small as an improvement can be, it may still be incompatible with the existing packages.
That's the different between local maxima and global maxima. There's only so much you can do by improving the existing. In many situations, you need to start again to come up with something better.
Provider was born this way. Freezed was born this way. And I can honestly say that in a few years, it's likely that these two packages will be replaced by something better.
4
u/ncuillery Apr 23 '20
This is the contributor/personal point of view, talking about reward and competition.
The OP brings the industry point of view, talking about stability and consistence.
The huge diversity is a danger on the long term. The React Native ecosystem suffered from the same sin and the most productive contributors organizes themself into a "brand" named react-native-community " because the ecosystem was a mess. At least a react-native-community package guarantees a relative reliability.
It's a very good thing that Flutter has created a similar program: https://flutter.dev/docs/development/packages-and-plugins/favorites
3
u/remirousselet Apr 23 '20
Let's keep in mind that people are working for free.
You can't just remove the benefits of volunteer work and expect people to continue.
Rewards and fun are critical for the ecosystem.
2
u/dancovich Apr 23 '20
It's nice that someone took their time to create a package that can potentially help me... but wouldn't it be as helpful or even more helpful if they fixed the issue on a more popular, already existing package instead? Better yet, you have no obligation to keep fixing other bugs. If you don't have the time and only need to fix this one bug then that's completely ok.
I've forked several packages to fix issues in my projects, but I don't have the time to maintain a new package so if my solution can be cleaned and isn't too hacky or too tailored for my particular case I'll create a pull request. No need to create another package that does the exact same thing except with some bugs fixed.
1
u/esDotDev Apr 23 '20
Maybe true, but one sounds fun. And the other sounds like work. If I'm not doing something fun, I better be getting paid. If I'm not getting paid, Id rather hang out with my kids or play games. I work enough during the day :)
2
u/dancovich Apr 24 '20
If you're volunteering to help with an already existing project then you need to follow their rules and best practices, otherwise it's better to not help at all or only open issues. Bad help can be worse than no help.
1
u/esDotDev Apr 24 '20
Right, and for some people that situation is fun, but for others its a total turn off. That's just a reality.
2
u/esDotDev Apr 23 '20 edited Apr 23 '20
Totally. Not to mention, you will always be a secondary decision maker, subject to the opinions and decisions of the original maintainer. For many this is a non starter, they are looking into making a package specifically because they think they can make something that they will love that embraces their own personal opinions & style.
It may also be an issue for the maintainer, who may not interested in adding additional use cases (simplicity can be a virtue), or really taking advice from or working with anyone else.
Just the simple act of having to coordinate with someone can drain a lot of the fun factor, which is key when youre doing this after work hours just for fun.
1
u/ty1470 Apr 23 '20
You're describing the situation when a new package should be created (incompatible with existing packages, significantly different, solving a different problem, etc.) whereas OP is referencing redundant packages, which there are plenty of, and I think you hit the nail on the head: that redundancy is a direct result of developers feeling competitive and wanting to be rewarded. I disagree that the package system exists to introduce competition. Options? Sure. But those options should extend from the need for difference, not a desire to be the best and have one's name attached to it (competition).
1
u/remirousselet Apr 23 '20
That situation when a package should be created is extremely common. It doesn't have to be a major change to be incompatible with the existing package.
Take dartfmt. The maintainer refuses to add a way to configure line length through a setting. The only way to do that improvement is to fork dartfmt and add the setting.
That's a small change, but still incompatible with the current package.
1
u/esDotDev Apr 23 '20
Which speaks to a core problem with this 'ask'. Developers are opinionated, you're talking about strong personalities here, not robots.
1
u/_HEATH3N_ Apr 26 '20
The package system is here to introduce competition. If we truly wanted a single official standard, then these standards should be merged directly into Dart/Flutter instead of a package.
This isn't free-market economics we're talking about here. These are free plugins; I have no doubt most developers would prefer a single robust plugin that completely solves a specific use case than a dozen that each do a subset of the features slightly differently.
And I do think there is plenty that should be merged directly into Flutter. For example, most list views are infinitely scrolling. So why do we still need a plugin to handle this?
1
1
0
Apr 23 '20
[deleted]
19
u/Bernardi_23 Apr 23 '20
I’m one of the developers who made a sliding up panel package. When I created the package I didn’t know there were other ones like it, but as soon as I saw there were (including this one with more stars, which was in a much more advanced state), I stopped developing mine and tried to help the other one by opening an issue.
I completely agree with this post.
2
Apr 23 '20
I don't know it you did, but I hope you added some note somewhere saying that the package is no longer being actively developed and that you should use the other package instead. :)
3
u/Bernardi_23 Apr 23 '20
That’s a great ideia. I’ll do just that!
5
u/mitgoog Apr 24 '20
Even better, mark the package DISCONTINUED: https://dart.dev/tools/pub/publishing#discontinue
3
u/integrateus Apr 23 '20
Yeah it also helps ensure that these one off plugins don't go stale or unsupported after a year
0
Apr 23 '20
[deleted]
9
u/remirousselet Apr 23 '20
Arguably, this is the responsibility of pub.dev to fix those sort of things.
For example, it would be much less of an issue if we had name scoping, and that fork was named @/flare/audioplayer
2
u/mitgoog Apr 24 '20
Hi Remi, Michael from the Dart team here.
Yes, namespacing would help with the problem of getting "good" package names. But wrt. helping selecting between several packages, we already have verified publishers that I would argue help some.
1
u/remirousselet Apr 24 '20
Ah definitely. And likes and favorites too, there's no denying that. Thanks for your work :)
1
u/Skyost Apr 23 '20
This. They should implement this already for verified developers and then redirect old urls to the new ones.
0
Apr 23 '20
[deleted]
2
u/remirousselet Apr 23 '20
It shouldn't be breaking if the namespace is optional
0
48
u/nicolaszein Apr 23 '20
True. Do it people.