We see the same:

But... with fewer numbers, we are getting something... so must be a specific number... doing some testing.
We see the same:

But... with fewer numbers, we are getting something... so must be a specific number... doing some testing.
Seems to be an error with 50.5 and 83. Checking them out and also looking for that type of error perhaps in numbers that we did not test.
The error started in ZIM 016 - the Distill works with these (Container and Frame) before ZIM 016. I think this shows that not too much Distilling is going on these days. So seeing what the issue is.
Actually, container distills in 015 but frame does not. Both these have extra code underneath the class but still included in the distill number


Hmmm, was hoping that ZIM 015 did not have the extra code in the container but it does - it is pretty well the same code between the numbers.

There is a different error... it seems the errors are coming from the minifier saying that the code it is minifying has a bad syntax. Here is the error code for the Frame:

And here is the error code for the container

Okay... am just off to do a chore. Will think on it. It is a little tricky to debug as it is a node app and we might have to log in to another server, stop and start processes, etc. blah. But should be able to figure it out in the next couple hours.
Maybe if we can switch the minified and the complete code or comment out the minification, we can see what code it is trying to minify. And that would give us a clue because the line number would be there. etc. Right now, it is exiting before we see the non-minified code due to the error.

Thanks for your efforts Dan! I'm amazed more people don't use Distill. ZIM CAT 04 distilled down to 76kb transferred, whereas ZIM 019 without distillation is 445kb transferred. When your game downloads lots of images and music, and unfortunately ads to pay the bills, then Distill gives a fantastic saving that's not to be sniffed at.
Also, when the browser has to parse 1.5MB of JavaScript (unpacked) for ZIM then it's a big blocker on low end devices - I really notice problems with Time to Interactive core web vitals with those.
Going in now with a temporary modified distill that comments out the minified and should show the code it was trying to minify. That way we can check the line numbers against the errors.
Found the container problem, we had arrow functions in the es5 code:

Also arrow function in Keyboard, Ticker, and interval. So replacing those with anonymous functions.
For the Frame error, it does not seem to like the obj.default - not sure why. It says missing name after . like it does not like using "default" as a property name.

Default is a reserved word in JS so I can see why it doesn’t work!
Okay - replacing them with

And see if it gets past the check... it should. Other minifiers did not care about obj.default buy the one we are using in Distill seems to. We ran into that problem before with another keyword in js. Can't remember - a weird one like "description" or something.
Okay... that is updated and seemed to get us past the issues.

