On Mon, Jul 2, 2012 at 2:18 AM, Daniel Gonzalez <gonva...@gmail.com> wrote: > > I have taken a look at both pyjsbuild and pyjscompile. They are both small > scripts importing pyjs/pyjs/src/pyjs/browser.py. If I am not mistaken, this > is where the options are parsed, but I see no specific option to optimize > the size of the generated javascript. > > @Anthony: do you remember which flags are useful for this?
i personally don't like the monolothic build at all, and IMO the dynamic link should be the default. monolithic means that any change -- even a single char -- *anywhere* in your app results in the client downloading the full multi-MiB app in entirety. --dynamic-link allows only the changed modules to be re-downloaded, while all others are cached. with some tricks, you can also achieve cross-domain caching. i personally would use: --enable-strict --disable-debug --dynamic-link ... at the minimum. the first enables maximum python compat, the second disables anything considered debug (even stuff enabled by strict! this was the motivation for changes in option parsing), and the third links modules by <script> tags instead of copying them into the *cache.html files. i haven't tried the ompressor stuff yet, but the <script> loaded modules are pure JS, and i think should be compressible as-is. -- C Anthony