<?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[HCEverything - Medium]]></title>
        <description><![CDATA[A blog by Italian web design company HCE.IT. Tech, humour, code and nonsense. - Medium]]></description>
        <link>https://medium.com/hceverything?source=rss----6dce6702e7df---4</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>HCEverything - Medium</title>
            <link>https://medium.com/hceverything?source=rss----6dce6702e7df---4</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 19 Nov 2026 21:09:53 GMT</lastBuildDate>
        <atom:link href="https://medium.com/feed/hceverything" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[A saner approach to AI Delegation]]></title>
            <link>https://medium.com/hceverything/a-saner-approach-to-ai-delegation-b03766d991d1?source=rss----6dce6702e7df---4</link>
            <guid isPermaLink="false">https://medium.com/p/b03766d991d1</guid>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[vibe-coding]]></category>
            <category><![CDATA[best-practices]]></category>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[llm]]></category>
            <dc:creator><![CDATA[Paolo Mioni]]></dc:creator>
            <pubDate>Tue, 14 Jul 2026 08:04:15 GMT</pubDate>
            <atom:updated>2026-07-14T09:34:07.234Z</atom:updated>
            <content:encoded><![CDATA[<h4>Are we using LLMs the right way when coding? Some considerations coming from actual work experience in using AI as a long-time tech lead</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Sl5RwWLjf5RmCO_z" /><figcaption>Photo by <a href="https://unsplash.com/@ansach227?utm_source=medium&amp;utm_medium=referral">Andrej Sachov</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>On one of the latest <a href="https://tldr.tech/">TLDR Newsletters</a> (July, 13th 2026), I have encountered an article that advocates “Intent Engineering” instead of “Prompt Engineering”. I don’t want to do injustice to its author but, to summarize it quickly, it says more or less the following: “The latest, top-tier LLMs are so good at coding now that they will design your code structure much better than you could possibly do, so you might just tell them what to do and it will work out just fine”. You’ll find a link to the original article at the end of mine, if you want to read for yourself.</p><h3>THE GENIUS OF ISAAC ASIMOV</h3><p>Like many other Sci-Fi writers, Isaac Asimov was able to imagine many of the modern technological developments. In one of his best books, The Foundation Trilogy, the Galactic Empire is on the brink of collapse. The economy is not functioning anymore, and all the nuclear plants are in disarray because fewer and fewer people actually know how they function internally. Later in the novels, the eponymous Foundation finds a way to miniaturize nuclear plants, but to avoid neighbouring states from learning how to operate them, it builds a whole religion around them and presents them as magical artifacts. What does it have to do with AI, you will ask.</p><h3>LET’S ASK A SPECIALIST</h3><p>The whole history of the growth of civilization is made of building specialization, making sure that a specific job is carried out by those who are best, or most qualified, to do something. If you have a legal problem, you go to a lawyer, if you have a problem with water at your house you call a plumber. This is because they can solve your problem better and faster than you could. We outsource tasks we’re not particularly good at, thus making our life more efficient. When we have problems with our selves we go to a psychologist, which is possibly the highest level of outsourcing when you think about it.</p><p>We also outsource specialized tasks to machines. Grinding wheat was first done by humans with a mortar, then it was done by windmills, and now it is done in big industrial plants. Tailors have been (mostly) replaced by machines, which can produce clothes much faster than humans. Robots perform many tasks that would be too dangerous for people, like defusing bombs for example.</p><p>So all good until now, that’s the way civilization goes. Or not?</p><h3>CAN’T GET THERE FROM HERE</h3><p>Let’s start with an analogy. Since the introduction of computer map technology, almost everyone relies on it blindly. Mostly it works just fine (until Maps leads you and your bike to pass through someone’s private property… but that’s another story). They help you skip traffic and get to your destination faster and using less fuel.</p><p>Before them, getting to an unknown location required a physical map of the area, precise directions, quite a little trial and error, and maybe asking for more directions to total strangers. Our life’s improved significantly. But how many of us would now be able to get anywhere without their smartphone?</p><p>Often, I find myself using the phone even to get to places I’ve been to several times, because during the previous trips I didn’t look at the road as much as I used to, and looked a lot at the navigator app instead. So I cannot remember the landmarks I would have normally used to orient myself on future visits. I guess that some part of my brain’s mapping ability has atrophied, and often I force myself to get to places without using apps at all, because I fear to be too dependent on external tools that are not under my control, but mostly because I’m just ashamed of myself.</p><h3>PLAINLY WRONG CODE</h3><p>Like most of the people working with the help AI nowadays, I don’t have the obligatory “10 year experience with Claude Code” that appears in all jokes about improbable job offers.</p><p>I’ve used Claude Code for a while now, with some degree of success but some frustration too. I have had experience working the real full stack on fairly big projects, from using Kubernetes to complex Front-end development. I’ve built or directed the development of big applications that consisted of lots and lots of back-end code with classes, interfaces, object patterns, etc., as well as big front-end projects with complex front-end stuff going on. Since I started using Claude Code, in general it has sped up some of my (and my team’s) development, but I did have my share of hiccups.</p><h4>DevOps</h4><p>One of the things where I had the worst experiences is DevOps in general. If I asked for advice on an issue in this field, the more specific the issue I was facing was, the worse were the answers I got. In some cases I got very helpful advice, and saved a lot of time on looking for specific commands that I wasn’t familiar with. On other occasions I received very verbose but inaccurate responses, or suggestions that led me in a completely wrong direction.</p><p>One of my colleagues had a database completely wiped without asking (it was a development one, we’re all good, don’t worry about us). Once, a draft application migration plan create by Claude missed a series of very important steps and I had to do it from scratch, as it was much faster for me to redo the planning myself.</p><p>Very often, I had to look for the old-style online resources (Stack Overflow, or other forums), or just read the f***ing manual. In these cases, I wasted time and still paid for the tokens.</p><h4>Front-end code</h4><p>Front-end has a lot to do with order in your classes, and choosing the right names for things so that you can figure out the layout logic. In my experience, front-end code generated by LLMs is not very well structured, the logical sequences of classes and breakpoints is not always there, and code can easily become a tangle that’s quite difficult to debug. LLMs in this case are great at fleshing out components, their HTML and basic behaviours. But the code always needs some double checking, otherwise it will be very difficult to maintain. I often have a feeling I would have written much better code myself, and then I would have spent less time reviewing and fixing things later.</p><h4>Frameworks in general</h4><p>In general, if the framework that you’re using is well-documented, well structured and widely used, you get good code done. On a Symfony project, I got great results adding a couple of small functions on a code base I had barely touched in the past. However, try and get some help on Drupal and you will have much less fun.</p><h4><strong>Documentation</strong></h4><p>One of the things that AI is supposedly very good at is writing documentation. Writing documentation is a pain, since it requires people who are very good at writing code to write in understandable English, which can be a pain to some. And anyway it rarely gets read. The client rightfully requires documentation, a “good developer” is supposed to produce it, and the problem is solved with AI. However, I find that the documentation produced by AI is often much sloppier than what a developer would produce. AI writes documentation that is full of unexplained buzzwords and cryptic sentences, and while sometimes it assumes too much knowledge from the reader, on other occasions it is overly verbose and repetitive. The end result is, I often find it, much more time-consuming to read than documentation written, or at least rewritten, by actual people.</p><h4>Unit Tests</h4><p>Unit tests are another pain for developers. It can be difficult to design the right ones, and to identify the really important cases to test. AI can produce lots of Unit Tests for every piece of code it writes (or you wrote), but I often get the feeling that there are too many of them and often the right ones have been skipped. So, if time allows, I tend to review them all and rewrite some of them.</p><h4>Code quality</h4><p>This is probably the worst pain point. I generally don’t like the code produced by AI much, even if it works. It too often looks like the code written by a slightly sloppy developer, who worried the most about getting the job done than thinking about what they’re doing. The code needs to be reviewed a lot, it often doesn’t match the code style of the project, sometimes there are gaping holes in the logic. Subsequent rewrites or fixes to a code base can significantly decrease its quality. When there are more than two cases for an IF clause, I expect them to be replaced by a SWITCH expression. It’s more readable and easier to maintain. Instead, I often get 4 IFs in a row, especially if there was one there to begin with.</p><p>As long as an LLM is much cheaper than a developer, this might be worth it. If prices will increase significantly, I’d rather hire a junior programmer and teach them how to improve their code quality. I try to tell Claude to produce code in such and such a way, but it doesn’t always work as I would like, and often it seems to be doing simply what it wants.</p><h4>Your life is different, I know</h4><p>As usual, your mileage may vary, and probably many of you always have had perfect success with all the times they used LLMs for IT work. They are going to tell me I’m wrong in very specific cases, and that I should have used the LLM in a different and better way, etc. But I guess most of you will share at least a part of my frustrations (as well as my satisfaction when things go very well, which they often do).</p><p>So, how to deal with these issues?</p><h3>WE’VE EXHAUSTED THE YEARLY AI BUDGET IN APRIL!</h3><p>To outline the worst case scenario: at the moment of writing, none of the big companies behind AI models are turning any profit. They are all burning venture capital money. Currently, subscriptions to AI Coding platforms like Claude Code are heavily subsidized to drive adoption.</p><p>However, whoever has projects which run on standard LLM API calls (which are not subsidized) knows that the real costs per token are much higher than what you’re paying for your local Claude Code. When Anthropic first introduced it in Claude Code, Claude Fable (one of the latest top-tier LLMs mentioned before) was supposed to be charged per token usage, just like normal API calls. At the time of writing, they reverted to letting you use it with your normal subscription, but only half of the time. This is probably due to lack of adoption of the new model since it was so expensive. But, in the end, we should expect costs of AI usage to rise.</p><p>I have spoken with a brilliant engineer who has deployed a big company-wide infrastructure using Claude to run sequences of tasks, automating away a lot of the complexity of her daily life. This saves her time and money, at the moment, and the same procedures can be shared within the company so others can take profit off that too. However, if these procedures are too deeply ingrained in their daily work life, and suddenly costs rise too much, what would happen? This for me is a very strong dependency on something that is not under our control, and this dependency could turn against us.</p><h3>WHAT YOU SHOULD DO</h3><h4>Control Costs</h4><p>As you might guess, it doesn’t make sense to get rid of a coworker that costs 1 to replace it with a tool that will cost 2 or more, and can sometimes do a sloppier job at it. So you have to make sure that you use LLMs for the things for which they’re better and faster than us, which is not every single thing you do in your daily life.</p><h4>Avoid total dependency</h4><p>Especially if you’re making heavy usage of AI APIs, always try to choose the cheapest model that does what you need to do. This requires building preliminary tests using different models and providers, to compare the ratio between their output quality and their cost per token. Try to use AI frameworks that abstract away the vendor-specific logic, so you can quickly switch to other providers, change model and even use local LLMs if you have the means of setting them up.</p><h4>Use Claude to create code to do things, not to do the same things over and over again</h4><p>Very often it is very useful to let Claude do a procedure for you. If it’s a very repetitive one (data extraction from spreadsheets, for example), you should instead tell Claude to write the code that does that procedure. Have it written in the language of your choice, so you can make small adjustments as needed. The generated code will be much faster than using AI every time, it will run at a fraction of the cost, and consume much less energy too.</p><h4>Enforce style guides</h4><p>It can be hard to make flesh developers to follow style guides, I know. I don’t find it easy to do this with LLMs either. Besides using all possible linters, the best option I’ve found is to have the initial part of the code written by someone who writes clean code, and instruct the LLM to follow the existing code style. You will find a lot of resources online to achieve even better results, I’m sure.</p><h4>Keep your old skills honed</h4><p>You need to be able to get there from here, even if you’re slower than Maps. You really do.</p><h3>CONCLUSION</h3><p>I think that Isaac Asimov, if he were alive today, would probably use LLMs to help with his writing. But I’m pretty sure he wouldn’t use “Intent engineering”, and just tell them “Write me a book about a Foundation on the outskirts of a declining Galactic Empire”. And although he wasn’t exactly writing as well as Jane Austen, I’m sure he would heavily revise their prose.</p><h4>NB</h4><p>Sorry if this article is mostly about my experience with Claude Code and not other AI coding tools: although I’ve used several other models for API implementations, I have settled on using Claude to help me with coding, since I found it very easy to integrate in my coding practices and stuck with it.</p><h4>References</h4><p>The article about prompt engineering (1 minute read):</p><p><a href="https://danielmiessler.com/blog/intent-engineering">From Prompt Engineering to Intent Engineering</a></p><p>If you haven’t read Asimov’s Foundation (a few day’s read):</p><p><a href="https://en.wikipedia.org/wiki/Foundation_(novel_series)">https://en.wikipedia.org/wiki/Foundation_(novel_series)</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b03766d991d1" width="1" height="1" alt=""><hr><p><a href="https://medium.com/hceverything/a-saner-approach-to-ai-delegation-b03766d991d1">A saner approach to AI Delegation</a> was originally published in <a href="https://medium.com/hceverything">HCEverything</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to choose a headless CMS: the most important criteria to make the choice]]></title>
            <link>https://medium.com/hceverything/how-to-choose-a-headless-cms-28f2a69e3876?source=rss----6dce6702e7df---4</link>
            <guid isPermaLink="false">https://medium.com/p/28f2a69e3876</guid>
            <category><![CDATA[composable-architecture]]></category>
            <category><![CDATA[cms]]></category>
            <category><![CDATA[jamstack]]></category>
            <category><![CDATA[headless]]></category>
            <category><![CDATA[headless-cms]]></category>
            <dc:creator><![CDATA[Paolo Mioni]]></dc:creator>
            <pubDate>Wed, 20 Mar 2024 11:33:16 GMT</pubDate>
            <atom:updated>2024-03-21T11:41:23.514Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/782/1*_pr_EpTroc6K4CCxy5rndQ.png" /></figure><h3>In the jungle of modern CMS choices, which is the one you should choose? This article aims to help you not to select the best headless CMS (that’s impossible), but the right criteria to make the choice.</h3><p>There’s a great numbers of headless CMSs on the market, all seemingly doing the same function and providing a very similar set of basic features. There is a huge difference between them in terms of costs, with licenses for enterprise versions of market leaders costing even hundreds of thousands of dollars per year, whereas less known competitors can cost a fraction of that.</p><p>So how do you choose the right one for your project (or company)? There are several things to consider.</p><h3>What’s a headless CMS?</h3><p>First things first: some of you might not be completely familiar with what exactly a headless CMS is. If you already know, skip to the next section of this article.</p><p>A headless CMS is a way of managing sets of information (articles, lists of references, technical documents, product information, picture galleries) in a way that is totally independent of their presentation (what you enter in the system is the information’s structure, not the way that it is presented to end users). Once the information is inserted, it can be consumed and displayed in several different ways.</p><p>The same series of articles inserted in a headless CMS can be easily displayed with a completely different graphical presentation in a web site, in a mobile app, or automatically inserted at the bottom of a newsletter, without manually copying and pasting the text from one place to the other. This can happen thanks to the fact that the information is available through APIs (web services that provide data on demand) that serve the raw information structure, and any target system can display it to the users the way they want, depending on the touchpoint in use.</p><p>With headless CMSs, it is also very easy to structure information very precisely, creating specific fields for specific pieces of information (think about a movie database, where you need to enter the director, the screenwriters, the actors, date of release, average rating, etc.) and validating them according to the desired format. It is also very easy to create relationships between different pieces of information, creating complex structures for your data.</p><p>In a Headless CMS, a data structure can be easily created using only a graphical interface, as opposed to using code, which is more intuitive for less skilled users (even though the task is still done by developers, as it’s quite technical). This does not always bring to time savings, but it can be very useful, especially when starting a new project.</p><p>The usage of APIs to deliver content has also become almost indispensable for all recent websites built with reactive JavaScript frameworks like Vue or React, used in a so-called “serverless” architecture. These frameworks read data using APIs, which can potentially come from very different sources, mix it together according to need and display it to the end users.</p><p>This is completely different from old “monolithic” CMSs (like WordPress), where data structures were limited, or had to be written in code, and information was often partially preformatted by the user while being inserted. Given the fact that headless and composable solutions have been very fashionable lately, most of the old CMSs have developed solutions that are similar to Headless CMSs, like APIs and codeless data structures, but often they are not implemented natively, but more as an afterthought. This can lead to significant differences in performance and ease of use depending on the technology being used.</p><h3>When is a Headless CMS useful?</h3><p>Beside being fashionable, and very useful when your site is made with reactive frameworks, why should you use Headless CMSs instead of “standard” systems? Here are some points:</p><h4>Centralization of information</h4><p>It can be extremely useful to centralize the management of information within your company, having a single place where a specific piece of information resides and is updated for everybody (a so-called “single source of truth”). This avoids having to share text documents between users, or doing copy and paste of information in different systems. For example, you don’t have to start long workflows, a long chain of tickets or emails, to update a couple of sentences in a product description, then check things to make sure everybody got the text right. You just edit in one place and click “Publish”.</p><p>Furthermore, if you have a complex approval requirements for you content (for example, your texts must be validated by a legal department or a lawyer before going live), you can implement advanced validation workflows that allow to have the right OKs from the right people before a content goes live and is updated, everywhere in your touchpoints.</p><p>The extra cost in building a headless system is usually completely compensated by the efficiency of the process and the numbers of emails, tickets, calls that are spared to all involved in the process. It also allows companies to improve their brand identity: this is part of what is called an “omnichannel” approach, a way for enterprises to keep their brand information consistent across all media.</p><h4>Design Systems</h4><p>A Design System is a set of components that make up a website or application, and can be composed together to create a complete modular website, where every page is built like a Lego toy. Basic pieces like text, images, buttons and inputs can be put together in different components that in turn can be used to create a complex, modular page.</p><p>A Design System can have a higher upfront setup cost, but it allows for incredible flexibility in creating great quantities of complex content, all the while maintaining a coherent visual style (brand consistency), thus improving business value and the usability of a digital product, ultimately improving customer retention. In the long term, a Design System provides significant cost savings both in terms of development and content creation/composition.</p><p>Since Headless CMSs came out around the same time Design Systems were becoming a requirement for big projects, they are natively built to comply with a design system’s technical requirements in terms of data composition. Content can be organized in small blocks of data, which then can be composed to form different pages in a website. The same component can be used in different pages and page types, for maximum flexibility. It is also possible to decide which components can be inserted in a specific page type (eg: a product page, a blog post page), thus enforcing a set of rules within a flexible Design System.</p><h3>Criteria for choosing a Headless CMS</h3><h4>Availability / Reliability / Performance</h4><p>The purpose of a Headless CMS, once the content has been inserted, is to provide that content in a fast and easy fashion. If the content is needed for an internationalized app that is used all over the world, you might need extreme high speed worldwide delivery. In this case, it’s important that you choose an established player with a great worldwide distribution strategy, like Contentful or Contenstack. On the contrary, you might be creating a website that is fully cached through a CDN on your end, and in that case the speed of delivery might not be as important, and you might be fine installing the software locally, like you can do with Strapi or with Sulu.</p><h4>Service Level and Support</h4><p>The high-tier CMSs offer SLAs with up to 99,95% availability (this means that they can be unresponsive for about 4 hours per year, in case of emergencies). This is a high level of commitment, since it requires a very well organized infrastructure. It can therefore be very expensive. Other CMSs provide a lower SLA, which means you might want to take into account the fact that they might (they have the contractual right to) be down for 8 or more hours a year.</p><p>Support is also vital in case of issues or development problems. Some Headless CMSs offer plans with real time support via chats like Slack, others will require you to file a ticket on their ticket system. A real-time chat, if managed by competent people, can make all the difference when you have a problem that needs to be solved in real time.</p><p>So, if your application is not mission critical, you might save some money and use a great “smaller” CMS like DatoCMS, or Strapi. Vice versa, if you need a high level of support, you might resort to the big players like Hygraph or Storyblok.</p><h4>Informational material / Documentation / Community</h4><p>Managing content in a Headless CMS seems to be reasonably straight forward: insert title, insert text, add picture, click “publish”. However, it can happen that content managers can feel stuck because the modular approach to building content can be a strong paradigm change for them, who maybe have been inserting articles in WordPress all their lives.</p><p>In this case, it is vital to have good manuals and good training. Most Headless CMSs have a clear interface which is quite self-explanatory, but it might be very useful to have comprehensive manuals (in the user’s language) in order understand the system better. Furthermore, people from the younger generations tend to be visual learners, and might prefer to watch videos instead of reading manuals. Some Headless CMS companies have tons of video tutorials, others very few. That might make a difference for you if your content management staff is of the less skilled kind or is new to these systems.</p><p>The same is valid for developers: the more documentations, examples, demos, walkthroughs they have available the better. Video lessons are less important maybe in this case, except for beginner developers. The bigger players tend to have a better set of documentation both for end-users and developers, but that obviously comes at a cost.</p><p>A community of users can be important to find help/suggestions when there is no documentation for a specific problem, or you don’t want to pay for a support plan. Therefore if a specific Headless CMS has lots of questions on Stack Overflow or similar platforms, it generally means that it’s widely used and you will find answers to common issues more easily (although you might think at first that it’s because it’s full of bugs 😉). At the time of writing, Contentful has over 800 Stack Overflow questions, Storyblok has 70, others have fewer.</p><h4>Real time preview</h4><p>Since the most difficult task for end-users is to check that their content looks correct on the target destination, it is very useful to have a quick preview of the content. Some Headless CMSs feature a live preview system that takes a little to integrate with your website, but then allows to preview things in real time. This is very useful if you have a main target for your content (a specific app / website), less so if you are really using the CMS as an omnichannel system. This feature has become very important for many users, so it’s slowly being introduced in many CMSs that didn’t have it at first. The first to introduce it has been Storyblok, which has a great preview system. But also Sulu, which is an Open Source CMS with added headless funcionality, can be set up to have a great real-time preview system.</p><h4>Data structure</h4><p>Although Headless CMSs might look very similar superficially (they all create content from components), they have core differences in the way they do some structural things with data, the way they create relationships between components, and the way you can create pages and content structured. Each CMS’s internal logic can make doing some things much easier and others more complex. This is probably the trickier factor in choosing on Headless CMS over another, and will be the subject of a specific article in the future. In the meanwhile, all I can say is that you’d better have your data structure analyzed by a professional in order to choose the right Headless CMS for your requirements.</p><h4>Internationalization</h4><p>Being designed from scratch for big projects, all Headless CMSs come with a significant set of internationalization capabilities. Some do better than others, but in general they manage internationalization quite well. Keep in mind that some might support your way of handling internationalized content better than others, or at a lower cost (I’m planning an article on the main modes of internationalization of content). In this case too, it’s best that you have your internationalization strategy checked by a professional to see in which CMSs it can be implemented best.</p><h4>Feature development / extensibility</h4><p>Depending on the complexity of your project, you might just need the basic stuff the CMS has to offer. If you have specific needs, you might want your development team to create custom extensions, for example to interact with external data sources like company ERPs or CRMs. The most widespread Headless CMSs already have plug-ins to integrate with existing systems, and a means of creating your own. Others might be more flexible, and this might influence your choice.</p><h4>On premise or on the Cloud?</h4><p>Most Headless CMSs are hosted on the Cloud, which implies that they are directly responsible for the fact that your solution is up and running, is regularly backed up and performs correctly. There are some CMSs which come with versions that can be installed on-premise, either in a free open source version, or with a paid license. Strapi and Directus can be installed on you premises, as well as Sulu. Keep in mind that Directus requires a paying license. Having the CMS in your system can allow more control on the location of your data (think about the GDPR) and its security, but requires you to set up and manage your own hosting infrastructure.</p><h4>Pricing model and costs</h4><p>Headless CMSs have become ubiquitous (and fashionable), since they’re part of the so-called Jamstack (solutions based on JavaScript, API and Markup). Therefore there are many players in this field, from market leaders that target big corporation’s needs (with costs to match), to smaller provider that cost much less. Given the fact that it’s very difficult to know beforehand how much resources your site will consume, many of these pieces of software offer several pricing tiers, often based on limits on the traffic you generate, the amount of data you insert and/or how complex your data solution is. Some of these price models can be limiting in how your site operates, so it’s important to make sure that your current (and future) data structure and usage conforms to the limits of the plan/tier you’re choosing. In this case, it can be quite complicated to make the best choice, and you’d better check with a pro to make sure you don’t overpay, or that you don’t run the risk of running soon out of contractual resources, having to increase your budget midway through the project.</p><h3>Conclusion</h3><p>As you might have noticed, choosing the right Headless CMS, with over 100 candidates on the market (<a href="https://jamstack.org/headless-cms/">check here</a> for the full list) may be daunting. This article should be useful to give you a framework on which to base your decision. If you have any more doubts, get in touch with us and we will probably be able to help you, we’ve managed projects with many of the major Headless CMS providers, working both for big international brands as well as small companies. You can get in touch with us <a href="https://www.hce.it/en/contacts">clicking here</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=28f2a69e3876" width="1" height="1" alt=""><hr><p><a href="https://medium.com/hceverything/how-to-choose-a-headless-cms-28f2a69e3876">How to choose a headless CMS: the most important criteria to make the choice</a> was originally published in <a href="https://medium.com/hceverything">HCEverything</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What is the default screen size for Webpagetest’s Amazon Agents?]]></title>
            <link>https://medium.com/hceverything/what-is-the-default-screen-size-for-webpagetests-amazon-agents-56dbe3a84815?source=rss----6dce6702e7df---4</link>
            <guid isPermaLink="false">https://medium.com/p/56dbe3a84815</guid>
            <category><![CDATA[web-performance]]></category>
            <category><![CDATA[web-performance-testing]]></category>
            <category><![CDATA[web-development]]></category>
            <dc:creator><![CDATA[Paolo Mioni]]></dc:creator>
            <pubDate>Wed, 11 Dec 2019 15:36:10 GMT</pubDate>
            <atom:updated>2020-04-17T11:20:40.540Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/993/1*mxLcNUtQqB7reWWud_KzDA.png" /></figure><p>Webpagetest, when used in a custom instance on Amazon, can load pre-made on-demand Agents using custom Amazon machines. It is not very clear, however, at what screen size their browsers operate. Apparently, this is kept to a minimum to reduce resource usage, however if you’re testing a website you might need to know at what size the screen is running, for example to check what images are being loaded.</p><p>Obviously you can script tests and force screen sizes, like this:</p><pre>setViewportSize	1366	   768<br>navigate	https://www.example.com</pre><p>But I still wanted to know what the default size is. I looked for this information everywhere and I could not find it, so I did a couple of tests against a page on our servers, where JavaScript was outputting the screen dimensions and the inner width of the window, basically this code:</p><pre>document.getElementById(&#39;test&#39;).innerHTML = `Screen: ${window.screen.width}   x   ${window.screen.height} &lt;br&gt;     Inner:  ${window.innerWidth} x ${window.innerHeight}     `</pre><p>The result was, for a Windows agent:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1008/1*Vpv4TuMBWIQhBj2BDzcJTA.png" /><figcaption>Screen and window inner sizes under Windows</figcaption></figure><p>And using a Linux Agent:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Qp2UY3CIJz62FvF1HiMTbg.png" /><figcaption>Screen and window inner sizes for a Linux agent</figcaption></figure><p>This means that, if you have set your standard desktop breakpoint from tablet landscape and above (&gt; 1024px ), like we often do, on a Windows agent you won’t get the desktop layout in the screenshots, but probably the layout you set up for mobile or tablet portrait. Which is the reason why I tested to begin with.</p><p>This is it. Thanks for your time, if you find this info useful you can thank me for my time in the comments. Or just clap.</p><p>Mioni out.</p><h4>Performance optimization</h4><p>If you need help optimizing the performances of your website, get in touch with <a href="https://www.hce.it/">HCE.IT</a>: you can find more information about our <a href="https://www.hce.it/en/performance-optimization">performance optimization services</a> <a href="https://www.hce.it/en/performance-optimization">clicking here</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=56dbe3a84815" width="1" height="1" alt=""><hr><p><a href="https://medium.com/hceverything/what-is-the-default-screen-size-for-webpagetests-amazon-agents-56dbe3a84815">What is the default screen size for Webpagetest’s Amazon Agents?</a> was originally published in <a href="https://medium.com/hceverything">HCEverything</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to add a custom set of issue Labels to Gitlab CE]]></title>
            <link>https://medium.com/hceverything/how-to-add-a-custom-set-of-issue-labels-to-gitlab-ce-b7e63c4f8b2a?source=rss----6dce6702e7df---4</link>
            <guid isPermaLink="false">https://medium.com/p/b7e63c4f8b2a</guid>
            <category><![CDATA[project-management]]></category>
            <category><![CDATA[git]]></category>
            <category><![CDATA[gitlab]]></category>
            <category><![CDATA[issue-tracking]]></category>
            <dc:creator><![CDATA[Paolo Mioni]]></dc:creator>
            <pubDate>Wed, 25 Sep 2019 14:05:19 GMT</pubDate>
            <atom:updated>2019-09-24T15:15:56.217Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QcBu8Nt9LuqUAwoddBHBBQ.jpeg" /></figure><p>If you’re using Gitlab CE internally in your company, and you’re making heavy use of its internal Issue tracking system:</p><ol><li>you might be <strong>unhappy with the default set of labels</strong> available for you Issues and Boards.</li><li>you might want to <strong>create your own set of labels </strong>and apply <strong>the same set to several repositories</strong>, once you’ve standardized your internal workflow.</li></ol><p>We were satisfying both conditions 1. and 2., so the valiant <a href="https://medium.com/@fsavina">Fabio Savina</a>, a member of our team at <a href="https://www.hce.it/">HCE.it</a>, decided to create a custom NPM script to help us in our plight. You can find it here:</p><p><a href="https://github.com/HCESrl/gitlab-standard-labels">HCESrl/gitlab-standard-labels</a></p><p>It allows you to:</p><ul><li>Create default labels for your projects, based on our choices</li><li>Create your own custom configuration with your own labels, colours, priorities etc. and use those</li><li>Add some of those labels to the default board for the project</li></ul><p>How to use it:</p><ul><li>install it on your machine with npm</li><li>follow the instructions in the README.md file within the project</li></ul><p>The code is not perfect and might not work with all versions of Gitlab CE, but at least that’s a start! If something isn’t working, or if you need a new feature, please file a bug report in <a href="https://github.com/HCESrl/gitlab-standard-labels/issues">Github Issues here</a>.</p><p>The default list of labels we use are the following:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/712/1*gusarbB1G_VlSfdaNpS8xA.png" /><figcaption>Default list of labels for Gitlab Issues</figcaption></figure><p>Thanks for your time, if there are any errors or if you have any suggestions let us know in the comments below!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b7e63c4f8b2a" width="1" height="1" alt=""><hr><p><a href="https://medium.com/hceverything/how-to-add-a-custom-set-of-issue-labels-to-gitlab-ce-b7e63c4f8b2a">How to add a custom set of issue Labels to Gitlab CE</a> was originally published in <a href="https://medium.com/hceverything">HCEverything</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Parcel.js: moving static resources to a separate folder]]></title>
            <link>https://medium.com/hceverything/parcel-js-moving-static-resources-to-a-separate-folder-aef63a038cbd?source=rss----6dce6702e7df---4</link>
            <guid isPermaLink="false">https://medium.com/p/aef63a038cbd</guid>
            <category><![CDATA[parcel-js]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Paolo Mioni]]></dc:creator>
            <pubDate>Mon, 10 Jun 2019 10:06:41 GMT</pubDate>
            <atom:updated>2019-06-21T08:19:11.958Z</atom:updated>
            <content:encoded><![CDATA[<p>Being somewhat tired of configuring different versions of Webpack for different projects and perusing lengthy documentation, searching for plugins and looking at hundreds tutorials, many of which are related to an unspecified version of Webpack which is usually not compatible with the one we’re using, I tried to use <a href="https://parceljs.org/">Parcel.js</a> for a few new front-end projects.</p><p>The prospect of using a “zero configuration web application bundler” was indeed very enticing. In some respects, Parcel.js delivers on that promise, since if your workflow is fairly straightforward it is very quick to install and it works sort of out of the box. In other respects, I found out that this comes at a cost. If you workflow doesn’t match the use cases that have been foreseen by the developers, you will need to add configuration to your project for the various plug-ins it uses (PostCSS, Sass, etc.). But more on that in a future article.</p><h3>The problem</h3><p>One of the big drawbacks I’ve found with Parcel.js is that all resources are output in the same folder. Parcel.js avoids naming conflicts in your assets by hashing all files it produces with a hash which (I believe) changes every time the content changes size, so it provides an automatic cache busting system when you deploy a new version of your site/application to a server. Which is nice. However, if your initial asset structure looks something like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/439/1*wEoyppkts21GtgIH3gbgng.png" /><figcaption>Original assets folder, with fonts and images in separate folders and subfolders</figcaption></figure><p>once you build it for production it will be converted into something like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/447/1*RLeKjqKKLUaAlIqSwXAL4g.png" /><figcaption>Flattened folder in build, with all resources on the same level</figcaption></figure><p>all files are on the same level, and if you have many files in your project you end up with a huge folder full of hashed files, whose names are also fairly difficult to read.</p><p>Which is all fine, if the only thing you need to do with your built application is to push it to production using a Continuous Integration tool that will build and deploy for you. However, there are some use cases in which this won’t work. Some that come to my mind are the following:</p><ol><li>If you need to setup some <strong>specific server-side rules</strong> for some assets only (for example, some JPEGs but not all of them, or some fonts but not all of them). In this case it might be much more convenient to create a per-folder rule than to use some complicated naming convention for each file and use RegExps to match the files you need. It would be helpful, and maybe simple to implement, if Parcel.js would at least prepend each file’s current folder hierarchy on the name of the file, which would make it much easier to create said RegExps.</li><li>If you ever need to <strong>look at the files in the build</strong>, maybe to look for something problematic in a file’s compression, for example, once an application becomes big it becomes <strong>very</strong> difficult to find what you’re looking for.</li><li>It might not be a problem anymore, and it might depend on the file system you are using in production, but sometimes there are limits on how many files you can have in one folder, and having <strong>too many files in a folder has a performance hit</strong>. Parcel’s own build cache system uses several different folders to cache intermediate compilation artifacts, for the same reason.</li><li>You might need to deliver the built package to a third party for integration, for example if you’re only developing the front-end of an application or site, which then needs to be integrated with a CMS of some sort. Go tell the implementers that they need to fetch all their templates for, say, twenty layouts or fifty components from the root folder, and that all of the resources and images, Javascript, compiled CSS and all, are in the same folder as well. It just doesn’t look right (or professional, for that matter).</li></ol><p>My use case was number four. The implementers did not want anything to do with our front-end build process, and did not even want to look at the components we’d created for the project (which in our case were <a href="https://handlebarsjs.com/">Handlebars</a> partials). They just wanted the plain HTML and the compiled JavaScript and CSS, possibly with a diff of changes to the HTML when we delivered a new package. It sounds primitive, and all evidence points to the fact that these implementers are probably coding in Dreamweaver or FrontPage or something, but these things do happen in real life, even with big companies. I haven’t had the courage to ask if they were doing the site in Joomla.</p><p>I searched Parcel’s documentation to find some option that would do that, but in vain. I looked in the plethora of Parcel open issues, and found a few threads started by people with the same problem, one of them being <a href="https://github.com/parcel-bundler/parcel/issues/2991">this one</a>, but there are several. Apparently, this feature will be available in the next version, Parcel 2, which is still in development.</p><p>I had a look at the code to see if it was feasible, given my time constraints with the project I was working on, to create a plugin to do what I wanted. But that would have required me to study a big part of Parcel’s source code, and it was a total no-go for me. So I decided to build a custom script to achieve what I needed, after Parcel’s build process was finished.</p><h3>The solution</h3><p>It is actually a very simple script, however it has worked for me for the project I needed it for, and it has in a couple more project I did with Parcel after that one. So I decided to share it with you, while we all wait that the guys at Parcel deliver version 2. Here is the code, from a file I called postbuild.js. It is in Node.js, it is NOT very efficient, it does NOT run in parallel, but it gets the job done:</p><pre>const fs = require(&#39;fs&#39;);<br>const path = require(&#39;path&#39;);<br>const replace = require(&#39;replace-in-file&#39;);<br>const escapeRegExp = require(&#39;lodash.escaperegexp&#39;);<br><br>// the directory in which you&#39;re outputting your build<br>let baseDir = &#39;public&#39;<br>// the name for the directory where your static files will be moved to<br>let staticDir = &#39;static&#39;<br>// the directory where your built files (css and JavaScript) will be moved  to<br>let assetsDir = &#39;build&#39;<br><br>// if the staticDir directory isn&#39;t there, create it<br>if (!fs.existsSync(path.join(__dirname, baseDir, staticDir))){<br>  fs.mkdirSync(path.join(__dirname, baseDir, staticDir));<br>}<br><br>// same for the assetsDir directory<br>if (!fs.existsSync(path.join(__dirname, baseDir, assetsDir))){<br>  fs.mkdirSync(path.join(__dirname, baseDir, assetsDir));<br>}<br><br>// Loop through the baseDir directory<br>fs.readdir(`./${baseDir}`, (err, files) =&gt; {<br>  // store all files in custom arrays by type<br>  let html = []<br>  let js = []<br>  let css = []<br>  let maps = []<br>  let staticAssets = []<br><br>  files.forEach(file =&gt; {<br>    // first HTML files<br>    if(file.match(/.+\.(html)$/)) {<br>      console.log(&#39;html match&#39;, file)<br>      html.push(file)<br>    } else  if(file.match(/.+\.(js)$/)) { // then JavaScripts<br>      js.push(file)<br>    } else if(file.match(/.+\.(map)$/)) { // then CSS<br>      maps.push(file)<br>    } else if(file.match(/.+\.(css)$/)) { // then sourcemaps<br>      css.push(file)<br>    } else if(file.match(/.+\..+$/)){ // all other files, exclude current directory and directory one level up<br>      staticAssets.push(file)<br>    }<br>  });<br>  // check what went where<br>  console.log(&#39;html&#39;, html, &#39;css&#39;, css, &#39;js&#39;, js, &#39;staticAssets&#39;, staticAssets)<br><br>  // create an array for all compiled assets<br>  let assets = css.concat(js).concat(maps)<br><br>  // replace all other resources in html<br>  html.forEach(<br>    file =&gt; {<br>      staticAssets.forEach(name =&gt; {<br>        let options = {<br>          files: path.join(&#39;public&#39;, file),<br>          from: new RegExp(escapeRegExp(name), &#39;g&#39;),<br>          to: staticDir + &#39;/&#39; + name<br>        }<br>        try {<br>          let changedFiles = replace.sync(options);<br>          console.log(&#39;Modified files:&#39;, changedFiles.join(&#39;, &#39;));<br>        }<br>        catch (error) {<br>          console.error(&#39;Error occurred:&#39;, error);<br>        }<br>      })<br>      assets.forEach(name =&gt; {<br>        let options = {<br>          files: path.join(&#39;public&#39;, file),<br>          from: new RegExp(escapeRegExp(name), &#39;g&#39;),<br>          to: assetsDir + &#39;/&#39; + name<br>        }<br>        try {<br>          let changedFiles = replace.sync(options);<br>          console.log(&#39;Modified files:&#39;, changedFiles.join(&#39;, &#39;));<br>        }<br>        catch (error) {<br>          console.error(&#39;Error occurred:&#39;, error);<br>        }<br>      })<br>    }<br>  )<br><br>  // replace map links in js<br>  js.forEach(<br>    file =&gt; {<br>      maps.forEach(name =&gt; {<br>        let options = {<br>          files: path.join(&#39;public&#39;, file),<br>          from: name,<br>          to: &#39;../&#39; + assetsDir + &#39;/&#39; + name<br>        }<br>        try {<br>          let changedFiles = replace.sync(options);<br>          console.log(&#39;Modified files:&#39;, changedFiles.join(&#39;, &#39;));<br>        }<br>        catch (error) {<br>          console.error(&#39;Error occurred:&#39;, error);<br>        }<br>      })<br>    }<br>  )<br><br>  // replace links in css<br>  css.forEach(<br>    file =&gt; {<br>      staticAssets.forEach(name =&gt; {<br>        let options = {<br>          files: path.join(&#39;public&#39;, file),<br>          from: new RegExp(escapeRegExp(name), &#39;g&#39;),<br>          to: &#39;../&#39; + staticDir + &#39;/&#39; + name<br>        }<br>        try {<br>          let changedFiles = replace.sync(options);<br>          console.log(&#39;Modified files:&#39;, changedFiles.join(&#39;, &#39;));<br>        }<br>        catch (error) {<br>          console.error(&#39;Error occurred:&#39;, error);<br>        }<br>      })<br>    }<br>  )<br><br>  // move js and css and maps<br>  assets.forEach(<br>    name =&gt; {<br>      fs.rename(path.join(__dirname, &#39;public&#39;, name), path.join(__dirname, &#39;public&#39;, assetsDir,  name), function (err) {<br>        if (err) throw err<br>        console.log(`Successfully moved ${name}`)<br>      })<br>    }<br>  )<br>  // move staticAssets<br>  staticAssets.forEach(<br>    name =&gt; {<br>      fs.rename(path.join(__dirname, &#39;public&#39;, name), path.join(__dirname, &#39;public&#39;, staticDir,  name), function (err) {<br>        if (err) throw err<br>        console.log(`Successfully moved ${name}`)<br>      })<br>    }<br>  )<br><br><br>});</pre><h4>How to use it</h4><p>You can just copy and paste (and change) this code in your project, save it in the root of your project and call it postbuild.js, then run it after your standard parcel build scripts.</p><p>In my package.jsonI use it like this after the build script:</p><pre>&quot;build&quot;: &quot;parcel build pages/index.hbs --out-dir public --no-cache &amp;&amp; node postbuild.js&quot;</pre><p>I decided not to build a NPM package for this, for the following reasons:</p><ul><li>It is a temporary, less than ideal solution, not worth of being made permanent in any way</li><li>I would not have the time to maintain a package</li><li>People should learn that not every problem they have with their build compilation flow can be solved with the magic inclusion of a third-party NPM package. Sometimes it’s best to write some code yourself.</li></ul><p>Hope this little thing serves your purpose, if it does let me know in the comments, if it doesn’t, let me know in the comments, if you have something else you want to say about this matter, let me know in the comments.</p><p>Thanks for your time.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=aef63a038cbd" width="1" height="1" alt=""><hr><p><a href="https://medium.com/hceverything/parcel-js-moving-static-resources-to-a-separate-folder-aef63a038cbd">Parcel.js: moving static resources to a separate folder</a> was originally published in <a href="https://medium.com/hceverything">HCEverything</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[SEO Optimization And Vue.js — An Article I Published On Smashing Magazine]]></title>
            <link>https://medium.com/hceverything/seo-optimization-and-vue-js-an-article-i-published-on-smashing-magazine-19833b2bc2e0?source=rss----6dce6702e7df---4</link>
            <guid isPermaLink="false">https://medium.com/p/19833b2bc2e0</guid>
            <category><![CDATA[optimization]]></category>
            <category><![CDATA[vuejs]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[seo]]></category>
            <category><![CDATA[vue]]></category>
            <dc:creator><![CDATA[Paolo Mioni]]></dc:creator>
            <pubDate>Wed, 22 May 2019 10:54:14 GMT</pubDate>
            <atom:updated>2020-04-17T14:06:55.038Z</atom:updated>
            <content:encoded><![CDATA[<h3>SEO Optimization And Vue.js — An Article I Published On Smashing Magazine</h3><h4>A short story about tight deadlines, car websites and online magazines</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*fNT0V37y1miVnqiy" /><figcaption>Photo by <a href="https://unsplash.com/@curtismacnewton?utm_source=medium&amp;utm_medium=referral">Curtis MacNewton</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Several months ago now I was the lead developer on the website for a new model by a major car manufacturer. Deadlines were tight as hell and the design was very complex and full of experimental stuff, so we chose to develop it in Vue.js. It was the only sensible option for us given that the site had many transitions between pages, complex animations and whatever gets thrown in a site that has to impress the end user and the client these days.</p><p>Problem was, the site had many sub-pages (it was not a SPA), every page and many of each page’s content needed to be shareable via Twitter and Facebook, and all of the content of the pages was supposed to get indexed by Google. There was really no time (or budget, for that matter) to set up server-side rendering, as we hadn’t adopted <a href="https://nuxtjs.org/">Nuxt</a> from the start. After all Nuxt was then still in its infancy, so to speak. We checked all literature about Googlebot and JavaScript, and it seemed pretty evident to us that, if we did it right, Google would have indexed the whole site without pre-rendering. The SEO consultants would have none of that, and said that pre-rendering was a must to achieve the best results.</p><p>In the end, since the go-live was supposed to be in less than a month, development had started and there was no way we could integrate Nuxt in the development process in time, we decided to go ahead without pre-rendering, see what happened, and fix stuff later if needed.</p><p>Within a few days of the go-live, the site got indexed by Google for minor phrases, and Google was picking text content that was being rendered by Vue. Within a few months, the site was ranking first for all major searches related to that car model. I was very happy that we were proven right, however since everyone was still pre-rendering sites and Nuxt was becoming all the rage (we adopted it too for newer projects, but for reasons other than SEO) I was left wanting to know the exact state of the art in the matter.</p><p>So I devised an experiment to see what Googlebot actually did on a website which was loading content in all sorts of weird ways, to check what happened and how it would be indexed. I created a website in Vue, filled it with text about <a href="https://en.wikipedia.org/wiki/Infinite_Jest">Infinite Jest</a>, which is one of my favourite books, and made sure that some content was loaded dynamically and also from external web services. Once the experiment was over, I wrote an article about it and other experiences I’ve had with indexing of Vue.js sites. A few busy months passed, then I finally had time to review it and have it checked by an SEO specialist friend of mine. I submitted it to Smashing Magazine, they liked it, and so here it is:</p><p><a href="https://www.smashingmagazine.com/2019/05/vue-js-seo-reactive-websites-search-engines-bots/">Vue.js And SEO: How To Optimize Reactive Websites For Search Engines And Bots - Smashing Magazine</a></p><p>Let me know what you think in the comments. Or comment the real article directly.</p><h4>Vue.js development</h4><p><em>Our company,</em><a href="https://www.hce.it/"><em> HCE.IT</em></a><em>, specializes in Vue.js development. We have a competent team of developers who can tackle any project, including PWAs and web apps. We have delivered major projects for big brands. </em><a href="https://www.hce.it/en/vue-development"><em>Click here</em></a><em> if you need </em><a href="https://www.hce.it/en/vue-development"><em>Vue.js development</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=19833b2bc2e0" width="1" height="1" alt=""><hr><p><a href="https://medium.com/hceverything/seo-optimization-and-vue-js-an-article-i-published-on-smashing-magazine-19833b2bc2e0">SEO Optimization And Vue.js — An Article I Published On Smashing Magazine</a> was originally published in <a href="https://medium.com/hceverything">HCEverything</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to show your App Version from package.json in your Vue application]]></title>
            <link>https://medium.com/hceverything/how-to-show-your-app-version-from-package-json-in-your-vue-application-11e882b97d8c?source=rss----6dce6702e7df---4</link>
            <guid isPermaLink="false">https://medium.com/p/11e882b97d8c</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[webpack]]></category>
            <category><![CDATA[vuejs]]></category>
            <dc:creator><![CDATA[Paolo Mioni]]></dc:creator>
            <pubDate>Fri, 16 Nov 2018 18:47:36 GMT</pubDate>
            <atom:updated>2020-04-17T14:06:03.741Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*1B59daLR7Yvxcg2_" /><figcaption>Photo by <a href="https://unsplash.com/@pankajpatel?utm_source=medium&amp;utm_medium=referral">Pankaj Patel</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><h4>IMPORTANT: SECURITY UPDATE</h4><p><em>This article has been updated on Sep 20th, 2019 to reflect some security concerns that were expressed by </em><a href="https://medium.com/@dubaaron"><em>Aaron W</em></a><em> in the comments. Instead of importing the whole package.json file, we’re only importing the version number. Thanks Aaron!!</em></p><p>—</p><p>When your Vue application is not just a web-based app or website, but it is a proper application, it can be distributed and packaged in different versions to different end-users. In those cases it is very useful to show your application version somewhere in your layout. If the application does not work as expected, it’s very easy to check if the user is using an old version.</p><p>After spending one hour looking for the right solution for this task, I found one and managed to make it work on one of our <a href="https://cli.vuejs.org/guide/">Vue CLI 3</a>-based applications. Once I got it to work, I decided to spend another hour writing this article in the hope of saving you guys some time!</p><h3>Exporting package.json’s version property</h3><p>First thing, you should edit your vue.config.js file, which you can find in the root folder of your Vue CLI 3 project. You should change the module.exports section so that it looks like this:</p><pre>const fs = require(&#39;fs&#39;)<br>const packageJson = fs.readFileSync(&#39;./package.json&#39;)<br>const version = <strong><em>JSON</em></strong>.parse(packageJson).version || 0<br>module.exports = {<br>    configureWebpack: {<br>        plugins: [<br>            new webpack.DefinePlugin({<br>                &#39;process.env&#39;: {<br>                    PACKAGE_VERSION: &#39;&quot;&#39; + version + &#39;&quot;&#39;<br>                }<br>            })<br>        ]<br>    },<br>// the rest of your original module.exports code goes here<br>}</pre><p>This exports the version of yourpackage.json file in a global property which you can access in your code using the process.env object. If for whatever reason the version property is not available in the package.json file, it will be exported as 0 (Zero).</p><h3>Reading the imported content and processing it</h3><p>It is useful to have a centralized point where to read the data and make it available to the rest of the app, and the best place is your VueX store. In store/index.js, add the following code:</p><pre><strong>export default new </strong>Vuex.Store({<br>  state: {<br>    packageVersion: process.env.PACKAGE_VERSION || &#39;0&#39;<br>    // the rest of your state here</pre><pre>},<br>  getters: {<br>    appVersion: (state) =&gt; {<br>      <strong>return </strong>state.packageVersion<br>    }<br>    // the rest of your getters here  <br>},</pre><p>What does this do? It reads the content of the variable that you had set at compile time and makes it available as a Store property.</p><p>You then need to add a getter to be able to read it in our Vue application. I’ve called it appVersion. See the code above.</p><h3>Using the package version in your app</h3><p>This can be done in several ways.</p><p>If you want to use it directly in your template’s HTML code, you just need to do this:</p><pre>My Awesome App version {{ $store.getters.appVersion }}</pre><p>If you want to use it in a computed function (maybe to add some extra custom formatting in the context in which you’re using the value), you can do this:</p><pre><br>computed: {<br>  appVersion () {<br>    <strong>return this</strong>.$store.getters.appVersion<br>  } <br>  // other computed values here<br>},</pre><p>If you just want to dump it to the developer console, you can for example do the following in your mounted hook in some component:</p><pre>mounted () {<br>  console.info(&#39;App version &#39; + <strong>this</strong>.$store.getters.appVersion)<br>}</pre><p>And so on.</p><p>You can use this system to read more properties from your package.json, if needed, but you are strongly advised, if your application has any security concerns , <strong>not to include </strong>the whole<strong> </strong>package.json file in your code as exposing the versions of the libraries you use in your project might make life easier to a hacker. See the comments section below for more info on the problem.</p><p>Remember, in general you don’t have security concerns only if your application is an internal test or a University assignment. If your code runs in production anywhere, you should worry about application security. If your code manages sensitive data, or might be run on a site that manages sensitive data, your should definitely be very cautious.</p><h3>Conclusion</h3><p>At this moment, you should have applied the code above to your application, StackOverflow-style, and left the building.</p><p>If you’re still with me, I have to add a couple of considerations:</p><ul><li>This system allows you, with little extra work, to keep the version number in your front-end synced to the place where you should be keeping it updated anyway, that is your package.json file. No need to add it statically to some .env file every time you bump version.</li><li>If you put your version number on top of your loading screen in a small print, Fortnite-style, people will need to reload your app to read the version. I would suggest to add it to a footer or to a <em>Help -&gt; About</em> dialogue somewhere in your layout. Fortnite is not <em>always</em> cool.</li></ul><p>Thanks for your kind attention, and don’t forget to clap and point out all of my mistakes in the comments.</p><h4>DISCLAIMER</h4><p><em>Most of the solution comes from this forum post (and other similar ones): </em><a href="https://forum.vuejs.org/t/in-cli3-how-to-get-version-from-package-json/34876"><em>https://forum.vuejs.org/t/in-cli3-how-to-get-version-from-package-json/34876</em></a><em>, I’ve expanded it, explained it and made some changes for your convenience.</em></p><h4><em>Vue.js development</em></h4><p><em>Our company,</em><a href="https://www.hce.it/"><em> HCE.IT</em></a><em>, specializes in Vue.js development. We have a competent team of developers who can tackle any project, including PWAs and web apps. We have delivered major projects for big brands. </em><a href="https://www.hce.it/en/vue-development"><em>Click here</em></a><em> if you need </em><a href="https://www.hce.it/en/vue-development"><em>Vue.js development</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=11e882b97d8c" width="1" height="1" alt=""><hr><p><a href="https://medium.com/hceverything/how-to-show-your-app-version-from-package-json-in-your-vue-application-11e882b97d8c">How to show your App Version from package.json in your Vue application</a> was originally published in <a href="https://medium.com/hceverything">HCEverything</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[All your browser are belong to us — JavaScript malware and unwanted pop-ups]]></title>
            <link>https://medium.com/hceverything/an-article-about-a-malicious-script-6451b46a61ab?source=rss----6dce6702e7df---4</link>
            <guid isPermaLink="false">https://medium.com/p/6451b46a61ab</guid>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[malware-analysis]]></category>
            <dc:creator><![CDATA[Paolo Mioni]]></dc:creator>
            <pubDate>Mon, 16 Jul 2018 08:38:55 GMT</pubDate>
            <atom:updated>2018-07-19T10:25:30.127Z</atom:updated>
            <content:encoded><![CDATA[<h3>I wrote an article on CSS-Tricks about a malicious script that hijacks clicks and sends them to another site. You’ve never seen that happen, have you?</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/1*VPZR19LGrQO1MW_4Dcy31g.png" /></figure><p>I recently published an article on CSS-Tricks about a malicious JavaScript piece of code that hijacks user clicks. I deciphered, de-obfuscated and analysed the script to show how it works and the techniques being used.</p><p>The analysis took a lot of time and patience, but it was very interesting. I first had to find a suitable script, then had to dissect it and make sense of it. I think the article shows the fun I’ve had in doing it.</p><p>Anyway, <a href="https://css-tricks.com/anatomy-of-a-malicious-script-how-a-website-can-take-over-your-browser/">here is the link</a>:</p><p><a href="https://css-tricks.com/anatomy-of-a-malicious-script-how-a-website-can-take-over-your-browser/">Anatomy of a malicious script: how a website can take over your browser | CSS-Tricks</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6451b46a61ab" width="1" height="1" alt=""><hr><p><a href="https://medium.com/hceverything/an-article-about-a-malicious-script-6451b46a61ab">All your browser are belong to us — JavaScript malware and unwanted pop-ups</a> was originally published in <a href="https://medium.com/hceverything">HCEverything</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Comparing Responsive Email Frameworks]]></title>
            <link>https://medium.com/hceverything/comparing-responsive-email-frameworks-a3340d81ba64?source=rss----6dce6702e7df---4</link>
            <guid isPermaLink="false">https://medium.com/p/a3340d81ba64</guid>
            <category><![CDATA[responsive]]></category>
            <category><![CDATA[direct-marketing]]></category>
            <category><![CDATA[responsive-design]]></category>
            <category><![CDATA[direct-mail-marketing]]></category>
            <category><![CDATA[email]]></category>
            <dc:creator><![CDATA[Paolo Mioni]]></dc:creator>
            <pubDate>Thu, 17 May 2018 07:30:50 GMT</pubDate>
            <atom:updated>2018-05-17T07:17:10.574Z</atom:updated>
            <content:encoded><![CDATA[<p>I’ve recently published an article on CSS-Tricks about Responsive Email Frameworks. It contains a comparison of different approaches to developing templates for DEM emails.</p><p>It details advantages and disadvantages of hand-coding (whether from scratch or using a boilerplate of some sort), and then compares the most prominent frameworks on the market, <a href="https://mjml.io/">MJML</a> and <a href="https://foundation.zurb.com/emails.html">Foundation for Emails</a>.</p><p><a href="https://css-tricks.com/choosing-a-responsive-email-framework%E2%80%8Amjml-vs-foundation-for-emails/">You can read it here</a>.</p><p><a href="https://css-tricks.com/choosing-a-responsive-email-framework%E2%80%8Amjml-vs-foundation-for-emails/">Choosing a Responsive Email Framework: MJML vs. Foundation for Emails | CSS-Tricks</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a3340d81ba64" width="1" height="1" alt=""><hr><p><a href="https://medium.com/hceverything/comparing-responsive-email-frameworks-a3340d81ba64">Comparing Responsive Email Frameworks</a> was originally published in <a href="https://medium.com/hceverything">HCEverything</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Applying srcset: choosing the right sizes for responsive images at different breakpoints]]></title>
            <link>https://medium.com/hceverything/applying-srcset-choosing-the-right-sizes-for-responsive-images-at-different-breakpoints-a0433450a4a3?source=rss----6dce6702e7df---4</link>
            <guid isPermaLink="false">https://medium.com/p/a0433450a4a3</guid>
            <category><![CDATA[front-end-development]]></category>
            <category><![CDATA[frontend]]></category>
            <category><![CDATA[responsive-design]]></category>
            <category><![CDATA[responsive-web-design]]></category>
            <category><![CDATA[web-development]]></category>
            <dc:creator><![CDATA[Paolo Mioni]]></dc:creator>
            <pubDate>Mon, 30 Oct 2017 09:52:40 GMT</pubDate>
            <atom:updated>2020-04-09T11:06:50.606Z</atom:updated>
            <content:encoded><![CDATA[<p>How to choose the correct pixel width of your images based on common viewports and the size of the image in your design.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*C1sxbAPa1uP4NYckHa432g.jpeg" /><figcaption>Photo by Antonio Campanella</figcaption></figure><p>There are several <a href="http://ericportis.com/posts/2014/srcset-sizes/">great guides</a> online that explain how to use responsive images, both using the <em>srcset</em> and <em>sizes</em> attibutes of the &lt;img&gt; tag and the more sophisticated (and sometimes overly complicated) &lt;picture&gt; tag. They usually explain the technical details of the two methods of implementing responsive images, and their respective benefits. But they rarely give you advice on <strong>how to actually use the tags</strong>, especially in terms of choosing the image sizes to actually insert in the tags.</p><p>This article arises from a personal need: lately I have been working as lead front-end developer or lead developer on high traffic websites where images need to be optimized both for performance and for bandwidth reasons. The sites, as is usually the case lately, are <strong>full of big images</strong>, often used in full-page mode, sometimes as a background for text, but also as the predominant content on the page. Images can take 100% of the page width, but depending on the designers’ choices <strong>they can take a variable percentage of the screen</strong>, and often that percentage varies according to the current breakpoint.</p><p>While applying the <em>srcset</em> attribute on many images on the websites I was not 100% satisfied with my choice of images sizes, which had been done relying on the few pieces of advice available on the web and by <strong>manually testing</strong> on a range (several, actually) of browsers. I decided I wanted to act on the basis of some <strong>analysis of empirical data</strong> instead of an abstract understanding of the problem.</p><p>There are several factors involved in managing responsive images, some of which are:</p><ul><li>End-user <strong>screen size</strong></li><li>End-user <strong>browser capabilities</strong></li><li>End-user <strong>screen resolution</strong></li><li>End-user <strong>bandwidth</strong> (I imagine some mobile browser might take that into account when requesting images, I actually don’t know whether they do or not)</li><li><strong>Width of image</strong> in the layout (percentage of screen real estate occupied by image)</li><li><strong>Different width of the image</strong> depending on <strong>breakpoint</strong> (for example, a product image in an e-commerce website might occupy less than 33% of the screen on desktop resolutions if the products are distributed in lines of 3, and maybe 50% or 100% on mobile where they are distributed in lines of 2 or one under the other).</li><li><strong>Different image shape</strong> depending on <strong>breakpoint</strong>, where an image is completely different depending on the layout (for example, show the photo of a full person on desktop, and the face only on mobile). This is a fairly extreme case, and often requires a very tight team of designers/developers to put in practice, as generally images have to be cut “by hand” to match each layout. They generally require the &lt;picture&gt; tag, and are (according to my work experience) a rarer case, and they will not be treated here.</li></ul><p>Given that with the <em>srcset</em> attribute browsers have total freedom in choosing which images to display, I decided to base my decisions on actual data from real browsers, and not only on calculations. We do not know which version of each image the browsers will actually download until they do.</p><h3>The “experiment”</h3><p>This section describes the methodology used to <strong>retrieve real browser data</strong> on responsive images, and as such it will be fairly boring. If you’re interested in the results only, feel free to <strong>skip to the next section</strong>.</p><p>To have real data from real browsers, I decided to build an actual web page full of responsive images, which <strong>occupy a different percentage of the available width</strong>, using what I believed would be the standard ratios used in most websites. So, one image at 10% width, one at 20%, one at 25%, and so on: 33%, 50%, 66%, 75%, 100%.</p><p>For each of this images, using a front-end development framework I created with my company (<a href="https://github.com/HCESrl/it.hce.microframework">The HCE Microframework</a>), I built <strong>a version of the image at several resolutions</strong> (every 200px as well as most of the major device screen sizes on the market) and created an <em>img </em>tag with the appropriate <em>srcset</em> attribute, like this:</p><pre>&lt;div class=&quot;responsiveImage size-75&quot;&gt;&lt;img src=&quot;<a href="http://responsiveimages.hce.it/counter.php?path=images/components/10/responsiveImage/75percent.jpg">/counter.php?path=images/components/10/responsiveImage/75percent.jpg</a>&quot; srcset=&quot;/counter.php?path=images/components/10/responsiveImage/75percent.jpg 10w, /counter.php?path=images/components/2048/responsiveImage/75percent.jpg 2048w, /counter.php?path=images/components/1920/responsiveImage/75percent.jpg 1920w, /counter.php?path=images/components/1800/responsiveImage/75percent.jpg 1800w, /counter.php?path=images/components/1680/responsiveImage/75percent.jpg 1680w, /counter.php?path=images/components/1600/responsiveImage/75percent.jpg 1600w, /counter.php?path=images/components/1440/responsiveImage/75percent.jpg 1440w, /counter.php?path=images/components/1400/responsiveImage/75percent.jpg 1400w, /counter.php?path=images/components/1366/responsiveImage/75percent.jpg 1366w, /counter.php?path=images/components/1280/responsiveImage/75percent.jpg 1280w, /counter.php?path=images/components/1200/responsiveImage/75percent.jpg 1200w, /counter.php?path=images/components/1024/responsiveImage/75percent.jpg 1024w, /counter.php?path=images/components/1000/responsiveImage/75percent.jpg 1000w, /counter.php?path=images/components/800/responsiveImage/75percent.jpg 800w, /counter.php?path=images/components/768/responsiveImage/75percent.jpg 768w, /counter.php?path=images/components/600/responsiveImage/75percent.jpg 600w, /counter.php?path=images/components/400/responsiveImage/75percent.jpg 400w, /counter.php?path=images/components/200/responsiveImage/75percent.jpg 200w&quot; sizes=&quot;75vw&quot; /&gt;&lt;/div&gt;</pre><p>As you can see, the HTML gets pretty big quite quickly. This is just one image, mind. The number in the URL of the image indicates the actual image’s width.</p><p>Here’s how the page looks like:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Cx68uRjumdtYrLS8zULXZg.png" /></figure><p>Then we used <a href="https://www.browserstack.com/">Browserstack</a>’s nice <a href="https://www.browserstack.com/automate">Automate</a> suite to run <strong>a series of automated tests</strong>: I chose a wide range of devices and browsers supporting responsive images, and had them visit the page. We also had to run a few tests manually using an emulator <strong>simulating small smartphones</strong>, since Browserstack’s suite tends to include small smartphones with relatively obsolete browsers (their suite is meant for testing apps and website on a wide range of browsers, so this is not a criticism), and obsolete browsers have no support of responsive images.</p><p>While the browser were visiting the page, we tracked <strong>how many times each version of the same image was actually downloaded</strong>. This way, for every use of each image (100%, 50%), I hoped to have a clearer idea of what sizes might be required in an actual real-world situation.</p><h3>The results</h3><p>The following graph shows the actual image sizes requested for every image in the page.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/630/1*ceq93MjbSFm5gh-xauwniQ.png" /><figcaption>Sizes of images requested by percentage width of images</figcaption></figure><p>As you can see, <strong>every image has been requested at almost every size available</strong> below its maximum size on the maximum screen used. For example, the 100percent image has been requested at every size from 2048px of width downwards. 2048px width was the maximum size available for the image, and was requested by several different devices.</p><p>Let’s see a quantitative distribution for the 100% width image:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/630/1*vPgRe0jLjjmv7DpXTuVMaA.png" /><figcaption>Number of request for each image size for responsive image set as 100% width of page</figcaption></figure><p>And for a 50% image:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/630/1*YrrRHLg0j16XD8bZSEndAQ.png" /><figcaption>Number of request for each image size for responsive image set as 50% width of page</figcaption></figure><p>As you can see, for every image you end up getting <strong>requests at any size available</strong>, since the combination of viewport sizes and image width produces requests for all sizes of images available.</p><p>The result is that, to accommodate every browser with the best possible image size, you should have a <strong>dedicated server providing custom images</strong> based on the browser’s request. This obviously requires big resources that are not available to everybody, even on major projects. If you have them available, the obvious solution is to output image sources for every 100px or so and let the server do the rest.</p><h3>What if you don’t have a dedicated image server?</h3><p>If you’re faced with a <strong>finite number of server resources</strong> it means that you have to compile images via a deploy procedure, using some automation tool like Gulp or Webpack, or you have to resize them once and for all via a CMS - and creating many different versions of the same image can easily take a long time . If you have to manage a high traffic website and you need to optimize responsive images to reduce bandwidth costs and improve user experience, you probably need to <strong>follow another approach</strong>.</p><h3>“You just need three image versions” (??)</h3><p>I’ve heard this sentence a lot. People assume that once you’ve done a version for mobile, desktop and tablet you are done. This is <strong>completely incorrect</strong> in my opinion. There’s a <strong>huge variety of screen resolutions</strong> on the Web, and even though current browsers are getting very good at scaling images up, interpolating pixels if the image is too small, this strategy has a severe limit. The fact is that High-DPI screens are getting common even for desktops. In my opinion, for an image that takes 100% width of your design, if you target desktops in your project, you need (at least) to output an image 1920px of width. If you then produce <strong>two other versions</strong>, you’re left with one for smaller screens at, say, 1024px or 1366px width, and a smaller one for smartphones (at 750px for an average mobile phone at 2x resolution).</p><p>But this strategy has serious drawbacks in several situations: just as an example, let’s say someone has a desktop/laptop computer with a 1440px screen resolution with a bad connection: browsers usually pick from your <em>srcset</em> the image that matches their on-screen requirements, or a larger image. This means that they will download an image that is <strong>much larger than required</strong>. A 1920x1080px image (16:9 ratio) can be 33% bigger than the matching 1440x810px image. This means a much slower performance for the user and much higher (unnecessary) bandwidth costs, especially if you have many images on the site.</p><h3>A pragmatic solution</h3><p>In my opinion, <strong>you need 6 or 7 different image versions</strong> for each image. For an image that takes 100vw on your final site, the target widths could be the following:</p><p><strong>1920px</strong> (this covers FullHD screens and up)<br><strong>1600px</strong> (this will cover 1600px desktops and several tablets in portrait mode, for example iPads at 768px width, which will request a 2x image of 1536px and above)<br><strong>1366px</strong> (it is the <a href="http://gs.statcounter.com/screen-resolution-stats#monthly-201705-201705-bar">most widespread desktop resolution</a>)<br><strong>1024px</strong> (1024x768 screens, excluding iPads which are hi-density anyway, are rarer, but I think you need some image size in between, not to leave too big a gap between pixel sizes, in case the market changes)<br><strong>768px</strong> (useful for 2x 375px mobile screens, as well as any device that actually requests something close to 768px)<br><strong>640px</strong> (for smartphones)</p><p>This leaves you <strong>covered for most cases</strong>. If you think that 640px is too high a minimum, keep in mind that most smartphones on the market now have high pixel density, and even though they declare 320px of viewport width, they will support double that at minimum, therefore 640px.</p><p>The above sizes are meant as a <strong>reference for 100vw images</strong>. If an image covers less screen width in your design, you need to <strong>divide the above numbers</strong> by the actual (approximate) width of the image on screen. So, for a 50vw image, you need to halve the above widths. For an image designed to occupy 33vw of the screen, you divide them by three, and so on.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/456/1*9hZu0y3I4HIMC6SIXsrtaA.png" /><figcaption>Some examples of the image sizes you should produce, based on your original size choices</figcaption></figure><p>Of course you can be more granular if you like. If your application/website caters mostly to mobile browser, it won’t hurt if you put more resolutions there in the lower range of sizes.</p><p>I tend to make sure to cover desktops reasonably well, since at big image sizes there are much bigger differences in size between images: the same JPG at 1920x1080px is much bigger than at 1600x900px. Furthermore, the most “vulnerable” type of device is desktops/laptops on a bad connection (imaging someone with a laptop on Wi-Fi or 4G). If you, for example, do not serve an image at 1600px, they might all request a 1920px image and the site will be much slower. Keep in mind, also, that while your site might have 60%+ of mobile users, it will still be checked and tested most of the time with desktops and laptops by most of your clients.</p><p>As usual with all these solutions, your mileage may vary, and you should carry out your own analysis based on your site’s target and visitor statistics (if they are available to you).</p><h3>Support</h3><p>In case you’re wondering, <em>srcset </em>is supported by all major browsers, with the <strong>major exceptions of IE11</strong> <strong>and versions of Edge</strong> below 16 (released on October 2017), check here: <a href="http://caniuse.com/#feat=srcset">http://caniuse.com/#feat=srcset</a>. For the lucky ones who can boast about not having to support IE11/Edge, please keep it to yourselves and do not brag in the comments.</p><h3>Old browsers — polyfill and default image</h3><p>What to do for old browsers which do not support responsive images? The answer is, use a <strong>polyfill</strong> for responsive images, like <a href="https://scottjehl.github.io/picturefill/">picturefill,</a> which will implement the functionality for you via Javascript.</p><p>Otherwise, since you can serve only one image to all browsers that do not support responsive images (in the normal <em>src </em>attribute), you need to decide whether to cater for desktop browsers, by serving a larger image, or mobile browsers, by serving a smaller image. The decision depends on your target audience and your priorities. Usually it’s safe to assume that mobile browsers will support responsive images, so you should put a version for IE11 desktop, say at 1600px of width to stay on the safe side.</p><h3>Conclusions</h3><p>Managing responsive images is <strong>not an exact science</strong>, and unless you have a lot of resources at hand, it can be a time-consuming endeavour. You must <strong>make your own choices</strong> based on your project’s requirements. I hope this article helps you in doing so. If you have something to add or some corrections to suggest, or you totally disagree on every point made above, please let me know in the comments.</p><h3>Applications</h3><p><em>(update from 2018–04–16) </em>I’ve published a Vue.js component plugin that applies the logic above to create responsive image tags for you. Currently, it requires a server that automatically resizes images when a URL with width and height of the image is called. It’s called <a href="https://github.com/HCESrl/vue-responsive-image">Vue Responsive Image</a>. It creates <em>src</em>, <em>srcset</em> attributes, and if required also separate <em>source</em> tags for mobile and tablet portrait.</p><h3>Some useful references</h3><ul><li>About <a href="https://deviceatlas.com/blog/most-used-smartphone-screen-resolutions-in-2016"><strong>screen resolutions</strong> and their <strong>market share</strong></a><strong>.</strong></li><li>Another site with <a href="http://gs.statcounter.com/screen-resolution-stats#monthly-201705-201705-bar"><strong>useful stats</strong></a><strong>.</strong></li><li><a href="http://ericportis.com/posts/2014/srcset-sizes/">This article</a> explains the <strong>basics of <em>srcset</em></strong>: it is fairly old, but it’s still very good.</li><li>The <a href="https://scottjehl.github.io/picturefill/"><strong>Picturefill</strong></a> polyfill.</li><li>If you want to explore these issues more in depth, here’s a <a href="https://cloudfour.com/thinks/responsive-images-101-part-9-image-breakpoints/"><strong>brilliant article</strong></a> by <a href="https://cloudfour.com/is/jason-grigsby/">Jason Grigsby</a>. My article approaches things from a slightly different angle, his article discusses more or less everything else you need to know about the topic.</li></ul><h3>Questions? Feedback?</h3><p>If you have questions, or would like to let me know your thoughts on this article, feel free to do so in the comments. If you liked this article, go ahead and clap (there’s a clap button underneath the article in case you’re not familiar with Medium), and feel free to share it.</p><h3>Need help with your project?</h3><p>At HCE.IT we provide consultancy and development services. We can help you improve the front-end performance of your site, while saving lots of resources at the server level. <a href="https://www.hce.it/en/performance-optimization">Click here to read more and get in touch</a>!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a0433450a4a3" width="1" height="1" alt=""><hr><p><a href="https://medium.com/hceverything/applying-srcset-choosing-the-right-sizes-for-responsive-images-at-different-breakpoints-a0433450a4a3">Applying srcset: choosing the right sizes for responsive images at different breakpoints</a> was originally published in <a href="https://medium.com/hceverything">HCEverything</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>