framework.js minified

Hi all,

There is a reason why the css files and framework.js are not minified and optimized?

I think they gzip it anyway, so that reduces size while keeping original readable.

Yes, that’s exactly it. We’ve done some tests from time to time and we’ll need to build a minification engine into the framework if we still want to be able to troubleshoot bug reports. So far the minification doesn’t fall into the low-hanging fruit category of things to optimize.

But their is nothing stopping people from making their own minified versions of the framework.js files in the Xojo 2014r2.1\Resources\WebFrameworks folder which might help a bit.

Except, as Greg noted, it would make it harder for Xojo to help you if you had a problem. Sounds counter productive to me.

Yes but no :wink:

I am not saying Xojo should do it, people themselves could do it and keep copies of the originals and Xojo would only support the original framework.js files and NOT minified versions in the same way they wouldnt support you if you had hacked around inside the files yourself. This way you benefit in a production environment from the minification etc.

Personally I would like to see a command line switch on web apps where you could specify if you want to use minified or unminified files with the default in debug to be unminified and in production to be minified but this way Xojo would also say that you have to run the app in unminified mode to get support etc.

Just this clause in the EULA
You agree not to decompile, reverse engineer or modify any part of the Xojo IDE or the Xojo Framework.

[quote=125789:@Nathan Wright]Yes but no :wink:

I am not saying Xojo should do it, people themselves could do it and keep copies of the originals and Xojo would only support the original framework.js files and NOT minified versions in the same way they wouldnt support you if you had hacked around inside the files yourself. This way you benefit in a production environment from the minification etc.

Personally I would like to see a command line switch on web apps where you could specify if you want to use minified or unminified files with the default in debug to be unminified and in production to be minified but this way Xojo would also say that you have to run the app in unminified mode to get support etc.[/quote]
Just means that the FIRST question we have to ask everyone when they submit a bug report is

  1. did you alter Xojo in any way ?
    a yes here means its not our bug til you use an unmodified version

  2. send the project that is having issues (so we can verify that your output is NOT hacked altered etc)
    not sending such a project would also mean “not our bug tile you can show us it is with an UNMODIFIED project”

I’m not sure that strikes the right kind of relationship - but when folks may alter the sources you kind of have to do that
I worked for a vendor that shipped source code before & that was pretty much the first two steps

[quote=125797:@Norman Palardy]Just this clause in the EULA
You agree not to decompile, reverse engineer or modify any part of the Xojo IDE or the Xojo Framework.[/quote]

Oops, didnt even think about the EULA (my bad!)

[quote=125798:@Norman Palardy]I’m not sure that strikes the right kind of relationship - but when folks may alter the sources you kind of have to do that
I worked for a vendor that shipped source code before & that was pretty much the first two steps[/quote]

I was not suggesting that hacking the framework.js was a good idea and would much prefer to have the option within Xojo itself in some way but until Xojo Inc does something this was the only way I could think that might allow someone to squeeze a little more speed out of the load time for pages etc. That said I think the framework.js gets wrapped into one file which is loaded when the app starts so not really much of an overhead in my view, but I may be wrong about this.

I’m really going to suggest that you don’t do this. As Norman mentioned, it’s a violation of the EULA, and you will not get support from us if you’ve minified the framework. Basically, whenever we run into something that we can’t reproduce, we usually compare the framework files that your app is delivering against the version that shipped with Xojo. If they don’t match we’re going to point to that and tell you to try it with the stock code.

Minification programs do modify code. They remove whitespace, they remove comments and many of them rename local variables. Consider the code:

var j; var i; i = i + ++j;

The minifier is likely going to do this:

var j; var i; i=i+++j;

Which will be interpreted by the browser javascript engine as:

var j; var i; i=i++ +j;

It’s subtle, but now instead of j being incremented, i does. I’m not saying that we’ve done this particular thing, but it’s an important reason that you don’t minify someone else’s code.

We haven’t audited all of the code for minification yet (I was the second engineer to work on this code), and until we do that, it is not safe to minify it.

As always Greg, thanks for the detailed explanation, I can fully appreciate what you are saying and wont be minifying anything in Xojo (not that I actually was planning to, just theoretic chat). :wink: