Tag Archives: Plugins

NativeScript Offline Plugins

There are cases where you might want to package plugins with your app in your version control; like for example you are using a commercial plugin or maybe a proplugin and need to use cloud building.

The simplest setup that I have personally used is in the very root of your application.


You create a folder called plugins. Inside this folder you put any commercial and plugins you need to keep with the apps source. For example one of my projects looks like the above picture, I have 5 plugins that are actually in version control with the application. So anyone checking out the source code from git will get all these plugins with the application.

To use these plugins in your NativeScript app, in the root directory you type "tns plugin add ./plugins/nativescript-compress-0.0.1.tgz" you need to type the ENTIRE name including the extension.

How do I download them

So say I want to have the proplugins/nativescript-dialog plugin.

npm pack @proplugins/nativescript-dialog
will download the latest .tgz file into the current directory for you.

NativeScript - State of Plugins - a solution

We currently have a massive number of broken plugins, hiding the few flowers in all the weeds as I discussed in the first State of Plugins post. These  flowers still need nutrients and maintenance efforts to keep them alive as we outlined in the post: costs of a plugin. We went into the long tail of support, and how this burns out authors, and how little (if any) money is actually donated to an author. How have you supported any of the plugins you've used? When authors leave the community;  the flowers they planted, almost always die and are replaced by even more weeds, which of course just propagates the issues… So we are currently at a point where only a few unpaid authors maintain virtually all the plugins.

We also discussed how the two plugin sites deal with all the weeds, and the side effects of both stances, and finally finished off with all the additional issues that are present in the plugin community. Overall, in summary, our community and plugins in general need some help, and we the community has to solve it...

All of these issues, is what pushed me to look for a better solution,  all of this information has been percolating around my brain for a while. Several solutions have been tried by different people (including myself) and unfortunately each has failed over the last couple years.

So lets cover the issues in brief and some solutions that we have brainstormed, discovered, or found other communities implementing as solutions...

Finding the good plugins in all the bad plugins.

