- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I just wanted to drop a note that the plugin import behavior is a little counter-intuitive. The interface, etc. are all fine (spectacular really) but the behind the scenes import is a little wonky.
After updating to the latest XDK that allowed plugins to live outside the www folder, I moved some custom plugin code into the new "plugins" folder at the same level as the www directory and began the import from the GUI. The result was a "plugin not found" error. But when I went to retry, the plugin folder was DELETED. This was obviously because the XDK was trying to create the plugin folder automatically (with the same name) and ended up nuking the source folder (with the same name) in the process. I almost freaked out when I realized the plugin I spent weeks working on had just been deleted. Luckily I was able to retrieve the plugin code from the online app center by downloading the last bundle I built with. However, I didn't expect this to happen and wanted to share.
At the very least, there should be a warning that nothing should be placed manually in the plugins folder but ideally, the XDK should recognize if the plugins folder is the source, that it doesn't have to "move" (read delete and copy) the plugin folder over.
Let me know if you have any questions about how to reproduce this,
David
P.S. On an unrelated GUI note, it would be nice to have some grouping in the imported plugins list that shows what was imported from git, which are cordova/xdk core plugins, and what is my own custom code just like old versions of the XDK had. Thanks!
- Tags:
- HTML5
- Intel® XDK
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi David, thanks for the feedback.
That local plugin add behavior is the result of using Cordova CLI under the hood. Unfortunately, that is not obvious to the typical XDK user. I'll issue a bug report that will request attempting to prevent installing from the <project-root>/plugins directory. Even with such a restriction, your plugin "source" should always live outside the <project-root>/plugins directory. When the plugin is added there are other operations that can be performed on it, transforming it from your plugin source to something that Cordova will use in the build step.
It may be possible to add some notation in the plugins list indicating the source of the plugin.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Understood. I suspected that this was due to the Cordova CLI operations happening when a plugin is imported. I will be much more careful to keep my plugin sources outside of the <project-root>/plugins directory so that the CLI doesn't think its updating in the same destination as the source. It was just very tempting to move my plugins into that well named folder :) I haven't used the CLI recently, but I don't remember if even it issues an error/warning if you instruct it to source a plugin from the plugins destination folder. A well placed error message is definitely useful here in both the CLI and the XDK to keep people from deleting their plugin source :). I'll try it out and file a bug with apache cordova if its also the case there.
Re: the plugin sources, those were simply useful to see where plugins were coming from at a glance since most projects have the cordova/xdk plugins but will differ in the git/registry/custom plugins. Having them separated somehow removes the clutter of the standard plugins and focuses attention on the more custom code in the project. Thanks!

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page