Deploying generated files from Gulp with msbuild and webdeploy

We recently started using Gulp for our front end build process and that’s been enormously helpful in consolidating how and where our front end technologies were generating output. This led to us having a bunch of extra files that were now generated at build time and didn’t actually exist in the csproj. Unfortunately, we were at a loss as to deploy these, and what’s worse, we had 3 different ways that we deploy our web applications. We needed a solution that works with

  • Web applications deployed to IIS via webdeploy
  • Web applications deployed to Azure Web Sites via webdeploy
  • Web applications deployed to Azure Web Roles via package

It’s a shame that there isn’t a consistent way of listing all the files to deploy, but, we are able to get all the files deployed that we need deployed. Ultimately, there were 2 customizations needed to be made for the final solution.

[Continue Reading...]

0 Responses to Deploying generated files from Gulp with msbuild and webdeploy

BundleConfig Considered Harmful

Web apps are getting really large and complex and we need to have plans in place to handle the problems associated with apps of that size. We need to anticipate problems to make sure we don’t overlook something that will come back and bite us when our apps start to grow. One of the most overlooked parts of web apps is how our code is organized and delivered to browsers. This covers everything from what a file looks like, to what the script includes look like, and how this differs from dev to production. Microsoft developers (myself included) tend to be setup for failure in regards to this topic, because of the default project template that we get in ASP.NET. In these templates, Microsoft took a very odd and flawed approach to organization, bundling, minification, etc.

[Continue Reading...]

0 Responses to BundleConfig Considered Harmful

Building an efficient subscription for knockout computed observables

Subscribing to a ko.computed isn’t the same thing as subscribing to a ko.observable. Ryan Niemeyer has written on the topic and I’ll admit, it took me a while to wrap my head around it. I’ll go over the problem and how we bypass it, but the end result is really handy and reusable: a new ‘efficientlySubscribe’ method that is a part of all ko.computed’s.

[Continue Reading...]

3 Responses to Building an efficient subscription for knockout computed observables

Extending Ryan Niemeyer’s protectedComputed

Ryan Niemeyer has a great article on the protectedComputed that he came up with, but I needed a little more functionality out of it. I ended up adding a few things and wanted to get it online for public consumption if anyone found the new functionality useful, so here it is!

[Continue Reading...]

0 Responses to Extending Ryan Niemeyer’s protectedComputed

Changing an observableArray in 1 notification

I was just reading Ryan Niemeyer’s 2nd post about performance in knockout.js and I saw arrayPushAll. We ended up needing to use it for reasons other than performance, but performance does benefit greatly from its use.

We just had a problem (4/6/2012) where we were adding an array of items, one at a time in a loop, to an observable array. We wanted that notification of the array changing to trigger an ajax request, but we couldn’t because we were getting {n} notifications and we only wanted one request.

Initially I had to wire up the event in an odd way and that approach didn’t feel right since it seemed that we should be able to use the arrays changed notification. I should have thought to look up if ko had a slice or an equivalent, but I didn’t at the time. Now we just use arrayPushAll and this gives us a single notification because its a single change to the array. This is a much better solution and the added performance is great too!

0 Responses to Changing an observableArray in 1 notification