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 234508 - Provide an easy way to see non-minified remote JS file
Summary: Provide an easy way to see non-minified remote JS file
Status: NEW
Alias: None
Product: web
Classification: Unclassified
Component: HTML Project (show other bugs)
Version: 7.4
Hardware: PC All
: P3 normal (vote)
Assignee: Tomas Mysik
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-08-16 16:02 UTC by Petr Jiricka
Modified: 2013-12-17 09:34 UTC (History)
2 users (show)

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Petr Jiricka 2013-08-16 16:02:33 UTC
1. Create a HTML5 project using e.g. the HTML Boilerplate template
2. Under Remote Files node, you see a jquery.min.js file. This file is coming from https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js

=> It would be useful to have an action that will show a non-minified version of this file, i.e. https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.js. This could be placed e.g. in the popup menu of the node in explorer ("Open non-minified"), or as an extra tab in the editor next to the Source and History tabs (i.e. a "Non-minified" tab). The correct URL would be found based on naming patterns, i.e. if the original URL contains ".min" or "-min" just before the .js extension, then this part would be removed.
Comment 1 David Konecny 2013-08-18 18:50:51 UTC
I think this is a feature request for JS editor - an ability to reformat and beautify minimized JS code.

Using an alternative URL without "[.-]min" can occasionally work but is not reliable enough.

The main issue is that a mapping from minimized code to unminimized is needed otherwise features like JS debugger, Goto JS Declaration, etc. will stop working. And the mapping is known only if beautification was done directly by NB JS editor (or if project comes with a source map file mapping to uncompressed version of JS file).
Comment 2 Petr Jiricka 2013-08-19 07:53:54 UTC
> Using an alternative URL without "[.-]min" can occasionally work but 
> is not reliable enough.

Well, I would say formatting/beautifying can not work reliably either. Plus it will never restore code commments. 

Wrt. JS debugger/Goto declaration - this is true, though I would say in some situations just seeing the original code is a value in itself, even without the debugger.
Comment 3 Petr Hejl 2013-08-20 08:34:18 UTC
(In reply to David Konecny from comment #1)
> I think this is a feature request for JS editor - an ability to reformat and
> beautify minimized JS code.

I don't think so. Obviously something different has been requested. While non-minified source has a value on its own (as also confirmed in comment #2) the formatted minified source is still pretty much useless - "formatted" does not mean "readable" due to syntactic constructs, variable naming etc.
Comment 4 Tomas Mysik 2013-12-12 06:15:54 UTC
Taking over.