Asp.Net MVC programming advice. Toodles, Evan Nagle.
Sep
07

Chirpy to the XXXtreme – v1.0.0.5 Release (Party? NSFW? Eh? Eh?)

32 Comments
Posted by Evan in Visual Studio

I’m excited to announce the release of Chirpy v.1.0.0.5–Chirpy to the XXXtreme. That’s right. This version of Chirpy will blow the pants off of every clothed person in the universe. So, if you haven’t gotten dressed already, don’t bother.

Before diving too deep into the realm of the extreme, let me re-divulge the following preface: if you’re completely new to the madness of Chirpy, I recommend that you read about Chirpy’s core features. You can also watch David Ebbo demo Chirpy as a part of his MvcConf presentation. That should get you caught up. And once you’re caught up, come on back to this post.

Another important side-note: Chirpy’s current warp-like maturation is largely due to the superb and continued contributions of Andy Edinborough and Francis Noel. As a thanks for their support, and as an impetus for continued feather-laden progress, I kindly ask that you consider throwing a dollar or two (hundred [thousand]) into our donation hat. Andy, after all, has four children, and each requires at least one plate of sustenance per day. And I, although completely childless, have an insatiable, child-like desire for candy bars and diet Red Bulls.

At the very least, if you have experienced the pleasure of the flightless Chirpy bird (or if you feel like complaining about how crappy Chirpy is), go to Chirpy’s Codeplex page and write a comment or two. Or, if you’d like to follow the project more closely, feel free to follow all of Chirpy’s developers on Twitter.

Alright. Without further ado:


Xxxtreme New Chirpy Features

Let’s start with the obvious: you can download Chirpy v1.0.0.5 here.

Got it? Good.

Now, here’s an overview of all of the new features that you’ve just blessed yourself with. Click on the feature below that most likely suits your fancy, or, if you’re a real sucker for e-pain, you can scroll through the whole document (may God help you) until you reach the very, very end.

  • Chirpy Handles Seven New File Extensions
  • Chirpy Handles Inline Aspx and Ascx Translation and Minification
  • Chirpy’s Source is Now More Modularized and Multi-Threaded
  • Chirpy Can Use Google Closure Tools Offline
  • Chirpy’s Config Files Now Tote Intellisense

Feature 1: Chirpy Handles Seven New File Extensions

The new extensions include:

  1. .michaelash.css. Minify your stylesheets using Michael Ash’s Regex enhancements. If you’re unfamiliar with Michael Ash’s Regex CSS enhancements, you can read more about the project here.
  2. .hybrid.css. Minify your stylesheets with YUI Compressor + Michael Ash’s Regex enhancements.
  3. .msajax.css. Minify your stylesheets with Ms Ajax Minifier. If you’re unfamiliar with Microsoft’s Ajax Minifier, you can read more about the library here.
  4. .msajax.js. Minify your javascript files with Ms Ajax Minifier. If you’re unfamiliar with Microsoft’s Ajax Minifier, you can read more about the library here.
  5. .michaelash.less. Translate your Less files with the DotLess Translator, and minify the outputted CSS file with Michael Ash’s Regex enhancements.
  6. .hybrid.less. Translate your Less files with the DotLess Translator, and minify the outputted CSS file with YUI Compressor + Michael Ash’s Regex enhancements.
  7. .msajax.less. Translate your Less files with the DotLess Translator, and minify the outputted CSS file with MS Ajax Minifier.

Feature 2: Chirpy Handles Inline Aspx and Ascx Translation and Minification

Step 1: In your MVC or WebForms project, create a new View. Name the view Test.chirp.aspx:

spacer

Step 2: Insert a new inline script into your Test.chirp.aspx file:


<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

    <h2>Test.Chirp.aspx</h2>

    <script type="text/javascript">
        function thisWillGetMinifiedYo() {
            alert("hi");
            alert("bye");
        }
    </script>
</asp:Content>

Step 3: In the codebehind Test.aspx file, you’ll notice that all of your inline javascript has been minified:

spacer

Step 4: Now, for the fun part. Let’s create an inline Less tag. And let’s add some less code into our aspx page:


<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
    <style type="text/less">
        @color : #123456;

        tag
        {
            background-color:@color;
        }
    </style>
</asp:Content>

Step 5: In the codebehind Test.aspx file, you’ll notice that your inline Less code has been translated into minified CSS. Fun for all (don’t mind the mistake here, if you can sniff it out):

spacer


