Load files ordering

In this little post we’ll see how load files ordering works in an Meteor application.

In fact the rules are quite simple:

Templates (.html files) are loaded before anything.

Files in the lib directory are loaded then.

Files in deeper directories are loaded before.

Ordering for files in the same directory is alphabetical.

Main. * Files are loaded last.

Here’s an example:

l-o6MItz_28wmT_ZskqzA8A4H8_YH3Uju0d_kPCDKjq4AXzF9IXLe0yvCBJ12Ildv90OV7CmOkfIBh0Q8ZlIfpAN1UaZA6VfcUkzPXvVSkTvPvfJapudZwuEjUUU1lXEzrAnzdE

Because lib has a higher precedence, everything inside, will be loaded first, however, following the same rules mentioned above. As the /lib/1/2 is the deepest directory, files there are read before and a.js and z.js are loaded following the alphabetical order.

Why is this important? Because if you do not remember that, you could for example, trying to use a function that has not been defined, due to the fact that the file where it is, has not been loaded yet.

4NpHJhl4iL6Me9oiaqpE15O9rer4gppBgzu_IP2FPCNpOYQPc4zfYYfNd7LpQAeaiuHe3SybROFYSxcMvAr9un2Nr-leoNhS1W2y3EDUxzl3fefcwS3Z7iS_SRT_H9B45soT7ho

Conclusion

Although simple, is good to know details defined by the platform, to avoid headaches with little mistakes that in the end of day, end up taking much of our time.

Allan de Queiroz

Allan de Queiroz
London based software engineer

XServer forward from Linux text mode for Headless purposes.

Hello, this post is about XServer forward from Linux text mode, **not ssh forward, anything related to VNC** or things like that.Recently...… Continue reading