There is basically three ways to do this. The first I have actually tried with my PNR (https://plugins.nativescript.rocks) site. I foresaw this issue years ago, which is why I added the ability to put comments and rank plugins. Unfortunately; the community has decided that doing this is too much work (and I don’t disagree – I don’t even do it! ). So very few plugins have actually received a rank or any comments. I also tried to automatically rank plugins, but if anyone has looked at the auto-generated ranks on any of the sites – I’ll be blunt, they are also worthless. So ranking via computer or via the community seems to be a completely failed effort.

The Verified Plugin program - this initially sounds like a awesome idea on its surface. Unfortunately, if you delve into the issues it brings; lets just say that in the grand scheme of things; of what it offers verses what it takes -- this is easily the WORST thing to ever happen to the NativeScript plugin community. have a whole blog post detailing the whys, which will be released at a later point in time...

The final way is to create a curated list of good plugins that are evaluated by people, so that they can be known to be working and/or in a good state. This requires people in the community to spend some time on this and spend more time testing the demos and maintaining this curated list of working plugins. Overall this seems like the bet solution; but it requires a lot of time and effort by someone(s) .

Working Plugins?

Next issue is now that you found a potential match; does it have a demo? Unfortunately a large number of plugins have bad meta-data and so they don’t even link to their git repo (even the NativeScript team has a few of these). Which means you have to google to try and find the original repo (if it even publicly exists) and then finally download and run the demo. So this step is also a pain, and can be time consuming in some cases, but assuming the author has a repo and a demo, you can try it out. If it doesn't , hopefully it has docs so you can either create the quick demo or integrate it into your app to see if it works.

And the issues keep piling on...

This brings up another issue; now that you have a demo that actually appears to run,  you still have to test all the functionality for the most part upfront to verify it is fairly bug free and it will work for your purposes.

Is the author trustworthy, can I trust their code? (How many of you audit any of the plugins?)

Is the plugin and its dependencies under a good/safe license? I've personally seen several plugins that were Apache / MIT licensed; that use GPL dependencies.

What happens if the plugin has a bug? Does the author fix it rapidly? Is the plugin even maintained? If you have the time to debug and create a PR, will it even be looked at, let alone merged and then pushed to npm?

Does the plugin author get any donations for a cup of coffee for all their hard work? Wait, that is my issue, and the answer is "nope, almost never". .

Wow, a whole load of interesting issues. Well, now that I have outlined some of the issues, I believe, all or most of them, are solvable with one community driven program.

I want to state upfront, I do know everyone initially is not going to like this proposed solution -- We saw the problem, and we sincerely care about plugins, and the community! We want to see the best for it. As such we are currently using our own time, money, and skills to try and solve this problem in a method, that we believe, the community can and will support. So in total transparency, if you have a better idea – I sincerely welcome you to propose and build it. The more actual solutions to all these issues, means our community has more wins!

Magic?

So what magic is this you speak of? Do we really have a wand we can wave and solve all these issues??? Believe it or not; yes!

I am very proud to announce a plugin authors program to solve all of this.

We call this program ProPlugins.

Sweet, all solved let’s go home… Oh wait, you want the details, don’t ya…

The Details

The idea behind ProPlugins is that it  is a curated list (solves: finding plugins) of highly maintained and top-quality plugins (knowing if a plugin will work), from top authors (trustworthy). Issues are resolved appropriately, PR’s are looked at in a timely fashion. Metadata in the plugins are correct (metadata issues) and link to the proper repos and even a link to download the most current demo. All plugins will be required to have  at the minimum, a NativeScript-Core demo (the demo issue). All plugins have documentation (the doc issue). All plugins are supported by all the authors on the ProPlugins team (the maintenance issue).

Phase ONE requirements are tough enough to move things forward; however, they are not as stringent as phase two and three as we have a whole outline of how to get from here to there and then to have the very best plugins any community can possibly have.

In other words; we as the top authors in the community are replanting our flowers in a new weed free garden, and then as the caring gardeners we are, taking care of all our plugins as the ProPlugins team.

So how does the community fit in? The other part of the solution is how to let the community help solve the issue… In the past the community hasn’t really helped much with maintenance of plugins (*3), it hasn’t helped much with actually handling plugin issues or answering questions on the repos. Nor has the community helped with rating plugins. So basically the community has been mostly absent… So why is this? Each of these items takes time, and most of the community has a job they do, then spend time with their family, and finally most enjoy doing other hobbies. So they don’t have the time to help with all these things, and many times assume someone else will help, in other words there's not much incentive . This is very common in the open source world, the number of stars a project gets verses the so few people that help. NativeScript has over 17,000 stars; but has only so far 100 contributors; and the majority of that 100 are paid Progress employees. So instead of requesting the community donate their time  in areas that it obviously has not been willing to help in for the last 4 years; we will change the narrative…

This is going to be a subscription program. I know what you are thinking, "are we nuts???" Please bare with me; while I explain why we choose this route and why you will actually really want this route...

The community helps by paying a small monthly subscription  to access all these maintained plugins. They don’t have to work on them, they don’t have to help with issues, or do anything they haven’t wanted to do for the last 4 years. So the community can continue as-is, but it is now going to help support itself a different way. This low monthly fee is then used to fund all the maintenance and enhancements on all the plugins in the ProPlugins program. You the community, will be  supporting all the authors of the plugins, making it sustainable open source. Your subscription will help support the maintenance of the actual plugins you use. So now this becomes a totally win-win situation! The plugins you use become higher quality; which then means you spend less time searching, fixing, and testing them. Second because the costs are spread out across the entire community your monthly fee is so small, you won’t even miss it. This co-operative helps everyone (including you) in the community out. A simple low cost on your part can = High Quality for everyone. Honestly how much better can it really be?

So the better question to ask is, what is your time worth? In this case, ProPlugins will save you massive amounts of time, energy, money and frustration. Instead, it gives you what you need on a silver platter worth millions(*1) for  less than the cost of a meal at a cheap fast food restaurant… Can you really afford to pass it up?

Being the plugin developers that have been in the community the longest; we hope  the community will want to go in this direction; since we believe this will fix virtually all of the issues that have plagued us for the last 4 years, and gives us all an incredibly bright future. But, to emphasis how committed we are to the community, let me give you a small example: When I started planning the ProPlugin transition, I personally had planned on moving pretty much all my plugins over to the ProPlugins. However, when I ran all the numbers, I found out that my NativeScript-Permissions plugin is used in a large number of plugins as a dependency. Because we don't want to force the community to do anything, it will continue to be supported on the public npm so that everyone can continue to use it without us breaking anything (and it already fully supports AndroidX!). Our heart really is for the community!

Who is behind the ProPlugins?

Multiple of the top 10 plugin developers have come on board for the initial release. In addition several others have committed to joining in the very near future and are working through the NS 6 issues in their plugins -- but were unable to join the start of phase 1 due to the very short window that we had to work in. We were aiming to release very close to NS 6’s release; and we still ended up launching a bit later than we wanted to.

So what is the cost?

We are starting it out at $9.99 per month for the first 500 subscribers; then it moves to 12.99, and finally at 1000 subscribers it goes to 15.99. We want to reward the first subscribers, that are willing to become a major part of the solution. In addition, as long as you keep your subscription active; your rate will stay the same as a thank you for joining when you did!

So what does this awesome subscription give you:

  • Access to a private gitlab repo where all support, development, issues and feature request will be handled.
  • Open source plugins (yes all the plugins are still open source)
  • Access to a private npm server (You can easily do npm i --save @proplugins/nativescript-somename ---- tns plugin add will be working shortly after the NativeScript team accepts a PR to fix a bug in their code. ).
  • Access to timely bug fixes and/or your ability to ask for features (not guaranteed to be implemented)
  • Access to a curated list of plugins, which we hope to grow over time with plugins that have been abandoned by their original authors. (We have several in mind already, and one already in the list.)
  • Access to easy to use search, quick links from the npm web server to issues and a direct demo downloads.
  • Access to a boat load of plugins from top authors, some of them never released before!
  • Plugins that are already tested and work in NativeScript 6
  • Many new plugins being added daily (we were in time crunch; trying to get close to NS6’s release date. So there are quite a few plugins that didn’t make the initial cut off date; that should show up shortly as we finish testing them all under NS 6)
  • Some Phase 2 plans, based on subscriptions:
    • NS-Angular and NS-Vue demos and instructions for those flavors for all plugins. We would like the plugins to be all inclusive.
    • Integration and demo testing in Preview/Playground
    • Integration with PNR, to search and filter only ProPlugins
    • Screenshots for all plugins
    • All Dependency licensing in plugins license file.

“So where do I go for this awesome deal?" I am glad you asked; You can join the cooperative at 

proplugins.org

In addition you can see all the plugins that already exist in the repo on our npm server at     https://npm.proplugins.org

We hope you are as enthusiastic about where we can take these plugins and the jump in quality that we can do with the entire community participating. We have an awesome road ahead of us, with all of your help.

Sincerely all of us at the ProPlugins Team

*1) According to the Comoco scale we have over a million  dollars in development costs that we have already poured into these plugins over the last 4 years. If you had to recreate every plugin in the ProPlugins Co-op, you would be out a lot of money. If you do have that type of money, we do accept donations and/or sponsors!

*2) If you are a plugin author that would like more information on how this project works, and how we plan to do compensation; please see our website.

*3) Community numbers for involvement in the top 40 plugins is actually rather poor. The numbers show such low participation on those 40, that in most cases it is actually non-existent for the rest of the plugins. This is very typical in all communities, not just NativeScript.

NativeScript - State of the Plugins

Broken Puzzle Pieces

