Is this build configuration possible with Durandal and the tools available?

169 views
Skip to first unread message

mlde...@gmail.com

unread,
Jan 5, 2015, 3:49:30 PM1/5/15
to duran...@googlegroups.com
I'm still trying to grasp all the different JS build tools and how they work. (grunt, gulp, mimosa, weyland/almond, etc)
For my application, an ideal deployment would look like this:

css : 1 minified file for all css ( can do that with .Net bundle)
3rd party scripts : 1 minified file.  Includes all 3rd party js like jquery, knockout.  It excludes core durandal.    (can do that with .Net bundle.)
durnadal : 1 minified file of all durandal core js including plugins and transitions.
app code common:  1 minified file of all custom services including logger, dataservice, utilities, etc
app code views and viewmodels: keep these all individual files to be requested when needed.  Minify the viewmodels.

Is this possible, and if so, which of the tools can get me there?

Thanks


James Reategui

unread,
Jan 7, 2015, 2:45:20 PM1/7/15
to duran...@googlegroups.com
I would recommend that you look at the gulp-durandal project : https://www.npmjs.com/package/gulp-durandal
You'll need to install nodejs on your dev machine.

Once you have that working by default the last 3 items you mention would be bundled into one file - which for us has worked really well even with a huge application. If you really want to split it up i think you could start by trying to modify gulp-duranal or maybe via configuration.

mlde...@gmail.com

unread,
Jan 7, 2015, 3:26:20 PM1/7/15
to duran...@googlegroups.com
Thanks, I'll take a look at that project.
I'm trying to NOT have all the durandal and app code into 1 file though.  For 2 reasons:

1) When its all bundled together, startup time is longer since download time is longer
2) The user will be downloading many views/viewmodels that they may not even access.  Would prefer those to be "on-demand".

Both of those reasons are amplified when using mobile (slower pipe and devices with less memory capacity)
Also, this gives me the flexibility to upgrade the application in parts. 

On Monday, January 5, 2015 3:49:30 PM UTC-5, mlde...@gmail.com wrote:

James Reategui

unread,
Jan 7, 2015, 10:50:05 PM1/7/15
to duran...@googlegroups.com
I thought the same thing (although we dont have a mobile version yet), but after we tried it with the default config, the final minified version was 700kb (w/o js map) and then with server gzip compression it came down to around 300 kb. We tried it with our users (its an LOB app) and the load time was more than quick enough for people. 
So, my 2 cents would be for you to just give it a try with the defaults; maybe it's good enough.

Robert Greyling

unread,
Jan 8, 2015, 3:53:24 AM1/8/15
to mlde...@gmail.com, duran...@googlegroups.com
Hi there mldev,

Take a look this thread where George P is experimenting using require.js bundles to do exactly what you're talking about: https://groups.google.com/forum/#!topic/durandaljs/iN_UpDS7kPo

I'm currently experimenting with this using gulp-durandal and will feed back there on my progress soon. If you'd like to give that a go, let us know how you get on.

Hope that helps,
Rob G


--
You received this message because you are subscribed to the Google Groups "DurandalJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to durandaljs+...@googlegroups.com.
Visit this group at http://groups.google.com/group/durandaljs.
To view this discussion on the web visit https://groups.google.com/d/msgid/durandaljs/e80ddcf4-8d05-4e12-96ee-ceb0c02f475a%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

James Reategui

unread,
Apr 8, 2015, 7:06:25 PM4/8/15
to duran...@googlegroups.com
Hi,
So I'm going to have to swallow my words... Our web app has grown a lot, and now I need to look into seperating the gulped (ie. minified files) for production into the different modules. Our initial load time is too long. 

Were you able to accomplish this and if so any recomendations or pointers you could send me to?

Robert Greyling

unread,
Apr 9, 2015, 4:38:51 PM4/9/15
to James Reategui, duran...@googlegroups.com
That's a tough one James - I was looking into it a fair bit and although I got it to work, the timings on loading the site didn't change that drastically when I took into account the increase in network requests caused by it. I basicaly reverted back to single JS payload and looked for ways to decrease that payload in the end and have actually begun the port work over to Aurelia now so I don't see me going back to it any time soon. Still waiting to see what the bundling story is with Aurelia but I suspect it will be quite configurable so will have a number of options.

Hope you solve it.
Rob

--
You received this message because you are subscribed to the Google Groups "DurandalJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to durandaljs+...@googlegroups.com.
Visit this group at http://groups.google.com/group/durandaljs.

James Reategui

unread,
Apr 10, 2015, 9:10:33 AM4/10/15
to duran...@googlegroups.com, ja...@materia.pe
Hmm, I think I'm not going to spend time on that then - seems like a rat chase... Just wait until we see what the story is with Aurelia for bundling and then maybe speed up our switch.
Thanks for the feedback.
Reply all
Reply to author
Forward
0 new messages