kendo-labs / kendo-bootstrapper

GNU General Public License v3.0
49 stars 20 forks source link

How do library files work? #21

Closed toddanglin closed 11 years ago

toddanglin commented 11 years ago

When you create a new project, there a number of "library" files shown in your project. Are these files that have been added to the project by default? Or are they only added to the project after you select the checkbox next to the file name?

If they are added by default, is there any reason NOT to delete them? For instance, I know I only want one Kendo UI theme (not all of them). Should I delete all of the files I don't want? Or will that be handled automatically by the build steps?

Finally, if I delete a Library file, I assume that only deletes it from the currently selected project. If I want to re-add it, where do I find it?

mishoo commented 11 years ago

The files in a new project come partially from the bootstrapper itself (the default project template) or copied from the Kendo UI sources that you provide initially. Yes, every file shown in the right side belongs to the project. Perhaps the choice of naming "project files" and "library files" is an unfortunate one because it makes one believe that "library files" are not part of the project; they are, but they're not editable nor are they subject to compilation/minification.

If you delete them they are removed from the disk too. There is no way to get them back unless you have them somewhere (for example files are never removed from the original Kendo UI source that you provide; they are simply copied into each new project).

If you'd like to keep them around but not see them in the list, tick the respective checkboxes and Operate → Unregister files. In this case they remain in the project folder but are no longer managed by the Bootstrapper.

toddanglin commented 11 years ago

Will the Bootstrapper automatically reference/load all files listed under "Project" and "Library" files, then?

In other words, if you do not want a file to be loaded on your page, should you explicitly delete it (or deregister it) from the Bootstrapper?

mishoo commented 11 years ago

The files that are loaded in a page are determined via dependencies. There's an icon that looks like a link to the right of each file (the second icon in the group) which opens the dependencies of that file. If you open the deps of "index.html" for example you'll see it depends on kendo.default.css.min. If you uncheck that file and select i.e. kendo.black.min.css then it'll load the black theme. If you select both, it'll load both (not sure that's a good idea ;-).

Also, you can see in the deps of index.html that it selects app.js but not for instance kendo.web.min.js — that still works because the latter is a dependency listed under app.js.

So the answer is "no" — the bootstrapper won't automatically load all files. If a file is not listed as a dependency of the HTML page, or of some file that the HTML page depends upon (perhaps indirectly) then it's not loaded.

Hope this clarifies..? Please let me know if you have any suggestions to improve this.

toddanglin commented 11 years ago

Got it! That helps a lot.

Perhaps as an enhancement we could visually indicate which of the listed files will be loaded (because they're part of the dependency tree) and which will not. A visual distinction would help quickly reveal if a file you do (or don't) want loaded on your page is properly configured (without being forced to manually examine a bunch of dependencies across different files).

I'll create an enhancement issue for this and close this issue. Thanks for the explanations.