<?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 David Pertiller on Medium]]></title>
        <description><![CDATA[Stories by David Pertiller on Medium]]></description>
        <link>https://medium.com/@Vieltrinker?source=rss-f3fb21c2bffe------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*RK07oaW9DC8qLEgC7FjytQ.jpeg</url>
            <title>Stories by David Pertiller on Medium</title>
            <link>https://medium.com/@Vieltrinker?source=rss-f3fb21c2bffe------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 31 May 2026 20:42:15 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@Vieltrinker/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[How to efficiently use Stencil Web Components in React (with typings)]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://javascript.plainenglish.io/how-to-use-stencil-web-components-in-react-within-a-nx-monorepo-d6644f6ee858?source=rss-f3fb21c2bffe------2"><img src="https://cdn-images-1.medium.com/max/1682/1*qPO_UlEgb_1sQ2xLF1uYQA.png" width="1682"></a></p><p class="medium-feed-snippet">Use Stencil components in React apps with generated React wrappers and typings for efficient use with TypeScript and JSX</p><p class="medium-feed-link"><a href="https://javascript.plainenglish.io/how-to-use-stencil-web-components-in-react-within-a-nx-monorepo-d6644f6ee858?source=rss-f3fb21c2bffe------2">Continue reading on JavaScript in Plain English »</a></p></div>]]></description>
            <link>https://javascript.plainenglish.io/how-to-use-stencil-web-components-in-react-within-a-nx-monorepo-d6644f6ee858?source=rss-f3fb21c2bffe------2</link>
            <guid isPermaLink="false">https://medium.com/p/d6644f6ee858</guid>
            <category><![CDATA[react]]></category>
            <category><![CDATA[front-end-development]]></category>
            <category><![CDATA[stenciljs]]></category>
            <category><![CDATA[web-components]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[David Pertiller]]></dc:creator>
            <pubDate>Sun, 31 May 2020 22:29:41 GMT</pubDate>
            <atom:updated>2021-01-21T21:39:14.452Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Quick wins for your Ionic Angular App with ES2015]]></title>
            <link>https://medium.com/weekly-webtips/quick-wins-for-your-ionic-angular-app-8a3765df026e?source=rss-f3fb21c2bffe------2</link>
            <guid isPermaLink="false">https://medium.com/p/8a3765df026e</guid>
            <category><![CDATA[ionic]]></category>
            <category><![CDATA[typescript]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[angular]]></category>
            <category><![CDATA[web-development]]></category>
            <dc:creator><![CDATA[David Pertiller]]></dc:creator>
            <pubDate>Thu, 09 May 2019 23:59:25 GMT</pubDate>
            <atom:updated>2020-06-02T12:27:39.703Z</atom:updated>
            <content:encoded><![CDATA[<p>You may have heard about <strong>differential loading</strong>. It’s a feature that was introduced in the Angular CLI 8 and it creates separate bundles for ES2015 and ES5:</p><ul><li>ES2015 bundles will be loaded by modern browsers</li><li>ES5 bundles will be loaded by older browsers</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*A3FxH64UNUNC_qW2GNs7AA.png" /><figcaption>Performance comparison: app built with ES5 and app built with ES2015 without ES5 browser support</figcaption></figure><p>The main benefit of the ES2015 bundle is that it takes advantage of new language features and requires less polyfills, resulting in a <strong>smaller bundle size</strong>.</p><p>I thought about using this feature to benefit from smaller bundle sizes in my Ionic apps but realized that when packaging the app, shipping two bundles instead of one would not reduce the size, but increase it.</p><h3>Proposal</h3><p><strong>In the context of packaged hybrid mobile apps, it just bloats the app size when you embed separate bundles of the same code.</strong></p><p>The reason why I propose not to use differential loading in hybrid mobile apps is that we don’t even need to ship an ES5 bundle. It turns out that mobile browsers have great support for ES2015 (formerly known as ES6) already: <a href="https://caniuse.com/#feat=es6">https://caniuse.com/#feat=es6</a></p><p><strong>In short, don’t create separate bundles but simply go with ES2015 right away.</strong></p><h3>How-to</h3><p>Here are the steps on how to configure differential loading for your Angular app to only produce an ES2015 bundle:</p><h4>Angular CLI 8+:</h4><p>If you’re using the Angular CLI 8+, es2015 is already the default compile target. This already produces a bundle for ES2015, but during a production build, Angular’s build process will also generate a bundle for ES5, which is needed for differential loading on older browsers. To keep our package tidy, we want to go for the newer ES2015 bundle only. This means we need to configure Angular’s build process to <strong>disable differential loading and only create a single build for ES2015. </strong>On top of that, skipping the ES5 bundle generation also speeds up the whole build process. These are the necessary steps:</p><ul><li>Create a file named browserslist in the root of your Angular/Ionic project (in case you already have such a file, continue with that one)</li><li>Copy the browser settings from the code below or this <a href="https://github.com/Mobiletainment/browserslist-es2015/releases/download/v1.0/browserslist"><strong>browserslist template</strong></a>, which represent browsers with full support for ES2015. This defines our minimum feature set and leaves out all browsers which do not support our desired features, effectively disabling browsers which only support ES5:</li></ul><pre>Chrome &gt;= 71   # let&#39;s keep it simple by picking only one desktop browser with full ES2015 support<br>Android &gt;= 56<br>ios_saf &gt;= 11<br>safari &gt;= 11</pre><h4>Angular CLI 7:</h4><p>If you’re using the <strong>Angular CLI 7</strong> or lower, the process is even simpler. All you have to do is configure the <strong>TypeScript</strong> compiler to target es2015 instead of es5:</p><ol><li>Open the file <strong>tsconfig.json</strong></li><li>In compiler options, set &quot;target&quot;: &quot;es2015&quot;</li></ol><p>In addition, we’re turning off <strong>es5BrowserSupport</strong>:</p><ol><li>Open the file <strong>angular.json</strong></li><li>Find or create the build option es5BrowserSupport under projects/app/architect/build/options and set it tofalse</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UGvs_wjA1WEM8mcU3fBJ6g.png" /><figcaption>Angular build without generating separate bundles for ES5 and ES2015</figcaption></figure><p>That’s it. Our build will now produce only one bundle and our code will run on all modern mobile browsers nevertheless.</p><p>If you want to learn more about configuring differential loading, you can read about it in the Angular docs here: <a href="https://angular.io/guide/deployment#configuring-differential-loading">Configure Differential Loading</a>. In any case, we’re already set for creating a smaller bundle with less polyfills.</p><h3>Size and Performance Comparison</h3><p>After running a new production build on my app <a href="https://medium.com/@Vieltrinker/citybike-vienna-%EF%B8%8F-warm-temperatures-a45c98e41a4f?source=friends_link&amp;sk=e467de474e13f544d271b25580182dbf">Citybikes Vienna</a> using the Angular CLI 7, I figured that creating a modern ES2015 bundle without ES5BrowserSupport reduced the bundle size by <strong>390 kB (-13%)</strong>:</p><ul><li>Old size: 2953 kB</li><li>New size: 2563 kB (-13%)</li></ul><p>Satisfied with this quick win I checked if the smaller bundle size and the difference in the compilation have an actual effect on the app’s performance. While there are more reliable and statistically correct tests, I simply used an actual device and measured the startup time of the app after installation. This video compares the two apps side by side:</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2F3177JqpYUuc%3Ffeature%3Doembed&amp;url=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D3177JqpYUuc&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2F3177JqpYUuc%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="640" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/32d09e3f71d974ae6cfd21d90f94412a/href">https://medium.com/media/32d09e3f71d974ae6cfd21d90f94412a/href</a></iframe><p>On this Samsung Galaxy S9 with Android 8.0 (API level 26), the <strong>startup time improved from 613 ms to 532 ms</strong>. <strong><em>So, yes, it did speed things up!</em></strong></p><p>Side note: If you calculate the performance gain in the startup time, the saving is also 13%, just like with the file size. But this is only by chance, it doesn’t mean that they are in a relation of proportionality. The important thing to take away here is that the startup time has decreased too, which is yet another quick win.</p><h3>Summary</h3><p>To wrap it up, the ES5 app is quite fast already, but the ES2015 bundle is still faster and also more efficient in terms of file size. Thanks to the simple configuration options of Angular and Typescript, it’s only a matter of flipping two switches:</p><ol><li>Target: ES2015</li><li>Disable ES5</li></ol><p>So, let’s go for it!</p><p>If you like to check out the performance yourself, you can get my free bike sharing app here:</p><p><a href="https://citybikes.pertiller.tech/get">Citybikes Vienna | Bike Sharing App</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8a3765df026e" width="1" height="1" alt=""><hr><p><a href="https://medium.com/weekly-webtips/quick-wins-for-your-ionic-angular-app-8a3765df026e">Quick wins for your Ionic Angular App with ES2015</a> was originally published in <a href="https://medium.com/weekly-webtips">Webtips</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Vienna ❤️ Citybikes]]></title>
            <link>https://medium.com/@Vieltrinker/citybike-vienna-%EF%B8%8F-warm-temperatures-a45c98e41a4f?source=rss-f3fb21c2bffe------2</link>
            <guid isPermaLink="false">https://medium.com/p/a45c98e41a4f</guid>
            <category><![CDATA[visualization]]></category>
            <category><![CDATA[cycling]]></category>
            <category><![CDATA[travel]]></category>
            <category><![CDATA[austria]]></category>
            <category><![CDATA[sharing-economy]]></category>
            <dc:creator><![CDATA[David Pertiller]]></dc:creator>
            <pubDate>Sun, 24 Mar 2019 22:41:41 GMT</pubDate>
            <atom:updated>2019-05-10T19:25:41.457Z</atom:updated>
            <content:encoded><![CDATA[<h4>I used Open Government Data to create a time-lapse video showing bike rentals from Vienna’s Citybike stations.</h4><h4>Intro</h4><p>These rental bikes are available free of charge for one hour and are the most eco-friendly choice to travel through Vienna. And yes, they are more environmentally friendly than scooters, simply because they are powered by your feet rather than an electric engine. 😉</p><p>There are currently 121 bike stations across Vienna and they’re available 24/7. Stations have a limited number of available bikes and a limited number of available boxes. You can return your bike wherever you find a station with an available box and thus keep the sidewalks free from parked bikes.</p><h4>Visualization</h4><p>Impressed by this service, I built an app to tell you more about bike rentals from Vienna’s Citybike stations. The app can be used to check any station for the current availability of bikes. In addition, it lets you visualize the utilization of all stations within the last hour. As basis for this, each station is visualized by a badge with two numbers:</p><p>Left: the number of available bikes | Right: the number of available boxes for returns</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9K5k3qBWvOjprceMcHOyeg.png" /><figcaption>Simple In-App visualization of Citybike utilization, powered by open government data</figcaption></figure><p>To show you this visualization in action, I created a video that shows bike rentals on a sunny and calm Saturday afternoon in Vienna in March 2019.</p><p><strong><em>It visualizes data of an entire hour in less than 2 minutes:</em></strong></p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FIdIW5M9_nU8%3Ffeature%3Doembed&amp;url=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DIdIW5M9_nU8&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FIdIW5M9_nU8%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="640" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/7f9ba5de102f6af1c9a9ae6d23abd42f/href">https://medium.com/media/7f9ba5de102f6af1c9a9ae6d23abd42f/href</a></iframe><h4>Utilization analysis</h4><p>Within only one hour, more than 700 bikes were borrowed.</p><p>At any given time, the most visited station is visualized at the top right. Hot spots like Museumsplatz have up to three rentals per minute, which essentially means that such stations are busy nonstop.</p><p>In addition to the number of rentals, the app visualizes the utilization of every Citybike station using a heat map. A dark red circle around a station indicates that there were 10 or more rentals or returns at that station within an hour. Telling by the heat map, almost all of the 121 stations were used quite frequently over this short period.</p><h4>Download the free app</h4><p>If you’d like to see this action for yourself and find out more, you can use my free app “Citybikes in Vienna” for an interactive time-lapse of Vienna’s Citybike rides. Or, if you feel like it, you can use this app to find your nearest Citybike station and start cycling yourself. 🚴‍♀️🚴‍♂️</p><p><a href="https://citybikes.pertiller.tech/get">Citybikes Vienna | Bike Sharing App</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a45c98e41a4f" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>