Let us know if there is anything else as you go, and thanks for your patience and help.
Cheers.
Thank you! I’ll test it tomorrow.
Distill works now, but the distilled output is missing ZIM.Monitor.
Uncaught TypeError: can't access property "frames", zim.Monitor is undefined
ZIM.Monitor is also missing from the functions list so I'm unable to add it manually.
Edit: I have got a working distill with the following steps:
// zapp directives
WW.zapp_scaling = null;
WW.zapp_width = null;
WW.zapp_height = null;
WW.zapp_color = null;
WW.zapp_outerColor = null;
WW.zapp_assets = null;
WW.zapp_path = null;
WW.zapp_progress = null;
WW.zapp_gpu = null;
WW.zapp_gpuObj = null;
WW.zapp_maxNum = null;
WW.zapp_singleTouch = null;
I've discovered another Distill issue with the following input:
21 28 22 1 50.44 50.5 50.435 50.34 10 17.6 12 50.432 47.5 7 59 50.6 50.7 7.5 47.6 34.85 50.8 13.5 9 41.5 13.45 50 48.1 40 52 50.97 45.3 8 54 41.55 27.66 27.6 27.5 55 41.1 48 6.1 6 18 20 19 41.7 45 11.5 17 30 53.2 81.5 81.6 31 34 51 47.8 47.7 32 47.87 13 13.1 27.8 13.3 27.7 13.47 13.34 13.4 53.15 41.8 14 41.95 41.97 41.6 27.9 45.5 47.88 69.972 33.16 35 50.1 11.7 45.12 33.165 69.9 33.15 53.5 9.8 9.7 83.3 83.35 83 9.99 83.36 13.46 39 13.32 53 45.22 84
Error:
[ERROR] 12871:11:missing ; before statement
[ERROR] 1:0:Compilation produced 1 syntax errors.
org.mozilla.javascript.EvaluatorException: Compilation produced 1 syntax errors.
at com.yahoo.platform.yui.compressor.YUICompressor$1.runtimeError(YUICompressor.java:154)
at org.mozilla.javascript.Parser.parse(Parser.java:392)
at org.mozilla.javascript.Parser.parse(Parser.java:337)
at com.yahoo.platform.yui.compressor.JavaScriptCompressor.parse(JavaScriptCompressor.java:312)
at com.yahoo.platform.yui.compressor.JavaScriptCompressor.(JavaScriptCompressor.java:533)
at com.yahoo.platform.yui.compressor.YUICompressor.main(YUICompressor.java:131)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at com.yahoo.platform.yui.compressor.Bootstrap.main(Bootstrap.java:21)
Oh - will add the Monitor and zapp directives. And test that batch of numbers. I suppose we should just test all the numbers or add a little switch somewhere that does that for us. Should be able to look into this today. Cheers.
Started in on it - looking good. I think we can just remove any line with ZIM.Monitor. Anyway - have to go out to a punk book event. Will continue on afterwards. Nothing active yet.
Distill has been updated. We had a let variable in the Blob code. We ran Distill with all the functions and noted five classes that will not run with Distill minify as they have ES6 in them. For those, you can check no minify and minify yourself. No minify will also let you still run Distill and see where any errors may happen. For instance, if we let an arrow function or const/let slip in.
Distill is working great now thank you.
I am amazed how much both CreateJS grew from 1.3.4 => 1.5, and ZIM Cat 04 => ZIM 019, for the same project. A lot of code which apparently can't be tree-shaken has been added to both.
CreateJS 1.3.4 => 243kB
CreateJS (2.0 see Pull Request) => 266kB
ZIMJS CAT04 (DISTILLED) => 150kB
ZIMJS 019 (DISTILLED) => 270kB
Unless we can tree shake the recently added features better, which I'm not using on Topmarks, I'm inclined to stick with the older versions and patch the modernization changes back into CreateJS 1.3.4.
So your distill numbers, you put in the same app code numbers for each, and the difference coming out was 120k of minified code? That is a lot. What were your numbers and we will see what is causing the difference.
So I collate all the distill numbers across my all games using a python script. It pops out these:
21 28 22 1 50.44 6.1 50.5 50.435 50.34 10 17.6 12 50.432 47.5 7 59 50.6 50.7 7.5 47.6 34.85 50.8 13.5 9 41.5 13.45 50 48.1 40 52 50.97 48 41.55 41.97 54 27.66 27.6 27.5 55 41.1 41.7 41.95 69.9 47.7 33.15 9.8 11.7 30 45.3 6 18 20 19 35 45 11.5 17 9.7 13.46 7.8 66.5 45.5 13.61 41.64 13.2 41.71 50.1 8 31 34 56 27.68 41.2 36 41.63 32 45.12 83.3 83.35 83 9.99 83.36 41.8 53 27.65 51 41.6 39 13.32 45.22 53.2 81.5 81.6 47.8 47.87 13 13.1 27.8 13.3 27.7 13.47 13.34 13.4 53.15 14 27.9 47.88 69.972 33.16 33.165 53.5 13.466
Using the above numbers...
// ZIM - https://zimjs.com - DISTILLED NON-MINIFIED (570.7 KB) cat/04/ZIM
// ZIM - https://zimjs.com - DISTILLED NON-MINIFIED (737.1 KB) 019/ZIM
So a lot of dependencies must have been added to the parts of ZIM that I've used.