<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/xsl" href="https://shazwazza.com/rss/xslt"?>
<rss xmlns:a10="http://www.w3.org/2005/Atom" version="2.0">
  <channel>
    <title>Shazwazza</title>
    <link>https://shazwazza.com/</link>
    <description>My blog which is pretty much just all about coding</description>
    <generator>Articulate, blogging built on Umbraco</generator>
    <image>
      <url>/media/0libq25y/frog.png?rmode=max&amp;v=1da0e911f4e6890</url>
      <title>Shazwazza</title>
      <link>https://shazwazza.com/</link>
    </image>
    <item>
      <guid isPermaLink="false">1310</guid>
      <link>https://shazwazza.com/post/smidge-plus-nuglify-bundling-minification-and-source-maps/</link>
      <category>Web Development</category>
      <title>Smidge + Nuglify bundling, minification and source maps</title>
      <description>&lt;p&gt;Smidge &lt;strong&gt;&lt;a rel="noopener noreferrer" href="https://github.com/Shazwazza/Smidge/releases/tag/v2.0.0-rtm" target="_blank"&gt;2.0.0 RTM&lt;/a&gt;&lt;/strong&gt; is finally here!&lt;/p&gt;
&lt;p&gt;What is Smidge? Smidge is a lightweight &lt;u&gt;runtime &lt;/u&gt;bundling library (&lt;em&gt;CSS/JavaScript file minification, combination, compression&lt;/em&gt;) for ASP.NET Core -  &lt;a rel="noopener noreferrer" href="/post/smidge-20-alpha-is-out/" target="_blank"&gt;&lt;em&gt;Here’s some more background info on Smidge&lt;/em&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;There’s plenty of great &lt;a rel="noopener noreferrer" href="https://github.com/Shazwazza/Smidge/milestone/5" target="_blank"&gt;new features in the version 2.0.0&lt;/a&gt; , but in this post I’ll just highlight a couple of fun ones….&lt;/p&gt;
&lt;h2&gt;Nuglify and source maps&lt;/h2&gt;
&lt;p&gt;&lt;a rel="noopener noreferrer" href="https://github.com/xoofx/NUglify" target="_blank"&gt;Nuglify&lt;/a&gt; if an ASP.NET Core port of the old &lt;a rel="noopener noreferrer" href="http://ajaxmin.codeplex.com/" target="_blank"&gt;AjaxMin&lt;/a&gt; library and this works very nicely with Smidge too. By default Smidge uses an updated version of &lt;a rel="noopener noreferrer" href="http://www.crockford.com/javascript/jsmin.html" target="_blank"&gt;JsMin&lt;/a&gt; that I maintain called &lt;a rel="noopener noreferrer" href="https://github.com/Shazwazza/JsMinSharp" target="_blank"&gt;JsMinSharp&lt;/a&gt; for it’s JavaScript minification engine. JsMin works fairly well, it’s primary feature is that it’s &lt;em&gt;fast &lt;/em&gt;because it doesn’t come with any bells and whistles and doesn’t produce a &lt;a rel="noopener noreferrer" href="https://en.wikipedia.org/wiki/Abstract_syntax_tree" target="_blank"&gt;Syntax Tree&lt;/a&gt;. Nuglify on the other hand does produce a Syntax Tree which gives it loads of control over how the minification is done so that it can produce much smaller files, has the ability to rename/reduce parts of the JS and to produce &lt;a rel="noopener noreferrer" href="https://www.html5rocks.com/en/tutorials/developertools/sourcemaps/" target="_blank"&gt;source maps&lt;/a&gt;. The downfall of all this control is that it becomes much slower but Smidge is smart enough to cache processed files on the server in a persistent state so it won’t re-process your files if it doesn’t need to.&lt;/p&gt;
&lt;p&gt;Here’s a quick benchmark of JsMin vs Nuglify to minify jQuery using the default options (and no source map). As you can see JsMin is substantially faster and is far better for memory but Nuglify can reduce the file size quite a lot more &lt;em&gt;(smaller Minified % is better)&lt;/em&gt;&lt;/p&gt;
&lt;table border="0" width="700" style="box-sizing: border-box; overflow: auto; margin-bottom: 16px; white-space: normal; word-spacing: 0px; margin-top: 0px; border-collapse: collapse; text-transform: none; border-spacing: 0px; orphans: 2; widows: 2; display: block; letter-spacing: normal; background-color: #ffffff; text-indent: 0px; font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px;"&gt;
&lt;thead&gt;
&lt;tr style="box-sizing: border-box; border-top: #cccccc 1px solid; background-color: #ffffff;"&gt;
&lt;th style="box-sizing: border-box; border: #dddddd 1px solid; padding: 6px 13px 6px 13px;"&gt;Method&lt;/th&gt;
&lt;th style="box-sizing: border-box; border: #dddddd 1px solid; padding: 6px 13px 6px 13px;"&gt;Median&lt;/th&gt;
&lt;th style="box-sizing: border-box; border: #dddddd 1px solid; padding: 6px 13px 6px 13px;"&gt;StdDev&lt;/th&gt;
&lt;th style="box-sizing: border-box; border: #dddddd 1px solid; padding: 6px 13px 6px 13px;"&gt;Scaled&lt;/th&gt;
&lt;th style="box-sizing: border-box; border: #dddddd 1px solid; padding: 6px 13px 6px 13px;"&gt;Scaled-SD&lt;/th&gt;
&lt;th style="box-sizing: border-box; border: #dddddd 1px solid; padding: 6px 13px 6px 13px;"&gt;Minified %&lt;/th&gt;
&lt;th style="box-sizing: border-box; border: #dddddd 1px solid; padding: 6px 13px 6px 13px;"&gt;Gen 0&lt;/th&gt;
&lt;th style="box-sizing: border-box; border: #dddddd 1px solid; padding: 6px 13px 6px 13px;"&gt;Gen 1&lt;/th&gt;
&lt;th style="box-sizing: border-box; border: #dddddd 1px solid; padding: 6px 13px 6px 13px;"&gt;Gen 2&lt;/th&gt;
&lt;th style="box-sizing: border-box; border: #dddddd 1px solid; padding: 6px 13px 6px 13px;"&gt;Bytes Allocated/Op&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr style="box-sizing: border-box; border-top: #cccccc 1px solid; background-color: #ffffff;"&gt;
&lt;td style="box-sizing: border-box; border: #dddddd 1px solid; padding: 6px 13px 6px 13px;"&gt;JsMin&lt;/td&gt;
&lt;td style="box-sizing: border-box; border: #dddddd 1px solid; padding: 6px 13px 6px 13px;"&gt;10.2008 ms&lt;/td&gt;
&lt;td style="box-sizing: border-box; border: #dddddd 1px solid; padding: 6px 13px 6px 13px;"&gt;0.3102 ms&lt;/td&gt;
&lt;td style="box-sizing: border-box; border: #dddddd 1px solid; padding: 6px 13px 6px 13px;"&gt;1.00&lt;/td&gt;
&lt;td style="box-sizing: border-box; border: #dddddd 1px solid; padding: 6px 13px 6px 13px;"&gt;0.00&lt;/td&gt;
&lt;td style="box-sizing: border-box; border: #dddddd 1px solid; padding: 6px 13px 6px 13px;"&gt;51.75%&lt;/td&gt;
&lt;td style="box-sizing: border-box; border: #dddddd 1px solid; padding: 6px 13px 6px 13px;"&gt;-&lt;/td&gt;
&lt;td style="box-sizing: border-box; border: #dddddd 1px solid; padding: 6px 13px 6px 13px;"&gt;-&lt;/td&gt;
&lt;td style="box-sizing: border-box; border: #dddddd 1px solid; padding: 6px 13px 6px 13px;"&gt;-&lt;/td&gt;
&lt;td style="box-sizing: border-box; border: #dddddd 1px solid; padding: 6px 13px 6px 13px;"&gt;155,624.67&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style="box-sizing: border-box; border-top: #cccccc 1px solid; background-color: #f8f8f8;"&gt;
&lt;td style="box-sizing: border-box; border: #dddddd 1px solid; padding: 6px 13px 6px 13px;"&gt;Nuglify&lt;/td&gt;
&lt;td style="box-sizing: border-box; border: #dddddd 1px solid; padding: 6px 13px 6px 13px;"&gt;69.0778 ms&lt;/td&gt;
&lt;td style="box-sizing: border-box; border: #dddddd 1px solid; padding: 6px 13px 6px 13px;"&gt;0.0180 ms&lt;/td&gt;
&lt;td style="box-sizing: border-box; border: #dddddd 1px solid; padding: 6px 13px 6px 13px;"&gt;6.72&lt;/td&gt;
&lt;td style="box-sizing: border-box; border: #dddddd 1px solid; padding: 6px 13px 6px 13px;"&gt;0.16&lt;/td&gt;
&lt;td style="box-sizing: border-box; border: #dddddd 1px solid; padding: 6px 13px 6px 13px;"&gt;32.71%&lt;/td&gt;
&lt;td style="box-sizing: border-box; border: #dddddd 1px solid; padding: 6px 13px 6px 13px;"&gt;53.00&lt;/td&gt;
&lt;td style="box-sizing: border-box; border: #dddddd 1px solid; padding: 6px 13px 6px 13px;"&gt;22.00&lt;/td&gt;
&lt;td style="box-sizing: border-box; border: #dddddd 1px solid; padding: 6px 13px 6px 13px;"&gt;15.00&lt;/td&gt;
&lt;td style="box-sizing: border-box; border: #dddddd 1px solid; padding: 6px 13px 6px 13px;"&gt;4,837,313.07&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;Source maps you say? JsMin isn’t all that smart so it can’t produce source maps (&lt;em&gt;&lt;a rel="noopener noreferrer" href="https://github.com/Shazwazza/Smidge/issues/57" target="_blank"&gt;yet&lt;/a&gt;&lt;/em&gt;) but Nuglify certainly can and by default the &lt;em&gt;Smidge.Nuglify&lt;/em&gt; package has this turned on by default. Here’s how you can get this working:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Follow the super easy Smidge &lt;a rel="noopener noreferrer" href="https://github.com/Shazwazza/Smidge#quick-start" target="_blank"&gt;quick start installation guide&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Install the Smidge.Nuglify package
&lt;div&gt;
&lt;div class="nuget-badge"&gt;
&lt;p&gt;&lt;code&gt;PM&amp;gt; Install-Package Smidge.Nuglify&lt;/code&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;Add Smidge Nuglify to your services: &lt;code&gt;services.AddSmidgeNuglify();&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Use Smidge Nuglify in your Configure method: &lt;code&gt;app.UseSmidgeNuglify();&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Replace JsMin  with Nuglify for the default pipeline:
&lt;pre&gt;&lt;code class="language-csharp"&gt;services.Configure(opt =&amp;gt;
{
    opt.PipelineFactory.OnCreateDefault = (type, pipeline) =&amp;gt; pipeline.Replace(opt.PipelineFactory);
});
&lt;/code&gt;&lt;/pre&gt;
&lt;/li&gt;
&lt;li&gt;That’s it! Nuglify is now the JS minifier for the default pipeline and will produce source maps. You can configure the Nuglify settings in the &lt;em&gt;AddSmidgeNuglify&lt;/em&gt; method.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Now you can debug via the source maps in dev tools:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://shazwazza.com/media/articulate/windows-live-writer-smidge-nuglify_9f43-image_4.png"&gt;&lt;img style="background-image: none; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-width: 0px;" src="https://shazwazza.com/media/articulate/windows-live-writer-smidge-nuglify_9f43-image_thumb_1.png" border="0" alt="image" title="image" width="600" height="350" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;File watching&lt;/h2&gt;
&lt;p&gt;Smidge can now watch your source files and if any changes are detected it can auto cache bust the bundle and flag for re-processing.&lt;/p&gt;
&lt;p&gt;Previous to version 2.0.0 if you were in release mode all of the bundling/minification would be active but you really just wanted to test this behavior but unfortunately it meant that if you updated a js/css file you would have to go bump the Smidge version in the config file to clear out the server side persistent cache. In 2.0.0, you can configure your bundle with different environment options for both Debug and Production. For example, perhaps in Debug mode you still want your bundles to be active so that the minification, combination, compression, etc… is still happening but you want to still actively edit files … you can easily do this! Here’s a nice fluent syntax to achieve this:&lt;/p&gt;
&lt;pre&gt;&lt;code class="language-csharp"&gt;bundles.CreateJs("my-application", "~/js/site.js", "~/js/app")
    .WithEnvironmentOptions(BundleEnvironmentOptions.Create()
        .ForDebug(builder =&amp;gt; builder
            .EnableCompositeProcessing()
            .EnableFileWatcher()
            .SetCacheBusterType())
        .Build()
    );
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;For this example the “my-application” bundle will do the following when being rendered in debug:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Still process the files in the bundle and minify, combine, compress into a composite file&lt;/li&gt;
&lt;li&gt;Attach file watchers to all files in the bundle&lt;/li&gt;
&lt;li&gt;Change the cache buster for this bundle to only survive the lifespan of the current app domain&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;And what’s cool is that if you edit any of the source files in this bundle it will auto cache bust to a new value and re-process the bundle when it’s next requested.&lt;/p&gt;
&lt;h2&gt;Debug vs Production?&lt;/h2&gt;
&lt;p&gt;There’s a few ways that you could render assets in either debug or production mode but this is probably the easiest and uses ASP.NET Core’s environment tag helpers. Notice the debug attribute on the script/link tags and that the src/href attributes just include the bundle name … this is using Smidge’s tag helpers to define which bundle to render and if it’s in debug mode.&lt;/p&gt;
&lt;pre&gt;&lt;code class="language-html"&gt;&amp;lt;environment names="Development"&amp;gt;
	&amp;lt;link rel="stylesheet" href="my-css" debug="true" /&amp;gt;
	&amp;lt;script src="my-js" debug="true"&amp;gt;&amp;lt;/script&amp;gt;
