openpsa / jsgrid

Fork of last jqGrid version before license change
http://openpsa.github.io/jsgrid/
Other
28 stars 12 forks source link

Not all jqGrid file are included in the build #29

Closed OlegKi closed 9 years ago

OlegKi commented 9 years ago

Hi,

I do made some changes in my repository to reduce the size of resulting jquery.jqGrid.min.js. I don't planned to do to make such changes before, but the results was too good: i could reduce the size of jquery.jqGrid.min.js by the last changes from 282 KB (289.272 bytes) till 275 KB (282.532 bytes) in the current version.

After that I compared the size of grid.js-4.7.0.min.js and grid.js-4.7.0.js with the size of jquery.jqGrid.min.js and jquery.jqGrid.src.js from my repository. Your jquery.jqGrid.min.js is smaller. After some additional analyse I've found out that the current build of grid.js-4.7.0.min.js and grid.js-4.7.0.js don't includes the files which you moved in external folder:

jqDnR.js
jqModal.js
jquery.fmatter.js
JsonXml.js

It's a clear bug in the build process which need be fixed.

Best regards Oleg

flack commented 9 years ago

Thanks for the report! Should be fixed now.

OlegKi commented 9 years ago

One small additional remark. I understand many advantages of building process which uses Grunt. Nevertheless I tried to test only one thing: the size of the final file jquery.jqGrid.min.js (or grid.js-4.7.0.min.js) in your case because I use Closure Compiler in my fork of jqGrid and you use Uglify.

If I compile the current jquery.jqGrid.src.js from my my repository with respect of Closure Compiler I get jquery.jqGrid.min.js of the size 275 KB (282.532 bytes), but if I compile the same file using Uglify I get minimized file of the size 277 KB (284.619 bytes). So the usage of Closure Compiler seems be the best choice if one take in the consideration the final results.

Best regards Oleg P.S. During making of the experiments I've found a small bug in the current build file. I had to execute explicitly grunt concat --force --verbose. It seems that there are not declared dependency from the task "concat" in the build process.You can try to delete the file build\grid.js-4.7.0.js and you will see that no new build\grid.js-4.7.0.js file and no dist\grid.js-4.7.0.min.js will be created.

flack commented 9 years ago

@OlegKi I just tested grunt concat like you described, but for me, it works normally:

$ grunt clean:build
Running "clean:build" (clean) task
>> 1 path cleaned.

Done, without errors.

$ grunt concat
Running "concat:compile_css" (concat) task
File dist/grid.js-4.7.0.min.css created.

Running "concat:compile_js" (concat) task
File build/grid.js-4.7.0.js created.

Done, without errors.

Could you post the error message you are getting?

flack commented 9 years ago

About the compiler: If you look a bit at benchmarks, it seems that Closure Compiler compresses a little bit better, and runs approx. ten times slower than Uglify. Since the compile task is not run during grunt watch, the performance penality will not apply, i.e. for development, there would be no difference. For compile, the runtime of the task is not so important, so I guess we can switch back to Closure Compiler. I've found this package:

https://github.com/thanpolas/grunt-closure-tools

which seems to provide all the configuration we need. I'll open a new ticket for the change

OlegKi commented 9 years ago

The difference that you executed $ grunt clean:build and I used grunt --force --verbose corresponds to the information from README.md. Probably my experiments were not so clean, but I wanted just inform you about. I didn't execute clean task explicitly or concat task. I make experiments on the repository which I loaded before and where I made some experiments. In any way I had the repository where build directory with many files inside exists. After some strange effects I could see that grid.js-4.7.0.js was not regenerated during executing grunt --force. I deleted the file grid.js-4.7.0.js and had successful build without any dist\grid.js-4.7.0.min.js.

In any way I can't reproduce the problems now. Either the problem is soled or I have now another state of the files. So we can forget the problem.