yal-haxe / haxmin Goto Github PK
View Code? Open in Web Editor NEWA Haxe-JavaScript code minifier
A Haxe-JavaScript code minifier
Hi,
another Issue I ran into, is the use of the void operator in a condition statement
For instance:
if (x === void 0) {
// XXX
}
because void becomes $void in the output.
If I read the doc (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/void) I think it could be fixed by replacing void 0 by void(0).
:)
Hi!
As mentionned there (http://yal.cc/introducing-haxmin/#comment-344367) output is corrupt when finally keyword is found in javascript input: a semi colon is added after the catch block, the finally keyword is not taken into account.
js input:
try {}catch(e){} finally{}
js output:
try {} catch(e){}; finally // -> error unexpected token finally
Thanks!
A significant number of these strings are not getting renamed.
My minified output contains a bunch of occurrences that look similar to this:
var pR = function () {};
qO["jF.myfolder.MyClassName"] = pR;
pR.b4 = "jF.myfolder.MyClassName";
pR.bq = true;
pR.prototype = {
d2: pR
};
I tried troubleshooting this by looking in "default.txt", my "whitelist.txt", "Main.hx", and "HaxeMin.hx", for the strings "myfolder" and "MyClassName", but I find no matches anywhere.
"myfolder" and "MyClassName" are just example strings. I used the actually strings from my code for the above step.
TL;DR - HaxMin is behaving as if many of my com.package.className
strings have been whitelisted, but they definitely aren't, and it's preventing the desired minification from occurring.
When running Haxmin on a Openfl JS project i get a bunch of
Uncaught SyntaxError: Unexpected string
I am not sure why they occur but it is caused by things like this
get_xJ:get_"xJ"
So after running haxemin I have to do a search and replace changing
get_" with "get_
and
set_" with "set_
After this I have to prettify the JS code. For some reason the bracket requires a carriage return or semicolon.
....."get_K5"}$$9._E.......
to change it to
....."get_K5"};$$9._E.......
I am assuming this is actually an issue with the JS code coming from openfl. Is there any way to turn off minify-ing (for testing purposes if nothing else) or can it be made smart enough to append a ; or carriage return when needed?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.