I had a discussion the other day with one of my buddies at nStudio. I was lamenting the fact that our communities plugins really really suck. It doesn’t matter if you use my site PNR (https://Plugins.Nativescript.Rocks) or Progress’s MarketPlace. Trying to find an actual working plugin seems like a trial almost akin to having a tooth pulled.

What is this? Its a video version!

The Video to go with the blog post!

Quantity

Mountain of Plugins

Normally a larger quantity of things is better than a smaller quantity, like I want more money than less. But a smaller quantity is considerably better in many cases, how quickly your app starts up, or how quickly you can build your app. So which is it here? That is a hard one, normally more plugins means more features you can add to your app. But our community seems to have been struck with the "Lets create a useless fork" virus. The larger quantities of Plugins is not our friend at the moment.

Normally having 1167 plugins would be considered a good thing, however, because of how many weeds we have in that 1167 plugins -- this now presents the problem of finding an actual flower in all these weeds. Both sites have search engines, so at least you don’t have to look through all 1167 plugins to find a specific plugin. So lets try a couple examples:

Let's first look at the keyword Dialog.

If we use the Market place we see there are 13 plugins that have the word dialog in them. If we use my site, PNR, we get 8 matches. Whats the difference? Well let's look at each one…

First, the Marketplace has the extra results (found primarily from bad meta-data):

  • Loading Indicator (doesn’t have anything to do with a dialog)
  • Essent Loading Indicator (ditto, and a fork of the above)
  • Loading Indicator SSI (ditto, and another fork)
  • Loading Indicator New (ditto, and another fork).
  • Nstudio NativeScript Dialog (a fork of NS-Dialog)

By default PNR, black lists all forks. This is in an attempt to eliminate what I consider the largest source of weeds. In almost every case I have ran into with forks they are virtually worthless and just add more noise to the results. So, looking at the above list, we have 3 of 5 plugins found on Marketplace were forks that really didn’t add anything. The final fork, is a fork I made on a plugin abandoned by its author. My fork works, so it is actually a good result, that my own site, PNR, didn't show. (*1, *2)

So, on one hand Market place did give you an extra good result; but it also gave you several extra bad results, that you have to manually filter out. This is especially bad with something like notification – PNR has 20 plugins Market shows 31. Any guesses about those extra 11 plugins?

This is an interesting issue and one that both plugins sites have opposing directions on how to deal with. So according to the Marketplace they have 1167 plugins in their database. My database only shows you 1050 of the 1379 (*5) that I currently track, (Numbers are as of July 5th). So based on 1167 vs 1050; the primary difference is because I’ve eliminated that extra 10% of the plugins because they were all forks. I want you to really think about that number, 10% of all plugins in our community are either forks with no changes or forks with minor changes. And that doesn't even count those that are side-forked (*6). So now we have multiple forks that may or may not work; mostly abandoned, and in a lot of cases these are forks from the original plugin, which usually is one of the better plugins in the community and is actually maintained…

Image by _Alicja_ from Pixabay

So we have a lot of weeds in our flower garden. Which can frequently make it hard to find that lone flower in the sea of weeds. Sometimes it will stand out...

Working Status (or Quality)

The second issue, and bigger issue is the actual Working Status/Quality of the actual plugins that you do find. If all 1167 plugins were working, the first issue would not be as big of an problem . Yes, it would be annoying to filter through the sheer volume of forks; but at least we would know they worked..

Lets again take our dialog query example from above… We are pretending that we are using NS 5.4, as in NS 6.0 pretty much all of these broke and now need some fixes...

- The first plugin in the list is done by Shiva (@ nStudio) and updated only a couple weeks ago; NativeScript-CFAlertDialog, I can guess that it will work out of the box. His docs have screen shots, and sample code. All in all looks like a high quality plugin.

- The second plugin in the list is NativeScript-color-dialog, I can also guess this will work out of the box as it was done by Brad (@ nStudio) and was also updated recently. So far two for two are probably in a good state…

- The third plugin is NativeScript-Dialog; it shows the last time it was modified was 2016; odds are, just based on that alone, is it is much more likely to be broken. The weird thing is that the Marketplace says it is NS 5 compatible. Since I maintain the actual working fork of this abandoned  plugin, I can tell you with absolute certainty this version of the plugin does not work in iOS on any version of NS. So 2 out of 3 working is still not bad so far.

- Next plugin is NS-EasyDialog – Its a fork of NS-CFAlertDialog and an older side-fork at that (*3)… 2 out of 4. So we are now at 50% of the plugins are believed to be good…

To speed this up, I won’t document each of the plugins, just the final numbers. So by the time we finish looking at all 8 plugins on PNR; we are at probably 62% of them in good working order. If we use the Marketplace and look at all 13 plugins found: We have probably 53% in good working order . Considerably better averages than I had expected, when I started this blog. I have frequently seen less than 20% working for some plugins. We still had to look at each one of them, and then evaluate if it met our needs, so we're spend time going through 8 (or 13) plugins. Then once we  have a list of those that meet our needs we need to actually download and try the demo, to actually verify it will work (assuming they have a demo). Which is where we would have typically figured out that only half of these actually worked…

In addition we might also need to search for “alert” and “toast”. It really is depending on what you are needing to show on the screen.  Searching with “Alert | Dialog | Toast” (*4) the total number of plugins found is 15 plugins on PNR, and approximately 28 on Marketplace via 3 separate queries. So we  might actually need to look at 28 different plugins to find (hopefully) the one working plugin we need.

Now, just looking at one simple keyword dialog, we quickly estimated the quality of working vs non-working is somewhere around 62%. But the truth is, I didn’t actually download any of these plugins or actually try the demos, I just “assumed” they worked because several indicators were present that made me be able to make a decently good judgment call on if they are still working. As a counterpoint – In one case last week, out of about 20 plugins I actually did a check on, not a single one actually still worked in the current version (5.4) of NativeScript. The reality is that out of 53%/62% actually is still high, once we attempt to download the demos and try them their is a very good likely hood that we will have excluded a couple more.

In addition, like the example above with the NS-Dialog plugin. You don’t actually know if it works on both iOS and Android still. You could download the demo, and the plugin might behave beautifully on one platform and still be totally broken on another… So running the demo on both platforms is pretty much necessary  to verify everything is still working. Hopefully a demo exists and the demo actually tests the functionality you need.

So as the community gets bigger and older, the quality of the plugins is now becoming more and more  hit or miss. Even some of my own plugins I forget to put things in the docs, or when I wrote them originally I didn’t even think a demo was needed. But community wide; this issue is a growing problem. There are many plugins that just have no documentation or literally anything except a name. In addition the metadata provided to NPM which PNR and Marketplace uses to filter and display them is also  broken in a large number of plugins, which then makes searching and finding more hit and miss.

Oh, and if you are using a flavor of NativeScript (like NS-Vue, NS-React, or NS-Angular) the results are considerably worse for you. Frequently the plugins haven’t even been tested in any of the additional flavors. The only way to improve the quality is for someone to actually spend the time fixing the source, readme’s, metadata, demo’s, testing and documenting how to make them work in each of the flavors, etc...

The Top 40 Open Source Plugins

Let's switch gears a bit and look at some additional real numbers. So I took what are the top 40 plugins based on NPM downloads and then ran some numbers and gathered info on all of them. First, I excluded the NS-UI-* plugins by Progress. They aren't actually open source; and their repo numbers totally screw with the averages (in a very bad way). So it makes more sense to exclude them as Progress employees are paid to maintain them and the number of open issues is crazy high...

Most open source authors are unpaid; I even have a recent blog article about this outlining the costs of an actual plugin. Which, if you are unaware or you think that authors get paid for them; that article  will give you some clarity of what is facing an open source developer and how much of their time and money they put into a plugin. If you haven't read it, please stop and do so  now!

Secondly, the top 40 open source plugins get about 28,000 total downloads per week. These 40 plugins are written by only 12 authors. About 1/4 of the 28,000 (~ 7000 downloads a week) are from 9 of the plugins that I wrote.   So, I can give you a pretty good idea about how much support I personally see on my repos for the percentage of usage that those plugins get.

in 4 years, on my 9 Plugins, I have had 6 excellent PRs out of the 44 accepted PRs from the total of 70 PR's that came from the community (The reason 26 weren't accepted is either they were duplicates, they didn't add anything, or changes were already in place, but not pushed to the repo yet). I personally will accept as many PR's as possible, no matter how poor quality they are, because I really want to encourage more. A large percentage of the 44 accepted were actually from several of these same top authors (or people at Progress).   Where in that same 4 years, I did 340 commits for a total of 139 releases, all for free. As you can see the scale is pretty heavily unbalanced to the author doing the majority of the work.

Total PR's for 4 years in my 9 top plugins

 Remember, these 9 plugins are part of the top 40 most used plugins. So how much real community involvement is when their is a whopping total of only 11 PRs a year for all 9 plugins. Yes, you read that right, basically the total of 1.2 PRs, per plugin, per year! Of that 11 PRs per year; 10 of the PR's are small trivial PR's, and 1 is a decent PR.

Total PR's for all 9 top plugins in 4 years

Now if we look community wide at the top 40 plugins in the same 4 years; they have had over 3700 issues; of which 783 are still open. This means that on average these  12 authors that own those 40 plugins, have to deal with 77 issues a year each. Frequently these issues will require testing to see if the author can duplicate the issue. If they can, then finding the issue and fixing it... It actually is a testament to how much these authors care about the community , that they still have close to an 80% closure rate.

This is not sustainable; almost 4000 issues in just the top 40 plugins, all handled by basically 12 people whom I would venture most (if not all) of them are not paid to do any of it. Now to put this in even more outrageous numbers; I myself actually have 25 open source plugins! Not just those top 9; that we have been discussing above. So the additional 16 plugins, which are not used as much, still also have issues, and fixes that have had to be done. The other 11 authors; also have additional plugins. In fact the top 5 authors in the community have almost 200 open source plugins that they wrote and support.  If we get that poor of community support for even the top 40 plugins, how much support do you expect is expended on the rest of even less used plugins in the community?

To say the least; these numbers are very depressing at how few people are actually holding up the plugins in the community...

Breaking Changes

Now depending on how long you have been in the community; you may not realize that basically each major release of NativeScript has broken a part of the plugins. This means that NS 2 -> NS 3 required fixes (some not so trivial). NS 3 -> NS 4, NS 4 -> NS 5, and now NS 5 -> NS 6. Each of these releases had breaking changes; unfortunately this time is no different and there are a couple different breaking changes in the new NS 6 update. This is one of the major reasons the plugins in the community are in such disarray. Many plugin authors have come and gone over the years. Those plugins may have been top notch when they were released; but no one picked them up when that author left. So you still find many plugins from NS 1, 2 and 3, that sound awesome, but don't work because the original author left and no one from the community stepped in to maintain it. I have 25 plugins that I need to verify work in NS 6, trace down any issues and commit fixes to them, all for free. That is a lot of time and energy...

Community Involvement

I have discussed with Progress about money for the plugins issue; and they have told me in no uncertain terms that there is no money for plugins. The answer did not surprise me, as based on why NativeScript exists this is not an area that they believe will help its core purposes. So it is not an area they are willing to fund. I didn't want to assume it, and there was no harm done in asking.

So this obviously then becomes 100% the communities problem. We now have over a 1,000 plugins in the community and another large chunk of them broke with the  new NS 6 upgrade. Unfortunately most will probably permanently join all the other plugins, in the plugin graveyard, that died in the prior NS 2, 3, 4 and 5 updates.

Possible Solutions

  1. Money from Progress (Nope)
  2. Money from another large sponsor (Who??? )
  3. Verified Plugins Program ( Creates even more issues, -- uh, Nope. )
  4. Community stepping up, by doing a lot more work to fix existing plugins via PRs ( That would be awesome, but seems unlikely. )
  5. ???? Please make some suggestions ????

*1 – PNR has been updated since I wrote this blog article to hide the original ns-dialog, and re-enable showing the working fork nstudio-ns-dialog. But initially it was opposite, and I’m willing to be totally fair and say my site had some bad results.

*2 – If you have created a fork of another project that you are maintaining because of major feature changes and/or the original author abandoned it – please let me know; I’ll white list it on PNR.

*3 – I have already black listed this fork now on PNR, as it is a unmaintained fork (which was not tagged as a fork because it was side-forked...

*4 - PNR actually support | and & in the main plugins search filter; However, it can ONLY use one at a time. The first one it finds, it uses for the rest of the search So if you doblah | blah2 & blah3 it will treat it as blah | blah2 | blah3 -- sorry I was very lazy when I quickly wrote the parser, and it is undocumented "Feature". In future versions, I will probably beef this up to allow things like (x | b) & (c | d) but at this point, it is really simple stupid and unsupported.

*5 - the extra almost 300 plugins that I track are plugins that were depreciated, or aren't actually NativeScript plugins. The original developer used a set of key words that made it show up in the tracking set that I track from NPMJS, so they had to be tagged as invalid to eliminate them from view.

*6 - Side forks, are where the person git clones the repo; but then creates a new repo with the code and it isn't "linked" to the original repo. i.e. it is a fork, but was forked "outside" of the a normal fork method. Unfortunately, I have not figured a good way to detect this, because it no longer has a link back to the original repo as a normal fork does.

NativeScript Plugins and the costs...

A NativeScript Logo in Puzzle Form
NativeScript Plugins

Now most of you are not plugin developers; and as such do not understand what costs go into creating or maintaining an open source plugin. Normally I wouldn’t even think to post something like this; and I don't want this to be seen as "whoa is me". But a statement from someone at Progress; made me realize that many others are probably also be under the mistaken idea of all the costs of a plugin and so I now feel I should address this...

So here is the summary of the statement made to me in a conversation:

Plugins are either paid for mostly by companies, clients, or those that are free are still excellent advertising for your services. So releasing a plugin is a win/win situation.”

The funny thing is before I started doing NativeScript plugins; I am sure I thought the exact same thing. So, I can’t fault anyone for thinking this! It is very easy to think plugins and open source work is created by “mostly” companies, as it makes logical sense – all the press Microsoft, Google, Facebook and Amazon generate from their open source work. This can also be especially true, if you are doing open source work and being paid by a company for your work (like the NativeScript team, and the many teams at Google, Microsoft, etc that are producing open source work). So, I can honestly see how this is the prevalent view.

In a nutshell there are three separate claims here we will discuss:

  • Plugins are mostly paid for.
  • Plugins that aren’t paid for; are good advertising
  • Releasing them is a win/win situation.

Claim: Plugins are mostly paid for. (TLDR: false)

First of all, being fairly in tune with the plugin community; to my knowledge the majority of all the plugins in the NativeScript community are actually done as a mix of paid and unpaid work and those that were paid, are very very rarely still supported by the company who initially funded or released it. So even if a company actually sponsored the plugin, there is no followup money to continue maintaining or enhancing it. Meaning the author is almost always again donating their time to make this plugin work and/or do maintenance on it!

Since I really don't like talking in hypotheticals; we will use my plugins as an example. 21 of my 25 open source plugins were done completely on my own dime. Meaning, no actual clients paid me for any of that work. That includes some of my most popular plugins like NativeScript-Permissions and NativeScript-Sqlite (*3).

A lot of people have assumed that the authors of these plugins are paid by a company to maintain them. I may list Master Technology or nStudio on my plugins documentation to try and advertise my services, since I do own/co-own those companies. But I do not see a dime of money from anybody (nor even from my own companies) directly for working on any of my own plugins. Pretty much all work on all my open source plugins is in on my own totally unpaid time. These were all done either to help one of my own personal projects, for the technical challenge, or to help the community. Occasionally, I might actually fix a bug or add a feature that can be directly attributed to a client needing to use the plugin, which then it might be paid for. But that is not as common as many might think. (Lets just say in the 4 years I've done this, I've only had a handful of requests.)

For a truly complete picture of at least my plugins; 4 of my 25 plugins (mainly smaller plugins), actually had some real paid parts to them. Yay! Again, not normally enough to actually pay for the entire open source development of the plugin. But enough to pay for some or several of the extra features in them to meet that clients specific needs. So yes, there can be some money in it. But in most cases, it is still not even enough to typically pay for just the time that went into creating that plugin in the first place, let alone any of the time to support it or maintain it.

In addition as one of the few developers that has actual commercial plugins, I can also speak on this side of the coin. Even the money made on my commercial plugins has not actually paid for the actual development costs of those commercial plugins. In fact there used to be another developer with a commercial plugin -- he recently left the NativeScript market. There just hasn’t been enough purchases. And finally, I do have a lot more private/unreleased plugins that were in a several of the cases mostly (or even in a some cases, fully) funded by clients. In this aspect; there could have been good money involved with some of these. (*1)

So based on my own personal experiences, and many discussions with others in the community; I would have to say there isn’t nearly as much money going around to deal with making them -- let alone any money for support, bug fixing and/or documentation. One of the most famous examples of this issue. The OpenSSL library; it underpins the entire secure parts of the internet. HTTPS is provided by OpenSSL; so browsers, servers, your phones all have OpenSSL libraries (*2) in them. The team that was maintaining this highly complex software, was only getting about $2,000 a YEAR in donations; despite many many many companies using it in their hardware and software that they sold for massive profits. This matches my experience; both my donation Paypal and my attempt at a Patreon accounts have seen so little money, that I don’t even think it is enough to even get a coffee even once a month.

This is called the long tail of support: the support side still needs to happen; but no funding occurs for all the additional work that will easily exceed the initial work on the plugin over the life of the plugin.

Claim: Plugins that aren’t paid for, are good advertising (TLDR: mostly false)

Some people believe that I get paid in Advertising. That makes some logical sense, and yes I do to some extent. Since I have several of the top plugins, I won't totally dismiss this as 100% false. Let us dissect this logically. I have a pretty good grasp of the reality of this -- with my 25 open source plugins in the eco-system, and being in it since day one. That seems like a potentially large amount of advertising, I could be getting. This statement actually was very true when NS was first started; each plugin released had a huge huge amount of ability to be seen. Unfortunately, their is now well over one thousand plugins. That means even with all my plugins together – I only have approximately 2.5% of the advertising market (+/- a tad depending on popularity) and that is shrinking daily. So even the advertising I can do with them; really is simply drowned out by the other 97.5% of the plugins. Having popular plugins, or long standing well known plugins does help increase that percentage; but just the sheer volume of plugins pretty much negates a plugins ability to do much advertising. Again, having a well supported and widely used plugin; helps increase this percentage a lot -- but anyone putting a plugin into the community now -- well your new plugin is just 1 in over a 1000...

With the amount of time it takes to actually create a plugin and then maintain it -- It is actually considerably cheaper for me to spend that time just doing additional contract programming; and then be a sponsor at a conference (which can be a tax write off for smaller companies) – so that my company is seen everywhere at it. A conference can now drum up considerably more business. That company is seen with only 5 or 10 other sponsors, and might even be seen on many of the videos; tweets, etc. All the way around good press, and typically gives the company the ability to talk one on one with many potential clients and hand out even more advertising and share contact information in person. Or write blog posts like this one, that are hopefully shared everywhere. (Hi, I do contract work :-D!!!) Or just be very helpful in the community so that people know why you are considered one of the top developers in the community and so you get contacted because of that. There are several ways in the NS community to stand out; and almost all of them are considerably cheaper than writing a plugin.

Unfortunately, their is one big GOTCHA people don't realize. If the plugin is broken, it actually turns into a significant liability and so it is negative advertising! Which now means that plugin now actually turns from help into a source of long term money and time drain; as I try to make sure my free “advertisement” isn’t now a liability… Nothing inspires a potential client, more than trying your "free" plugins and it crashing. Yes, that will totally inspire them to try your paid services.

Just for those who haven't been around since the beginning of NativeScript time; there have been over 5 different sets of breaking changes to plugins over just 4 years. Each time a breaking change occurred; some of the plugins had to be completely rewritten or heavily modified to make work again. Others, fortunately had much more minor changes or if you are really lucky; no changes. But any way you cut it; all the plugins you released had to be re-tested, debugged, and upgraded to the next version of the framework. So writing plugins, this isn't a write once, and it can just sit and work forever, like plugins in many of the other communities. This is why plugins from NS 1, NS 2, NS 3, NS 4 don't work in NS 5, and of course our newest breaking changes are occurring in the brand new NativeScript 6 release. So watch a lot of plugins break again...

Claim: Its Win/Win (TLDR: LOL, So very false…)

Well you can probably guess based on the first two claims at how this goes -- since those were both false. But I have probably the one of best story to show you how false this claim is. This is a 100% true story, and I am attempting to minimize it to the best of my ability because I am not trying to make the parties look bad. I think this situation really points out how terribly lopsided this "win/win" idea really is or can be.    I can only speak to my story; but I have heard about another one in our community that is likewise just as "great".

So first lets take my awesome top rated NativeScript-Sqlite open source plugin, it was released for free, no strings attached, and developed by me for free, nobody paid me for any of the open source part of it(*3).    According to the COMOCO scale; it is worth about $150,000 in development costs. So far, nothing wrong, this was my goal for it to be something useful in the community. And I am very happy it is a useful plugin for everyone to use.   This is open source at its finest!  

So there is this small company called Kinvey, which Progress bought for ~49 million dollars a couple years ago.   Kinvey is a HIPAA compliant Database as a service; primarily focused on mobiles. They charge very large sums of money to companies for every byte of traffic / data stored.  Product is well written, and very secure -- so overall companies like paying the money for the piece of mind it gives them. Still Nothing wrong here, either. Good product, and excellent revenue stream for Progress.   They support several different mobile platforms, including NativeScript.

Does anybody want to take a guess where I'm going with this?   So when they developed their plugin for the NativeScript platform, they used one of those totally awesome open source plugins.    Any guesses to which one? Ding. Ding. Ding. Yes, you are correct – my NativeScript-Sqlite. Again, so far, nothing really bad, right...

Now I want you to really think about this.   Progress pays their programmers to build NativeScript, they also pay their programmers to create and maintain the Kinvey services and plugin (so the Progress developers all get paid). Progress also paid 49 million for Kinvey, so definitely the creators of that technology got paid. Progress also now gets paid massive amounts of money for every single byte of data stored that the app uses which has this Kinvey plugin in it. (So hopefully they are making all that money back!).   So far, let me be 100% clear – their is nothing is wrong with these people being paid, in fact they all deserve to be paid for all their work. So now every single NativeScript app that uses Kinvey has my plugin in it for all the offline features...

Everybody is happy right?    

Well, not so much. First, I have never even seen a single penny of revenue from Progress for this part of my awesome "win".  Oh well, that is the breaks of a well designed open source plugin, right?   It is being useful, its entire purpose in life. Woo Hoo, Yay! Ok, not so much -- I'll admit it is a bit annoying, they are making millions off of some of my work, and I don’t even see a single penny.   And, I do realize it is only a small (but critical) part of the NativeScript side of the project, but it is more the principle that bothers me. This story is such a common story in our industry (think OpenSSL) – I am in very good company of people whose excellent hard work is totally unpaid for and/or underfunded; but the company using it makes crazy boat loads from it. So, I'll just let it be – and we can count this as a “oh well”, and life can go on... 

Oh, I bet you thought I was done!    Ahahahahahaha....

Let’s not stop yet, it gets even worse!   So, I obviously didn't "win" on the first point (i.e. direct money).  So, what in the world could be worse? Well what about that awesome advertising/recognition that is the second point we discussed above.   Anyone want to take a guess?     Lazy person, I bet you clicked the link.  🙂   

Ok, I'll be nice and embed a picture here of the link...

Because my plugin is a declared NPM Dependency,  I also don't even get any recognition either. Nor does anyone see ANY of my documentation, my name or any of my advertising for any of my services.  So all these companies that pay Kinvey hundred's of thousands of dollars, who would be actually the perfect targets for me to do contract work for -- they don't even know I exist!   Kinvey, has my plugin so integrated, nobody even knows it even uses my code. I am totally invisible, even though my plugin is the offline part of their NativeScript plugin.  So, now we are at no money and no advertising/recognition, on something that is used to easily make millions for Kinvey.

Well, you know what; you won't believe it -- but the story continues to gets even WORSE! But we will actually stop here; my goal here isn't to make Progress and/or Kinvey look bad! My goal with this example is to actually show how much of an awesome "win/win" situation this really is for a real open source NativeScript plugin author...    The plugin was 100% funded by me, is worth about $150,000 in development costs; and it is being used in apps, which was my purpose in releasing it. But I honestly can’t think of a case anyone can make where this can really be considered an actual “win/win” situation.


So in summary; these are three separate claims here:

  • Plugins are mostly paid for. (False)
    • Very few of my released plugins are even partially paid for, let alone fully paid for. And none of them have had funding for the long tail of support.
  • Plugins that aren’t paid for; are good advertising (False)
    • Advertising from the plugin is such a small percentage of the entire market; it is more cost effective to do other forms of advertising. In addition do to all the down sides of plugins long tail of support, it will very easily become a liability or negative advertising and/or a money/time sink.
  • Releasing them is mostly a win/win situation. (False)
    • Win/Win it is not (See story above). In addition to the long tail of support; in our community, we rarely see much support or PR’s for the actual issues. The costs for the long tail of support can greatly out weight any potential benefit from the first two items.

Notes

*1 – Unreleased because the long tail of support that I mentioned, it is crazy bad in all reality and as I don’t want any bad advertising. At this moment, I am unwilling to release more “free” plugins that just require more free maintenance work and support. I have a hard enough time keeping up with my existing plugins. At some point in the future; they might get released if I can figure out ways to mitigate the costs...

*2 – There are now a couple of forks of OpenSSL that are used in some products, so OpenSSL is not in everything now; it used to be. In addition, because of a nasty vulnerability in OpenSSL a couple years ago; several of the bigger internet companies figured out that they needed to do a better job and they stepped up and started funding the OpenSSL foundation. So this is to my knowledge funding is no longer an issue for the OpenSSL foundation.

*3 – There is one of the commercial add-ons for SQLite that has been partially funded by a client. But the open source side; was not funded by anyone but me.


All company names and trademarks are owned by their respective companies.

NativeScript AndroidX support and Plugins

The next major version of NativeScript (version 6) will be switching from the android.support packages to the new androidx namespace. This will be a hard break; as you can only use the support api's or androidx api's; but not both. This is something Google has been implementing for a while; and NativeScript is getting on board to eliminate later issues and give us great support. The awesome developers at Progress have already created a fork of NativeScript; which you can install to test which uses androidx instead of using the support libraries.

Since one of my plugins is affected by the changes; I took a look into what was required to support both the current versions of NativeScript and the new upcoming version of NativeScript.

For any of you who have plugins; this code is what I basically devised.

let androidSupport=null;
if (android.support && android.support.v4) {
  androidSupport = android.support.v4;
} else if (global.androidx && global.androidx.core) {
  androidSupport = global.androidx.core;
}

Then you can use androidSupport to access the namespace, and it pretty much works the same as what you would access using android.support.v4 or the new androidx.core replacement. Because we used feature detection; this allows us to support both namespaces in the same code base.

So if you have JavaScript or TypeScript code that uses android.support.* then you can use this technique to make your plugin forwards compatible with the next major version of NativeScript while retaining support for the prior versions.

Here is a list of classses that are being moved from android support to androidx: https://developer.android.com/jetpack/androidx/migrate

Plugins.nativescript.rocks upgraded

Behind the scenes PNR (http://plugins.nativescript.rocks) has been upgraded to support several cool new features.

At this moment the largest difference is the backend data storage system has been completely changed; and now has a lot of new data available to it.    This system should allow us to do some more pretty cool things in the future...

By using this new data; I also have a bit more accurate plugin list,    In addition the new system has the ability to track both NativeScript 2.x plugins and separately 3.x.  So on the page you can now see a select list that allows you to change "All" (All plugins), "2.x" plugins that should be only 2.x compatible; and then finally only 3.x compatible.  In addition I took the time to actually drop a physical search bar in the title area; as my virtual search bar seemed to confuse a lot of people.

Play around with it, let me know if you run into any issues.

NativeScript 3.0 Sneak Peek and what it entails for Plugin developers.

For those who are not aware, v3.0 of NativeScript is the next major version that will be released.  It has been being worked on for several months now as it has parts of it have been completely rewritten to enhance speed of the framework in a number of areas.    Some parts of it have undergone radical changes in design, and as such will require changes to plugins to make them compatible.

Unfortunately these changes are a breaking change and will mess up the plugins for a while...

Some pre-release information has trickled out and as such the plugin developers needs to be made aware of these changes, so we can start getting a jump on these changes...

The biggest issue is any plugins that deals with any properties, or stylers has been completely changed.   These plugins will HAVE to be changed to support 3.0.   This means your plugin will no longer be NS <= 2.5 compatible, these are BREAKING changes.

 

Plugin Sites and the Package.json

As an aside if your plugin doesn't have any breaking changes and can continue to work fine in all versions of NS; then I am asking you to add a new flag to your package.json file to flag that this plugin is 3.0 compatible but doesn't require 3.0.

Your package JSON NativeScript section should look like this:

"nativescript": {
   "platforms": {
      "android": "2.3.0",
      "ios": "2.3.0"
    },
    "plugin": {
       "nan": "false",
       "core3": "true",
       "pan": "true",
       "wrapper": "ios",
       "category": "visual"
    }
 },

The additional "plugin" structure is being introduced  to try and capture the data that has been missing from the plugin infrastructure.  At this moment each item is totally optional.   However, this will allow the plugin sites to categories and filter the plugins based on criteria's that are important to subsets of the users using the plugin sites.  Please see: http://fluentreports.com/blog/?p=489 for more details on the new "plugin" structure proposal.

 

Back to the breaking Changes

The first resource is that some of the NativeScript team produced a video last week https://youtu.be/bwO3cYPb4zQ which will give a decent overview of the changes.

The developers working on the 3.0 project gave a run down of the changes and how they benefit us and/or what changes we need to be concerned about.

The second resource, which I find to be a bit more valuable is this document that is in the source repo.  https://github.com/nativescript/nativescript/blob/master/Modules30Changes.md

They used this document in the above video; but since they only covered an overview and this documents has all the nitty-gritty details.

For this to be a smooth transition I really strongly encourage you on the "core3" attribute be used if you are not just bumping your platforms to 3.0.0.      I will be automatically filtering out plugins that I believe are only 2.0 for 2.0 mode and 3.0 for 3.0 mode.  So  having things tagged correctly will help the end users have a much more painless transition.

 

NativeScript: Plugins - Let Fix the Data!

Some of you might not be aware but I wrote the plugins.nativescript.rocks.   I also helped write the plugins.nativescript.org site (if something doesn't work on plugins.nativescript.org; please blame my cohorts in crime, Nathan Walker and George Edwards.   I had NOTHING to do with any bugs!  😛  )

Well, with the new upcoming changes in 3.0 and some data that we have been unable to determine I have decided to request that the plugin authors add a little bit more metadata to the package.json file that comes with the plugin.

So lets look at the existing "nativescript" key.

"nativescript": {
   "platforms": {
      "android": "2.3.0",
      "ios": "2.3.0"
    }
 },

This tells nativescript which version of NativeScript runttimes are supported.   This allows the TNS command line to throw and error/warning if you are not using the proper versions.   This is useful information as this tells us what platforms are supported.   However, this fails when people (like me) write dummy wrappers to support the plugin not crashing on the other platform.     On the plugins site it will say this plugin supports both Android and iOS, but in all reality the plugin only really supports iOS, and actually doesn't really do anything on Android.    I would like to have the plugins site actually reflect this reality rather than you downloading a plugin you thing works on Android and it turns out it doesn't.

In addition since Angular was introduced to the eco-system, there are a large number of plugins that actually do NOT work with NAN (NativeScript Angular) code.   And even some that don't work with PAN (Plain Awesome NativeScript) code.  In addition in the future we might get other frameworks supported like VueJS (VAN?), etc.

So I would like to start capturing the data so that we can do these additional cool things.   And so I am proposing the following additional OPTIONAL meta data to be added.

"nativescript": {
   "platforms": {
      "android": "2.3.0",
      "ios": "2.3.0"
    },
    "plugin": {
       "nan": "false",
       "pan": "true",
       "core3": "true",
       "wrapper": "ios",
       "category": "visual"
    }
 },

nan = NativeScript ANgular will be assumed to be false, unless Angular is detected in the Keywords/name/description.
pan = Plain Awesome NativeScript Will be assumed to be true.
core3 = Supports NS Core Modules 3. Will be assumed FALSE if platforms.ios/.android < 3
Will be assumed TRUE if platforms.ios/andorid >= 3.
wrapper = Using a dummy wrapper Will default to false, use "ios" or "android" to signify platform which is using a wrapper.
category This is the category to put the plugin in.   Valid categories currently are: "Interface", "Processing", "Templates", "Developer", "Utilities"

I am up for other category suggestions.   But at this point these are the primary categories that I use on plugins.nativescript.rocks.

Please note each key is optional; however, your plugin will get extra points for having an category key.  And you will LOSE points if we detect a plugin is using a wrapper and you haven't tagged it, as this is a issue the plugin users really hate seeing faulty data about the plugins support.

I would recommend plugin authors start adding this to any releases of there plugins so that we can capture the data.  This will become critical with the 3.0 release as a large chunk of plugins are not going to be compatible between NS 2 & NS 3.

NativeScript: Patreon Posts & Plugins

For those who are unaware; I've started doing paid content; see my post on "Why Patreon" to see the reasons.   I'm going to attempt to keep this post updated with plugins and posts that are available to those who are my patreon supporters.

Posts:

 

Plugins:

 

NativeScript: Android plugins and Windows path size issues

If your on Linux or OSX you can skip this post; it only applies to us pathetic people that prefer Windows (like me ). I do have Linux and OSX, so maybe I'm not that pathetic; but since I do prefer Windows, maybe I am.

If you don't want to read the reason this occurs but all you want is the fix; then scroll down to the fix!

Well if you see this error: Command [Some Path]\gradlew.bat failed with exit code 1 then you more than likely ran into this error if you see a lot of messages above it with "No Delegate Set" and errors.

Well to understand the issue you need to understand that this is a issue between Windows, Gradle and how NativeScript (A fix might show up by v1.8 of NativeScript) currently does Android plugins. Windows, if it supported larger path sizes; this wouldn't be an issue (which is why it works on Mac/Linux). NativeScript if it handled plugins differently might not run into this issue either. But at the current place we are at; it does so here is the crux of the issue.

1. Windows only supports 255 character path sizes (if they are not UNC or Unicode path's)

2. NativeScript scans all your plugins; any that have a platforms/android folder; it will use the include.gradle file found in that folder.  If there is NOT a include.gradle file; it will create one for you using the plugin name as the information.

3. Gradle combines all the productFlavors (which are inside the include.gradle files) into one long string.

Ok, lets look at a sample include.gradle file (this is also what is also generated for you, if it doesn't exist)

android {
    productFlavors {
        "nativescript-websockets" {
            dimension "nativescript-websockets"
        }
    }
}

So lets pretend your code exists at: C:\nativescript\AwesomeProject\, so there is (32) characters. Now add platforms\android\ (18). Next add build\intermediates\res\merged\ (31) as this is where Gradle does its resource merging. So lets say you are using the Telerik NativeScript UI plugin; and lets grab one of the image names \debug\drawable-xxhdpi\someimage.png which is of course adds another 49 characters. So this means we are using 130 characters already; leaving us with 122 characters left to play with.

So if you have a plugin installed like nativescript-websockets you get 23 characters used just for a single plugin. I bet you can see where this is going. Add on the cool nativescript-telerik-ui plugin and you have another 23 characters used. Add just a couple more plugins, and yes -- you are now well over 255 character limit!

Guess what happens???    Well if you are following the story so far; you get a nice error that gradle quit with error 1.

The Fix:

Now for the good news; here is how you can continue developing!

  1. Go to your app folder and do a tns platform remove android to safely recover, you need to kill your existing android platforms folder.
  2. Go into you node_modules folder, and then you need to repeat this next set of steps for EACH of the plugins you have installed.
    • Enter that plugins platforms\android folder and edit the include.gradle -- if that folder doesn't exist then you are done and can skip this plugin.  If the folder exists but the include.gradle file doesn't exist you can choose to ignore it or create your own.  DO NOT create a platforms\android folder, if it doesn't exist. Only create a include.gradle if the plugin already has a platforms\android folder and it doesn't have a include.gradle.
    • Edit the include.gradle and make the name shorter; this is the formula that I used.   Replace nativescript with "ns", eliminate any dashes, and then use the first letter for each word in the plugin.   So "nativescript-cardview" becomes "nscv",and "nativescript-telerik-ui" becomes "nstu". So the include.gradle changes from above (nativescript-websockets) to:
      android {
          productFlavors {
              "nsws" {
                  dimension "nsws"
              }
          }
      }

      Pretty simple huh?   By shorting the name, you go from 23 character per plugin to 4 characters per plugin.   So you can now easily fit 5 plugins in the same space it used to take for 1 plugin.  Please make sure the total letters are unique -- don't have two plugins with the same name (i.e. "nsws" for nativescript-websockets and nativescript-webserver)  as the same name, make them distinct.  Having duplicate names will probably break Gradle.
  3. Do a nativescript platform add android to re-install the platform after you are all done, and then you should be good to go.

Please note this potential side effect: I have confirmation below that if you are using a plugin that requires additional permissions; this work around will unfortunately not merge the info from the plugins AndroidManifest.xml file.   With all the plugins I had, I never saw this issue; but depending on what you are doing this is something you may run into.   You have two choices to deal with this:

  1. Don't rename that specific plugin inside the include.gradle file.  This way the AndroidManifest.xml file will get merged properly.   You an afford a couple plugins to still have large names.
  2. Copy the information that you need (like permissions) from the plugins AndroidManifest and manually merge it into your master manifest located at App/App_Resources/Android/AndroidManifest.xml

The bug report so you can track this is Android/369 and based on the conversation with the NativeScript devs this should hopefully be fixed in v1.8 (but no promises).