Loading ...
Sorry, an error occurred while loading the content.

Re: [ydn-javascript] Minify and obscufate

Expand Messages
  • Matt Warden
    ... Hash: SHA1 ... There is no obfuscation, only minification (although, obviously it is less readable when minified, which is why YUI also ships with the
    Message 1 of 3 , Jun 29, 2006
    • 0 Attachment
      -----BEGIN PGP SIGNED MESSAGE-----
      Hash: SHA1

      edward_stow wrote:
      > Hello,
      >
      > What minifier does Yahoo use to compress and obscufate the yui code
      > and is it available for general use.

      There is no obfuscation, only minification (although, obviously it is
      less readable when minified, which is why YUI also ships with the
      original source).

      I'm pretty sure they use jsmin. I'm not sure if I believe this because
      it has been said by one of the developers, or if it is my own
      assumption. You can find jsmin here:

      http://javascript.crockford.com/jsmin.html

      Note that minification is not as simple as you likely suspect. There are
      a number of perfectly legal JavaScript statements that will break
      horribly upon minification. You need to run your code through an
      analyzer before minification to avoid the introduction of these kinds of
      bugs. One such (very good) analyzer is jslint:

      http://www.jslint.com/

      You will get a lot of errors and warnings -- more than you need to fix
      for minification -- but it will catch all the potential problems that
      would arise after minification. If you want to only fix those issues,
      you'll need to look into which warnings result in post-minification
      errors and which do not (it's mostly common sense, but you can also find
      some info about this on the jsmin page).

      - --
      Matt Warden
      Oxford, OH, USA
      http://mattwarden.com


      This email proudly and graciously contributes to entropy.
      -----BEGIN PGP SIGNATURE-----
      Version: GnuPG v1.4.2.2 (GNU/Linux)
      Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

      iD8DBQFEpFnOrI3LObhzHRMRAm+LAJ9OHkIHNmVa6SJ1zQVQCQBupyCI+QCghjWW
      LcMlk20qs4TJrs2NB9UvzeM=
      =n/Yi
      -----END PGP SIGNATURE-----
    • edward_stow
      ... I don t thinks its jsmin - the yui minified code includes parameter (and variable?) substitutions. ... Yes good advice jslint should be used anyway to
      Message 2 of 3 , Jun 29, 2006
      • 0 Attachment
        --- In ydn-javascript@yahoogroups.com, Matt Warden <mwarden@...> wrote:
        >
        > -----BEGIN PGP SIGNED MESSAGE-----
        > Hash: SHA1
        >
        > edward_stow wrote:
        > > Hello,
        > >
        > > What minifier does Yahoo use to compress and obscufate the yui code
        > > and is it available for general use.
        >
        > There is no obfuscation, only minification (although, obviously it is
        > less readable when minified, which is why YUI also ships with the
        > original source).
        >
        > I'm pretty sure they use jsmin. I'm not sure if I believe this because
        > it has been said by one of the developers, or if it is my own
        > assumption. You can find jsmin here:
        >
        > http://javascript.crockford.com/jsmin.html

        I don't thinks its jsmin - the yui minified code includes parameter
        (and variable?) substitutions.

        >
        > Note that minification is not as simple as you likely suspect. There are
        > a number of perfectly legal JavaScript statements that will break
        > horribly upon minification. You need to run your code through an
        > analyzer before minification to avoid the introduction of these kinds of
        > bugs. One such (very good) analyzer is jslint:
        >
        > http://www.jslint.com/

        Yes good advice jslint should be used anyway to check code. I have a
        comprehensive suite of unit tests so I should be able to trap most
        issues that may arise.

        >
        > You will get a lot of errors and warnings -- more than you need to fix
        > for minification -- but it will catch all the potential problems that
        > would arise after minification. If you want to only fix those issues,
        > you'll need to look into which warnings result in post-minification
        > errors and which do not (it's mostly common sense, but you can also find
        > some info about this on the jsmin page).
        >
        > - --
        > Matt Warden
        > Oxford, OH, USA
        > http://mattwarden.com
        >
        >
        > This email proudly and graciously contributes to entropy.
        > -----BEGIN PGP SIGNATURE-----
        > Version: GnuPG v1.4.2.2 (GNU/Linux)
        > Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
        >
        > iD8DBQFEpFnOrI3LObhzHRMRAm+LAJ9OHkIHNmVa6SJ1zQVQCQBupyCI+QCghjWW
        > LcMlk20qs4TJrs2NB9UvzeM=
        > =n/Yi
        > -----END PGP SIGNATURE-----
        >
      Your message has been successfully submitted and would be delivered to recipients shortly.