It begins after a question : what is the best free javascript compressor ? You can find Jscompact, JSMin, Dojo ShrinSafe, Yahoo Compressor and don't forget packer. Well, all of us compress, but how ? Packer is the best compressor but not adapted. It reduce length but time of evaluation is too long. Jscompact and JSMIN are minifier and don't shrink variable name safely. Dojo ShrinSafe is great, great for safe bot not for code lenght. Now, it remains Yahoo Compressor. This is a great tools, but after have examined it, there is some gap and I'm not an expert in java. Moreover, There don't exist tools to shrink javascript in PHP. So I tried to create my javascript compressor with my predilection language.

The best way for avoid a big structural object model was the regular expression with PCRE. Too reliable and fast as old. But due to this and usage of the php language, my regexp become very long and don't human readable. So I created an attached class named Preg_File to write regexp in files with a strict format including template method. And finaly with help of recursive pattern, I can created a relativement stable javascript parsor, and finaly a reductor.

It is not perfect and I hate things that are not perfect. But after 6 month without modification, I decided that is the time of share it. Now or never.

posted by Fred at 2011-12-23 10:59:33
Merci pour ce beau travail et ce partage ;)
Thanks for this great work and sharing it ;)

posted by Xorax at 2012-09-26 02:00:02
Well, JSXS is now available on Github :)