<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Ari Palo on Medium]]></title>
        <description><![CDATA[Stories by Ari Palo on Medium]]></description>
        <link>https://medium.com/@aripalo?source=rss-505d86fcf177------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*lQQmnK29KjYhlF4Dr9aKcQ.jpeg</url>
            <title>Stories by Ari Palo on Medium</title>
            <link>https://medium.com/@aripalo?source=rss-505d86fcf177------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 23 Nov 2026 08:35:28 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@aripalo/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Thoughts on Angular 2 after ng-conf 2015 (and some whisky)]]></title>
            <link>https://medium.com/@aripalo/thoughts-on-angular-2-after-ng-conf-2015-and-some-whisky-8392c260095c?source=rss-505d86fcf177------2</link>
            <guid isPermaLink="false">https://medium.com/p/8392c260095c</guid>
            <dc:creator><![CDATA[Ari Palo]]></dc:creator>
            <pubDate>Sun, 08 Mar 2015 03:03:14 GMT</pubDate>
            <atom:updated>2015-03-08T21:16:01.070Z</atom:updated>
            <content:encoded><![CDATA[<h2>Thoughts on Angular 2 after ng-conf 2015<br>(and some whisky)</h2><p><em>On Migrating from Angular 1 to Angular 2, the New Syntax, Web Components, Performance, TypeScript and Future of JavaScript.</em></p><p>Saturday, March 7th: I’ve been mostly sipping whisky (<em>The Tennesee straight bourbon</em> sort, not the proper <em>Scotch</em> sort! My stock of Scotch seem to have somehow magically depleted…) <strong>and</strong> watching presentation videos from <a href="http://www.ng-conf.org/">ng-conf</a> 2015, held on March 5th-6th in Salt Lake City, Utah in <em>United States of America</em> — so maybe my choice of whisky was appropriate?</p><p>The presentations mostly discussed the upcoming Angular version 2 and how the current Angular 1.x development accounts for that.</p><p><em>So here’s what </em><strong><em>I found</em></strong><em> most interesting in 2015 ng-conf:</em></p><h3>Migration path!</h3><p>Let’s start with the big one: Last year’s biggest rage in Angular community seemed to be about the announcement from Angular core contributors that there will not be a migration path from Angular v1 to Angular v2.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*a0iJWvFkUL5zoPWGAqwvrA.png" /></figure><p>Luckily for us who are currently developing Angular v1 apps, <a href="https://twitter.com/bradlygreen">Brad Green</a> and <a href="https://twitter.com/igorminar">Igor Minar</a> told that <a href="http://youtu.be/QHulaj5ZxbI?t=10m30s">there will be a migration path</a>! The main component in migrating to version 2 will be <a href="https://github.com/angular/router">the new router</a>, which will work for both versions 1 &amp; 2 of Angular <strong>and</strong> allow one to run both versions of Angular inside one app.</p><p>There are two ways to approach the migration:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Gxn6a0BdQi1wNmerpR50FA.png" /></figure><ol><li><strong>Inside-out</strong>: where the main application is still Angular 1 and parts of the application will be refactored for Angular 2</li><li><strong>Outside-in</strong>: where the main application is first refactored into Angular 2</li></ol><p><a href="https://twitter.com/m_gol">Michał Gołębiowski</a> and <a href="https://twitter.com/andrewtjoslin">Andrew Joslin</a> discussed the <a href="https://www.youtube.com/watch?v=pai1ZdFI2dg">details of refactoring Angular 1.3 app to ES6 powered Angular 2 app</a> and it didn’t look impossible!</p><h4>About the new router</h4><p><a href="https://twitter.com/briantford">Brian Ford</a> gave a <a href="https://www.youtube.com/watch?v=vecg70fPDFw">good introduction to the new router</a> that is slightly based on the community work of <a href="https://github.com/angular-ui/ui-router">ui-router</a>, but developed in TypeScript with Angular 2 and the migration path from 1 to 2 in mind.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wphODeOcqp0DAf84WVmVrg.png" /></figure><p>The funny thing about the new router is that it actually has some EmberJS related code in it, from project called <a href="https://github.com/tildeio/route-recognizer">route-recognizer</a>.</p><h3>New Syntax</h3><p>When I first saw the “bracket-attribute-based template syntax” (as I call it) of Angular 2 few months ago, I was disgusted:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/133714210835ab8148d57df8cfe160f8/href">https://medium.com/media/133714210835ab8148d57df8cfe160f8/href</a></iframe><p>That didn’t look really “HTMLy”. But, as <a href="https://twitter.com/mhevery">Miško Hevery</a> pointed out in the <a href="https://www.youtube.com/watch?v=-dMBcqwvYA0">2015 ng-conf Friday’s keynote</a>: those “bracket-attributes” <a href="http://www.w3.org/TR/html5/syntax.html#attributes-0">are completely valid HTML</a> <strong>as syntax goes</strong>. Though they certainly are not <a href="http://www.w3.org/TR/html5/dom.html#global-attributes">global attributes</a> and I noticed that W3C validator (which unfortunately is less and less useful tool these days) reports “<strong>Attribute [foo] is not serializable as XML 1.0.</strong>” error even if HTML5 validation is chosen.</p><p>There will also be a “canonical syntax” without the brackets with “bind-prop” and “on-event” attributes (which I suspect can be prefixed with “data-” to make them valid HTML5, though I have nothing to back that up).</p><p>Turns out this new bracket-attribute based syntax actually makes templates even more descriptive: Instead of using ng-bind attribute which will set its value to element’s text one can simply use [text] attribute or instead of ng-hide one can simple set attribute [hidden] to true (notice how these bracket attributes map to the standard HTML attributes).</p><h4>Properties, events and methods</h4><p>The Angular 2 DOM API consists of properties, events and methods:</p><ul><li>Square brackets [] signify expressions (used with properties)</li><li>Parenthesis () signify statements (used with events)</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XZiNOs47h-96prjsWS8veA.png" /><figcaption>Expression vs Statement in Angular 2</figcaption></figure><ul><li>Hash mark # signify a rerefence (used with methods)</li></ul><p>In Angular 1.x it is difficult to access another element’s methods in the template. In Angular 2.x a reference declared with a hash mark allows one to do just that:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/07e602b7f1c50596ac6346a295a63717/href">https://medium.com/media/07e602b7f1c50596ac6346a295a63717/href</a></iframe><h4>A lot less of syntax</h4><p>By introducing this new syntax Angular 2 does away with a lot of (now unnecessary) directives:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/55daf8caadedac1adc6da511fb3ed76a/href">https://medium.com/media/55daf8caadedac1adc6da511fb3ed76a/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WhUhwSAXRziiRx4PrsHmaw.png" /><figcaption>Summary of the Angular 2 DOM API syntax</figcaption></figure><h4>Tooling</h4><p>Besides actually simplifying the Angular 2 DOM API for the developer, due to the new syntax, Angular 2 can for example catch typos in properties and I suspect that down the road editors/IDEs will take advantage of this new syntax as well.</p><h3>Web Components &amp; Shadow DOM</h3><p>Angular 2 actually does not care if a DOM component is a native browser element, Angular component or Web Component. There is no difference and the API will be same to all components, so mixing them is not at all a problem. This is because Angular is retiring its <a href="https://docs.angularjs.org/api/ng/directive/ngTransclude">transclusion</a> feature used in Angular 1.x for “replacing an element” and uses instead standard <a href="http://www.w3.org/TR/shadow-dom/">Shadow DOM</a> feature from Web Components. For browsers that do not support Shadow DOM <a href="https://www.youtube.com/watch?v=-dMBcqwvYA0&amp;feature=youtu.be&amp;t=45m40s">Angular 2 will emulate/shim it</a>.</p><h3>Performance</h3><p>AngularJS 1 can be pretty slow especially with long lists (at least without any optimizations). Here’s <a href="https://twitter.com/djsmith42">Dave Smith</a> showcasing it in his <a href="https://www.youtube.com/watch?v=LgshdUnTNPc">performance related presentation</a>:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/1*AYMUWshlwvTq7-68yOjbIw.gif" /><figcaption>Vanilla Angular 1</figcaption></figure><p>As probably many others have done already, I’ve been looking into using ReactJS as way to boost up performance in Angular 1 apps, which is exactly what Dave showed, a much faster performance with AngularJS v1 + ReactJS:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/1*xuLM1MoCA7yJxWpc8Bysrg.gif" /><figcaption>Angular 1 + ReactJS</figcaption></figure><p>But then right at the end of his presentation, he showed the same demo with Angular 2 and the result is more than impressive, almost instant! <strong>READ THE UPDATE BELOW!</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/1*YM661f3OJ48HX9Yv6oXXow.gif" /><figcaption>Vanilla Angular 2</figcaption></figure><pre><strong><em>UPDATE March 8th 8:57 PM UTC:</em></strong><br>As few people have already notified me on Medium.com notes and on Facebook that there was a mistake in the above presentation by Dave Smith. The Angular 2 demo was set to zero millisecond timeout instead of the same 500ms timeout that the Angular 1 &amp; ReactJS demo had, so the comparison above is false. </pre><pre>Smith and ng-conf have uploaded a new video of the presentation where on the end Angular 1 &amp; ReactJS vs Angular 2 are compared with the same timeout. You can see it here: <a href="http://youtu.be/XQM0K6YG18s?t=17m37s">http://youtu.be/XQM0K6YG18s?t=17m37s</a></pre><pre>The performance difference is now much smaller there and one has to note that Angular core contributors helped to optimize the Angular 2 demo, but ReactJS people haven’t had the change to optimize the Angular 1 &amp; ReactJS demo.</pre><pre>Turns out there is no silver bullet.</pre><p>As <a href="https://twitter.com/victorsavkin">Victor Savkin</a> <a href="http://victorsavkin.com/post/110170125256/change-detection-in-angular-2">points out in his blog</a>: “In Angular 2 there are no two-way data-bindings” (at least <a href="https://www.youtube.com/watch?v=cwXZ0YFvpzs">not at the moment</a>). I guess that combined to the <a href="https://www.youtube.com/watch?v=jvKGQSFQf10">new reinvented change detection</a> are probably the biggest reasons for these performance improvements.</p><p>Change detection graph in Angular 1.x was more like a “cycle” where for example it is sometimes unclear which nodes update in which order. In Angular 2 the change detection graph is a <a href="http://en.wikipedia.org/wiki/Arborescence_%28graph_theory%29">directed tree structure</a> which is a lot faster to work with:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0JG8-2PajpLj9uj64fs0eQ.png" /></figure><h3>Types, Supersets and Future of JavaScript</h3><p>Previously I have personally been strongly against types in JavaScript, but maybe it’s the fact that last few years I’ve been building more “<a href="http://www.yourdictionary.com/enterprisey">enterprisey</a>” JavaScript software for both browser and NodeJS, that has lately lead me to think that types in JavaScript might be a good idea. This “revelation” of mine happened at convenient time as Angular 2 seems to be about typed languages.</p><h4>AtScript no more, just TypeScript</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QXVB8ht9DqFVQ_TkGh-DLw.png" /></figure><p>Maybe a bit controversially, when Angular team started developing Angular 2 they decided to use AtScript (created by Google) which actually was an extension providing annotions on top of Microsoft’s <a href="http://www.typescriptlang.org/">TypeScript</a> which then is a superset of JavaScript adding optional static typing along with providing features of upcoming ES6 version of JavaScript. *Phew*</p><p>Luckily at ng-conf 2015 things got a little more simpler as the Angular core contributors together with the TypeScript team’s <a href="https://twitter.com/jntrnr">Jonathan Turner</a> from Microsoft announced that TypeScript v1.5 <a href="https://www.youtube.com/watch?v=QHulaj5ZxbI&amp;feature=youtu.be&amp;t=23m30s">will merge the annotations feature from AtScript</a> and Angular 2 development will be done using it.</p><p>A lot of the talk in the conference was <a href="https://www.youtube.com/watch?v=U7NYTKgkZgo">about</a> <a href="https://www.youtube.com/watch?v=Xw93oketp18">TypeScript</a>, the Angular core contributors kept reminding that even though Angular 2 itself is developed with TypeScript, one can still develop <em>applications</em> on top of Angular 2 with plain JavaScript.</p><h4>Flow type vs TypeScript</h4><p>Angular contributors Brad Green and Igor Minar <a href="http://youtu.be/QHulaj5ZxbI?t=20m45s">mentioned that they’ve been discussing types in JavaScript with Facebook too</a>, but they did not specify anything else.</p><p>Facebook has developed something a <strong>bit</strong> similar as AtScript/TypeScript, called <a href="http://flowtype.org/">Flow</a>. But Flow seems to be more about “additional type checking for JavaScript” than “bringing types into JavaScript”, especially now after they <a href="http://flowtype.org/blog/2015/02/20/Flow-Comments.html">introduced support for “Flow comments”</a>: So I suspect that Flow with Flow comments will most certainly become a “lint-like” type checking tool for JavaScript developers that do not want an extra compilation step (like TypeScript to JavaScript) into their build process.</p><h4>Future of JavaScript?</h4><p>TypeScript with backing from Microsoft and Angular core team which sort of means “Google” combined with the growing interest from developers on bringing types to Javascript (which can be seen for example in the amount of contributors in <a href="https://github.com/borisyankov/DefinitelyTyped">DefinitelyTyped</a> and general hype in the internet), it might not be so far fetched to say that we will have types in vanilla JavaScript in few years.</p><p>Actually there <a href="http://wiki.ecmascript.org/doku.php?id=strawman:types&amp;s=types">are</a> <a href="https://github.com/dslomov-chromium/typed-objects-es7">some</a> <a href="http://wiki.ecmascript.org/doku.php?id=harmony:typed_objects">drafts</a> regarding of bringing types into ES7 already. Also, in their welcoming keynote <a href="https://twitter.com/bradlygreen">Brad Green</a> and <a href="https://twitter.com/igorminar">Igor Minar</a> told that <a href="https://www.youtube.com/watch?v=QHulaj5ZxbI&amp;feature=youtu.be&amp;t=18m59s">they want to take annotations and types from TypeScript and bring those to TC39 standardization process</a>.</p><h3>Summary</h3><p>At first I didn’t like Angular 2 at all. Mostly because of the weird looking syntax and the announcement of “no migration path”. But:</p><ul><li>the new syntax seems to make more and more sense</li><li>there is actually a migration path from v1 to v2</li><li>the performance improvements almost seem to reach “Apple-esque superlatives”</li></ul><p>… it seems that now I can’t wait for Angular 2 to become production ready! Hopefully towards the end of the year we’ll have something at least “almost production ready” to play with:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0KGLqVh4bFiGFFqZ33QWDw.png" /><figcaption>Angular 2 alpha was released in February, Angular.io site published in March and Google will be doing a large scale app migration to Angular 2 in May 2015.</figcaption></figure><h4>Disclaimer of sorts</h4><p>Because I haven’t yet tried Angular 2 alpha myself (or because of the whisky), it is entirely possible that I’ve understood something a bit wrong, so if you spot anything, please leave a note!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8392c260095c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[My two cents on hiding the full URL ]]></title>
            <link>https://medium.com/@aripalo/my-two-cents-on-hiding-the-full-url-f54bcd124bf4?source=rss-505d86fcf177------2</link>
            <guid isPermaLink="false">https://medium.com/p/f54bcd124bf4</guid>
            <dc:creator><![CDATA[Ari Palo]]></dc:creator>
            <pubDate>Sun, 04 May 2014 18:42:58 GMT</pubDate>
            <atom:updated>2014-05-04T19:10:40.189Z</atom:updated>
            <content:encoded><![CDATA[<h4>A compromise might be what we need.</h4><p>Google is experimenting on hiding the pathname of the URL in Chrome (mainly to prevent phishing). After I first read about it on <a href="https://news.ycombinator.com/item?id=7678580">Paul Irish’s Hackernews post</a>, I did what a “proper internet citizen” does when they get angry: <a href="http://www.urbandictionary.com/define.php?term=ragetweet">ragetweeted</a> about it;</p><h3>Twitter / aripalo: Fuck you @googlechrome (if ...</h3><p>Fuck you @googlechrome (if you really implement this https://news.ycombinator.com/item?id=7678580 ). URLs are the basis of the internet.</p><h3>The non-web-savvy</h3><p>Couple days later (and after calming down) I read Jake Archibald’s “<a href="http://jakearchibald.com/2014/improving-the-url-bar/">Improving the URL bar</a>” blog post which got me thinking: URLs are truly broken for the non-web-savvy users. I too have those elderly relatives and acquaintances who always “pester” me with their computer-related questions, so I can imagine a bit how hard the web usage can sometimes be for them. It’s easy for me to defend the complexities of the URL, but (as Jake showed in his example URLs) for those non-web-savvy users it is impossible to notice the difference between:</p><p><strong>the original:</strong><a href="http://www.halifax.co.uk.creditcards.wt.seg_3.common.credit0-crdtcard-lnke-crdtcard00.this.evil.jakearchibald.com/creditcards/?WT.seg_3=Common/promotion/credit_cards/hlinke/credit0-crdtcard-lnke-crdtcard00"><br></a><a href="http://www.halifax.co.uk/creditcards/?WT.seg_3=Common/promotion/credit_cards/h">http://www.halifax.co.uk/creditcards/?WT.seg_3=Common</a>…<br><strong>and a phishing-site:</strong><br><a href="http://www.halifax.co.uk.creditcards.wt.seg_3.common.credit0-crdtcard-lnke-crdtcard00.this.evil.jakearchibald.com/creditcards/?WT.seg_3=Common/promotion/credit_cards/hlinke/credit0-crdtcard-lnke-crdtcard00">http://www.halifax.co.uk.creditcards.wt.seg_3.common</a>…</p><p>… if it’s even hard for us “so called web-savvy” users. So hiding the full URL and only showing the domain has its benefits as it increases the changes of non-web-savvy noticing that something’s off with the URL.</p><h3>What about the web-savvy users then? What about the Internet?</h3><p>The <a href="http://tools.ietf.org/html/rfc3986">URL</a> is a complex concept, but understanding the basics of it and assuming websites provide <a href="http://en.wikipedia.org/wiki/Clean_URL">clean</a>, <a href="http://www.w3.org/Provider/Style/URI.html">cool</a> and well <a href="http://warpspire.com/posts/url-design/">designed</a> URLs, then the URL becomes a powerful tool, for example:</p><ul><li>If you arrived to a page via link you can always verify your location by looking at the URL (and especially the path).</li><li>It helps you to understand the general information architecture of the site (even if the site’s web design has made it more complex than it actually is).</li><li>You don’t need to try to find a link to &lt;somewhere&gt; if you know that the resource is located at /&lt;somewhere&gt;</li></ul><p>Even it makes everyday life of non-web-savvy users a lot easier, I personally don’t believe hiding the full URL is a good thing. I know it’s there available on click/focus, but we’re still talking about the core concept of the web:<br>I don’t think it deserves to be hidden.</p><h3>A compromise</h3><p>After trying out the experimental feature in Chrome Canary, I came up with a really simple idea that could be a solution that works for both non-savvy and savvy web users. I quickly threw something together in Photoshop to demonstrate and then tweeted it:</p><h3>Twitter / aripalo: .@jaffathecake I&#39;m conserned ...</h3><p>Chrome is experimenting with hiding parts of the URL. I think this is great for the web. http://jakearchibald.com/2014/improving-the-url-bar/ ... pic.twitter.com/70GiCSNQVo</p><p>Basically, <strong>highlight the domain </strong>and slightly fade out the pathname part (and rest) of the URL.</p><p>By highlighting the domain it’s really easy for the user to understand in which website she currently is as the domain doesn’t get mixed with the “noise” of the URL path, query parameters or fragment identifiers.</p><p>In my example the whole domain and subdomains are highlighted. Another variation could be even to highlight only the domain-name and the tld, leaving subdomains unhighlighted, which would especially help noticing phishing sites.</p><p>The rest of the domain (path, query parameters and fragment identifiers) would still be always visible and accessible, but not in a disrupting way. I really hope Chrome developers would consider solution like this as it doesn’t take away features from the more advanced users, but still “simplifies the URL” enough for the non-web-savvy users.</p><h4>Secure vs. insecure</h4><p>As couple people already <a href="https://twitter.com/rauschma/status/462946141274124288">pointed</a> <a href="https://twitter.com/yatil/status/462952652754939904">out</a>, my example image is problematic as the browser can’t really always determine which site is “secure” versus “insecure”. At least I’d hope browsers would even more highlight trustworthy/verified sites with <a href="http://en.wikipedia.org/wiki/Extended_Validation_Certificate">EV SSL certificates</a> and so on.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f54bcd124bf4" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>