I've been getting back into building scrappy little web apps for my friends. On top of this, I recently joined a startup and getting away from Enterprise class software has made me make a huge mind-shift. In the recent past when I wanted to build apps I was thinking Kubernetes, Helm Charts, etc. However, in small app, and startup land reducing the barriers to ship is very important.
So many people know me as a very performance focused engineer, and as someone that cares about perf I've always been a bit embarrassed about this blog. In actual fact this blog as it sits now is fast by most people's standards. I got a new job in July, and well I work with an absolute mad lad that is making me feel pretty embarrassed with his 900ms page load times. So I've decided to build my own blog engine, and compete against him.
Here we are, its 2017 dotnet core is out, and finally dotnet has a proper cli. In a previous post we explored the new cli. In short you can use the dotnet cli to build, test, package, and publish projects. However sometimes just using the cli is not enough. Sometimes, you land in a place where you have many projects to compile, test, and package.
Recently I had heard live.asp.net had started to precompile the razor views. I figured I'd dig in and quickly figure out how to do it.
When Visual studio 2015 launched, I wrote a blog post titled Resharper without Resharper. This was clearly aimed at giving people the ability in 2015 to divorce themselves from the very expensive product. In writing the post however, I didn't realize people would just want a low down on cool vs2015 extensions.
Now that dotnet core tools have been released I thought it would be good to look into the dotnet cli. This is a new command line interface to build, manage, compile and run
dotnet core based applications
Recently I wanted to make myself a short url host. Really, I made this not to make short urls, but to make memorable urls for myself.
tl;dr click here
When we talk about capturing metrics in applications. One server/service that constantly is in all conversations monitoring, is statsd. Incase you have never heard of it, statsd is a udp/tcp server that you send your in-code metrics to. These metrics get aggregated by statsd, and are forwarded to various backends. Some backends are services like librato or sumologic. Other times you are sending metrics to time series databases such as graphite or god forbid influxdb.
This boils down to in code you can say "log whenever this block of code is hit" or say "measure how long this function takes to execute". These stories come together to form pretty graphs, and rich alerts. All of this enabled by statsd.
So now that Windows server 2016 is generally avalible for the first time ever windows users can now use containers. Ok, so what exactly are containers? Well more or less they are virtual operating systems that share the same kernel as the host OS. In regular VM's the hardware is shared between machines, but containers go a step further and share the kernel of the OS. Why does this matter? Well because you are sharing an existing kernel that is already running, your startup times are instantanious. To put this in perspective, this is virtualization at the OS level.
On Linux, containers have been a thing for a long time. This technology is called LXC. Docker itself is a layer ontop of various container platforms embedded in operating systems.
dotnet CLI is currently in RC2, and while the train is fast approaching RTM, most tools are still catching up. dotnet seems to have a documented cli based install for every platform except the good ol windows. That being said getting a windows based install/build is possible.
For a while now I have been playing with rails, and rack webapps. If you are not familiar with these, they are webservers created in ruby. One of the features I ran into during my journey into ruby land is Turbolinks. Incase you are not familiar, Turbolinks is basically a simplified pjax, with a lot of flexibility. When you click on a link in a page with turbolinks, the link action is hijacked and the target page is loaded via ajax. The result of the ajax call (which is presumed to be html) will replace the document of the body tag. At the end of the day its a technology to load your server side pages via ajax.
In case you havn't been paying attention, recently it was announced that helios was no longer a thing. Helios was the loader for ASP.NET 5 in IIS. Instead they are using the http Platform Handler to proxy the connections to kestrel.
I was exploring around github, and I stumbled upon an interesting project called Miniblog which was a lightweight blog engine written in c#. The thing that immediately stood out to me was the lack of a
As I dug around the code I realized this was not a Web App, which most of us were familiar with, but a websites project. I then suddenly realized that the whole thing only used razor!
I am a huge fan of Nancyfx because its much more lightweight than the MVC framework created at Microsoft. To say the least I am a massive fan of small tools, and micro frameworks. So when I realized this whole thing was powered by razor only I was immediately impressed.
I decided to dig around on the internet to see if anyone else was talking about this. I found out quickly that it has been possible for some time, but I didn't find many references about it.
The one thing that bummed me out about the Miniblog example was that it was not a web app. You can use nuget packages will websites, but you cannot make references to other projects in the solution. This was a problem for me, and unlike websites, web app's are precompiled which reduces application startup time.
Entity Framework is the ORM that has been pushed by the MSFT giant over the last few years to the .NET community.
SquishIt is a content bundler and minification tool. The github documentation contains exaples how to install and use it, and a sample application is provided. However I had some issues getting it to work with razor so I figured I would share these pain points with you.