&amp;lt;/environment&amp;gt;

&amp;lt;environment names="Staging,Production"&amp;gt;
	&amp;lt;link rel="stylesheet" href="my-css" /&amp;gt;
	&amp;lt;script src="my-js"&amp;gt;&amp;lt;/script&amp;gt;
&amp;lt;/environment&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;Thanks!&lt;/h2&gt;
&lt;p&gt;Big thanks to &lt;a rel="noopener noreferrer" href="https://github.com/dazinator" target="_blank"&gt;@dazinator&lt;/a&gt; for all the help, recommendations, testing, feedback, etc… and for the rest of the community for filing bugs, questions, and comments. Much appreciated :)&lt;/p&gt;</description>
      <pubDate>Thu, 23 Mar 2023 15:08:27 Z</pubDate>
      <a10:updated>2023-03-23T15:08:27Z</a10:updated>
    </item>
    <item>
      <guid isPermaLink="false">1245</guid>
      <link>https://shazwazza.com/post/smidge-20-alpha-is-out/</link>
      <category>ASP.Net</category>
      <title>Smidge 2.0 alpha is out</title>
      <description>&lt;style&gt;
div.nuget-badge p code {
background: none;
background-color: #202020 !important;
border: 4px solid silver !important;
border-bottom-left-radius: 5px 5px !important;
border-bottom-right-radius: 5px 5px !important;
border-top-left-radius: 5px 5px !important;
border-top-right-radius: 5px 5px !important;
color: #e2e2e2 !important;
display: block !important;
font: normal normal normal 1.5em/normal 'andale mono', 'lucida console', monospace !important;
line-height: 1.5em !important;
overflow: auto !important;
padding: 15px !important;
}
&lt;/style&gt; &lt;img title="ASP.NET-Core-Logo_2colors_RGB_bitmap_MEDIUM" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; float: none; padding-top: 0px; padding-left: 0px; margin-left: auto; display: block; padding-right: 0px; border-top-width: 0px; margin-right: auto" border="0" alt="ASP.NET-Core-Logo_2colors_RGB_bitmap_MEDIUM" src="http://shazwazza.com/media/articulate/windows-live-writer-smidge-20-alpha-is-out_abc7-aspnet-core-logo_2colors_rgb_bitmap_medium_5.png" width="198" height="57"&gt;  &lt;p&gt;What is Smidge? Smidge is a lightweight &lt;u&gt;runtime &lt;/u&gt;bundling library (&lt;em&gt;CSS/JavaScript file minification, combination, compression&lt;/em&gt;) for ASP.NET Core. &lt;/p&gt; &lt;p&gt;&lt;img style="float: left; margin: 10px 20px 10px 0px; display: inline" src="https://raw.githubusercontent.com/Shazwazza/Smidge/master/assets/logo2.png" align="left"&gt;If you’ve come from ASP.NET 4.5 you would have been familiar with the &lt;a href="https://www.asp.net/mvc/overview/performance/bundling-and-minification" target="_blank"&gt;bundling/minification API&lt;/a&gt; and other bundling options like &lt;a href="https://github.com/shazwazza/clientdependency" target="_blank"&gt;ClientDependency&lt;/a&gt;, but that is no longer available in ASP.NET Core, instead it is advised to do all the bundling and pre-processing that you need as part of your build process …which certainly makes sense! So why create this library? A few reasons: some people just want to have a very simple bundling library and don’t want to worry about Gulp or Grunt or WebPack, in a lot of cases the overhead of runtime processing is not going to make any difference, and lastly, if you have created something like a CMS that dynamically loads in assets from 3rd party packages or plugins, you need a runtime bundler since these things don’t exist at build time.&lt;/p&gt; &lt;p&gt;Over the past few months I’ve been working on some enhancements to Smidge and have found a bit of time to get an &lt;a href="https://github.com/Shazwazza/Smidge/releases/tag/2.0.0-alpha" target="_blank"&gt;alpha released&lt;/a&gt;.&amp;nbsp; There’s loads of great new features in &lt;strong&gt;Smidge 2.0&lt;/strong&gt;! You can install via Nuget and is targets .NET Standard 1.6 and .NET Framework 4.5.2&lt;/p&gt; &lt;div class="nuget-badge"&gt; &lt;p&gt;&lt;code&gt;PM&amp;gt; Install-Package Smidge -Pre&lt;/code&gt;&lt;/p&gt;&lt;/div&gt; &lt;h2&gt;New to Smidge?&lt;/h2&gt; &lt;p&gt;It’s easy to get started with Smidge and there’s &lt;a href="https://github.com/Shazwazza/Smidge" target="_blank"&gt;lots of docs available on GitHub&lt;/a&gt; that cover installation, configuration, creating bundles and rendering&amp;nbsp; them.&lt;/p&gt; &lt;h2&gt;New Features&lt;/h2&gt; &lt;p&gt;Here’s a list of new features complete with lots of code examples&lt;/p&gt; &lt;h3&gt;Customizable Debug and Production options&lt;/h3&gt; &lt;p&gt;&lt;a title="https://github.com/Shazwazza/Smidge/issues/58" href="https://github.com/Shazwazza/Smidge/issues/58"&gt;&lt;font size="2"&gt;https://github.com/Shazwazza/Smidge/issues/58&lt;/font&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;Previous to version 2.0, you could only configure aspects of the Production options and the Debug assets that were returned were just the raw static files. With 2.0, you have full control over how your assets are processed in both Debug and Production configurations. For example, if you wanted you could have your assets combined but not minified in Debug mode. This will also allow for non native web assets such as TypeScript to have pre-processors running and able to work in Debug mode. &lt;/p&gt; &lt;p&gt;Example:&lt;/p&gt;&lt;pre class="csharpcode"&gt;services.AddSmidge(_config)
    .Configure&amp;lt;SmidgeOptions&amp;gt;(options =&amp;gt;
    {
        &lt;span class="rem"&gt;//set the default e-tag options for Debug mode&lt;/span&gt;
        options.DefaultBundleOptions.DebugOptions.CacheControlOptions.EnableETag = &lt;span class="kwrd"&gt;false&lt;/span&gt;        
    });&lt;/pre&gt;
&lt;style type="text/css"&gt;.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }
&lt;/style&gt;

&lt;h3&gt;Fluent syntax for declaring/configuring bundles&lt;/h3&gt;
&lt;p&gt;&lt;a title="https://github.com/Shazwazza/Smidge/issues/55" href="https://github.com/Shazwazza/Smidge/issues/55"&gt;&lt;font size="2"&gt;https://github.com/Shazwazza/Smidge/issues/55&lt;/font&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;If you want to customize Debug or Production options per bundle, you can do so with a fluent syntax, for example:&lt;/p&gt;&lt;pre class="csharpcode"&gt;app.UseSmidge(bundles =&amp;gt;
{                
    &lt;span class="rem"&gt;//For this bundle, enable composite files for Debug mode, enable the file watcher so any changes&lt;/span&gt;
    &lt;span class="rem"&gt;//to the files are automatically re-processed and cache invalidated, disable cache control headers&lt;/span&gt;
    &lt;span class="rem"&gt;//and use a custom cache buster. You could of course use the .ForProduction options too &lt;/span&gt;
    bundles.Create(&lt;span class="str"&gt;"test-bundle-2"&lt;/span&gt;, WebFileType.Js, &lt;span class="str"&gt;"~/Js/Bundle2"&lt;/span&gt;)
        .WithEnvironmentOptions(BundleEnvironmentOptions.Create()
                .ForDebug(builder =&amp;gt; builder
                    .EnableCompositeProcessing()
                    .EnableFileWatcher()
                    .SetCacheBusterType&amp;lt;AppDomainLifetimeCacheBuster&amp;gt;()
                    .CacheControlOptions(enableEtag: &lt;span class="kwrd"&gt;false&lt;/span&gt;, cacheControlMaxAge: 0))
                .Build()
        );                
});&lt;/pre&gt;
&lt;style type="text/css"&gt;.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }
&lt;/style&gt;

&lt;h3&gt;Customizable Cache Buster&lt;/h3&gt;
&lt;p&gt;&lt;a title="https://github.com/Shazwazza/Smidge/issues/51" href="https://github.com/Shazwazza/Smidge/issues/51"&gt;&lt;font size="2"&gt;https://github.com/Shazwazza/Smidge/issues/51&lt;/font&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;In version 1.0 the only cache busting mechanism was Smidge’s version property which is set in config, in 2.0 Smidge allows you to control how cache busting is controlled at a global and bundle level. 2.0 ships with 2 &lt;em&gt;ICacheBuster&lt;/em&gt; types:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;em&gt;ConfigCacheBuster &lt;/em&gt;– the default and uses Smidge’s version property in config&lt;/p&gt;
&lt;li&gt;
&lt;p&gt;&lt;em&gt;AppDomainLifetimeCacheBuster &lt;/em&gt;– if enabled will mean that the server/browser cache will be invalidated on every app domain recycle&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;
&lt;p&gt;If you want a different behavior, you can define you own &lt;em&gt;ICacheBuster&lt;/em&gt; add it to the IoC container and then just use it globally or per bundle. For example:&lt;/p&gt;&lt;pre class="csharpcode"&gt;&lt;span class="rem"&gt;//Set a custom MyCacheBuster as the default one for Debug assets:&lt;/span&gt;
services.AddSmidge(_config)
    .Configure&amp;lt;SmidgeOptions&amp;gt;(options =&amp;gt;
    {
        options.DefaultBundleOptions.DebugOptions.SetCacheBusterType&amp;lt;MyCustomCacheBuster&amp;gt;();       
    });

&lt;span class="rem"&gt;//Set a custom MyCacheBuster as the cache buster for a particular bundle in debug mode:&lt;/span&gt;
bundles.Create(&lt;span class="str"&gt;"test-bundle-2"&lt;/span&gt;, WebFileType.Js, &lt;span class="str"&gt;"~/Js/Bundle2"&lt;/span&gt;)
    .WithEnvironmentOptions(BundleEnvironmentOptions.Create()
            .ForDebug(builder =&amp;gt; builder
                .SetCacheBusterType&amp;lt;MyCacheBuster&amp;gt;()
            .Build()
    );&lt;/pre&gt;
&lt;h3&gt;Customizable cache headers&lt;/h3&gt;
&lt;p&gt;&lt;a title="https://github.com/Shazwazza/Smidge/issues/48" href="https://github.com/Shazwazza/Smidge/issues/48"&gt;&lt;font size="2"&gt;https://github.com/Shazwazza/Smidge/issues/48&lt;/font&gt;&lt;/a&gt;&lt;font size="2"&gt;&amp;nbsp;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;You can now control if you want the &lt;em&gt;ETag&lt;/em&gt; header output and you can control the value set for max-age/s-maxage/Expires header at a global or bundle level, for example:&lt;/p&gt;&lt;pre class="csharpcode"&gt;&lt;span class="rem"&gt;//This would set the max-age header for this bundle to expire in 5 days&lt;/span&gt;
bundles.Create(&lt;span class="str"&gt;"test-bundle-5"&lt;/span&gt;, WebFileType.Js, &lt;span class="str"&gt;"~/Js/Bundle5"&lt;/span&gt;)
    .WithEnvironmentOptions(BundleEnvironmentOptions.Create()
            .ForProduction(builder =&amp;gt; builder                                
                .CacheControlOptions(enableEtag: &lt;span class="kwrd"&gt;true&lt;/span&gt;, cacheControlMaxAge: (5 * 24)))
            .Build()
    );&lt;/pre&gt;
&lt;style type="text/css"&gt;.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }
&lt;/style&gt;

