Giulio Canti's Blog https://gcanti.github.io Replacing propTypes with type annotations in React 0.13 In React 0.13.0 you no longer need to use React.createClass to create React components Mon, 02 Feb 2015 00:00:00 +0000 https://gcanti.github.io/2015/02/02/replacing-prop-types-with-type-annotations.html https://gcanti.github.io/2015/02/02/replacing-prop-types-with-type-annotations.html Understanding React and reimplementing it from scratch Part 2: Controllers In the previous article I introduced the universal virtual DOM (UVDOM) and the concept of views as functions. But this kind of view is "impassive", that is it's not able to react to user inputs. If I could render the view in the browser and click the button nothing will happen. In a browser user inputs are modeled as events so I need to add events to the UVDOM and a way to handle them... Mon, 24 Nov 2014 00:00:00 +0000 https://gcanti.github.io/2014/11/24/understanding-react-and-reimplementing-it-from-scratch-part-2.html https://gcanti.github.io/2014/11/24/understanding-react-and-reimplementing-it-from-scratch-part-2.html Understanding React and reimplementing it from scratch Part 1: Views Pressed by my own thread on Reddit I started a journey to understand what can be generalized and unified in the different implementations of a React-like library. The best way I know to understand something isn't just to learn how it works but which problems it's trying to solve and why it's designed that way. Wed, 29 Oct 2014 00:00:00 +0000 https://gcanti.github.io/2014/10/29/understanding-react-and-reimplementing-it-from-scratch-part-1.html https://gcanti.github.io/2014/10/29/understanding-react-and-reimplementing-it-from-scratch-part-1.html JavaScript, Types and Sets - Part II Now it's time to define four other useful type combinators Tue, 07 Oct 2014 00:00:00 +0000 https://gcanti.github.io/2014/10/07/javascript-types-and-sets-part-II.html https://gcanti.github.io/2014/10/07/javascript-types-and-sets-part-II.html JavaScript, Types and Sets - Part I In this article I'll illustrate how a mathematician could regard the JavaScript language and its type system. I'll talk about sets, functions and immutability, building a coherent framework of concepts. This framework helps me to reason about the system while I'm coding. I hope it can help you too Mon, 29 Sep 2014 00:00:00 +0000 https://gcanti.github.io/2014/09/29/javascript-types-and-sets.html https://gcanti.github.io/2014/09/29/javascript-types-and-sets.html Six reasons to define constructors with only one argument After all the comments here and on Reddit (thanks to all), I've updated this article to better explain my POV. Thu, 25 Sep 2014 00:00:00 +0000 https://gcanti.github.io/2014/09/25/six-reasons-to-define-constructors-with-only-one-argument.html https://gcanti.github.io/2014/09/25/six-reasons-to-define-constructors-with-only-one-argument.html JSON API Validation In Node.js In the last post I've showed a good solution for consuming a JSON API on the client, but what about the server? Mon, 15 Sep 2014 00:00:00 +0000 https://gcanti.github.io/2014/09/15/json-api-validation-in-node.html https://gcanti.github.io/2014/09/15/json-api-validation-in-node.html JSON Deserialization Into An Object Model Deserializing the payload of a JSON Api into your object model can be cumbersome: you must handle all this issues by hand. In this post I'll show you how this work can be done in a few lines of code and in a safe way with the help of tcomb. Fri, 12 Sep 2014 00:00:00 +0000 https://gcanti.github.io/2014/09/12/json-deserialization-into-an-object-model.html https://gcanti.github.io/2014/09/12/json-deserialization-into-an-object-model.html An alternative syntax for React propTypes Additional fine grained type checks, easily integrable with tcomb-form to build awesome demos of your components Wed, 10 Sep 2014 00:00:00 +0000 https://gcanti.github.io/2014/09/10/an-alternative-syntax-for-react-prop-types.html https://gcanti.github.io/2014/09/10/an-alternative-syntax-for-react-prop-types.html What if your domain model could validate the UI for free? Does the world need another validation library? Probably not, but I think of tcomb more as a tool to build fast and safe domain models Tue, 12 Aug 2014 00:00:00 +0000 https://gcanti.github.io/2014/08/12/what-if-your-domain-model-could-validate-the-ui-for-free.html https://gcanti.github.io/2014/08/12/what-if-your-domain-model-could-validate-the-ui-for-free.html