Evaluating Blazor
Total Page:16
File Type:pdf, Size:1020Kb
Linköping University | IDA Bachelor thesis, 16hp Autumn term 2020 | LIU-IDA/LITH-EX-G--20/079-SE Evaluating Blazor A comparative examination of a web framework Erik Sandberg Examinator, Petru Eles Copyright The publishers will keep this document online on the Internet – or its possible replacement – for a period of 25 years starting from the date of publication barring exceptional circumstances. The online availability of the document implies permanent permission for anyone to read, to download, or to print out single copies for his/hers own use and to use it unchanged for non-commercial research and educational purpose. Subsequent transfers of copyright cannot revoke this permission. All other uses of the document are conditional upon the consent of the copyright owner. The publisher has taken technical and administrative measures to assure authenticity, security and accessibility. According to intellectual property law the author has the right to be mentioned when his/her work is accessed as described above and to be protected against infringement. For additional information about the Linköping University Electronic Press and its procedures for publication and for assurance of document integrity, please refer to its www home page: http://www.ep.liu.se/. © Erik Sandberg Abstract Keywords: Blazor, web framework, WebAssembly, JavaScript, For my thesis work I have done an evaluation of the newly released Microsoft developed web framework Blazor. My methodology is based upon a couple of previous articles about evaluating web frameworks. From these articles I have gathered a number of criteria used in my evaluation: documentation, lines of code, community size, framework usage, framework maturity, framework freshness, browser support and framework cost. Additionally, since Blazor is based on C# instead of JavaScript, I have included a 9th criterion, comparing JavaScript with C#. Many of the criteria need some kind of counterpart for Blazor to be compared with, for this purpose I have mainly used the established web framework Angular, and in some cases Ember.js. When evaluating, I have not expected Blazor to exceed Angular. Rather I have counted all cases where Blazor can at least be considered comparable to Angular (or Ember.js) as favourable. I found that overall Blazor did very well in the comparison as 6 out of the 8 criteria I took from the articles evaluated favourably for Blazor. The two criteria where I found Blazor lacking were framework usage and framework maturity. While there are large numbers of showcases and example sites I did not find any large production websites developed with Blazor, and for obvious reasons the framework that was officially released earlier this year has yet to reach a mature state. Furthermore I found the extra criteria, JavaScript vs C#, was favourable to Blazor. Thus, my conclusion is that Blazor is certainly worth picking up for new projects. I argue that even though the framework is not yet fully mature it has come far in its short lifespan, and that even though Blazor is not widely used yet it is unlikely to go away considering that it is developed and supported by a large company like Microsoft. iii Table of Contents 1 Introduction..............................................................................................................6 2 Background...............................................................................................................7 2.1 Web Frameworks.......................................................................................................7 2.2 JavaScript and TypeScript.........................................................................................8 2.3 C#...............................................................................................................................10 2.4 WebAssembly...........................................................................................................10 2.5 Blazor........................................................................................................................11 3 Methodology...........................................................................................................12 3.1 My Application.........................................................................................................13 3.2 Evaluation criteria....................................................................................................14 3.2.1 Documentation........................................................................................................ 14 3.2.2 Lines of Code........................................................................................................... 15 3.2.3 Community Size....................................................................................................... 16 3.2.4 Framework Usage...................................................................................................16 3.2.5 Framework Maturity...............................................................................................17 3.2.6 Framework Freshness.............................................................................................17 3.2.7 Browser Support...................................................................................................... 18 3.2.8 Framework Cost....................................................................................................... 18 4 Findings...................................................................................................................19 4.1 Documentation........................................................................................................19 4.1.1 Extent and features coverage................................................................................19 4.1.2 Tutorials, examples and templates.......................................................................20 4.2 Lines of Code............................................................................................................21 4.3 Community Size.......................................................................................................23 4.4 Framework Usage....................................................................................................23 4.5 Framework Maturity................................................................................................24 4.6 Framework Freshness.............................................................................................24 4.7 Browser Support......................................................................................................25 4.8 Framework Cost.......................................................................................................25 5 Discussion................................................................................................................26 5.1 Documentation........................................................................................................26 5.2 Lines of Code............................................................................................................27 5.3 Community Size.......................................................................................................28 5.4 Framework Usage....................................................................................................29 iv 5.5 Framework Maturity................................................................................................29 5.6 Framework Freshness.............................................................................................30 5.7 Browser Support......................................................................................................30 5.8 Framework Cost.......................................................................................................31 5.9 JavaScript or C#?......................................................................................................31 6 Conclusion...............................................................................................................33 7 Reference List.........................................................................................................35 7.1 Articles......................................................................................................................35 7.2 Web pages................................................................................................................36 v 1 Introduction The last decade a myriad of JavaScript frameworks have emerged, and choosing which framework to work with is a major consideration for a project. Recently, new languages have also entered the scene, not only languages related to JavaScript like TypeScript, but traditional languages like C++ that are compiled and run as WebAssembly as well. Microsoft has recently developed the open source web framework Blazor, based on C# mixed with traditional HTML. Blazor consists of a server-side and a client-side implementation where the client-side implementation is based on WebAssembly. My intention is to first develop a small application using Blazor and then evaluate if the framework is comparable to leading web frameworks by setting various features of Blazor and its community side by side with corresponding features of leading web frameworks. Thus, I hope to determine, to a degree, if it is worth for a web developer or company working in web development to add Blazor to their repertoire. Personally