Feature 3: Chirpy’s Source is Now More Modularized and Multi-Threaded

It’s easier than ever to add your own translator to Chirpy. For starters, if you haven’t already, download and open Chirpy’s source project (you can download the source at Codeplex). Easy enough. Now, for Step 1, go ahead and open up the project in Visual Studio:

spacer

Step 2: Create a new Engine class in the Engines folder. In this example, I’ll create a really simple (read: stupid) Transform Engine:


using System;

namespace Zippy.Chirp.Engines
{
    public class TestEngine : TransformEngine
    {
        public TestEngine()
        {
            Extensions = new string[] { ".test.moo", ".test.foo" }; //extensions that this engine handles
            OutputExtension = ".test"; //outputted extension
        }

        public override string Transform(string fullFileName, string text, EnvDTE.ProjectItem projectItem)
        {
            return "//here is the outputted text:" + Environment.NewLine + text;
        }

        public override void Process(Manager.VSProjectItemManager manager, string fullFileName, EnvDTE.ProjectItem projectItem, string baseFileName, string outputText)
        {
            //process occurs after transformation
            //you can override, if you so choose...
            base.Process(manager, fullFileName, projectItem, baseFileName, outputText);
        }
    }
}

Step 3: Once your Engine class is built, you need to register your new engine in the Chirp class (Chirp.cs):


internal TestEngine TestEngine { get; set; }

public void LoadActions() {
    if(_EngineManager == null || _EngineManager.IsDisposed)
        _EngineManager = new EngineManager(this);

    _EngineManager.Clear();
    _EngineManager.Add(YuiCssEngine = new YuiCssEngine());
    _EngineManager.Add(YuiJsEngine = new YuiJsEngine());
    _EngineManager.Add(ClosureCompilerEngine = new ClosureCompilerEngine());
    _EngineManager.Add(LessEngine = new LessEngine());
    _EngineManager.Add(MsJsEngine = new MsJsEngine());
    _EngineManager.Add(MsCssEngine = new MsCssEngine());
    _EngineManager.Add(ConfigEngine = new ConfigEngine());
    _EngineManager.Add(ViewEngine = new ViewEngine());
    _EngineManager.Add(T4Engine = new T4Engine());
    _EngineManager.Add(TestEngine = new TestEngine()); //here's our baby
}

Step 4: Rebuild the vsi package. If you’re not comfortable creating a vsi file manually (as described here), you can automatically generate the vsi file as part of the Build process. Just make sure that the following commands are included in the Post-build event command line:

del “$(ProjectDir)$(OutDir)Chirpy.vsi”
“$(ProjectDir)$(OutDir)\ILMerge” /out:”$(ProjectDir)$(OutDir)Chirpy.dll” “$(TargetPath)” “$(ProjectDir)$(OutDir)EcmaScript.NET.modified.dll” “$(ProjectDir)$(OutDir)Yahoo.YUI.Compressor.dll” “$(ProjectDir)$(OutDir)dotless.Core.dll” “$(ProjectDir)$(OutDir)AjaxMin.dll”
“$(ProjectDir)$(OutDir)7za.exe” u Chirpy.zip “$(ProjectDir)$(OutDir)Chirpy.dll” “$(ProjectDir)$(OutDir)Chirpy.vscontent” “$(ProjectDir)$(OutDir)Zippy.AddIn”
rename “$(ProjectDir)$(OutDir)Chirpy.zip” “Chirpy.vsi”

Step 5: Open the vsi file, and install your customized version of Chirpy!

spacer

Step 6: Test out your awesome new engine. For my TestEngine, I created a file with the extension “.test.moo”. As a result, Chirpy creates a codebehind file:

spacer

Step 7: Take a look at the codebehind file that Chirpy created. Notice that we “transformed” the .test.moo file by adding a comment at the top of the file:

spacer

Step 8: If your engine might be helpful to other developers, please (and I mean PLEASE) consider submitting your addition to the project. I’d be excited to include it. And I’d be forever grateful for your contribution.


Feature 4: Use Google Closure Tools Offline

Though this feature has yet to be integrated into the main Chirpy project, Erik Zaadi has been working on a great Chirpy extension. The extension allows for offline use of Google Closure Tools. If you’re interested in using Erik’s madness, you can read about it here, and you can download the fork at Codeplex.


Feature 5: Chirpy’s Config File Now Totes Intellisense

You can download the XML schema file from here, or, if you’re lazy, you can reference the xsd file thusly:


<?xml version="1.0"?>

