Forum
19:07
10/08/2009
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
01:15
10/08/2009
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.
18:00
Moderators
30/10/2007
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.
Most Users Ever Online: 715
Currently Online:
52 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.comModerators: tony: 7721, Rumen[Trirand]: 81
Administrators: admin: 66