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 module(s) size #240

Open
yamsellem opened this issue Apr 30, 2016 · 2 comments
Open

Decrease module(s) size #240

yamsellem opened this issue Apr 30, 2016 · 2 comments

Comments

@yamsellem
Copy link

yamsellem commented Apr 30, 2016

I didn't know where to post this (which is part of the point I'm trying to make here), so I just posted it in what I think is the most important Ampersand module.

Using webpack or browserify is useful (and temporary) but it have one major drawback: bundle size.
Thus, Ampersand documentation does not even give numbers about the size of each ampersand module (thing we are accustomed to with js libraries).

Backbone weights 7.6kb, packed and gzipped.
Using ampersand-model and ampersand-view with browserify (which made smaller bundle, it seems) give 100kb, packed and gzipped.

10 times the size for a modular approach is a big price to pay (collection and router have to be added for a proper comparison). Can something be done about this?

@orenmizr
Copy link

the total bundle size sounds weird but it's been a awhile since i used ampersand for a project. only model + states = 100kb?
also,
backbone relies on

  • underscore for functional programming and helpers
  • jquery for dom manipulations

these also should be weighted.

@pgilad
Copy link
Member

pgilad commented Apr 30, 2016

Can you make a sample repo with the relevant browserify/webpack config?

I would make a:

  1. Empty basic html page
  2. Basic js file with ampersand-state, ampersand-model, ampersand-view and ampersand-router as deps

Lets try to analyze the dependency graph using any bundle modules analyzer and see what impacts the weight the most

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

3 participants