Forum

November 2nd, 2014
A A A
Avatar

Lost password?
Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

The forums are currently locked and only available for read only access
sp_Feed Topic RSS sp_TopicIcon
generate jquery.jqGrid.map.js in the next release of jqGrid
22/11/2014
19:07
Avatar
OlegK
Germany
Member
Members
Forum Posts: 1255
Member Since:
10/08/2009
sp_UserOfflineSmall Offline

Hello Tony,

I hope that you'll soon publish new version of jqGrid. It would be very good if it would includes jquery.jqGrid.map.js together with jquery.jqGrid.min.js. I makes some tests and suggest you to make small changes in build.gradle file which generates the map file. One needs first modify the line

    jscompiler 'com.google.javascript:closure-compiler:r1810'

to

    jscompiler 'com.google.javascript:closure-compiler:v20141023'

to include the line

    def jqGridSrcMapFile = new File(distdir, 'jquery.jqGrid.map.js')

and to modify the line

    ant.jscompile(output: jqGridMinFile, warning: 'QUIET', debug: logger.debugEnabled) {

to the line

    ant.jscompile(output: jqGridMinFile, warning: 'QUIET', sourceMapFormat: 'V3', sourceMapOutputFile: jqGridSrcMapFile, debug: logger.debugEnabled) {

I included the modification (see here) in the pending pull request. Additional advantage of updating to the new version of closure-compiler is the reducing the size of jquery.jqGrid.min.js file.

I recommend additionally to upgrade gradle/wrapper used in the build from gradle-1.0-milestone-8a-bin to the current gradle-2.2-bin.

Best regards
Oleg

09/12/2014
01:15
Avatar
OlegK
Germany
Member
Members
Forum Posts: 1255
Member Since:
10/08/2009
sp_UserOfflineSmall Offline

Hello Tony,

the file jquery.jqGrid-4.7.0.zip with the new version of jqGrid (from the official trirand download page) don't include source map file. Moreover I made some tests and could see small problem in generation of the source map: the sources property from the source map file. It seems to me that one should add small step to the distribution of jqGrid.

Let us we want that debugging of jquery.jqGrid.min.js in Google Chrome or Firefox would show the source lines of jquery.jqGrid.src.js. To implemnt this one could add the file jquery.jqGrid.min.map created by closure compiler. One need just verify that the last line of jquery.jqGrid.min.js contains the following

//@ sourceMappingURL=jquery.jqGrid.min.map

If one have jquery.jqGrid.min.map one should verify that and that the file contains the following lines 

{
"version":3,
"file":"jquery.jqGrid.min.js",
"sources":["jquery.jqGrid.src.js"],
...
}

It makes correct mapping from jquery.jqGrid.min.js to jquery.jqGrid.min.map and from jquery.jqGrid.min.map to jquery.jqGrid.src.js.

If the file of source entries have another values after working of closure compiler one can just make text replacement to modify jquery.jqGrid.min.map.

I'm not good in gradle but extending of doLast {...} of jqgrid-min task to the following work.

task 'jqgrid-min'(dependsOn: 'jqgrid') {
    description = "Minimize ..."

    def outputFile = new File(distdir, 'jquery.jqGrid.min.map')

    inputs.file jqGridFile
    outputs.file jqGridMinFile
    doLast {
        ant.taskdef(name: 'jscompile', ...
        ant.jscompile(
        ...
        }
        def fileContent = jqGridSrcMapFile.getText()
        fileContent = fileContent.replace('"sources":["dist/jquery.jqGrid.js"],', '"sources":["jquery.jqGrid.src.js"],')
        replace('"file":"jquery.jqGrid.map.js",', '"file":"jquery.jqGrid.min.js",')
        outputFile.write(fileContent)
    }
}

It doesn't matter how exactly jquery.jqGrid.min.js and jquery.jqGrid.min.map will be patched. it's just important that the described above entries are exist.

As an example one can try to debug in Google Chrome the demo, which uses jquery.jqGrid.min.js and jquery-1.11.1.min.js. One will sees the source code of jquery.jqGrid.src.js and jquery-1.11.1.js instead.

It's clear that source mapping is not perfect. The names of compiled/compressed variable will be not mapped to the names from the original source. Nevertheless it would be helpful to have jquery.jqGrid.min.map file which corresponds jquery.jqGrid.src.js to included in jquery.jqGrid-4.7.0.zip. Even without "//@ sourceMappingURL=..." line and without patched it jquery.jqGrid.min.map have some value for the users (like jQuery do this. jquery-1.11.1.min.js have no "//@ sourceMappingURL=..." statement, but jquery-1.11.1.min.map can be still used to make the reference to jquery-1.11.1.js). The users could makes the required modifications yourself if it will be difficult to automate the building process. One needs just to have jquery.jqGrid.min.map file which corresponds jquery.jqGrid.min.js and jquery.jqGrid.src.js. 

Best regards
Oleg

P.S. It would be helpful to publish the new 4.7.0 version of jqGrid on well known public places: nuget, the jQuery plugin registry, CDNJS CDN, jsDelivr CDN and other.

10/12/2014
18:00
Avatar
tony
Sofia, Bulgaria
Moderator
Members

Moderators
Forum Posts: 7721
Member Since:
30/10/2007
sp_UserOfflineSmall Offline

Thanks Oleg,

 

Will do the needed.

By the way the jQuery plugin repository is stoping to function. I do not know why.

Please look here

For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

Currently Online:
48 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

OlegK: 1255

markw65: 179

kobruleht: 144

phicarre: 132

YamilBracho: 124

Renso: 118

Member Stats:

Guest Posters: 447

Members: 11373

Moderators: 2

Admins: 1

Forum Stats:

Groups: 1

Forums: 8

Topics: 10592

Posts: 31289

Newest Members:

, razia, Prankie, psky, praveen neelam, greg.valainis@pa-tech.com

Moderators: tony: 7721, Rumen[Trirand]: 81

Administrators: admin: 66

Comments are closed.
Privacy Policy   Terms and Conditions   Contact Information