&lt;h3&gt;Callback to customize the pre-processor pipeline per web file&lt;/h3&gt;
&lt;p&gt;&lt;a title="https://github.com/Shazwazza/Smidge/issues/59" href="https://github.com/Shazwazza/Smidge/issues/59"&gt;&lt;font size="2"&gt;https://github.com/Shazwazza/Smidge/issues/59&lt;/font&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;This is handy in case you want to modify the pipeline for a given web file at runtime based on some criteria, for example:&lt;/p&gt;&lt;pre class="csharpcode"&gt;services.AddSmidge(_config)
    .Configure&amp;lt;SmidgeOptions&amp;gt;(options =&amp;gt;
    {
        &lt;span class="rem"&gt;//set the callback&lt;/span&gt;
        options.PipelineFactory.OnGetDefault = GetDefaultPipelineFactory;
    });

&lt;span class="rem"&gt;//The GetDefaultPipeline method could do something like modify the default pipeline to use Nuglify for JS processing:&lt;/span&gt;

&lt;span class="kwrd"&gt;private&lt;/span&gt; &lt;span class="kwrd"&gt;static&lt;/span&gt; PreProcessPipeline GetDefaultPipelineFactory(WebFileType fileType, IReadOnlyCollection&amp;lt;IPreProcessor&amp;gt; processors)
{
    &lt;span class="kwrd"&gt;switch&lt;/span&gt; (fileType)
    {
        &lt;span class="kwrd"&gt;case&lt;/span&gt; WebFileType.Js:
            &lt;span class="kwrd"&gt;return&lt;/span&gt; &lt;span class="kwrd"&gt;new&lt;/span&gt; PreProcessPipeline(&lt;span class="kwrd"&gt;new&lt;/span&gt; IPreProcessor[]
            {
                processors.OfType&amp;lt;NuglifyJs&amp;gt;().Single()
            });                
    }
    &lt;span class="rem"&gt;//returning null will fallback to the logic defined in the registered PreProcessPipelineFactory&lt;/span&gt;
    &lt;span class="kwrd"&gt;return&lt;/span&gt; &lt;span class="kwrd"&gt;null&lt;/span&gt;;
}

&lt;/pre&gt;
&lt;style type="text/css"&gt;.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }
&lt;/style&gt;

&lt;h3&gt;File watching with automatic cache invalidation&lt;/h3&gt;
&lt;p&gt;&lt;a title="https://github.com/Shazwazza/Smidge/pull/42" href="https://github.com/Shazwazza/Smidge/pull/42"&gt;&lt;font size="2"&gt;https://github.com/Shazwazza/Smidge/pull/42&lt;/font&gt;&lt;/a&gt;&lt;font size="2"&gt;&amp;nbsp;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;During the development process it would be nice to be able to test composite files but have them auto re-process and invalidate the cache whenever one of the source files changes… in 2.0 this is possible!&amp;nbsp; You can enable file watching at the global level or per bundle. Example:&lt;/p&gt;&lt;pre class="csharpcode"&gt;&lt;span class="rem"&gt;//Enable file watching for all files in this bundle when in Debug mode&lt;/span&gt;
bundles.Create(&lt;span class="str"&gt;"test-bundle-7"&lt;/span&gt;,
    &lt;span class="kwrd"&gt;new&lt;/span&gt; CssFile(&lt;span class="str"&gt;"~/Js/Bundle7/a1.js"&lt;/span&gt;),
    &lt;span class="kwrd"&gt;new&lt;/span&gt; CssFile(&lt;span class="str"&gt;"~/Js/Bundle7/a2.js"&lt;/span&gt;))
    .WithEnvironmentOptions(BundleEnvironmentOptions.Create()
            .ForDebug(builder =&amp;gt; builder.EnableFileWatcher())
            .Build()
    );&lt;/pre&gt;
