When Should You Write a jQuery Plugin? - J Query

After searching for an existing jQuery plugin to fit your needs, the plugins that were found either don’t meet your needs or are not constructed in a way that you can take advantage of them properly. Is it worth writing a new jQuery plugin that can be shared with others who have the same need?


There’s no cut and dried solution to this problem. The number of available jQuery plugins is large, but there are valid cases where plugins don’t exist to meet a particular need.
In my opinion, the decision to write and publish your own jQuery plugin comes down to three things:

  • Is it likely there are others who have the same problem?

  • What level of support are you willing to provide?

  • What level of community participation do you desire?


Build a plugin if there is a potential audience

If you’re facing a problem that remains unsolved, there are likely other developers who have encountered the same issue. How others before you have solved the issue is the key question. It’s assumed that you’ve done some homework at this point, searching for a solution. During that search, clues that may surface that point toward a need for a plugin can be found in forum posts or mailing list questions that have gone un answered.
There’s no easy way to decide whether a plugin is worth building, and the decision ultimately comes down to the person who is planning to build the plugin.
However, a general feel of whether there is a potential audience is worth exploring.
The other potential reason to build and publish your own plugin is if a plugin exists to meet your needs but does not fully do what you want. If this is the case, it is worth considering the potential for writing a patch and submitting that patch back to the original author for inclusion in the plugin. Participating in the open source process by submitting a patch to an existing project tends to be a much more efficient application of a developer’s most precious resource: time.

Know and communicate the level of support you are willing to provide

If writing your own plugin is the best option, a bit of forethought and planning will help make sure the process of hanging out your own open source shingle goes well.
Whenever you decide to publish your code, the first and biggest consideration is licensing. The jQuery core project is dual-licensed as MIT and GPL, but many other open source licenses are worthy of consideration. A more thorough discussion on the intricacies of open source licensing can be found at Wikipedia.
Second, it is important to consider and communicate the level of support that you, the plugin author, are willing to provide to others who may download and use your code.
Choosing to simply publish your code and provide no support is a completely valid option and is much better than keeping your code to yourself for fear of the potential support issues. The key is communication; writing a quick note about your support plan into the comments of your plugin will go a long way.
If you are willing to provide deeper support for a plugin that you want to publish, there are several great source code hosting sites that offer several features to assist in supporting your plugin.

Plan for participation from others

Lastly, think through and gauge your willingness to accept participation from others. Participation is a key component of the open source ecosystem, and it is wise to communicate your intention from the moment you publish your plugin. The attraction of allowing participation is that you can benefit from the work of others. Plugins that accept participation from others tend to attract additional users, partly because of the appearance of activity and partly because active code tends to be more trustworthy code.
Communicating the path to participation is key. Whether you intend to or not, any piece of code that is published tends to attract some sort of participation once users find it. Having a plan to engage that participation in an open and public way is essential.
One last word of advice: engaging participation simply by publishing your email address and allowing people to email you with comments and questions is generally a bad idea for a couple reasons. First, email isn’t a public forum that displays activity to potential users, and second, it introduces you, the plugin author, as a bottleneck to integrating that activity back into the plugin.

All rights reserved © 2020 Wisdom IT Services India Pvt. Ltd DMCA.com Protection Status

J Query Topics