Is there any way of specifying an order to the automatically loaded css or js files loaded by Meteor.
Searched the docs and can't find anything.
I ask because I'm at the playing about stage, and am trying to use Twitter Bootstrap with Meteor. In the examples that come with Bootstrap the base bootstrap.css is always loaded before the bootstrap-responsive.css.
Any ideas?
This question has since been answered in http://docs.meteor.com/
The JavaScript and CSS files in an application are loaded according to
these rules:
Files in the lib directory at the root of your application are loaded
first.
Files that match main.* are loaded after everything else.
Files in subdirectories are loaded before files in parent directories,
so that files in the deepest subdirectory are loaded first (after
lib), and files in the root directory are loaded last (other than
main.*).
Within a directory, files are loaded in alphabetical order by
filename.
These rules stack, so that within lib, for example, files are still
loaded in alphabetical order; and if there are multiple files named
main.js, the ones in subdirectories are loaded earlier.
You are correct, user files are loaded depth first, alphabetically otherwise.
https://guide.meteor.com/structure.html#load-order
lib/ directories and main.* files are special cases.
Packages can also alter load order, but I don't think any of the default packages do that.
Running on windows, the other solutions didn't work for me so I just put all the js files into 1 folder and just number them. Meteor loads them in alphabetical order.
Related
I always had a question about the problem of the folder of some site being very heavy, for example, let's assume that I'm using something similar to Bootstrap, in which case I would have several folders of Css/Js/Ajax/Vendor files, etc., but the HTML/PHP page would only import the css folder instead of using the others, having the other folders in the file would influence the loading of the site?
NO, a bulky project folder would not cause your website to load slower.
The way you perceive directories is quite different from the way they actually work. Directories are actually just pointers to where files are stored. The number of directories or files doesn't affect load speed, the server would only render what it needs by querying file paths (an HTML file, image, etc).
In another SO post here, the second option is to write G.this; in the first "top" file in order to create a namespace.
And then write "use strict" on the top of every other js file.
Is that all the content of such a file? and if so, where the "top" file should be located (server, client, both) and what name? as Meteor loads files based on their paths. Thanks
One of ways to create a global namespace in Meteor (as suggested in the SO answer) is to have a file where a global alias to this is declared, such as:
G = this;
This file should, ideally, be loaded first and on both client and server.
To achieve this, according to the doc:
Files within lib/ directory are loaded first (after loading template files on client).
Meteor will load any file outside client/ or server/ directories on both client and server.
Where no other rules may apply, alphabetical ordering of the paths is used to determine load order of the files.
So, in keeping with these rules I would save the file as app.js (or any similar name that would come first alphabetically). Then I would place this file at the root of lib/ folder so that it gets loaded both on client and server.
So, the path to app.js would be : ./your_meteor_project_root/lib/app.js
I used yiibooster I have changed many styles under /assets/73dd67/bootstrap/css/bootstrap-min.css
But when I changed my webapp name, the CSS files not found, I mean the folder '73dd67' changed to '253ft6'.
The same case when I moved my webapp to another computer. The '73dd67' folder changed again in another name.
What can I do so I can keep the CSS formatting?
Thanks for your answers
Asset folder have only cached files. You made changes in cached file not actual file.
So find the actual location of bootstrap-min.css and do your changes. After doing changes, just remove all cache folders inside the asset folder. Then you can see the output in next refresh itself.
Hope you are using yIIbooster as extension. So do your changes in extension css/bootstrap-min.css file.
I added the OCMock static library in Xcode with some header files.
I'm not sure what's changed since I added it but the file now appears twice in the Project Navigator - once at the top level and once under the usr/lib folders.
How do I get rid of the second (highlighted) listing?
It looks like you added OCMock's whole "usr" folder via a folder reference, most likely by accident.
You have three choices for a solution:
1)
Remove the "usr" folder from your list of files & folders in your project, and re-add just the "include" folder via folder reference (I'm presuming you want to use the folder reference so you can pick up the latest header files that are in there?).
2)
Add the required header files to your project directly (i.e. not using the folder reference).
3)
Or get rid of the first "libOCMock.a" library and just rely on the folder reference to pick up the static library living under the "usr" hierarchy.
I Downloaded the http://ftp.drupal.org/files/projects/nl-6.x-1.5.tar.gz file from Drupal Translations page. The readme file says to "Copy (merge) the content of this translation package into your Drupal installation root directory".
If i look at the package it has a few text files and a modules, profiles and themes folders. If I copy those in the root (so MAMP/sitename/) it overwrites a bunch of files (there are already modules and themes folders there ...) and whatever page I load on the site gives fatal errors.
Is it possible that on MAMP / Mac Unarchiver doesn't do copy/merge but actually Replaces the old modules folder with this new one?
What should happen, is that the relevant .po files are places in the folders where they should be. If things go wrong, what you'll end up having, would be a folder with all the .po's, in a nested set of folders.
In theory I guess it's possible to overwrite folders etc, but you would be opted to allow that first.
So you shouldn't be afraid that your entire Drupal install will be overwritten. You can just try to do the unpack and see what happens. Worst case, is that you'll need to place the files in the correct folders yourself.
I can't speak to Unarchiver, but if you're overwriting files then something's not behaving correctly. All the translation packs really do is add some additional files and folders (e.g. /modules/user/tranlsations/modules-user.nl.po to /modules/user).
My guess is that your whole /modules/user directory (along with all the others) is being replaced, rather than added to.
Have you tried merging the folders in Terminal? You should be able to merge these folders directly from tar. Comment back if you would like more detailed instructions on how to do that.