&lt;h2&gt;What’s next?&lt;/h2&gt;
&lt;p&gt;This is an alpha release since there’s a few things that I need to complete. Most are already done but I just need to make Nuget packages for them:&lt;/p&gt;
&lt;h4&gt;&lt;/h4&gt;
&lt;h3&gt;More pre-processors&lt;/h3&gt;
&lt;p&gt;I’ve enabled support for a &lt;a href="https://github.com/xoofx/NUglify" target="_blank"&gt;Nuglify&lt;/a&gt; pre-processor for both CSS and JS (Nuglify is a fork of the &lt;a href="http://ajaxmin.codeplex.com/"&gt;Microsoft Ajax Minifier&lt;/a&gt; for ASP.NET Core + additional features). I also enabled support for an Uglify NodeJs pre-processor which uses &lt;a href="https://github.com/aspnet/JavaScriptServices" target="_blank"&gt;Microsoft.AspNetCore.NodeServices&lt;/a&gt; to invoke Node.js from ASP.NET and run the JS version of Uglify. I just need to get these on Nuget but haven’t got around to that yet.&lt;/p&gt;
&lt;h3&gt;A quick note on minifier performance &lt;/h3&gt;
&lt;p&gt;Though Nuglify and Uglify have a better minification engine (better/smarter size reduction) than JsMin because they create an &lt;a href="https://en.wikipedia.org/wiki/Abstract_syntax_tree" target="_blank"&gt;AST (Abstract Syntax Tree)&lt;/a&gt; to perform it’s processing, they are actually much slower and consume more resources than JsMin. Since Smidge is a Runtime bundling engine, its generally important to ensure that the bundling/minification is performed quickly. Smidge has strict caching so the bundling/minification will only happen once (depending on your &lt;em&gt;ICacheBuster&lt;/em&gt; you are using) but it is still recommended to understand the performance implications of replacing JsMin with another minifier. &lt;a href="https://github.com/Shazwazza/Smidge/wiki/Custom-pre-processing#minification-benchmarks" target="_blank"&gt;I’ve put together some benchmarks&lt;/a&gt; (NOTE: a smaller Minified % is better):&lt;/p&gt;
&lt;table style="box-sizing: border-box; overflow: auto; margin-bottom: 16px; font-family: ; white-space: normal; word-spacing: 0px; margin-top: 0px; border-collapse: collapse; text-transform: none; color: ; border-spacing: 0px; orphans: 2; widows: 2; display: block; letter-spacing: normal; background-color: rgb(255,255,255); text-indent: 0px; font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px" width="700"&gt;
&lt;thead style="box-sizing: border-box"&gt;
&lt;tr style="box-sizing: border-box; border-top: rgb(204,204,204) 1px solid; background-color: rgb(255,255,255)"&gt;
&lt;th style="box-sizing: border-box; border-top: rgb(221,221,221) 1px solid; border-right: rgb(221,221,221) 1px solid; border-bottom: rgb(221,221,221) 1px solid; padding-bottom: 6px; padding-top: 6px; padding-left: 13px; border-left: rgb(221,221,221) 1px solid; padding-right: 13px"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size: 12pt" color="#333333"&gt;Method&lt;/font&gt;&lt;/font&gt;&lt;/th&gt;
&lt;th style="box-sizing: border-box; border-top: rgb(221,221,221) 1px solid; border-right: rgb(221,221,221) 1px solid; border-bottom: rgb(221,221,221) 1px solid; padding-bottom: 6px; padding-top: 6px; padding-left: 13px; border-left: rgb(221,221,221) 1px solid; padding-right: 13px"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size: 12pt" color="#333333"&gt;Median&lt;/font&gt;&lt;/font&gt;&lt;/th&gt;
&lt;th style="box-sizing: border-box; border-top: rgb(221,221,221) 1px solid; border-right: rgb(221,221,221) 1px solid; border-bottom: rgb(221,221,221) 1px solid; padding-bottom: 6px; padding-top: 6px; padding-left: 13px; border-left: rgb(221,221,221) 1px solid; padding-right: 13px"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size: 12pt" color="#333333"&gt;StdDev&lt;/font&gt;&lt;/font&gt;&lt;/th&gt;
&lt;th style="box-sizing: border-box; border-top: rgb(221,221,221) 1px solid; border-right: rgb(221,221,221) 1px solid; border-bottom: rgb(221,221,221) 1px solid; padding-bottom: 6px; padding-top: 6px; padding-left: 13px; border-left: rgb(221,221,221) 1px solid; padding-right: 13px"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size: 12pt" color="#333333"&gt;Scaled&lt;/font&gt;&lt;/font&gt;&lt;/th&gt;
&lt;th style="box-sizing: border-box; border-top: rgb(221,221,221) 1px solid; border-right: rgb(221,221,221) 1px solid; border-bottom: rgb(221,221,221) 1px solid; padding-bottom: 6px; padding-top: 6px; padding-left: 13px; border-left: rgb(221,221,221) 1px solid; padding-right: 13px"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size: 12pt" color="#333333"&gt;Scaled-SD&lt;/font&gt;&lt;/font&gt;&lt;/th&gt;
&lt;th style="box-sizing: border-box; border-top: rgb(221,221,221) 1px solid; border-right: rgb(221,221,221) 1px solid; border-bottom: rgb(221,221,221) 1px solid; padding-bottom: 6px; padding-top: 6px; padding-left: 13px; border-left: rgb(221,221,221) 1px solid; padding-right: 13px"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size: 12pt" color="#333333"&gt;Minified %&lt;/font&gt;&lt;/font&gt;&lt;/th&gt;
&lt;th style="box-sizing: border-box; border-top: rgb(221,221,221) 1px solid; border-right: rgb(221,221,221) 1px solid; border-bottom: rgb(221,221,221) 1px solid; padding-bottom: 6px; padding-top: 6px; padding-left: 13px; border-left: rgb(221,221,221) 1px solid; padding-right: 13px"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size: 12pt" color="#333333"&gt;Gen 0&lt;/font&gt;&lt;/font&gt;&lt;/th&gt;
&lt;th style="box-sizing: border-box; border-top: rgb(221,221,221) 1px solid; border-right: rgb(221,221,221) 1px solid; border-bottom: rgb(221,221,221) 1px solid; padding-bottom: 6px; padding-top: 6px; padding-left: 13px; border-left: rgb(221,221,221) 1px solid; padding-right: 13px"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size: 12pt" color="#333333"&gt;Gen 1&lt;/font&gt;&lt;/font&gt;&lt;/th&gt;
&lt;th style="box-sizing: border-box; border-top: rgb(221,221,221) 1px solid; border-right: rgb(221,221,221) 1px solid; border-bottom: rgb(221,221,221) 1px solid; padding-bottom: 6px; padding-top: 6px; padding-left: 13px; border-left: rgb(221,221,221) 1px solid; padding-right: 13px"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size: 12pt" color="#333333"&gt;Gen 2&lt;/font&gt;&lt;/font&gt;&lt;/th&gt;
&lt;th style="box-sizing: border-box; border-top: rgb(221,221,221) 1px solid; border-right: rgb(221,221,221) 1px solid; border-bottom: rgb(221,221,221) 1px solid; padding-bottom: 6px; padding-top: 6px; padding-left: 13px; border-left: rgb(221,221,221) 1px solid; padding-right: 13px"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size: 12pt" color="#333333"&gt;Bytes Allocated/Op&lt;/font&gt;&lt;/font&gt;&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;
&lt;tbody style="box-sizing: border-box"&gt;
&lt;tr style="box-sizing: border-box; border-top: rgb(204,204,204) 1px solid; background-color: rgb(255,255,255)"&gt;
&lt;td style="box-sizing: border-box; border-top: rgb(221,221,221) 1px solid; border-right: rgb(221,221,221) 1px solid; border-bottom: rgb(221,221,221) 1px solid; padding-bottom: 6px; padding-top: 6px; padding-left: 13px; border-left: rgb(221,221,221) 1px solid; padding-right: 13px"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size: 12pt" color="#333333"&gt;JsMin&lt;/font&gt;&lt;/font&gt;&lt;/td&gt;
&lt;td style="box-sizing: border-box; border-top: rgb(221,221,221) 1px solid; border-right: rgb(221,221,221) 1px solid; border-bottom: rgb(221,221,221) 1px solid; padding-bottom: 6px; padding-top: 6px; padding-left: 13px; border-left: rgb(221,221,221) 1px solid; padding-right: 13px"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size: 12pt" color="#333333"&gt;10.2008 ms&lt;/font&gt;&lt;/font&gt;&lt;/td&gt;
&lt;td style="box-sizing: border-box; border-top: rgb(221,221,221) 1px solid; border-right: rgb(221,221,221) 1px solid; border-bottom: rgb(221,221,221) 1px solid; padding-bottom: 6px; padding-top: 6px; padding-left: 13px; border-left: rgb(221,221,221) 1px solid; padding-right: 13px"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size: 12pt" color="#333333"&gt;0.3102 ms&lt;/font&gt;&lt;/font&gt;&lt;/td&gt;
&lt;td style="box-sizing: border-box; border-top: rgb(221,221,221) 1px solid; border-right: rgb(221,221,221) 1px solid; border-bottom: rgb(221,221,221) 1px solid; padding-bottom: 6px; padding-top: 6px; padding-left: 13px; border-left: rgb(221,221,221) 1px solid; padding-right: 13px"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size: 12pt" color="#333333"&gt;1.00&lt;/font&gt;&lt;/font&gt;&lt;/td&gt;
&lt;td style="box-sizing: border-box; border-top: rgb(221,221,221) 1px solid; border-right: rgb(221,221,221) 1px solid; border-bottom: rgb(221,221,221) 1px solid; padding-bottom: 6px; padding-top: 6px; padding-left: 13px; border-left: rgb(221,221,221) 1px solid; padding-right: 13px"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size: 12pt" color="#333333"&gt;0.00&lt;/font&gt;&lt;/font&gt;&lt;/td&gt;
&lt;td style="box-sizing: border-box; border-top: rgb(221,221,221) 1px solid; border-right: rgb(221,221,221) 1px solid; border-bottom: rgb(221,221,221) 1px solid; padding-bottom: 6px; padding-top: 6px; padding-left: 13px; border-left: rgb(221,221,221) 1px solid; padding-right: 13px"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size: 12pt" color="#333333"&gt;51.75%&lt;/font&gt;&lt;/font&gt;&lt;/td&gt;
&lt;td style="box-sizing: border-box; border-top: rgb(221,221,221) 1px solid; border-right: rgb(221,221,221) 1px solid; border-bottom: rgb(221,221,221) 1px solid; padding-bottom: 6px; padding-top: 6px; padding-left: 13px; border-left: rgb(221,221,221) 1px solid; padding-right: 13px"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size: 12pt" color="#333333"&gt;-&lt;/font&gt;&lt;/font&gt;&lt;/td&gt;
&lt;td style="box-sizing: border-box; border-top: rgb(221,221,221) 1px solid; border-right: rgb(221,221,221) 1px solid; border-bottom: rgb(221,221,221) 1px solid; padding-bottom: 6px; padding-top: 6px; padding-left: 13px; border-left: rgb(221,221,221) 1px solid; padding-right: 13px"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size: 12pt" color="#333333"&gt;-&lt;/font&gt;&lt;/font&gt;&lt;/td&gt;
&lt;td style="box-sizing: border-box; border-top: rgb(221,221,221) 1px solid; border-right: rgb(221,221,221) 1px solid; border-bottom: rgb(221,221,221) 1px solid; padding-bottom: 6px; padding-top: 6px; padding-left: 13px; border-left: rgb(221,221,221) 1px solid; padding-right: 13px"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size: 12pt" color="#333333"&gt;-&lt;/font&gt;&lt;/font&gt;&lt;/td&gt;
&lt;td style="box-sizing: border-box; border-top: rgb(221,221,221) 1px solid; border-right: rgb(221,221,221) 1px solid; border-bottom: rgb(221,221,221) 1px solid; padding-bottom: 6px; padding-top: 6px; padding-left: 13px; border-left: rgb(221,221,221) 1px solid; padding-right: 13px"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size: 12pt" color="#333333"&gt;155,624.67&lt;/font&gt;&lt;/font&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr style="box-sizing: border-box; border-top: rgb(204,204,204) 1px solid; background-color: rgb(248,248,248)"&gt;
&lt;td style="box-sizing: border-box; border-top: rgb(221,221,221) 1px solid; border-right: rgb(221,221,221) 1px solid; border-bottom: rgb(221,221,221) 1px solid; padding-bottom: 6px; padding-top: 6px; padding-left: 13px; border-left: rgb(221,221,221) 1px solid; padding-right: 13px"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size: 12pt" color="#333333"&gt;Nuglify&lt;/font&gt;&lt;/font&gt;&lt;/td&gt;
&lt;td style="box-sizing: border-box; border-top: rgb(221,221,221) 1px solid; border-right: rgb(221,221,221) 1px solid; border-bottom: rgb(221,221,221) 1px solid; padding-bottom: 6px; padding-top: 6px; padding-left: 13px; border-left: rgb(221,221,221) 1px solid; padding-right: 13px"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size: 12pt" color="#333333"&gt;69.0778 ms&lt;/font&gt;&lt;/font&gt;&lt;/td&gt;
&lt;td style="box-sizing: border-box; border-top: rgb(221,221,221) 1px solid; border-right: rgb(221,221,221) 1px solid; border-bottom: rgb(221,221,221) 1px solid; padding-bottom: 6px; padding-top: 6px; padding-left: 13px; border-left: rgb(221,221,221) 1px solid; padding-right: 13px"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size: 12pt" color="#333333"&gt;0.0180 ms&lt;/font&gt;&lt;/font&gt;&lt;/td&gt;
&lt;td style="box-sizing: border-box; border-top: rgb(221,221,221) 1px solid; border-right: rgb(221,221,221) 1px solid; border-bottom: rgb(221,221,221) 1px solid; padding-bottom: 6px; padding-top: 6px; padding-left: 13px; border-left: rgb(221,221,221) 1px solid; padding-right: 13px"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size: 12pt" color="#333333"&gt;6.72&lt;/font&gt;&lt;/font&gt;&lt;/td&gt;
&lt;td style="box-sizing: border-box; border-top: rgb(221,221,221) 1px solid; border-right: rgb(221,221,221) 1px solid; border-bottom: rgb(221,221,221) 1px solid; padding-bottom: 6px; padding-top: 6px; padding-left: 13px; border-left: rgb(221,221,221) 1px solid; padding-right: 13px"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size: 12pt" color="#333333"&gt;0.16&lt;/font&gt;&lt;/font&gt;&lt;/td&gt;
&lt;td style="box-sizing: border-box; border-top: rgb(221,221,221) 1px solid; border-right: rgb(221,221,221) 1px solid; border-bottom: rgb(221,221,221) 1px solid; padding-bottom: 6px; padding-top: 6px; padding-left: 13px; border-left: rgb(221,221,221) 1px solid; padding-right: 13px"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size: 12pt" color="#333333"&gt;32.71%&lt;/font&gt;&lt;/font&gt;&lt;/td&gt;
&lt;td style="box-sizing: border-box; border-top: rgb(221,221,221) 1px solid; border-right: rgb(221,221,221) 1px solid; border-bottom: rgb(221,221,221) 1px solid; padding-bottom: 6px; padding-top: 6px; padding-left: 13px; border-left: rgb(221,221,221) 1px solid; padding-right: 13px"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size: 12pt" color="#333333"&gt;53.00&lt;/font&gt;&lt;/font&gt;&lt;/td&gt;
&lt;td style="box-sizing: border-box; border-top: rgb(221,221,221) 1px solid; border-right: rgb(221,221,221) 1px solid; border-bottom: rgb(221,221,221) 1px solid; padding-bottom: 6px; padding-top: 6px; padding-left: 13px; border-left: rgb(221,221,221) 1px solid; padding-right: 13px"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size: 12pt" color="#333333"&gt;22.00&lt;/font&gt;&lt;/font&gt;&lt;/td&gt;
&lt;td style="box-sizing: border-box; border-top: rgb(221,221,221) 1px solid; border-right: rgb(221,221,221) 1px solid; border-bottom: rgb(221,221,221) 1px solid; padding-bottom: 6px; padding-top: 6px; padding-left: 13px; border-left: rgb(221,221,221) 1px solid; padding-right: 13px"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size: 12pt" color="#333333"&gt;15.00&lt;/font&gt;&lt;/font&gt;&lt;/td&gt;
&lt;td style="box-sizing: border-box; border-top: rgb(221,221,221) 1px solid; border-right: rgb(221,221,221) 1px solid; border-bottom: rgb(221,221,221) 1px solid; padding-bottom: 6px; padding-top: 6px; padding-left: 13px; border-left: rgb(221,221,221) 1px solid; padding-right: 13px"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size: 12pt" color="#333333"&gt;4,837,313.07&lt;/font&gt;&lt;/font&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr style="box-sizing: border-box; border-top: rgb(204,204,204) 1px solid; background-color: rgb(255,255,255)"&gt;
&lt;td style="box-sizing: border-box; border-top: rgb(221,221,221) 1px solid; border-right: rgb(221,221,221) 1px solid; border-bottom: rgb(221,221,221) 1px solid; padding-bottom: 6px; padding-top: 6px; padding-left: 13px; border-left: rgb(221,221,221) 1px solid; padding-right: 13px"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size: 12pt" color="#333333"&gt;JsServicesUglify&lt;/font&gt;&lt;/font&gt;&lt;/td&gt;
&lt;td style="box-sizing: border-box; border-top: rgb(221,221,221) 1px solid; border-right: rgb(221,221,221) 1px solid; border-bottom: rgb(221,221,221) 1px solid; padding-bottom: 6px; padding-top: 6px; padding-left: 13px; border-left: rgb(221,221,221) 1px solid; padding-right: 13px"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size: 12pt" color="#333333"&gt;1,548.3951 ms&lt;/font&gt;&lt;/font&gt;&lt;/td&gt;
&lt;td style="box-sizing: border-box; border-top: rgb(221,221,221) 1px solid; border-right: rgb(221,221,221) 1px solid; border-bottom: rgb(221,221,221) 1px solid; padding-bottom: 6px; padding-top: 6px; padding-left: 13px; border-left: rgb(221,221,221) 1px solid; padding-right: 13px"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size: 12pt" color="#333333"&gt;7.6388 ms&lt;/font&gt;&lt;/font&gt;&lt;/td&gt;
&lt;td style="box-sizing: border-box; border-top: rgb(221,221,221) 1px solid; border-right: rgb(221,221,221) 1px solid; border-bottom: rgb(221,221,221) 1px solid; padding-bottom: 6px; padding-top: 6px; padding-left: 13px; border-left: rgb(221,221,221) 1px solid; padding-right: 13px"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size: 12pt" color="#333333"&gt;150.95&lt;/font&gt;&lt;/font&gt;&lt;/td&gt;
&lt;td style="box-sizing: border-box; border-top: rgb(221,221,221) 1px solid; border-right: rgb(221,221,221) 1px solid; border-bottom: rgb(221,221,221) 1px solid; padding-bottom: 6px; padding-top: 6px; padding-left: 13px; border-left: rgb(221,221,221) 1px solid; padding-right: 13px"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size: 12pt" color="#333333"&gt;3.73&lt;/font&gt;&lt;/font&gt;&lt;/td&gt;
&lt;td style="box-sizing: border-box; border-top: rgb(221,221,221) 1px solid; border-right: rgb(221,221,221) 1px solid; border-bottom: rgb(221,221,221) 1px solid; padding-bottom: 6px; padding-top: 6px; padding-left: 13px; border-left: rgb(221,221,221) 1px solid; padding-right: 13px"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size: 12pt" color="#333333"&gt;32.63%&lt;/font&gt;&lt;/font&gt;&lt;/td&gt;
&lt;td style="box-sizing: border-box; border-top: rgb(221,221,221) 1px solid; border-right: rgb(221,221,221) 1px solid; border-bottom: rgb(221,221,221) 1px solid; padding-bottom: 6px; padding-top: 6px; padding-left: 13px; border-left: rgb(221,221,221) 1px solid; padding-right: 13px"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size: 12pt" color="#333333"&gt;0.97&lt;/font&gt;&lt;/font&gt;&lt;/td&gt;
&lt;td style="box-sizing: border-box; border-top: rgb(221,221,221) 1px solid; border-right: rgb(221,221,221) 1px solid; border-bottom: rgb(221,221,221) 1px solid; padding-bottom: 6px; padding-top: 6px; padding-left: 13px; border-left: rgb(221,221,221) 1px solid; padding-right: 13px"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size: 12pt" color="#333333"&gt;-&lt;/font&gt;&lt;/font&gt;&lt;/td&gt;
&lt;td style="box-sizing: border-box; border-top: rgb(221,221,221) 1px solid; border-right: rgb(221,221,221) 1px solid; border-bottom: rgb(221,221,221) 1px solid; padding-bottom: 6px; padding-top: 6px; padding-left: 13px; border-left: rgb(221,221,221) 1px solid; padding-right: 13px"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size: 12pt" color="#333333"&gt;-&lt;/font&gt;&lt;/font&gt;&lt;/td&gt;
&lt;td style="box-sizing: border-box; border-top: rgb(221,221,221) 1px solid; border-right: rgb(221,221,221) 1px solid; border-bottom: rgb(221,221,221) 1px solid; padding-bottom: 6px; padding-top: 6px; padding-left: 13px; border-left: rgb(221,221,221) 1px solid; padding-right: 13px"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size: 12pt" color="#333333"&gt;576,056.55&lt;/font&gt;&lt;/font&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;The last benchmark may be a bit misleading because the processing is done via NodeJs which executes in a separate process so I'm unsure if the actual memory usage of that can be properly captured by &lt;a href="https://github.com/dotnet/BenchmarkDotNet"&gt;BenchmarkDotNet&lt;/a&gt; but you can see it's speed is much slower. 
&lt;h2&gt;Thanks!&lt;/h2&gt;
&lt;p&gt;Big thanks to &lt;a href="https://github.com/dazinator" target="_blank"&gt;@dazinator&lt;/a&gt; for all the help, recommendations, testing, feedback, etc… and for the rest of the community for filing bugs, questions, and comments. Much appreciated :)&lt;/p&gt;</description>
      <pubDate>Thu, 23 Mar 2023 15:08:19 Z</pubDate>
      <a10:updated>2023-03-23T15:08:19Z</a10:updated>
    </item>
    <item>
      <guid isPermaLink="false">1269</guid>
      <link>https://shazwazza.com/post/introducing-smidge-an-aspnet-5-runtime-jscss-pre-processor/</link>
      <category>ASP.Net</category>
      <category>Web Development</category>
      <title>Introducing ‘Smidge’ – an ASP.NET 5 runtime JS/CSS pre-processor</title>
      <description>&lt;p&gt;During the past month I decided to dive deep into learning ASP.NET 5, and what better way to learn than to start a new OSS project :)&lt;/p&gt;
