Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Decrease filesize #2

Open
minicuper opened this issue Oct 13, 2014 · 2 comments
Open

Decrease filesize #2

minicuper opened this issue Oct 13, 2014 · 2 comments

Comments

@minicuper
Copy link

Notice that derby-standalone.min.js is 213kb. It is quite big. For example angular-1.1.5.min.js is 88kb, angular-1.2.10.min.js is 100kb.

So I've seen into the structure of the 213kb.

Look:

file size
derby/node_modules/derby-parsing/node_modules/esprima-derby/esprima.js 31655
derby/node_modules/derby-templates/node_modules/saddle/index.js 22000
derby/node_modules/derby-templates/lib/expressions.js 12017
derby/node_modules/derby-parsing/lib/index.js 10806
derby/node_modules/derby-templates/lib/templates.js 10232
derby/node_modules/racer/lib/Model/mutators.js 8911
browserify/node_modules/url/url.js 7952
derby/node_modules/racer/lib/Model/refList.js 6835
derby/lib/eventmodel.js 6084
derby/lib/Page.js 5777
derby/node_modules/racer/lib/Model/ref.js 5172
derby/node_modules/derby-parsing/lib/createPathExpression.js 4767
derby/node_modules/racer/lib/Model/filter.js 4057
browserify/node_modules/events/events.js 3896
derby/node_modules/racer/lib/Model/events.js 3836
derby/lib/App.js 3642
derby/node_modules/racer/lib/Model/fn.js 3560
derby/lib/components.js 3513
derby/node_modules/racer/lib/Model/setDiff.js 3497
derby/node_modules/tracks/node_modules/qs/index.js 3323
derby/node_modules/tracks/lib/History.js 3291
derby/node_modules/racer/lib/Model/LocalDoc.js 3069
derby/node_modules/derby-templates/lib/contexts.js 2629
browserify/node_modules/punycode/punycode.js 2605
derby/node_modules/racer/lib/util.js 2378
derby/node_modules/tracks/vendor/express/utils.js 2333
derby/node_modules/tracks/lib/router.js 2282
derby/node_modules/racer/lib/Model/collections.js 2221
browserify/node_modules/path-browserify/index.js 2156
derby/node_modules/racer/node_modules/arraydiff/index.js 1795
derby/node_modules/racer/node_modules/uuid/uuid.js 1785
derby/lib/documentListeners.js 1710
derby/node_modules/html-util/lib/parse.js 1533
derby/lib/Dom.js 1522
derby/node_modules/derby-templates/lib/operatorFns.js 1493
derby/node_modules/html-util/lib/index.js 1359
browserify/node_modules/process/browser.js 1246
derby/node_modules/racer/node_modules/deep-is/index.js 1076
derby/node_modules/derby-templates/node_modules/serialize-object/index.js 1055
derby/node_modules/derby-parsing/lib/markup.js 955
browserify/node_modules/querystring-es3/encode.js 935
derby/lib/textDiff.js 903
derby/node_modules/racer/lib/Model/paths.js 770
derby/lib/DerbyStandalone.js 751
derby/node_modules/tracks/lib/browser.js 682
derby/lib/Controller.js 662
browserify/node_modules/querystring-es3/decode.js 654
derby/node_modules/racer/lib/Model/Model.js 519
derby/node_modules/tracks/vendor/express/router/route.js 429
derby/node_modules/racer/lib/Model/defaultFns.js 385
/home/zag2art/work/derby-standalone/index.js 362
derby/node_modules/racer/node_modules/uuid/rng-browser.js 313
derby/node_modules/racer/lib/Model/Doc.js 295
derby/node_modules/racer/lib/Model/ModelStandalone.js 215
derby/node_modules/derby-templates/index.js 186
browserify/node_modules/querystring-es3/index.js 115

Including 20kb of nodejs shims:

file size
browserify/node_modules/url/url.js 7952
browserify/node_modules/events/events.js 3896
browserify/node_modules/punycode/punycode.js 2605
browserify/node_modules/path-browserify/index.js 2156
browserify/node_modules/process/browser.js 1246
browserify/node_modules/querystring-es3/encode.js 935
browserify/node_modules/querystring-es3/decode.js 654
browserify/node_modules/querystring-es3/index.js 115

The fattest: derby-esprima, saddle, derby-templates and derby-parsing. Most of them because minifyify can't reduce names like DynamicViewInstance.prototype.serialize.

Maybe we can make something to decrease final size? Or it's OK?

@josephg
Copy link
Member

josephg commented Oct 13, 2014

👍 thanks.

At the office hours last week we were talking about making a compiler tool for derby-standalone so you can compile your templates statically. Most of the size (and a lot of time!) comes from compiling templates - which may as well happen before you serve the page.

@minicuper
Copy link
Author

derby-parsing (including esprima) is just 47kb. It is big but not most of the size. derby-template and saddle anyway will be necessary.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants