Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Hot Towel: Why is Durandal and Require in the App folder rather than the Script folder?

This is coming from the idea of 3rd party libraries being in Script to discourage developers from customizing them. It would encourage them to write extensions to make it easier to take in a new version of either library.

like image 894
Matthew Ronemous Avatar asked Mar 20 '13 22:03

Matthew Ronemous


1 Answers

You make a good point about other developers mistaking the durandal libraries for customizable files.

But, you are not required to keep durandal anywhere. The folder structure can be whatever your heart desires. Because durandal does not impose any folder structure.. it only has a recommeneded default setup. There are benifits to following its pattern.

By keeping durandal as part of your application root folder. It keeps all your amd javascript files together in one root folder. This way when you run the durandal optimizer it can scan every subfolder to compress/minify/uglify all your html/css/js into 1 file. This is a nice benifit because its a 1 click build of your entire application.

Also, its a nice seperation because its a good idea to keep your 3rd party non-amd JavaScript libraries in a separate folder structure this way if you use a bundler to compress all your third party libraries into a separate file. The browser can cache your application separate from the third-party libraries. Because the third-party libraries don't change very often, whereas your application will probably be changing frequently.

But durandal's conventions are all completely configurable and you can put durandal in any location you like.

like image 140
Evan Larsen Avatar answered Sep 24 '22 16:09

Evan Larsen