&lt;p&gt;I chose to make a new new simple and extensible Javascript/CSS &lt;span style="text-decoration: underline;"&gt;runtime&lt;/span&gt; pre-processor for ASP.NET 5. It does file minification, combination and compression, has a nice file caching layer and it’s all done in async operations. I ported over a few ideas and code snippets from &lt;a href="https://github.com/Shazwazza/ClientDependency/" target="_blank"&gt;CDF (client dependency framework)&lt;/a&gt; but with a more modern approach. I’ve called it ‘Smidge’ = &lt;em&gt;something really small&lt;/em&gt;.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://github.com/Shazwazza/Smidge" target="_blank"&gt;The project is on GitHub&lt;/a&gt;, it’s still a work in progress but its functional and there’s even some documentation! In the next few weeks I’ll get more of the code and docs updated and hopefully have a beta release out. In the meantime, you can clone the source, browse the code, build it and of course use it if you like.&lt;/p&gt;
&lt;h2&gt;Project details&lt;/h2&gt;
&lt;p&gt;It’s currently only targeting &lt;em&gt;aspnet50 &lt;/em&gt;and not the Core CLR… I didn’t start with Core CLR because there was some legacy code I had to port over and I wanted to get something up and working relatively quickly. It shouldn’t be too much work to convert to Core CLR and Mono, hopefully I’ll find time to do that soon. It’s referencing all of the beta-* libraries from the ASP.NET 5 nightly myget feeds since there’s some code I’m using that isn’t available in the current beta1 release (&lt;em&gt;like Microsoft.AspNet.WebUtilities.UriHelper&lt;/em&gt;). The target KRE version is currently &lt;em&gt;KRE-CLR-amd64 1.0.0-beta2-10760.&lt;/em&gt;&lt;/p&gt;
&lt;h2&gt;Installation&lt;/h2&gt;
&lt;p&gt;I’ve put up an Alpha 1 release on Nuget, so you can install it from there:&lt;/p&gt;
&lt;div class="nuget-badge"&gt;
&lt;p&gt;PM&amp;gt; Install-Package Smidge -Pre&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;There’s some &lt;a href="https://github.com/Shazwazza/Smidge/blob/master/README.md#install" target="_blank"&gt;installation instructions here&lt;/a&gt;, you’ll need to add the smidge.json file yourself for now, can’t figure out how to get VS 2015 (kpm pack) to package that up … more learning required!&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;There’s certainly a lot of detective work involved in learning ASP.NET 5 but with the code being open source and browse-able/searchable on GitHub, it makes finding what you need fairly easy.&lt;/p&gt;</description>
      <pubDate>Thu, 23 Mar 2023 15:08:15 Z</pubDate>
      <a10:updated>2023-03-23T15:08:15Z</a10:updated>
    </item>
    <item>
      <guid isPermaLink="false">1277</guid>
      <link>https://shazwazza.com/post/aspnet-5-linux-support-for-runtime-js-css-preprocessing-with-smidge/</link>
      <title>ASP.Net 5 Linux support for runtime JS &amp; CSS preprocessing with Smidge</title>
      <description>&lt;p&gt;I’ve been working on a side project called &lt;a href="https://github.com/Shazwazza/Smidge" target="_blank"&gt;Smidge&lt;/a&gt; which is a runtime JS &amp;amp; CSS preprocessor for ASP.Net 5. I started this late last year after the 2014 MS MVP Summit as a good starting point to deep dive into ASP.Net 5. I’ve been keeping the codebase up-to-date with the beta releases of ASP.Net 5, I have it cross compiled to both dnx451 and dnxcore50 and recently updated to use Beta 7. This week I decided to give running ASP.Net 5 CoreCLR on Linux… and the result is IT WORKS!&lt;/p&gt; &lt;p&gt;I have next to no experience with Linux and considering that, it wasn’t actually very difficult to get my test site for Smidge up and running. Here’s the info on how I set this up:&lt;/p&gt; &lt;h2&gt;Linux setup&lt;/h2&gt; &lt;p&gt;I decided to use Ubuntu 14.04.3 LTS. I installed in on Hyper-V on Windows 10 and that was all very easy. I also setup SSH with the server so that I could remote terminal to it which is much nicer than using the terminal through the UI interface of Ubuntu via Hyper-V. Then basically followed the instructions here: &lt;a title="https://github.com/aspnet/Home/blob/dev/GettingStartedDeb.md#getting-started-with-aspnet-5-and-linux" href="https://github.com/aspnet/Home/blob/dev/GettingStartedDeb.md#getting-started-with-aspnet-5-and-linux.issues"&gt;https://github.com/aspnet/Home/blob/dev/GettingStartedDeb.md#getting-started-with-aspnet-5-and-linux&lt;/a&gt; – except that I didn’t configure any Nuget package sources since that is built into dnvm now. Once that was done I used dnvm to install the default runtime:&amp;nbsp; &lt;strong&gt;dnvm upgrade. &lt;/strong&gt;This installed mono by default but for my purposes I needed ASP.Net 5 CoreCLR since that’s what Smidge is built against and I wanted to see this CoreCLR cross-platform stuff in action. Issuing this command does the trick: &lt;strong&gt;dnvm install 1.0.0-beta7 -r coreclr&lt;/strong&gt; . Now when I list the runtimes installed (&lt;strong&gt;dnvm list&lt;/strong&gt;) I get: &lt;/p&gt; &lt;p&gt;&lt;a href="http://shazwazza.com/media/articulate/windows-live-writer-e42f7a425c51_13ed8-image_2.png"&gt;&lt;img title="image" style="display: inline" alt="image" src="http://shazwazza.com/media/articulate/windows-live-writer-e42f7a425c51_13ed8-image_thumb.png" width="800" height="223"&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;So now dnx is installed! We’re ready to go.&lt;/p&gt; &lt;h2&gt;dnu publish &amp;amp; bash&lt;/h2&gt; &lt;p&gt;What I really wanted to see was that I could build my solution on my Windows machine in Visual Studio and then export it and see if it would work on the Linux machine. Through the command line on Windows at the root of my project I used dnu publish (&lt;a title="https://github.com/aspnet/Home/wiki/DNX-utility#publish-dnu-publish" href="https://github.com/aspnet/Home/wiki/DNX-utility#publish-dnu-publish"&gt;https://github.com/aspnet/Home/wiki/DNX-utility#publish-dnu-publish&lt;/a&gt;) which outputs a ‘self-contained directory that can be launched’ = great! So I executed that command, it put the folder in my /bin folder for my current project and I copied over that directory to my Linux machine….&amp;nbsp; and realized I didn’t know what to do next ;)&lt;/p&gt; &lt;p&gt;I had a look through the files that dnu publish exports and the one that is listed in ASP.Net’s docs is the &lt;strong&gt;output/kestrel.cmd &lt;/strong&gt;(since the command in my project is named ‘kestrel’). Inside this file this is listed:&lt;/p&gt;&lt;pre class="csharpcode"&gt;&lt;span class="str"&gt;@"dnx.exe"&lt;/span&gt; --appbase &lt;span class="str"&gt;"%~dp0approot\src\Smidge.Web"&lt;/span&gt; Microsoft.Dnx.ApplicationHost --configuration Debug kestrel %*&lt;/pre&gt;
&lt;style type="text/css"&gt;.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }
&lt;/style&gt;

&lt;p&gt;which if you want to translate to Linux, you could execute this at the Linux terminal at the root of this folder:&lt;/p&gt;&lt;pre class="csharpcode"&gt;dnx --appbase &lt;span class="str"&gt;"approot/src/Smidge.Web"&lt;/span&gt; Microsoft.Dnx.ApplicationHost --configuration Debug kestrel&lt;/pre&gt;
&lt;style type="text/css"&gt;.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }
&lt;/style&gt;

&lt;p&gt;… which will actually work, BUT it turns out there’s a way more &lt;em&gt;Linuxy &lt;/em&gt;way to do it. dnu publish also creates this file which isn’t in the docs:&amp;nbsp; &lt;strong&gt;output/kestrel &lt;/strong&gt;Having a look at this file, the first line is: &lt;strong&gt;#!/usr/bin/env bash &lt;/strong&gt;…&amp;nbsp; so I can only assume this is something for Linux since I’ve heard the term bash before. Turns out on Linux you can just do this in the terminal from the root of this folder!&lt;/p&gt;&lt;pre class="csharpcode"&gt;bash kestrel&lt;/pre&gt;
&lt;style type="text/css"&gt;.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }
&lt;/style&gt;

&lt;p&gt;Result:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://shazwazza.com/media/articulate/windows-live-writer-e42f7a425c51_13ed8-image_4.png"&gt;&lt;img title="image" style="display: inline" alt="image" src="http://shazwazza.com/media/articulate/windows-live-writer-e42f7a425c51_13ed8-image_thumb_1.png" width="800" height="83"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;WHOOHOOO!&lt;/p&gt;
&lt;h2&gt;Lets see it in action&lt;/h2&gt;
&lt;p&gt;Now that it’s running, I’ll jump over to the UI in Ubuntu and fire up the browser… Tada!!&lt;/p&gt;
&lt;p&gt;&lt;a href="http://shazwazza.com/media/articulate/windows-live-writer-e42f7a425c51_13ed8-image_6.png"&gt;&lt;img title="image" style="display: inline" alt="image" src="http://shazwazza.com/media/articulate/windows-live-writer-e42f7a425c51_13ed8-image_thumb_2.png" width="600" height="889"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;Problems along the way&lt;/h2&gt;
&lt;p&gt;I probably made the above sound a bit easier than it was ;) … I did run into a few setup issues along the way. &lt;/p&gt;
&lt;h4&gt;Problem #1&lt;/h4&gt;
&lt;p&gt;The first one was when I first tried to run dnx:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;failed to locate libcoreclr with error libunwind.so.8: cannot open shared object file: No such file or directory” when you run dnx or dnu command&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;I solved this issue from reading about it on this nice post: &lt;a title="http://blogs.msdn.com/b/rdcdev/archive/2015/08/28/some-issues-when-hosting-asp-net-5-on-ubuntu-on-azure.aspx" href="http://blogs.msdn.com/b/rdcdev/archive/2015/08/28/some-issues-when-hosting-asp-net-5-on-ubuntu-on-azure.aspx"&gt;http://blogs.msdn.com/b/rdcdev/archive/2015/08/28/some-issues-when-hosting-asp-net-5-on-ubuntu-on-azure.aspx&lt;/a&gt; which has some other nice tricks if you run into Ubuntu issues with ASP.Net 5.&amp;nbsp; The solution was that I needed to run this command:&lt;/p&gt;&lt;pre class="csharpcode"&gt;sudo apt-get install libunwind8&lt;/pre&gt;
&lt;style type="text/css"&gt;.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }
&lt;/style&gt;

