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

Lazy-loading modules? #39

Closed
kokujin opened this issue Apr 24, 2014 · 1 comment
Closed

Lazy-loading modules? #39

kokujin opened this issue Apr 24, 2014 · 1 comment

Comments

@kokujin
Copy link

kokujin commented Apr 24, 2014

I have been using AMD modules and curl.js for a while, one great argument for this setup is that I can load a module depending on user-interaction( mobile devices especially). This has been the main reason why I have not transited to the use of webmake.

Is there some way to simulate lazy-loading cleaning using webmake?

Thanks

@medikoo
Copy link
Owner

medikoo commented Apr 24, 2014

@kokujin Currently Webmake doesn't provide Lazy-loading, but I think it's unlikely you really need that. It makes a difference only in really large codebases, where you want to optionally download 50-100kB, and that's already a lot. Usually quite complex app in total, when minified and gzipped doesn't have much more than 100kB.

See e.g. website I worked on lately http://elomas.gob.ar/ it's complex registration website. It's bundle of over 700 modules (!), in minified form it's 1MB file, but when gzipped it goes down to 200kB, and it initializes and loads pretty fast. Additionally due to good caching setup, every further load is near instant as application file is already cached.
So lack of lazy loading is not that big issue, and I wouldn't address it, unless it's really a visible problem. See also benchmark comparing speed of AMD style loading with generation of the CJS bundle on the fly: https://github.com/medikoo/cjs-vs-amd-benchmark#results

Still, I consider this a valid issue, and one of the most important thing that's missing in Webmake, there's already open issue for that: #7 so I'm closing it as a duplicate.

@medikoo medikoo closed this as completed Apr 24, 2014
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