<root
  xmlns="urn:ChirpyConfig"
  xmlns:xsi="www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="urn:ChirpyConfig www.weirdlover.com/chirpy/chirp.xsd">

  <FileGroup Name="mash.js" Minify="False">
    <File Path="jquery-1.4.2.min.js"/>
    <File Path="json2.min.js"/>
  </FileGroup>

  <FileGroup Name="mash.min.js" Minify="True">
    <File Path="jquery-1.4.2.min.js"/>
  </FileGroup>
</root>

Once you’ve referenced the xsd file, you’ll get your oh-so-desired intellisense:

spacer


That’s it! Once again, Chirpy says: Happy Coding!

spacer

  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
Get Shareaholic

Read More

  • Download Chirpy Zippy : Visual Studio AddIn for Js, Css, and Less Files (3)
    This post is another "milestone" in the arduous journey of the Zippy bird. It's an ugly bird, but the process of "making fluff out of feathers" has al...
  • Chirpy Attains Godlike Bird-Power In Version 1.0.0.4 (43)
    Let's start with the simplest part: download Chirpy at codeplex. Start fiddling around. If something doesn't work complain about it. If something does...
  • Chirpy Has a New Cage (and New Features!) (3)
    Already know sir Zippy biblically? Well, then. Due to overwhelming demand (and a deadly case of the avian bird flu), Chirpy (aka Chirpy Zippy) is now ...

You can leave a response, or trackback from your own site.

32 Responses to “Chirpy to the XXXtreme – v1.0.0.5 Release (Party? NSFW? Eh? Eh?)”

 
  1. spacer Jason Wicker says:
    September 7, 2010 at 8:47 pm

    Once again, you rocked my world! This tool is awesome.

  2. spacer Martin Aatmaa says:
    September 7, 2010 at 11:18 pm

    The translator/engine extensibility points are an awesome addition.

    sweettastic!

  3. spacer Serge says:
    September 10, 2010 at 3:16 am

    Hey, so i installed the vsi file, but when i add js files (someFileName.yui.js) i never get the code behind files. Am i missing some key configuration?

  4. Combine external files to get the minor amount of requests | Beastx's Blog says:
    September 19, 2010 at 9:57 am

    [...] Chirpy to the XXXtreme – v1.0.0.5 Release (Party? NSFW? Eh? Eh?) « weirdlover [...]

  5. spacer Daniel Steigerwald says:
    September 23, 2010 at 7:41 pm

    Is possible to enable google closure simple compression on all files in one FileGroup yet?

  6. spacer Evgenij says:
    September 24, 2010 at 2:32 am

    This thing is awesome!

    But it would be great to have LESS variables in one file, and use them in another. As far as I got, it doesn’t work that way.

  7. spacer Daniel Steigerwald says:
    September 24, 2010 at 10:58 pm

    @Serge It’s bug (fixed in repository). You can downgrade to 1.04, or wait to new release. I wonder that new fixed release isn’t out yet.

  8. spacer Evan says:
    September 25, 2010 at 10:51 pm

    Hey Daniel and Serge,

    The newest version of the vsi (1.0.0.5.2) SHOULD have all of the necessary fixes, does it not? The vsi was updated to include fixes from 9/14/10.

    Let me know if the issue still exists, and I’ll see what I can do.

    Cheers,
    Evan

  9. spacer Kevn says:
    September 26, 2010 at 5:19 am

    This is a great plugin. Exacly what my team needs.

    I tried it out and the mash up using a .chirp.config file worked, once. Now it doesn’t work for my anymore and I don’t know why. I even removed the plug in completely and re-installed it, but that didn’t work. Any insight why this might have happened?

  10. spacer Daniel Steigerwald says:
    September 26, 2010 at 7:36 pm

    Thanx, it is working now. I didn’t noticed a new version spacer
    I have one question, can I use google standard compression in .chirp.config for all files? YUI sucks sometimes, Google is much better.

  11. spacer Daniel Steigerwald says:
    September 26, 2010 at 7:43 pm

    Ok, MinifyWith=”gctSimple” works, thanx spacer

  12. spacer Daniel Steigerwald says:
    September 27, 2010 at 2:50 pm

    It seems I need local google compression. Se errors:

    Warning file size too large for Google: 786,605

    Warning Server error : Too many compiles performed recently. Try again later.

    How can I enable client side cimpilation?

  13. gipoco.com is neither affiliated with the authors of this page nor responsible for its contents. This is a safe-cache copy of the original web site.