&lt;h4&gt;Problem #2&lt;/h4&gt;
&lt;p&gt;Then I got this exception:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;The type initializer for 'libcrypto' threw an exception&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Which is referenced on this ASP.Net issue: &lt;a title="https://github.com/aspnet/dnx/issues/1806" href="https://github.com/aspnet/dnx/issues/1806"&gt;https://github.com/aspnet/dnx/issues/1806&lt;/a&gt; … and turns out that it’s also referenced on the above link. I can’t remember where exactly I found this solution but I had to run:&lt;/p&gt;&lt;pre class="csharpcode"&gt;apt-get install libcurl4-openssl-dev&lt;/pre&gt;
&lt;style type="text/css"&gt;.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }
&lt;/style&gt;

&lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;h4&gt;Problem #3&lt;/h4&gt;
&lt;p&gt;After fixing those 2 things, the bash kestrel command succeeded but when I went to test this in my browser, I just had a white screen. After Googling, I found this link: &lt;a title="http://stackoverflow.com/questions/28845892/blank-white-screen-on-error-with-kestrel-asp-net-5" href="http://stackoverflow.com/questions/28845892/blank-white-screen-on-error-with-kestrel-asp-net-5"&gt;http://stackoverflow.com/questions/28845892/blank-white-screen-on-error-with-kestrel-asp-net-5&lt;/a&gt; and as it turns out, I had the same issue. I forgot to add the error handling middleware. Perhaps when running in VS with IIS this is automatically taken care of for you… not sure. But in any case, it’s super important that you add it and you should add it as the first middleware so you can actually see if your other middleware fails, typically your ‘Configure’ method in your Startup class should start with:&lt;/p&gt;&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; Configure(IApplicationBuilder app, IHostingEnvironment env)
{
    &lt;span class="rem"&gt;// Add the following to the request pipeline only in development environment.&lt;/span&gt;
    &lt;span class="kwrd"&gt;if&lt;/span&gt; (env.IsDevelopment())
    {
        app.UseErrorPage();
    }
    &lt;span class="kwrd"&gt;else&lt;/span&gt;
    {
        &lt;span class="rem"&gt;// Add Error handling middleware which catches all application specific errors and&lt;/span&gt;
        &lt;span class="rem"&gt;// sends the request to the following path or controller action.&lt;/span&gt;
        app.UseErrorHandler(&lt;span class="str"&gt;"/Home/Error"&lt;/span&gt;);
    }
&lt;/pre&gt;
&lt;h4&gt;Problem #4&lt;/h4&gt;
&lt;p&gt;We’re not in Windows-land anymore! The errors I was getting were due to invalid file system paths. Turns out that .Net has always had this property: &lt;strong&gt;System.IO.Path.DirectorySeparatorChar &lt;/strong&gt;but there wasn’t much reason to use it since .Net only runs in Windows and that character is always backslash. So I had to change my hard coded backslash use to use this instead. Next file path issue was case sensitivity… DOH. The Smidge configuration file is: ~/smidge.json however in my c# code I was trying to load it in with “Smidge.json” which fails in Linux of course. &lt;/p&gt;
&lt;h4&gt;Problem #5&lt;/h4&gt;
&lt;p&gt;Static files… I’m so used to working with IIS I forgot that outside of IIS I’d need to make sure the static file middleware was used:&lt;/p&gt;&lt;pre class="csharpcode"&gt;app.UseStaticFiles();&lt;/pre&gt;
&lt;style type="text/css"&gt;.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }
&lt;/style&gt;

&lt;p&gt;I fixed that up and everything just worked… very freakin cool!!&lt;/p&gt;
&lt;h2&gt;Release – beta6&lt;/h2&gt;
&lt;p&gt;I’ve put up a new release on Nuget with these changes:&lt;/p&gt;
&lt;style type="text/css"&gt;
.nuget-badge code {
    -moz-border-radius: 5px;
    -webkit-border-radius: 5px;
    background-color: #202020;
    border: 4px solid silver;
    border-radius: 5px;
    box-shadow: 2px 2px 3px #6e6e6e;
    color: #e2e2e2;
    display: block;
    font: 1.5em 'andale mono','lucida console',monospace;
    line-height: 1.5em;
    overflow: auto;
    padding: 15px;
}
&lt;/style&gt;

&lt;div class="nuget-badge"&gt;
&lt;p&gt;&lt;code&gt;PM&amp;gt; Install-Package Smidge -Pre &lt;/code&gt;&lt;/p&gt;&lt;/div&gt;
&lt;p&gt;And the source is on GitHub: &lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;beta6 release: &lt;a title="https://github.com/Shazwazza/Smidge/releases/tag/1.0.0-beta5" href="https://github.com/Shazwazza/Smidge/releases/tag/1.0.0-beta6"&gt;https://github.com/Shazwazza/Smidge/releases/tag/1.0.0-beta6&lt;/a&gt; 
&lt;li&gt;home &amp;amp; docs: &lt;a title="https://github.com/Shazwazza/Smidge" href="https://github.com/Shazwazza/Smidge"&gt;https://github.com/Shazwazza/Smidge&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;</description>
      <pubDate>Thu, 23 Mar 2023 15:08:15 Z</pubDate>
      <a10:updated>2023-03-23T15:08:15Z</a10:updated>
    </item>
    <item>
      <guid isPermaLink="false">1305</guid>
      <link>https://shazwazza.com/post/client-dependency-framework-beta-released/</link>
      <category>Client Dependency</category>
      <title>Client Dependency Framework Beta Released</title>
      <description>&lt;div class="imported-post"&gt;This post was imported from FARMCode.org which has been discontinued. These posts now exist here as an archive. They may contain broken links and images.&lt;/div&gt;I’ve posted a new Beta release on CodePlex, you can get it here: &lt;a href="http://clientdependency.codeplex.com/Release/ProjectReleases.aspx" target="_blank"&gt;http://clientdependency.codeplex.com/Release/ProjectReleases.aspx&lt;/a&gt;. On the releases tab includes a sample web site that has most of the functionality that you can do so please download it for a documentation reference.&lt;/p&gt;  &lt;h2&gt;Newest changes &amp;amp; additions&lt;/h2&gt;  &lt;ul&gt;   &lt;li&gt;Namespace and codebase changes/steamlining&lt;/li&gt;    &lt;li&gt;Proper versioning added&lt;/li&gt;    &lt;ul&gt;     &lt;li&gt;Versioning is done on a global basis in the config&lt;/li&gt;      &lt;li&gt;Old versions are retained and can still be accessed from the Client Dependency URL that was previously used (if necessary) &lt;/li&gt;      &lt;li&gt;Versioned composite files names are prefixed with the version number (i.e. version 2 files will be prefixed with '2_') so it's easy to figure out which files are old &lt;/li&gt;      &lt;li&gt;The composite file map also reflects which composite file sets are under a specific version&lt;/li&gt;   &lt;/ul&gt;    &lt;li&gt;Provider model extended to support 2 types of providers: &lt;/li&gt;    &lt;ul&gt;     &lt;li&gt;File Registration Providers        &lt;ul&gt;         &lt;li&gt;Still comes with 2 providers: page header provider and a lazy loading JavaScript client based provider&lt;/li&gt;       &lt;/ul&gt;     &lt;/li&gt;      &lt;li&gt;Composite File Providers: &lt;/li&gt;      &lt;ul&gt;       &lt;li&gt;Comes with the standard provider: CompositeFileProcessor &lt;/li&gt;        &lt;li&gt;You can implement your own provider to customize the way that files are combined, compressed, minified, etc... if the standard provider isn't exactly what you are after&lt;/li&gt;     &lt;/ul&gt;   &lt;/ul&gt;    &lt;li&gt;Forced providers! You can now force a dependency to use a particular provider. This can be useful if you want to ensure that a particular script or stylesheet is rendered on to the page differently. For example, you may want to ensure that a script is lazy loaded (using the lazy load provider) but the rest are rendered in the page header. &lt;/li&gt;    &lt;li&gt;Utility methods added to the ClientDependencyLoader for more dynamic implementations &lt;/li&gt;    &lt;li&gt;A test website is included in the release which doubles as documentation, it includes:      &lt;ul&gt;       &lt;li&gt;Standard page header provider example &lt;/li&gt;        &lt;li&gt;Forced providers example &lt;/li&gt;        &lt;li&gt;Lazy load provider example &lt;/li&gt;        &lt;li&gt;Dynamically registering dependencies in your code behind &lt;/li&gt;        &lt;li&gt;Registering dependencies with attributes and via aspx controls&lt;/li&gt;     &lt;/ul&gt;   &lt;/li&gt; &lt;/ul&gt;  &lt;h2&gt;Things //TODO:&lt;/h2&gt;  &lt;p&gt;I’ve finished off versioning so at least i can cross that off from the previous list. But there’s still more to do:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Implement functionality for jQuery CDN&lt;/li&gt;    &lt;ul&gt;     &lt;li&gt;This will be a new control/attribute to easily include jQuery in your project&lt;/li&gt;      &lt;li&gt;You will have the option to select which CDN you want to use (Microsoft or Google), or you can supply an address (like your own CDN/web server)&lt;/li&gt;      &lt;li&gt;Though this framework will be included in Umbraco 4.1, we’ll be leaving this functionality out of the Umbraco build as we realize that there are quite a few installs that operate behind a firewall that won’t have access to the CDN.&lt;/li&gt;   &lt;/ul&gt;    &lt;li&gt;Implement skeleton for Microsoft AJAX 4 CDN&lt;/li&gt;    &lt;ul&gt;     &lt;li&gt;Again, this will be another new control/attribute to easily include Microsoft’s new brand of AJAX with their CDN solution&lt;/li&gt;   &lt;/ul&gt;    &lt;li&gt;Add support for MVC&lt;/li&gt;    &lt;li&gt;Support for JS/CSS Minification with options to disable per dependency&lt;/li&gt;    &lt;ul&gt;     &lt;li&gt;The reason this hasn’t been implemented yet is that I’ve found a lot of scripts/stylesheets break with minification so we need to be able to turn this on/off on a per file basis&lt;/li&gt;   &lt;/ul&gt;    &lt;li&gt;Some more documentation/examples in the example web application&lt;/li&gt; &lt;/ul&gt;</description>
      <pubDate>Thu, 23 Mar 2023 15:08:14 Z</pubDate>
      <a10:updated>2023-03-23T15:08:14Z</a10:updated>
    </item>
    <item>
      <guid isPermaLink="false">1307</guid>
      <link>https://shazwazza.com/post/clientdependency-now-supporting-mvc/</link>
      <category>Client Dependency</category>
      <title>ClientDependency now supporting MVC</title>
      <description>&lt;div class="imported-post"&gt;This post was imported from FARMCode.org which has been discontinued. These posts now exist here as an archive. They may contain broken links and images.&lt;/div&gt;I’m please to announce that the ClientDependency framework now supports MVC! It’s very easy to implement using HtmlHelper extension methods. Here’s some quick examples:  &lt;p&gt;Make a view dependent on a CSS file based on a path defined as “Styles”&lt;/p&gt;&lt;pre&gt;&amp;lt;% Html.RequiresCss("Content.css", "Styles"); %&amp;gt;&lt;/pre&gt;
