It took me some time to focus on this thread since I was busy on other
aspects of our application.
Your proposed "modules" is a good starting point, but let me add some
other points that may help:
1) We've added postfixes to our controller and view js files:
e.g our FooBar controller is in /myapp/controllers/
foobarController.js
and our FooBar view is in /myapp/views/foobarView.js
* However we can refactor our project to omit all postfixes.
2) I'm not clarified about the activation point of script loading.
Is it just the "event.c().m().v()" which should be able to load on
demand? since this is the single point of control of framework on
object lifecycles!
AND
What about $.$( "#objId" )? Does it just return already instantiated
objects? or tries to load on demand and instantiate?
On Jul 19, 6:10 pm, chris thatcher <
thatcher.christop...@gmail.com>
wrote:
> Sounds good, I can work on it this week. Lazy loading of scripts can help
> large application but a couple things that help in general are
> concatination and minification of scripts, as well as ensuring the server is
> gzip enabled if the client requests it(all modern browsers are gzip
> enabled). most 500Kb apps can be reduced to about 64Kb with minification
> and concatination, and with gzip you only have about 10Kb of wire transfer
> for the entire app with one http call and client caching means the app might
> load fastest with a single javascript file.
>
> That said, I do believe lazy load scales to substantially larger apps (you
> should still have abuild process which publishes minified javascript files
> when possible and always ensure server gzip is enabled still).
>
> One question has to do with the conventions that will be applied to discover
> lazy loaded files. Basically i expect this will work by basically mapping
> MyApp.Controllers.FooBar to /myapp/controllers/foobar.js with an optional
> prefix set in environments.js, for example :
>
> modules:{
> path:'/scripts/124-3596w/',
> secure: true,
> server: 'auto',
>
> }
>
> so that the app source will finally be resolved as
>
> https://server:port/scripts/124-3596w/myapp/controllers/foobar.js
>
> Let me know if you have additional requirements.
>
> The question of authorized access requires a server-side technology to
> enforce something like HTTP BASIC AUTH for a given path likehttps://server:port/scripts/124-3596w/myapp/controllers/admin.js.