When using view.yml config files to use Javascript libraries, the order in which they are added to a HTML document seems arbitrary.
Example
App view.yml
------------
default:
javascripts: [/sf/js/prototype/prototype, /sf/js/prototype/effects, behavior, my_app_library]
Module view.yml
---------------
all:
javascripts: [my_module_library, my_action_library]
... results in ...
<script type="text/javascript" src="/js/my_module_library.js"></script>
<script type="text/javascript" src="/js/my_action_library.js"></script>
<script type="text/javascript" src="/js/behavior.js"></script>
<script type="text/javascript" src="/js/my_app_library.js"></script>
<script type="text/javascript" src="/sf/js/prototype/prototype.js"></script>
<script type="text/javascript" src="/sf/js/prototype/effects.js"></script>
This is a significant problem if (as in my case) you have code in my_module_library.js which uses prototype.js or behavior.js - the code in my_module_library.js will fail.
Expected results
Javascript libraries should be included in exactly the order they are written in the configuration file. This is especially important when Javascript files depend on other ones (for example, my_module_library.js may use functionallity from my_app_library.js. Scripts from the app's view.yml should be included first, and then ones from the module/action configuration.
<script type="text/javascript" src="/sf/js/prototype/prototype.js"></script>
<script type="text/javascript" src="/sf/js/prototype/effects.js"></script>
<script type="text/javascript" src="/js/behavior.js"></script>
<script type="text/javascript" src="/js/my_app_library.js"></script>
<script type="text/javascript" src="/js/my_module_library.js"></script>
<script type="text/javascript" src="/js/my_action_library.js"></script>
I originally reported this on the forums, here: http://www.symfony-project.com/forum/index.php/t/987/