Skip to content

Instantly share code, notes, and snippets.

@jrburke
Last active December 13, 2015 17:39
Show Gist options
  • Save jrburke/4949790 to your computer and use it in GitHub Desktop.
Save jrburke/4949790 to your computer and use it in GitHub Desktop.
Gaia email layer split
/*
Generated with a build that does:
main:
include: ["almond", "event-queue", "mailapi/same-frame-setup"]
account:
exclude: ['event-queue', 'mailapi/same-frame-setup']
include: ['mailapi/activesync/account']
and with modifying mailapi/accountcommon to do this to load
(not correct logic, but just doing it for tracing experiments)
var $asacct;
require(['./activesync/account'], function (acct) {
$asacct = acct;
});
Maybe need to also dynamically load 'activesync/protocol' in that
dynamic require call too? Otherwise not much savings
*/
{ main:
[ 'js/ext/almond.js',
'js/ext/event-queue.js',
'js/ext/buffer.js',
'js/ext/mailapi/shim-sham.js',
'js/ext/mailapi/mailapi.js',
'js/ext/q.js',
'js/ext/microtime.js',
'js/ext/rdcommon/extransform.js',
'js/ext/rdcommon/log.js',
'js/ext/mailapi/util.js',
'js/ext/mailapi/quotechew.js',
'js/ext/bleach.js',
'js/ext/mailapi/htmlchew.js',
'js/ext/mailapi/mailchew.js',
'js/ext/events.js',
'js/ext/util.js',
'js/ext/stream.js',
'js/ext/encoding.js',
'js/ext/addressparser/index.js',
'js/ext/addressparser.js',
'js/ext/mimelib/lib/mimelib.js',
'js/ext/mimelib/lib/content-types.js',
'js/ext/mimelib/lib/content-types-reversed.js',
'js/ext/mimelib/index.js',
'js/ext/mimelib.js',
'js/ext/mailcomposer/lib/punycode.js',
'js/ext/crypto.js',
'js/ext/mailcomposer/lib/dkim.js',
'js/ext/http.js',
'js/ext/https.js',
'js/ext/url.js',
'js/ext/mailcomposer/lib/urlfetch.js',
'js/ext/fs.js',
'js/ext/mailcomposer/lib/mailcomposer.js',
'js/ext/mailcomposer.js',
'js/ext/mailapi/composer.js',
'js/ext/mailapi/mailbridge.js',
'js/ext/rdcommon/logreaper.js',
'js/ext/mailapi/a64.js',
'js/ext/mailapi/date.js',
'js/ext/mailapi/syncbase.js',
'js/ext/mailapi/maildb.js',
'js/ext/mailapi/allback.js',
'js/ext/mailapi/cronsync.js',
'js/ext/net.js',
'js/ext/tls.js',
'js/ext/mailparser/datetime.js',
'js/ext/mailparser/streams.js',
'js/ext/mailparser/mailparser.js',
'js/ext/imap.js',
'js/ext/mailapi/imap/probe.js',
'js/ext/os.js',
'js/ext/simplesmtp/lib/starttls.js',
'js/ext/simplesmtp/lib/client.js',
'js/ext/mailapi/smtp/probe.js',
'js/ext/wbxml.js',
'js/ext/activesync/codepages.js',
'js/ext/activesync/protocol.js',
'js/ext/mailapi/accountmixins.js',
'js/ext/mailapi/errbackoff.js',
'js/ext/mailapi/mailslice.js',
'js/ext/mailapi/searchfilter.js',
'js/ext/mailapi/imap/imapchew.js',
'js/ext/mailapi/imap/folder.js',
'js/ext/mailapi/jobmixins.js',
'js/ext/mailapi/imap/jobs.js',
'js/ext/mailapi/imap/account.js',
'js/ext/mailapi/smtp/account.js',
'js/ext/mailapi/fake/account.js',
'js/ext/mailapi/accountcommon.js',
'js/ext/mailapi/mailuniverse.js',
'js/ext/mailapi/same-frame-setup.js' ],
account:
[ 'js/ext/mailapi/activesync/folder.js',
'js/ext/mailapi/activesync/jobs.js',
'js/ext/mailapi/activesync/account.js' ] }
/* Second pass modifying accountcommon.js to do this instead:
var $asacct, $asproto;
require(['activesync/protocol', './activesync/account'], function (proto, acct) {
$asproto = proto;
$asacct = acct;
});
and build setup like this:
main:
include: ["almond", "event-queue", "mailapi/same-frame-setup"]
account:
exclude: ['event-queue', 'mailapi/same-frame-setup']
include: ['activesync/protocol', 'mailapi/activesync/account']
results in the following file splits:
*/
{ main:
[ 'js/ext/almond.js',
'js/ext/event-queue.js',
'js/ext/buffer.js',
'js/ext/mailapi/shim-sham.js',
'js/ext/mailapi/mailapi.js',
'js/ext/q.js',
'js/ext/microtime.js',
'js/ext/rdcommon/extransform.js',
'js/ext/rdcommon/log.js',
'js/ext/mailapi/util.js',
'js/ext/mailapi/quotechew.js',
'js/ext/bleach.js',
'js/ext/mailapi/htmlchew.js',
'js/ext/mailapi/mailchew.js',
'js/ext/events.js',
'js/ext/util.js',
'js/ext/stream.js',
'js/ext/encoding.js',
'js/ext/addressparser/index.js',
'js/ext/addressparser.js',
'js/ext/mimelib/lib/mimelib.js',
'js/ext/mimelib/lib/content-types.js',
'js/ext/mimelib/lib/content-types-reversed.js',
'js/ext/mimelib/index.js',
'js/ext/mimelib.js',
'js/ext/mailcomposer/lib/punycode.js',
'js/ext/crypto.js',
'js/ext/mailcomposer/lib/dkim.js',
'js/ext/http.js',
'js/ext/https.js',
'js/ext/url.js',
'js/ext/mailcomposer/lib/urlfetch.js',
'js/ext/fs.js',
'js/ext/mailcomposer/lib/mailcomposer.js',
'js/ext/mailcomposer.js',
'js/ext/mailapi/composer.js',
'js/ext/mailapi/mailbridge.js',
'js/ext/rdcommon/logreaper.js',
'js/ext/mailapi/a64.js',
'js/ext/mailapi/date.js',
'js/ext/mailapi/syncbase.js',
'js/ext/mailapi/maildb.js',
'js/ext/mailapi/allback.js',
'js/ext/mailapi/cronsync.js',
'js/ext/net.js',
'js/ext/tls.js',
'js/ext/mailparser/datetime.js',
'js/ext/mailparser/streams.js',
'js/ext/mailparser/mailparser.js',
'js/ext/imap.js',
'js/ext/mailapi/imap/probe.js',
'js/ext/os.js',
'js/ext/simplesmtp/lib/starttls.js',
'js/ext/simplesmtp/lib/client.js',
'js/ext/mailapi/smtp/probe.js',
'js/ext/mailapi/accountmixins.js',
'js/ext/mailapi/errbackoff.js',
'js/ext/mailapi/mailslice.js',
'js/ext/mailapi/searchfilter.js',
'js/ext/mailapi/imap/imapchew.js',
'js/ext/mailapi/imap/folder.js',
'js/ext/mailapi/jobmixins.js',
'js/ext/mailapi/imap/jobs.js',
'js/ext/mailapi/imap/account.js',
'js/ext/mailapi/smtp/account.js',
'js/ext/mailapi/fake/account.js',
'js/ext/mailapi/accountcommon.js',
'js/ext/mailapi/mailuniverse.js',
'js/ext/mailapi/same-frame-setup.js' ],
account:
[ 'js/ext/wbxml.js',
'js/ext/activesync/codepages.js',
'js/ext/activesync/protocol.js',
'js/ext/mailapi/activesync/folder.js',
'js/ext/mailapi/activesync/jobs.js',
'js/ext/mailapi/activesync/account.js' ] }
@jrburke
Copy link
Author

jrburke commented Feb 14, 2013

Some numbers, in bytes:

70780 TEST.js (just 'mailapi/activesync/account' in "account" layer, first test)
56402 TEST.min.js (comments and multiple empty lines removed)
165358 TEST2.js ('activesync/protocol', 'mailapi/activesync/account' in "account" layer, second test)
138488 TEST2.min.js (comments and multiple empty lines removed)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment