This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 256766 - Please refactor the logic of searching for npm/bower modules
Summary: Please refactor the logic of searching for npm/bower modules
Status: NEW
Alias: None
Product: web
Classification: Unclassified
Component: HTML Project (show other bugs)
Version: 8.1
Hardware: All All
: P2 normal with 1 vote (vote)
Assignee: Tomas Mysik
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-11-24 15:39 UTC by Christian Lenz
Modified: 2016-08-30 08:00 UTC (History)
1 user (show)

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments
Webstorm npm (324.34 KB, image/gif)
2015-11-24 15:39 UTC, Christian Lenz
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Christian Lenz 2015-11-24 15:39:40 UTC
Created attachment 157482 [details]
Webstorm npm

As you can see on my little screencast (Webstorm npm), more or less you can see it, in Webstorm, the IDE will eager load the whole list of npm or bower packages after you open the settings -> Node.js and NPM and click on add/install. What you see is a popup with a search field and an empty list view. After maybe 5 min. or so, you see the whole lost of ALL npm packages or ALL bower packages which are available in the wild. So now you can search for angular or grunt and it's still there. You can search for angular or grunt or whatever while loading, and if the list appears all packages are there. No searching again for this. You can update the list, I don't know what that makes but this is really fast (Not really an updating). And the search field is an instant search field with suggests while typing, what is I think default in the JetBrains IDE's.

In Netbeans you have a popup with a search field too, but you have to search for a concrete dependency like grunt-angular-modules-graph. After hitting search (Yes you have to hit search to trigger the search, (I understand it, because netbeans doesn't do an eager load), Netbeans does the search for the package. After minutes you see the package but only this package. Ok for this example this is a conrecte package name. If you search for angular, you will find more. The problem is, that netbeans performs a new search query if I search for grunt, grunt-graphviz or angular or whatever. I don't get the whole list from NPM or bower. And no, I don't want for "" to get the whole list. WebStorm saves the list, and when I open the settings and Node.js and NPM again, the list is still there.

So for me, it would be a very good enhancement to have the same behaviour in netbeans for NPM and Bower as for WebStorm. It is very handy, now it is a pain in the ass to add a new package to netbeans. I'm faster to use npm install or bower install but this is not what I want, I would like netbeans to do this.


Regards

Chris
Comment 1 Tomas Mysik 2015-11-24 16:10:10 UTC
Well, the main problem here is that, unfortunately, npm and bower are really slow in searching. NetBeans simply invokes "npm search <package>" and then waits for the result - and this is apparently slow. But you are right, we should try to improve the current poor usability.

Thanks for reporting.
Comment 2 Tomas Mysik 2015-11-25 10:49:36 UTC
BTW I just tried it and can confirm that npm search takes really long time (does really anyone use this feature?). Bower and CDNJS seem to me to be OK.

Thanks.
Comment 3 Christian Lenz 2015-11-25 11:48:31 UTC
I thought that netbeans does a npm search because of the long time. I don't know whether someone use it or not. The idea of fetching all packages and search inside that would be a better enhancement I think.
Comment 4 phpcoder 2016-08-30 05:32:47 UTC
Netbeans 8.1 almost becomes unusable with npm project. It takes at least 5 minutes just to open the project. It is absolutely ridiculous. I'm thinking of switching to other IDE (like Atom), even if I'm using Netbeans for many years already and still love it. But with loading like this.. just unusable.
Comment 5 Tomas Mysik 2016-08-30 08:00:04 UTC
(In reply to phpcoder from comment #4)
> Netbeans 8.1 almost becomes unusable with npm project. It takes at least 5
> minutes just to open the project. It is absolutely ridiculous. I'm thinking
> of switching to other IDE (like Atom), even if I'm using Netbeans for many
> years already and still love it. But with loading like this.. just unusable.

How is it related to this enhancement? If you have any performance problems, please report them as a new issue. Create a profiler snapshot [1] taken during the problem and attach it to the issue. Also please attach your IDE log [2].

Thanks.
[1] http://wiki.netbeans.org/FaqProfileMeNow
[2] http://wiki.netbeans.org/FaqLogMessagesFile