&lt;p&gt;Make a view dependent on jQuery using a full path declaration:&lt;/p&gt;&lt;pre&gt;&amp;lt;% Html.RequiresJs("/Js/jquery-1.3.2.min.js"); %&amp;gt;&lt;/pre&gt;
&lt;p&gt;Rendering the Style blocks and defining a global style path:&lt;/p&gt;&lt;pre&gt;&amp;lt;%= Html.RenderCssHere(new BasicPath("Styles", "/Css")) %&amp;gt;&lt;/pre&gt;
&lt;p&gt;Rendering the Script block (no global script path defined):&lt;/p&gt;&lt;pre&gt;&amp;lt;%= Html.RenderJsHere() %&amp;gt;&lt;/pre&gt;
&lt;p&gt;There’s still a provider model for MVC but it uses a slightly different implementation from Web Forms. The same &lt;code&gt;compositeFiles&lt;/code&gt; provider model is used but instead of the &lt;code&gt;fileRegistration&lt;/code&gt; provider model that is used in Web Forms, a new mvc &lt;code&gt;renderers&lt;/code&gt; provider model is used. A renderer provider is similar to the Web Forms &lt;code&gt;fileRegistration&lt;/code&gt; providers but instead of registering the markup in the page using the page life cycle, a renderer provider is used to render out the html block necessary to embed in the page.&lt;/p&gt;
&lt;p&gt;All of the functionality that existed in Web Forms exists in MVC. You can make as many views that you want dependent on as many of the same or different client files that you want and the system will still sort by position and priority and remove all duplicate registrations. Rogue scripts &amp;amp; styles still get processed by the composite file provider in MVC. Currently however, if you place user or composite controls on your views that have Client Dependencies tagged with either the control or attribute method used in Web Forms, these will not be registered with the view and output with the renderer.&amp;nbsp; &lt;/p&gt;
&lt;p&gt;MVC pages have been added to the demo project as examples so have a look! You can download the source &lt;a style="font-size: 16pt" href="http://clientdependency.codeplex.com/SourceControl/list/changesets" target="_blank"&gt;HERE&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;For full details and documentation go &lt;a style="font-size: 16pt" href="http://clientdependency.codeplex.com/" target="_blank"&gt;HERE&lt;/a&gt;&lt;/p&gt;</description>
      <pubDate>Thu, 23 Mar 2023 15:08:14 Z</pubDate>
      <a10:updated>2023-03-23T15:08:14Z</a10:updated>
    </item>
    <item>
      <guid isPermaLink="false">1325</guid>
      <link>https://shazwazza.com/post/css3-using-the-fun-stuff-in-real-life/</link>
      <category>Web Development</category>
      <title>CSS3: Using the fun stuff in real life</title>
      <description>&lt;h2&gt;Sweep IE6 under the carpet&lt;/h2&gt; &lt;p&gt;Do whatever you can to remove IE6 support from your website’s build spec. Proper CSS selectors like the direct child (&lt;code&gt;ul &amp;gt; li&lt;/code&gt;), the &lt;code&gt;:hover&lt;/code&gt; state for elements other than anchors, and attribute selectors (&lt;code&gt;a[href*=”http://”]&lt;/code&gt;)&amp;nbsp; &lt;strong&gt;do not work &lt;/strong&gt;in IE6. Then, add &lt;a href="http://ie6update.com/"&gt;ie6update&lt;/a&gt;in a &lt;a href="http://www.quirksmode.org/css/condcom.html"&gt;conditional comment&lt;/a&gt; and voila! IE6 users see a totally legit looking alert bar across the top of their screen telling them that the page below looks horrible because they have an old browser and need to upgrade. Now you are ready to begin.&lt;/p&gt; &lt;h2&gt;CSS3 is only sort of supported&lt;/h2&gt; &lt;p&gt;&lt;a href="http://www.css3.info/preview/"&gt;CSS3&lt;/a&gt; is currently a &lt;a href="http://www.w3.org/TR/css3-roadmap/"&gt;working draft&lt;/a&gt;. Microsoft hence decided to implement barely any of its features in IE8, and as a result your CSS3 magic is restricted to ‘modern’ (real) rendering engines, like &lt;a href="http://webkit.org/"&gt;WebKit&lt;/a&gt; (Google Chrome, Safari) and &lt;a href="https://developer.mozilla.org/en/Gecko"&gt;Gecko&lt;/a&gt; (Firefox). However, the developers of these engines understand that CSS3 is a draft and as such the interface can be changed without warning. As a safeguard they apply a prefix to the drafted properties they want to support. These are known as:&lt;/p&gt; &lt;h3&gt;&lt;a href="http://www.w3.org/TR/CSS2/syndata.html#vendor-keywords"&gt;Vendor-specific extensions&lt;/a&gt;&lt;/h3&gt; &lt;p&gt;If you’ve ever seen anything like &lt;code&gt;-moz-border-radius: 6px;&lt;/code&gt; you know what I mean. Vendor-specific extensions are a standardised and accepted (however &lt;a href="http://www.css3.info/vendor-specific-extensions-to-css3/"&gt;occasionally non-validating&lt;/a&gt;) way of implementing future rules without fear of breaking anything. If you want to use CSS3 properties you will most likely have to include the same property with a prefix right after (excepting the few properties like &lt;code&gt;opacity&lt;/code&gt; and &lt;code&gt;border-radius&lt;/code&gt;). Your rules will look something like this:&lt;/p&gt;&lt;pre&gt;.box {
	-webkit-box-shadow:2px 2px 5px gray;
	-moz-box-shadow:2px 2px 5px gray;
	box-shadow:2px 2px 5px gray;
	}&lt;/pre&gt;
&lt;p&gt;I know that hurts, but at least your repitition of code is localised.&amp;nbsp; And it is future-friendly – as browsers start supporting CSS3 your advanced styles will begin to appear!&amp;nbsp; A shadow on a header here, a rounded corner there, an opacity somewhere. Patience.&amp;nbsp; &lt;/p&gt;
&lt;p&gt;You’ll notice there’s no &lt;code&gt;-ie-border-radius&lt;/code&gt; property above. This is very sad. This leads us to our next restriction in using CSS3:&lt;/p&gt;
&lt;h3&gt;Don't force a design&lt;/h3&gt;
&lt;p&gt;Think about it - why must the design for a site look the same in IE as Chrome? What if they looked different? Someone who sees the site in IE is not going to know what they're missing. If a design feature can't be implemented in IE that's no reason not to implement it in WebKit, so long as it degrades gracefully.&lt;/p&gt;
&lt;p&gt;For this to work you need to be close to the designers (or be the designer) and have laid back superiors - it can't really be done when you're dealing with long chains of design approval. Convince everyone that the site is going to look &lt;em&gt;better&lt;/em&gt; in Chrome (happy face!), not &lt;em&gt;worse&lt;/em&gt; in IE (ANGRY FACE). &lt;/p&gt;
&lt;h3&gt;Validating CSS3&lt;/h3&gt;
&lt;p&gt;By default, the W3C's &lt;a href="http://jigsaw.w3.org/css-validator/"&gt;CSS Validator&lt;/a&gt; does not recognise CSS3. You must specify that you are validating CSS3 by clicking "More Options" on the validator page and selecting the &lt;em&gt;CSS level 3&lt;/em&gt; profile.&lt;/p&gt;
&lt;p&gt;That’s it! Go forth and play:&lt;/p&gt;
&lt;h2&gt;CSS3 Goodies you have &lt;em&gt;got&lt;/em&gt; to check out: &lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="http://www.css3.info/preview/rgba/"&gt;Colours with alpha values!&lt;/a&gt; 
&lt;li&gt;&lt;a href="http://www.css3.info/preview/multiple-backgrounds/"&gt;Multiple background images!&lt;/a&gt; 
&lt;li&gt;&lt;a href="http://www.w3.org/TR/2001/CR-css3-selectors-20011113/"&gt;New selectors!&lt;/a&gt; 
&lt;li&gt;&lt;a href="http://www.w3.org/TR/css3-fonts/#font-resources"&gt;Embedded fonts!&lt;/a&gt; 
&lt;li&gt;&lt;a href="http://developer.apple.com/safari/library/documentation/InternetWeb/Conceptual/SafariVisualEffectsProgGuide/Transforms/Transforms.html"&gt;3D transforms!&lt;/a&gt; 
&lt;li&gt;&lt;a href="http://webkit.org/blog/138/css-animation/"&gt;Animations!&lt;/a&gt; &lt;/li&gt;&lt;/ul&gt;
&lt;h2&gt;Note on this site&lt;/h2&gt;
&lt;p&gt;This post is pretty much a press release for the recent redesign of &lt;strong&gt;FARMCode.org&lt;/strong&gt; – CSS3 allowed me to code the site exactly how I wanted in Google Chrome, translate it across to Firefox in like 5 minutes and then conduct quick damage control for IE (no rounded corners there).&lt;/p&gt;</description>
      <pubDate>Thu, 23 Mar 2023 15:08:14 Z</pubDate>
      <a10:updated>2023-03-23T15:08:14Z</a10:updated>
    </item>
    <item>
      <guid isPermaLink="false">1273</guid>
      <link>https://shazwazza.com/post/umbraco-41-benchmarks-part-1/</link>
      <category>Umbraco</category>
      <category>Client Dependency</category>
      <title>Umbraco 4.1 Benchmarks Part 1</title>
      <description>&lt;div class="imported-post"&gt;This post was imported from FARMCode.org which has been discontinued. These posts now exist here as an archive. They may contain broken links and images.&lt;/div&gt;This is the first installment of what will hopefully be many Umbraco benchmark reports created by various members of the core team in the lead up to the launch of Umbraco 4.1. This benchmark report is about the request/response performance of the Umbraco back-office. This compares 4 different configurations: 4.0.3 with browser cache disabled (first run), 4.0.3 with browser cached files, 4.1 with browser cache disabled and 4.1 with browser cached files. These comparisons have been done by using newly installed Umbraco instances with ONLY the CWS package installed. The benchmark results were prepared by using &lt;a href="http://www.charlesproxy.com/" target="_blank"&gt;Charles Proxy&lt;/a&gt;.   &lt;style&gt;
































.stats th {background-color:#ffffcc;color:black;}
.stats td, .stats th {
border-top:solid 1px black;
border-right:solid 1px black;
border-top:solid 1px black;
}
.stats td.first, .stats th.first {
border-left:solid 1px black;
}
.stats tr.bottom td, .stats td.bottom {
border-bottom:solid 1px black;
}
.stats tr.one { background-color:#ededed;}
.stats tr.two { background-color:#dcdcdc;}
.stats tr.three { background-color:#ededed;}
.stats tr.four {background-color:#d6f5f5;}&lt;/style&gt;  &lt;table class="stats" cellspacing="0" cellpadding="2" width="623"&gt; &lt;tbody&gt; &lt;tr&gt; &lt;th class="first" valign="top" width="110"&gt;Test&lt;/th&gt; &lt;th valign="top" width="168"&gt;Stats&lt;/th&gt; &lt;th valign="top" width="68"&gt;4.0.3&lt;/th&gt; &lt;th valign="top" width="107"&gt;4.0.3 &lt;br&gt;client cached&lt;/th&gt; &lt;th valign="top" width="69"&gt;4.1&lt;/th&gt; &lt;th valign="top" width="99"&gt;4.1 &lt;br&gt;client cached&lt;/th&gt;&lt;/tr&gt; &lt;tr class="one"&gt; &lt;td class="first" valign="top" rowspan="2" width="110"&gt;&lt;strong&gt;Content app&lt;/strong&gt;&lt;/td&gt; &lt;td valign="top" width="168"&gt;Completed Requests&lt;/td&gt; &lt;td valign="top" width="68"&gt;68&lt;/td&gt; &lt;td valign="top" width="107"&gt;7&lt;/td&gt; &lt;td valign="top" width="69"&gt;46&lt;/td&gt; &lt;td valign="top" width="99"&gt;6&lt;/td&gt;&lt;/tr&gt; &lt;tr class="one"&gt; &lt;td valign="top" width="168"&gt;Response (KB)&lt;/td&gt; &lt;td valign="top" width="68"&gt;687.05&lt;/td&gt; &lt;td valign="top" width="107"&gt;72.48&lt;/td&gt; &lt;td valign="top" width="69"&gt;431.41&lt;/td&gt; &lt;td valign="top" width="99"&gt;32.54&lt;/td&gt;&lt;/tr&gt; &lt;tr class="two"&gt; &lt;td class="first" valign="top" rowspan="2" width="110"&gt;&lt;strong&gt;Edit content &lt;br&gt;home page&lt;/strong&gt;&lt;/td&gt; &lt;td valign="top" width="168"&gt;Completed Requests&lt;/td&gt; &lt;td valign="top" width="68"&gt;50&lt;/td&gt; &lt;td valign="top" width="107"&gt;2&lt;/td&gt; &lt;td valign="top" width="69"&gt;34&lt;/td&gt; &lt;td valign="top" width="99"&gt;1&lt;/td&gt;&lt;/tr&gt; &lt;tr class="two"&gt; &lt;td valign="top" width="168"&gt;Response (KB)&lt;/td&gt; &lt;td valign="top" width="68"&gt;385.10&lt;/td&gt; &lt;td valign="top" width="107"&gt;47.28&lt;/td&gt; &lt;td valign="top" width="69"&gt;343.36&lt;/td&gt; &lt;td valign="top" width="99"&gt;12.07&lt;/td&gt;&lt;/tr&gt; &lt;tr class="three"&gt; &lt;td class="first" valign="top" rowspan="2" width="110"&gt;&lt;strong&gt;Expand all &lt;br&gt;content nodes&lt;/strong&gt;&lt;/td&gt; &lt;td valign="top" width="168"&gt;Completed Requests&lt;/td&gt; &lt;td valign="top" width="68"&gt;17&lt;/td&gt; &lt;td valign="top" width="107"&gt;17&lt;/td&gt; &lt;td valign="top" width="69"&gt;16&lt;/td&gt; &lt;td valign="top" width="99"&gt;16&lt;/td&gt;&lt;/tr&gt; &lt;tr class="three"&gt; &lt;td valign="top" width="168"&gt;Response (KB)&lt;/td&gt; &lt;td valign="top" width="68"&gt;18.47&lt;/td&gt; &lt;td valign="top" width="107"&gt;18.47&lt;/td&gt; &lt;td valign="top" width="69"&gt;13.96&lt;/td&gt; &lt;td valign="top" width="99"&gt;10.85&lt;/td&gt;&lt;/tr&gt; &lt;tr class="four"&gt; &lt;td class="first bottom" valign="top" rowspan="2" width="110"&gt;&lt;strong&gt;TOTALS&lt;/strong&gt;&lt;/td&gt; &lt;td valign="top" width="168"&gt;Completed Requests&lt;/td&gt; &lt;td valign="top" width="68"&gt;135&lt;/td&gt; &lt;td valign="top" width="107"&gt;26&lt;/td&gt; &lt;td valign="top" width="69"&gt;96&lt;/td&gt; &lt;td valign="top" width="99"&gt;23&lt;/td&gt;&lt;/tr&gt; &lt;tr class="bottom four"&gt; &lt;td valign="top" width="168"&gt;Response (KB)&lt;/td&gt; &lt;td valign="top" width="68"&gt;1063.62&lt;/td&gt; &lt;td valign="top" width="107"&gt;138.23&lt;/td&gt; &lt;td valign="top" width="69"&gt;788.73&lt;/td&gt; &lt;td valign="top" width="99"&gt;55.46&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt; &lt;p&gt;&lt;em&gt;&lt;strong&gt;Note&lt;/strong&gt;: the above is based on &amp;lt;compilation debug=”&lt;strong&gt;false&lt;/strong&gt;”&amp;gt; being set in the web.config. If it is set to true, the compression, combination and minification for both the ClientDependency framework and ScriptManager is not enabled. Also, this is not based on having IIS 7’s dynamic/static compression turned on, these benchmarks are based on Umbraco performing ‘as is ‘ out of the box which will be the same for IIS 6.&lt;/em&gt;&lt;/p&gt; &lt;p&gt;Though there’s only 3 tests listed above, these results will be consistent throughout all applications in the Umbraco back office in version 4.1.&lt;/p&gt; &lt;p&gt;The 4.1 difference:&lt;/p&gt; &lt;ul&gt; &lt;li&gt;In 4.0.3, all ScriptResource calls generated by ScriptManager were not being compressed or minified. This was due to a browser compatibility flag that was set in the base page (this was probably very old code from pre v3!).  &lt;li&gt;Script managers in the back-office have the ScriptMode=”release” explicitly set (for minification of ScriptResource.axd)  &lt;li&gt;The &lt;a href="http://farmcode.org/page/ASPNet-ClientDependency-Framework.aspx" target="_blank"&gt;ClientDependency&lt;/a&gt; framework is shipped with 4.1 and all of the back office registers it’s JavaScript and CSS files with this framework. This allows for:  &lt;ul&gt; &lt;li&gt;Combination, compression, minification of dependencies  &lt;li&gt;Rogue script/style detection (for those scripts/styles that weren’t registered with the framework will still get compressed/minified)  &lt;li&gt;Compression/minification of specified Mime types, in this case all JSON requests in the back office (namely the tree)  &lt;li&gt;Compression/minification of all JavaScript web service proxy classes (‘asmx/js’ requests that are made by registering web services with the ScriptManager &lt;/li&gt;&lt;/ul&gt; &lt;li&gt;Much of the back office client scripting in 4.1 has been completely refactored. Most of the JavaScript has been rewritten and a ton of file cleanup has been done. &lt;/li&gt;&lt;/ul&gt; &lt;p&gt;Compared to 4.0.3, this is a HUGE difference with some serious performance benefits!&lt;/p&gt;</description>
      <pubDate>Thu, 23 Mar 2023 15:08:14 Z</pubDate>
      <a10:updated>2023-03-23T15:08:14Z</a10:updated>
    </item>
    <item>
      <guid isPermaLink="false">1164</guid>
      <link>https://shazwazza.com/post/styling-xml-with-css/</link>
      <category>Web Development</category>
      <title>Styling XML with CSS</title>
      <description>&lt;div class="imported-post"&gt;This post was imported from FARMCode.org which has been discontinued. These posts now exist here as an archive. They may contain broken links and images.&lt;/div&gt;I’m sure you’ve heard of XSLT (DON'T GO AWAY I'M NOT SUPPORTING XSLT!). XSLT is used to transform XML into different XML – for example, rendering XML as HTML.&amp;nbsp; An example:  &lt;h2&gt;The XSLT method&lt;/h2&gt;&lt;pre&gt;&amp;lt;album&amp;gt;
	&amp;lt;title&amp;gt;Funkentelechy Vs. The Placebo Syndrome&amp;lt;/title&amp;gt;
	&amp;lt;artist&amp;gt;Parliament&amp;lt;/artist&amp;gt; 
	&amp;lt;year&amp;gt;1976&amp;lt;/year&amp;gt; 
	&amp;lt;funkativity&amp;gt;10&amp;lt;/funkativity&amp;gt; 
&amp;lt;/album&amp;gt;
&lt;/pre&gt;
&lt;p&gt;can be transformed (using XSLT) to this:&lt;/p&gt;&lt;pre&gt;&amp;lt;div class="album"&amp;gt;
	&amp;lt;h1&amp;gt;Funkentelechy Vs. The Placebo Syndrome&amp;lt;/h1&amp;gt;
	&amp;lt;p class="artist"&amp;gt;Parliament&amp;lt;/p&amp;gt;
	&amp;lt;p class="year"&amp;gt;1976&amp;lt;/p&amp;gt;
	&amp;lt;p class="funkativity"&amp;gt;This album has a funkativity rating of 10/10&amp;lt;/p&amp;gt;
&amp;lt;/div&amp;gt;
&lt;/pre&gt;
&lt;p&gt;Now the question is, "is &lt;code&gt;h1&lt;/code&gt; a better tagname for the artist of the album than &lt;code&gt;artist&lt;/code&gt;?". I'm pretty sure the answer is no. However, the HTML engine has no idea how to display an &lt;code&gt;artist&lt;/code&gt; tag - it treats every unknown tag like a &lt;code&gt;span&lt;/code&gt; tag.&lt;/p&gt;
&lt;h2&gt;The pure CSS method&lt;/h2&gt;
&lt;p&gt;So display information has to come from somewhere else. Some people may find the idea of markup depending entirely on CSS for display abhorrent. I do not. I maintain that reading the source of the &lt;code&gt;album&lt;/code&gt; XML block makes just as much sense as reading the rendered HTML version. And screenreaders...if I was a screenreader I'd want concise and descriptive XML, rather than having to wade through a bunch of HTML crap. And let's be real: everyone's web client supports CSS.&lt;/p&gt;
&lt;p&gt;Styling XML with CSS is actually very simple and very robust. The first thing to understand is that HTML is just a custom &lt;a href="http://www.w3.org/TR/REC-xml-names/#scoping-defaulting" target="_blank"&gt;namespace&lt;/a&gt; of XML. The second thing to understand is you can have multiple namespaces present in any XML document. That means you can use both HTML and, say, a custom namespace...which you can define and set styling rules.&lt;/p&gt;
&lt;p&gt;I won't blather much more. I'll just fill you in on how &lt;a href="http://www.w3.org/TR/css3-namespace/#declaration" target="_blank"&gt;CSS targets namespaces&lt;/a&gt;.&lt;/p&gt;
&lt;h3&gt;The CSS @namespace declaration&lt;/h3&gt;
&lt;p&gt;In short, I can write up a stylesheet which targets a specific namespace and only a specific namespace. My XML file would look like this:&lt;/p&gt;&lt;pre&gt;&amp;lt;?xml version="1.0" encoding="UTF-8" ?&amp;gt;
&amp;lt;albums xmlns="http://jdiacono.org/music"&amp;gt;
	&amp;lt;album&amp;gt;
		&amp;lt;title&amp;gt;Funkentelechy Vs. The Placebo Syndrome&amp;lt;/title&amp;gt;
		&amp;lt;artist&amp;gt;Parliament&amp;lt;/artist&amp;gt; 
		&amp;lt;year&amp;gt;1976&amp;lt;/year&amp;gt; 
		&amp;lt;funkativity&amp;gt;10&amp;lt;/funkativity&amp;gt; 
	&amp;lt;/album&amp;gt;
&amp;lt;albums&amp;gt;
&lt;/pre&gt;
&lt;p&gt;Here I declare that the XML inside and including the &lt;code&gt;albums&lt;/code&gt; block is of the namespace &lt;code&gt;http://jdiacono.org/music&lt;/code&gt;. Don't be misled by the namespace looking like a URL...I haven't even registered &lt;strong&gt;jdiacono.org&lt;/strong&gt; and this is still valid. This is because namespaces are actually just unique, case-sensitive strings, and URLs tend to be unique and full of information. Let it be known that this block is &lt;em&gt;all there is&lt;/em&gt;. It is a completely self descriptive block of pure data, which references nothing external.&lt;/p&gt;
&lt;p&gt;Now to style this...here is my CSS:&lt;/p&gt;&lt;pre&gt;@namespace url("http://jdiacono.org/music");

albums {
	display:block;
	}
	
album {
	display:list-item;
	list-style-type:decimal;
	margin-bottom:0.5em;
	padding:0.5em;
	border:1px solid;
	}
	
album title {
	display:block;
	font-size:2em;
	font-weight:bold;
	border-bottom:1px dashed;
	}
	
album artist {
	display:block;
	font-size:0.9em;
	}
	
album year {
	display:block;
	font-weight:bold;
	letter-spacing:0.4em;
	color:Green;
	}
	
album funkativity {
	display:block;
	font-style:italic;
	}
	
album funkativity:before {
	content: "This album has a funkativity rating of ";
	}
	
album funkativity:after {
	content: "/10";
	}
&lt;/pre&gt;
&lt;p&gt;Now I have another example that is much more nourishing, which uses HTML and a custom XML namespace in the same page. You will need a browser other than IE to view this.&lt;/p&gt;
&lt;p&gt;&lt;a href="/sourcecode/sourcecode/cssNamespaces/cssNamespaces.xml" target="_blank"&gt;farmcode.org/sourcecode/sourcecode/cssNamespaces/cssNamespaces.xml&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;UPDATE: &lt;a href="http://ie.microsoft.com/testdrive/"&gt;Looks like IE9 is supporting this!&lt;/a&gt;&lt;/p&gt;</description>
      <pubDate>Thu, 23 Mar 2023 15:08:14 Z</pubDate>
      <a10:updated>2023-03-23T15:08:14Z</a10:updated>
    </item>
    <item>
      <guid isPermaLink="false">1237</guid>
      <link>https://shazwazza.com/post/aspnet-client-dependency-framework-rc1-released/</link>
      <category>Client Dependency</category>
      <title>ASP.Net Client Dependency Framework RC1 Released!</title>
      <description>&lt;div class="imported-post"&gt;This post was imported from FARMCode.org which has been discontinued. These posts now exist here as an archive. They may contain broken links and images.&lt;/div&gt;With the community feedback, bug reports, patches, etc… I’ve managed to find time to upgrade this library to a release candidate status. We do use this framework in many production websites but it was great to hear from other in regards to specific bugs that were found relating to particular environments. These bugs have all been fixed up and this library is looking very stable. &lt;/p&gt;  &lt;p&gt;You can download the binaries &lt;a href="http://clientdependency.codeplex.com/releases/view/42193" target="_blank"&gt;&lt;strong style="font-size: 22px"&gt;here&lt;/strong&gt;&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;Better yet, I’ve put together a near complete documentation library on CodePlex &lt;a href="http://clientdependency.codeplex.com/documentation" target="_blank"&gt;&lt;strong style="font-size: 22px"&gt;here&lt;/strong&gt;&lt;/a&gt; !!&lt;/p&gt;  &lt;p&gt;I still think the best way to learn about this project is to download the source code from CodePlex &lt;a href="http://clientdependency.codeplex.com/SourceControl/list/changesets" target="_blank"&gt;&lt;strong style="font-size: 22px"&gt;here &lt;/strong&gt;&lt;/a&gt;and have a look at the demo web application included.&lt;/p&gt;  &lt;p&gt;Moving forward, the next phase for this library is to add MVC support and another file registration provider called PlaceholderProvider which will give you even more granular control over where dependencies can be rendered in your markup. MVC support should be fairly straight forward and we’ll include a demo project for this as well.&lt;/p&gt;  &lt;p&gt;Well definitely be releasing a final version soon after the next Umbraco 4.1 release candidate is released (which will hopefully be fairly soon!)&lt;/p&gt;  &lt;p&gt;Happy day! Any and all feedback, bug reports and patches are definitely appreciated!&lt;/p&gt;</description>
      <pubDate>Thu, 23 Mar 2023 15:08:14 Z</pubDate>
      <a10:updated>2023-03-23T15:08:14Z</a10:updated>
    </item>
  </channel>
</rss>