Packages API: ability to load certain JavaScript files before others #181

bminer opened this Issue Jun 12, 2012 · 10 comments


None yet
9 participants

bminer commented Jun 12, 2012

For example, view templates should be loaded before custom application logic.

Not sure how this could be implemented...

This would also resolve hacks like these:


TomWij commented Jun 12, 2012

Note that this is not only necessary for the packages but also for the files in Meteor itself, it would be much better if this happened automatically through some automated parsing mechanism than having to be done by each developer which might result in annoying situations (Dependency chain: X --> Y --> Z --> X)...


zhangcheng commented Jun 18, 2012

Will bringing RequireJS solve this problem?


avital commented Sep 19, 2012

I believe some people resort to alphabetical ordering of filenames to get the right results. This is definitely a problem.


I believe some people resort to alphabetical ordering of filenames to get the right results. This is definitely a problem.

I used to do this when i first try to include third party features on a meteor project.


mpj commented Sep 20, 2012

@avital That is how I did it, yeah. It actually worked pretty well, but it's very hacky and doesn't allow for lazy loading stuff.

buguibu commented Nov 29, 2012

@mpj "lazy loading stuff" that's what i try for minify the web as much as possible, but maybe because i still dont understand how Meteor works.

I have tried to load a JS file with $.get("file.js"); but is received in the client as a Meteor page with all the packages.


gschmidt commented Dec 4, 2012

This is now being worked on as part of the new package system interface (by giving developers explicit control over the ordering of files in their project, when they want it.)


bminer commented Mar 8, 2013

@gschmidt - That's great news. Many people are having issues with this when switching to the Blade view engine. Their views get loaded after their application code, which causes statements like to complain... since has not yet been created.


bminer commented May 3, 2013

@gschmidt - Any updates on this? It's been a while, and I wanted to check in.

bminer referenced this issue in bminer/node-blade May 3, 2013


Showing current user in Meteor #173


glasser commented Apr 18, 2014

The specific use case requested here was added in f36abc9

glasser closed this Apr 18, 2014

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