On 3/26/13 4:58 AM, Sean Colyer wrote:
> I agree it would be good to move out of the global space. We can take a
> couple of different paths
to accomplish this.
>
> Option one -- Use augmentation to maintain file-by-file independence.
We could presumably use a form like:
> var openpgp = (function(context) { .. })(openpgp || {});
> in each of our js files to build the openpgp object up ad-hoc. I
think the major downside to this is that references that are now to our
more static calls (like in crypto/cfb folders:
openpgp_crypto_generateSessionKey) will all have to be update, i.e.:
openpgp.openpgp_crypto_generateSessionKey
>
> Option two -- Concatenate all the files and then wrap the entire
thing. This is similar to what jQuery does with intro and outro
(https://github.com/jquery/jquery/tree/master/src). We have to make sure
the files are built in the same order, but I think it is the path of
least resistance. We could avoid some of the updating associated with
option one. It could also be worthwhile here to switch to a build system
closer to what jQuery uses with node/grunt to accomplish some of these
tasks.
>
> I think Option two is what we are better positioned for and also a
good path forward.
>
> Thoughts?
I think that it would be nice also to think about setting up some kind
of "automated" (like Continuous Integration) system that on each commit,
with a github posthook, automatically "build" the OpenPGP.js" library
with a compressed/optimized single .js code.
That way it would be easier for anyone willing to use it in an efficient
way, to just embedd it already compressed/optimized?
Fabio
_______________________________________________
http://openpgpjs.org