I was thinking about how I would load my dependencies, whether I would have to steal everything in one go at the bottom of my view, or can I make multiple steals across each of the partial views (these might be shared across multiple pages) and they would be aggregated together?
What would be the best practise in this case and is the second option even possible? The first option seems much neater, but perhaps less flexible? Is there any other way I could tackle this?
First of all, welcome to the future of web development ;)...
So I'm pretty familiar with MS MVC, are you just using steal or are you using controllers and views too? If you are, I would bring everything in at once, but it your relying on MVC to render all your views, then bring them in with each partial. The tricky part with the last option is I don't think you'll be able to leverage the build and compression process since JMVC runs through your app like a browser would looking for dependencies at build time.
Thanks for the quick response. I'm using JSMVC controllers and views too, but I was planning on also using ASP.NET views and partials to display most of the page content, and only use views from JSMVC to display content generated from an AJAX request. Does that make sense?
So using the method I've just mentioned, I'd probably have to do the steal all at once in order to still be able to use the build and compression process?
Ya. The great thing about the 3.1 steal ( if your using 3.1 ) is that you can create packages that steal can use. These packages might be a another page and then steal will bring those down when it needs. This is not documented that much yet but will be soon and I'm curious how it would work with MVC too. There is hope though to make it not all have to come down at once ;)....
Could you give me a quick example on how to create packages and steal multiple packages at once? Or could you point me in the right direction? I've had a good look about the documentation and the internet and I can't find anything.
Right now steal.js has what it needs to support packages, but package support hasn't been implemented in steal/build. To manually do this, you could create a second app, steal the scripts you want to be in your package, build it, then in your main app (or apps) to include the package...
We set packaged: true to tell steal that when we compress, load this file, but don't add it to the production.js for this app. Basically, this can work right now, but there will soon be support for doing all this automatically. Adding this feature is at the top of the priority list for the 3.2 release.
So how is packages implementation different from the old one? Please take a look at Building With Shared Dependencies section. Which doesn't work in the latest jmvc code. Should we steal all shared plugins as packages now?
Leave a comment on Brian_Moschel's reply
Change topic type
Link this topic
Provide the permalink of a topic that is related to this topic