In checking my production app, I noticed that the $ function exists in the econsole, and there are references to Blaze in various places in the JS bundle.
How can I check for these, and make sure they are not being included in my project? Is there some kind of tool that can graph out the dependency tree?
Adding these kinds of tools to Meteor as first class citizens (especially with the dynamic module feature) would add a lot of value to the Meteor platform
There is no way to view the dependency tree so far as I know. The best you can do is meteor list. I’ve got a JQuery dependency that won’t go away no matter what I do. If you post your list of Meteor packages here, I’m sure Blaze would be easy enough to root out.
I removed every package except meteor-base@1.1.0-rc.7 and jquery remained. Then I remove that, and versions ended up empty. Then I put it back, and jquery came back.
Then I added back everything, and removed meteor-base, and jquery remained.
Some core Meteor packages still require jQuery and that’s why it’s in the builds. They are looking at ways to fully remove it as a requirement, but they aren’t there yet.
I know I heard @sashko talking about this process in a YouTube video, I just don’t remember what one, but likely yes meteor-base or something it requires.
If you are using (or when you will use) meteor-1.,5 then the package bundle-visualizer is super useful to graph packages in use, their sizes (and the whole size of the program in production) and their dependencies.
It helped us to reduce about a 20% the bundle size, removing, replacing and optimizing some packages.
Btw, I wonder if Google’s Closure Compiler could be used to further reduce bundle size. Maybe it could be as simple as taking the compiled .js file from Meteor and run it through it? Seems like it’s smarter than a plain minifier.
I installed that - but in a brief look honestly wasn’t sure what it all meant. I’ll have to find some readme or guide somewhere. It’d be nice if we could get a version of bundle-visualizer that didn’t show all the server modules.