<?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 Aleksander Stós on Medium]]></title>
        <description><![CDATA[Stories by Aleksander Stós on Medium]]></description>
        <link>https://medium.com/@stosiu?source=rss-b08df303a63c------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*uw937K8tLR7u9IGMOTS86g@2x.jpeg</url>
            <title>Stories by Aleksander Stós on Medium</title>
            <link>https://medium.com/@stosiu?source=rss-b08df303a63c------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 05 Dec 2026 10:48:52 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@stosiu/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[Things You Should Do In Web Development They Don’t Tell You About — part 2]]></title>
            <link>https://medium.com/swinginc/things-you-should-do-in-web-development-they-dont-tell-you-about-part-2-1245c3369225?source=rss-b08df303a63c------2</link>
            <guid isPermaLink="false">https://medium.com/p/1245c3369225</guid>
            <category><![CDATA[css]]></category>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[https]]></category>
            <category><![CDATA[web-development]]></category>
            <dc:creator><![CDATA[Aleksander Stós]]></dc:creator>
            <pubDate>Fri, 21 Sep 2018 14:24:02 GMT</pubDate>
            <atom:updated>2018-09-21T14:24:02.864Z</atom:updated>
            <content:encoded><![CDATA[<h3>Things You Should Do In Web Development They Don’t Tell You About — part 2</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BAr_0al-WlBi5mZ3Zm9OsA.png" /><figcaption>Created by <a href="https://dribbble.com/FilipWilczek">Filip Wilczek</a></figcaption></figure><p>You can have the best features in the world, but they don’t mean anything if any screen of your app loads even a bit slow. This post tells you how to not frustrate users with your app and uncovers some new technologies.</p><p>In the <a href="https://medium.com/swinginc/things-you-should-do-in-web-development-they-dont-tell-you-about-8ab03aaf81c2">first part of Things You Should Do In Web Development They Don’t Tell You About</a>, I wrote about good development practices. These were the most important things. Now, we can move to less compelling, but also beneficial, examples.</p><h3><strong>1. Use webpack to bundle your files</strong></h3><p>I remember the time when almost no one was bundling their files, but now it’s a standard. In most cases, we should send the code in one bundled file (for code splitting see the point 9). Why? It’s faster. Transferring one large file is faster than sending lots of smaller requests (however it might change in the future, see the next point). We can use tools like <a href="https://webpack.js.org/">webpack</a> to do it for us and within a minute make a configuration for our project which can bundle the files, minify code, remove comments, optimize styles and add required prefixes and transpile the code to extend browser support.</p><p>Here is a simple example of how it looks:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/dd57e6883f5808c25c29ddee45d82a4d/href">https://medium.com/media/dd57e6883f5808c25c29ddee45d82a4d/href</a></iframe><p>To help you understand how it works, I recommend you to read this post: <a href="https://medium.com/ag-grid/webpack-tutorial-understanding-how-it-works-f73dfa164f01">How webpack works on examples</a>.</p><p>If you want something more advanced, with optimizations pushed to the limits, you can check our <a href="https://github.com/SwingDev/react-ts-boilerplate/tree/master/webpack">SwingDev webpack configuration</a>. It supports .env files, Typescript, different configurations per environments and much more!</p><h3>2. Use Gzip, obviously</h3><p>You can save lots of KBs just by making sure gzip encoding is turned on your server. You can check if your server is using gzip with this website <a href="https://checkgzipcompression.com/">Checkgzipcompression.com</a> or you can check it on your own with Google Chrome DevTools.</p><p>Navigate to Network tab, select any CSS/JS file and look for Content-Encoding header. If it’s there, you are using gzip 🎉</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FMw1Vn2eUXmprYKhDPZJbw.png" /><figcaption>Google Chrome DevTools — Example of where you can look for <strong>content-encoding.</strong></figcaption></figure><p>If you are looking for <strong>something even better</strong>, you can investigate <a href="https://en.wikipedia.org/wiki/Brotli">Brotli</a>. I recommend you to read <a href="https://blogs.akamai.com/2016/02/understanding-brotlis-potential.html">Understanding Brotlis Potential</a>. It will show you why it’s worth checking out.</p><h3><strong>3. Use cache whenever possible</strong></h3><p><strong>Requests:</strong> Often, it is unnecessary to re-fetch data from an API if we know that it is unlikely to have changed within a specified period. By not fetching the data, we are being friendly to mobile data users, limiting unnecessary API calls, and minimizing re-renders of applications due to state updates.</p><p><strong>Assets:</strong> The browser’s caching mechanism is your friend. During development, it might lead to some very frustrating situations, but it really helps to improve your site performance. Every browser caches content like images, JavaScript or CSS. Nowadays we can take it to another level. By using Service Workers, we are able to get offline access to our resources.</p><p><a href="https://developer.mozilla.org/en-US/docs/Web/API/Service_Worker_API/Using_Service_Workers">Service worker docs</a></p><p><a href="https://developers.google.com/web/ilt/pwa/caching-files-with-service-worker">Caching files with service worker</a></p><p><em>Remember to have the respect for this powerful feature. It’s easy to get lost because of caching too much, so keep your hand on the pulse and test everything wisely before pushing it to production.</em></p><h3><strong>4. Serve images in proper sizes</strong></h3><p>Often we use the same images for different parts of our application. Let’s use an online shop as the example. Each product in the shop has its overview picture. We display it on the product details page, product listing page with two layout options: list and grid, and the page with the image in its original size.</p><p>We need at least four different image sizes. Why can we not use just one image? Imagine if the original picture is 1 MB and we display ten products per page. The user would download 10 MB of only photos and that’s not what we want. <strong>If you can, try to generate different images for the different parts of your site, this will save a lot of KBs for your users</strong>. You should also take current screen resolution into account. For example, if somebody opens your site on their mobile phone, there is no need to display the giant header image that you usually use. You probably also want a different picture for your crisp iPad Pro display and different for a budget Android device with low resolution.</p><p>You can use &lt;source/&gt; HTML tag which could be used inside HTML5 &lt;picture/&gt; to determine which images the web browser should use depending on screen width or height. <a href="https://www.w3schools.com/html/html_images.asp">Docs</a></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/1738b00888d5831ddbfe8f0eea965525/href">https://medium.com/media/1738b00888d5831ddbfe8f0eea965525/href</a></iframe><p>Or use <a href="https://css-tricks.com/snippets/css/media-queries-for-standard-devices/">CSS media queries</a></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/add079e16b905a73e77844341f595c97/href">https://medium.com/media/add079e16b905a73e77844341f595c97/href</a></iframe><h3><strong>5. Send only delta on updates</strong></h3><p>We can minimize payload, unweight our backend and increase the speed of the request by sending only changes that user has made in update requests. It might sound hard to extract changes in the very nested object but who said we have to write it on our own?</p><p>For deep deltas, we can use below example:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/b4052badc9043da8d6be62e9bcc5d2d7/href">https://medium.com/media/b4052badc9043da8d6be62e9bcc5d2d7/href</a></iframe><p>Remember that PUT and PATCH requests are created for different purposes. The PUTmethod is described as follows in <a href="http://tools.ietf.org/html/rfc5789">RFC 5789</a>:</p><blockquote><em>Several applications extending the Hypertext Transfer Protocol (HTTP) require a feature to do partial resource modification. The existing HTTP PUT method only allows a complete replacement of a document. This proposal adds a new HTTP method, PATCH, to modify an existing HTTP resource.</em></blockquote><p>So, PUT should only be used if you’re replacing a resource in its entirety, not when you are just updating some parts of it.</p><h3><strong>6. Show a badge that user lost Internet connection</strong></h3><p>It’s more common than you think that your users lose their Internet connection. The good practice is to let them know that our app has lost connection to the Internet and it might not be usable until it comes back. Support for queuing user actions and requests while you are offline is a topic for a different article, but I think you won’t have to implement it unless you work for a massive project which has to support such situations. For most applications, it’s enough to show an indicator on the screen that your app is attempting to re-establish the Internet connection.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/294/0*xwKlgxBSklw9cU7i" /><figcaption>Example of how <a href="https://trello.com/">Trello</a> handles it.</figcaption></figure><h3><strong>7. Use HTTP-2</strong></h3><p>It allows servers to “push” responses proactively into client caches instead of waiting for a new request for each resource. It uses the new ALPN extension which allows for faster-encrypted connections since the application protocol is determined during the initial connection. <a href="https://deliciousbrains.com/performance-best-practices-http2/">See also other gains of using HTTP/2</a>.</p><p>Another resource I can recommend for you to learn about this protocol benefit is a presentation done by Patrick Hamann on JSConf EU 2018</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FcznVISavm-k%3Ffeature%3Doembed&amp;url=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DcznVISavm-k&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FcznVISavm-k%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/72a693f22155d47110406ce2a956b54e/href">https://medium.com/media/72a693f22155d47110406ce2a956b54e/href</a></iframe><h3><strong>8. Code splitting</strong></h3><p>The most descriptive definition I know about code splitting is from <a href="https://reactjs.org/docs/code-splitting.html#code-splitting">React documentation</a>:</p><blockquote>Bundling is great, but as your app grows, your bundle will grow too. Especially if you are including large third-party libraries. You need to keep an eye on the code you are including in your bundle so that you don’t accidentally make it so large that your app takes a long time to load.</blockquote><blockquote>To avoid winding up with a large bundle, it’s good to get ahead of the problem and start “splitting” your bundle. <a href="https://webpack.js.org/guides/code-splitting/">Code-Splitting</a> is a feature supported by bundlers like Webpack and Browserify (via <a href="https://github.com/browserify/factor-bundle">factor-bundle</a>) which can create multiple bundles that can be dynamically loaded at runtime.</blockquote><blockquote>Code-splitting your app can help you “lazy-load” just the things that are currently needed by the user, which can dramatically improve the performance of your app. While you haven’t reduced the overall amount of code in your app, you’ve avoided loading code that the user may never need, and reduced the amount of code needed during the initial load.</blockquote><p><a href="https://reactjs.org/docs/code-splitting.html">Read more about code splitting in React</a></p><p><a href="https://medium.freecodecamp.org/analyzing-the-bundle-size-code-splitting-in-create-react-app-9238e96a5b26">Analyzing the bundle size code splitting in create react app</a></p><p><a href="https://toddmotto.com/lazy-loading-angular-code-splitting-webpack">Code splitting in Angular</a></p><p><a href="https://medium.com/js-dojo/3-code-splitting-patterns-for-vuejs-and-webpack-b8fff1ea0ba4">Code splitting in Vue</a></p><p>As you can see, there are many areas in which we can improve our application performance.</p><p>If you want more examples and solutions, you can look at <a href="https://swingdev.github.io/guides/frontend/">SwingDev’s Frontend Developer Guide</a>. We put in tons of work to make it, but it was definitely worth it, see for yourself.</p><p>As always, I’m more than happy to hear your thoughts on this topic, what else could be optimized, and if you were already aware of these things or not. Let me know in the comments!</p><p>HAPPY CODING and optimizing! 🦄</p><p><strong>Like it? Tap the 👏 button! Thank you!</strong></p><p>You can find me on <a href="https://github.com/Stosiu">GitHub</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1245c3369225" width="1" height="1" alt=""><hr><p><a href="https://medium.com/swinginc/things-you-should-do-in-web-development-they-dont-tell-you-about-part-2-1245c3369225">Things You Should Do In Web Development They Don’t Tell You About — part 2</a> was originally published in <a href="https://medium.com/swinginc">SwingDev Insights</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Things you should do in web development they don't tell you about]]></title>
            <link>https://medium.com/swinginc/things-you-should-do-in-web-development-they-dont-tell-you-about-8ab03aaf81c2?source=rss-b08df303a63c------2</link>
            <guid isPermaLink="false">https://medium.com/p/8ab03aaf81c2</guid>
            <dc:creator><![CDATA[Aleksander Stós]]></dc:creator>
            <pubDate>Thu, 09 Aug 2018 15:31:01 GMT</pubDate>
            <atom:updated>2018-08-09T15:31:01.176Z</atom:updated>
            <content:encoded><![CDATA[<h3><strong>Things you should do in web development they don’t tell you about</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vLW3PoU8qIHmAi9i8o3KkA.png" /></figure><p>Mobile devices are conquering the web — it’s a fact. Just in 2017 mobile share in web traffic have grown by 6 percentage points and will reach ⅔ of the whole traffic soon. But how can we know that we have prepared our app properly for mobile?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*AkhDJIJOAaFbi1mZmZ-KtA.jpeg" /><figcaption><a href="https://www.stonetemple.com/mobile-vs-desktop-usage-study/">https://www.stonetemple.com/mobile-vs-desktop-usage-study/</a></figcaption></figure><p>For me, as a junior developer, it was evident that every and each website I build must be responsive and mobile friendly, but it took much longer to realize that it is not only the layout that matters. In this post I would like to share my thoughts and experience after my three-year journey in web development and tell you<strong> what I would like to know when I was starting and what I have learned from more experienced friends.</strong></p><p>To keep things organized I decided to split my thoughts into two separate articles. The first one will explain the most important topics and the second will be more about optimizing and polishing.</p><ol><li><strong>Develop using Fast 3G mode</strong></li></ol><p>As a millennial and a geek I needed some time to realize that I live in a bubble when it comes to the internet speed… I’ve learned that lesson when I went on vacations with my family. We rented a flat in Croatia with a really bad wifi. The connection was unstable and the peak speed was around 5 Mbps. But somehow I was the only one complaining! The rest of my family was completely happy with the speed and the fact that it was taking them 10 seconds to load the Facebook feed. As it turned out, they had the same experience back at home. Later on I’ve checked the statistics and they blew my mind. For example, avg. world-wide download speed in Q1 2017 was around 7.2 Mbps (<a href="https://www.fastmetrics.com/internet-connection-speed-by-country.php#top-10-comparison-2017">source</a>). So one unoptimized image can cost you additional 1–2 second of web page loading. It’s crazy!</p><p>I am using my phone to test if the application I am working on works correctly, but being connected to high-speed wifi at the office is not the perfect setup. Fortunately, many smarter people realized it before me and created tools that can help us. To test our application in real conditions — we can use network throttling, for example using an excellent Google Chrome Online Dropdown tool.</p><p>Where to find it: Inspect Element -&gt; Network -&gt; Online dropdown</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*g-w_8h7Qgqq9Hf0n" /><figcaption>Google Chrome Online Dropdown</figcaption></figure><p>It will limit your internet speed to the selected option. So with this simple check, you can check how your application behaves in unfavorable network conditions.</p><p>Let’s use it <strong>ALL THE TIME</strong> when we are developing our applications to feel the same as our users might fell using our product. If you can break or find the spots where your app behaves incorrectly, it is almost 100% possible that your users will face the same problem and will be angry or will stop using the thing you have made and go to your market opponent.</p><p><strong>Bonus:</strong></p><p>Since Chrome 59 you can also use <a href="https://developers.google.com/web/updates/2017/04/devtools-release-notes#block-requests">requests blocking</a> tool. It’s beneficial if you want to test your application in lousy connection conditions when some requests don’t work. Later on, I will also attach a snipped which will prepare you for such case.</p><p><strong>2. Always double check if you have optimised the images</strong></p><p>There are various ways of how you could tune pictures on the websites, but for casual checking, you should just follow these:</p><ol><li>Make sure <strong>image resolution</strong> is similar or equal (depends on the case) to the one you are going to use. Graphic designers might send you even ten times bigger image, so check it before you add it to your project. The positive side effect is that the browser won’t have to downsize the images by itself so you might see some improvement in performance too.</li><li>Change the <strong>image type</strong>. In most cases, it won’t give you that much of free space, but you should choose the proper image format and know the reason why you selected it. It’s a topic for another article, so <a href="https://www.sitepoint.com/what-is-the-right-image-format-for-your-website/">here</a> is a reference where the problem is well described.</li><li><strong>Image compression</strong>. Maybe you didn’t know, but you can save up to 80% of image size without seeing changes in image quality! There are different ways on how you can introduce this to your projects. It’s easy to forget so you might want to automate it, for example, using `imagemin-webpack-plugin` which support many different image extensions and has the broad support of options. If you believe you will remember about it or want to do it from time to time, I recommend you using <a href="https://imageoptim.com/">imageoptim</a> or online tool <a href="http://optimizilla.com/">Optimizilla</a></li></ol><p>I hope you will save a lot of space one you follow this tip!</p><p><strong>3. Remember about buttons loading state</strong></p><p>Nowadays, every app makes asynchronous requests. There is nothing worse than making our user displeased because of the lack of a loading indicator. We should always double check if we set and unset loading states correctly in our buttons, containers and other components.</p><p><strong>4. Requests retries on errors (for fetches)</strong></p><p>The other way to improve the feeling of our application is to add request retries behind the scenes. With an unstable internet connection, it happens more than often that some of the requests fail because of the network error. Super safe and always reliable backend also won’t save your application from such case. Why? Think of a mobile device user who is using an elevator. A request has fired, but before getting the response, internet connection has been lost. It will result in an error… for which you should be prepared. Auto-request comes with the rescue. An important note here, please remember about exponential backoffs! You don’t want to kill your backend if it has filed with millions of requests waiting for it.</p><p>Here is an example of implementing auto-retry feature by using <a href="https://github.com/axios/axios">axios</a> library:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/f121a868b1742741dfdb59697a4ff630/href">https://medium.com/media/f121a868b1742741dfdb59697a4ff630/href</a></iframe><p>These are my thoughts and conclusions about the most important things. If you want to read more and learn how to use catch, learn UI tweaks and do other impressive optimizations, please consider subscribing to our blog because <strong>the second part of this article on on it’s way</strong>. I’m sure that there is a lot more to discover, but that’s the thing I love about development. There is always a space to improve, and you can sense the pleasure of learning all the time. I hope you find this article interesting. I’m more than happy to hear your thoughts on this topic, what more could be optimized and if you have already known of these things or not. Let me know in the comments!</p><p>HAPPY CODING and optimizing! 🦄</p><p><strong>Like it? Tap the 👏 button! Thank you!</strong></p><p>You can find me on <a href="https://github.com/Stosiu">GitHub</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8ab03aaf81c2" width="1" height="1" alt=""><hr><p><a href="https://medium.com/swinginc/things-you-should-do-in-web-development-they-dont-tell-you-about-8ab03aaf81c2">Things you should do in web development they don&#39;t tell you about</a> was originally published in <a href="https://medium.com/swinginc">SwingDev Insights</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>