Vaadin7 alpha3 @JavaScript on Root does not reload on refresh

I have been playing around with the alpha 3 release and I have to say that I am enjoying the new JavaScript integration, though I do seem to have run into a bit of an issue.

In my scenario I have jquery.js attached at the root, since it is a common dependency for many of the third party JavaScript components I am testing out.

public class MyAppRoot extends Root {//Root Code Here}

//define another class dependent on jquery
@JavaScript({"excanvas.js", "jquery.flot.js", "jquery.colorhelpers.js","jquery.flot.stack.js","flot_connector.js"})
public class FlotStack extends AbstractJavaScriptComponent {
//do stacked chart stuff here

Now when I run the application on my local Tomcat instance everything works fine, except if I add the command to preserve the Root.


With that command in place the root is indeed preserved on browser refresh; but any JavaScript associated at that level (jQuery in this case) is not loaded, and dependent components throw the following error:

The user has to terminate the session (close the browser) and open new one before the JS libraries will load again, basically nullifying the usefulness of the preserve root.

I have tried to push the JavaScript association to a lower component, for instance the first view added to the application navigator.

AppData.getNavigator().addView(MainView.NAME, new MainView());
//MainView contains @JavaScript({"jquery-1.8.0.js"} instead of MyAppRoot  

However there seems to be a build order issue, because all the dependent components attached to that view throw the same error.

In all cases Firebug shows the jquery.js file as being available, and I get this same results in IE, Firefox, and Chrome.

Do I need to choose between centralized JS libraries and preserving root, or am I missing something? It seems like the JS should be available regardless, so maybe it is a build order I am missing?

Any thoughts would be greatly appreciated.