<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Sashe Vuchkov on Medium]]></title>
        <description><![CDATA[Stories by Sashe Vuchkov on Medium]]></description>
        <link>https://medium.com/@sashevuchkov?source=rss-218e437d7519------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*L8JOT9NORmPgS_TFrh88LA.png</url>
            <title>Stories by Sashe Vuchkov on Medium</title>
            <link>https://medium.com/@sashevuchkov?source=rss-218e437d7519------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 05 Dec 2026 09:29:28 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@sashevuchkov/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[A Handy Way of Building Reusable React Components (Inspired by Hemingway)]]></title>
            <link>https://medium.com/@sashevuchkov/a-handy-way-of-building-reusable-react-components-inspired-by-hemingway-8d8143cdff08?source=rss-218e437d7519------2</link>
            <guid isPermaLink="false">https://medium.com/p/8d8143cdff08</guid>
            <category><![CDATA[front-end-development]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[reactjs]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Sashe Vuchkov]]></dc:creator>
            <pubDate>Sun, 29 Jan 2023 13:18:10 GMT</pubDate>
            <atom:updated>2023-01-29T13:18:10.486Z</atom:updated>
            <content:encoded><![CDATA[<p>What can we learn about coding and creating great software from some of the best novelists</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zcdq8ZMmz2vRhc_XHLnpGg.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/@glenncarstenspeters?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Glenn Carstens-Peters</a> on <a href="https://unsplash.com/photos/1F4MukO0UNg?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption></figure><p>Should we think about the reusability of our code all the time?</p><p>Some advise us to think about it only after we face the need for it. That means if we’re creating a brand new component and don’t know whether it will be used somewhere else, then we shouldn’t try to make it reusable because that complicates our life (think “analysis-paralysis” and “premature optimization”).</p><p><strong>After all — we can’t know the future, you know?</strong></p><p>Well, I disagree with that!</p><p>I believe we should plan our work and set up the scene correctly so we can later improve it more easily. In real life, nobody likes to touch stuff that “works well as is,” especially when there is a deadline and a bad legacy “smell.”</p><p>So the tendency is to write “new and better stuff”…</p><p>Like it’s supposed to be better just because it’s newly created. But the harsh reality is that most of us are far from perfection, and what’s good enough today will invariably become a “legacy” that needs to be improved by refactoring or replacing.</p><p>In Object Oriented Programming, the SOLID principles guide programmers and developers on how to plan (or refactor) their software for better design.</p><p>Although we’ll talk about functional React components, a big chunk of the “philosophy” behind SOLID is also applicable in our case, so I strongly encourage you to investigate this topic further.</p><p>The main takeaway is that we can and should plan to create understandable, testable, maintainable, and reusable code.</p><p>It never happens by chance…</p><p>In a minute, we’ll slice and dice one hardly reusable chunk of code into elegant React components, but before that, I will share with you my strategy for producing better results that I learned from a famous novelist.</p><h3>What Can We Learn About Coding From Hemingway?</h3><p>I’m totally convinced that making software is creative writing on a higher plane. So we can learn a lot about the process of “writing” from the great novelists of the past.</p><p>Hemingway once said to an aspiring writer:</p><blockquote>“The first draft of anything is rubbish.”</blockquote><p>It’s true in coding, too. Whenever I try to come up with the perfect component or function, that slows me down and makes me anxious.</p><p>That’s why I always start with a “first draft.”</p><p>I make the app to show me the component.</p><p>It should look as designed. And it should behave as planned. I don’t think about quality, reusability, or testability in this phase. I write what comes first to my mind.</p><p>When it’s on my screen, I switch to my editor again and start pondering how to make it better…</p><p>Let’s take this for example:</p><pre>import React, { useEffect, useState } from &#39;react&#39;;<br><br><br>export default function FeaturedPostsSection() {<br>    const [posts, setPosts] = useState([]);<br><br>    useEffect( () =&gt; {<br>        fetch(&quot;https://buhalbu.com/api/blog/featured&quot;)<br>            .then(response =&gt; response.json())<br>            .then(featuredPosts =&gt; setPosts(posts))<br>            .catch(error =&gt; console.log(error.message));<br>    }, []);<br><br>    return (<br>        &lt;section className=&quot;blog-featured-posts&quot;&gt;<br>            &lt;div className=&quot;container&quot;&gt;<br>                {posts.map(({slug, featuredMedia, category, path, title, author}) =&gt;<br>                    &lt;div key={slug} className=&quot;snippet&quot;&gt;<br>                        {featuredMedia &amp;&amp;  &lt;div className=&quot;snippet-img&quot;&gt;<br>                          &lt;img<br>                            src={featuredMedia.url}<br>                            alt={title}<br>                            width={428}<br>                            height={285}<br>                        /&gt;&lt;/div&gt;}<br>                        &lt;div className=&quot;snippet-img-overlay&quot;&gt;<br>                            &lt;a className=&quot;badge&quot;&gt;{category.name}&lt;/a&gt;<br><br>                            &lt;a href={path}&gt;<br>                                &lt;h5 className=&quot;snippet-title&quot;&gt;<br>                                    {title}<br>                                &lt;/h5&gt;<br>                            &lt;/a&gt;<br>                            &lt;p className=&quot;snippet-text&quot;&gt;{author.name}&lt;/p&gt;<br>                        &lt;/div&gt;<br>                    &lt;/div&gt;<br>                )}<br>            &lt;/div&gt;<br>        &lt;/section&gt;<br>    )<br>}</pre><p>The purpose of this component is to show a set of featured blog posts on top of the main archive page. It’s not so reusable because it doesn’t accept any props meaning that you can’t customize it dynamically. Also, it’s tightly coupled to my API and data structure.</p><p>If I don’t need precisely the same featured post snippets somewhere else, then I can’t reuse the section.</p><p>But no worry — it’s just a shitty first draft.</p><p>How can we make it better?</p><p>After analyzing it briefly, I can see eight stand-alone React components.</p><p>Let’s start with the easiest ones:</p><pre>import React from &#39;react&#39;;<br><br>//First Step<br>const SnippetText = ({children}) =&gt; {<br>   return &lt;p className=&quot;snippet-text&quot;&gt;{children}&lt;/p&gt;;<br>}<br><br>//Second Step<br>const SnippetText = (props) =&gt; {<br>    return (&lt;p<br>            {...props}<br>            className={`snippet-text ${props.className}`}<br>        &gt;<br>            {props.children}<br>        &lt;/p&gt;);<br><br>};<br><br>//Third Step<br>const SnippetText = React.forwardRef(<br>    (props, ref) =&gt; {<br>        return (&lt;p<br>            ref={ref}<br>            {...props}<br>            className={`snippet-text ${props.className}`}<br>        &gt;<br>            {props.children}<br>        &lt;/p&gt;);<br><br>    }<br>);<br><br>SnippetText.displayName = &#39;SnippetText&#39;;<br><br>export default SnippetText;</pre><pre>import React from &#39;react&#39;;<br><br>//First Step<br>export const Badge = ({children, href}) =&gt; {<br>    return &lt;a href={href} className=&quot;badge&quot;&gt;{children}&lt;/p&gt;;<br>}<br><br>//Second Step<br>export const Badge = (props) =&gt; { <br>    return (&lt;a <br>             {...props}<br>             className={`badge ${props.className}`} <br>            &gt;<br>            {props.children}<br>           &lt;/a&gt;); <br><br>};<br><br>// Third Step<br>export const Badge = React.forwardRef( <br>    (props, ref) =&gt; {<br>        return (&lt;a <br>                 ref={ref}<br>                 {...props}<br>                 className={`badge ${props.className}`} <br>                &gt;<br>                {props.children}<br>               &lt;/a&gt;); <br>    <br>    }<br>);<br><br><br><br>Badge.displayName = &#39;Badge&#39;;  <br><br>export default Badge;</pre><p>The components above are just styled HTML elements. By extracting them, we save ourselves from the effort of typing more code than needed. They are not a big win but illustrate the process well.</p><p>In step 1, we copy-paste the markup into its functional component;</p><p>In step 2, we adapt the component to accept all kinds of props that an HTML paragraph or anchor can take;</p><p>In step 3, we forward a reference (if any);</p><p>Let’s see more:</p><pre>import React from &#39;react&#39;;<br><br>export const SnippetTitle = React.forwardRef(<br>(props, ref) =&gt; { <br>    const Title = props.as || &#39;h5&#39;;<br><br>    return (<br>        &lt;a <br>           ref={ref}<br>           {...props}<br>           className={`snippet-title ${props.className}`}  <br>       &gt; <br>            &lt;Title&gt;{props.children}&lt;/Title&gt; <br>        &lt;/a&gt;<br>    );<br>});<br><br>SnippetTitle.displayName = &#39;SnippetTitle&#39;;<br><br>export default SnippetTitle;</pre><p>This is also a simple one — it’s the clickable post title that leads to the full text. As you might notice, I’ve made it slightly more reusable by adding the “as” property. That way, the title is not always H5, and it no longer has to be a heading at all.</p><p>And what about this one:</p><pre>import React from &#39;react&#39;;<br><br>export const SnippetImgOverlay = React.forwardRef(<br>(props, ref) =&gt; {  <br>    return (&lt;div <br>             ref={ref}<br>             {...props}<br>             className={`snippet-img-overlay ${props.className}`}   <br>            &gt;<br>            {props.children}<br>           &lt;/div&gt;);  <br><br>});<br><br>SnippetImgOverlay.displayName = &#39;SnippetImgOverlay&#39;;<br><br>export default SnippetImgOverlay;</pre><p>Here we extracted the container that holds the badge, the title, and the author’s name. Now we can create an alternative element that doesn’t make an overlay but places the three inner components below the image.</p><pre>import React from &#39;react&#39;;<br><br>export const SnippetBody = React.forwardRef( <br>(props, ref) =&gt; {  <br>    return (&lt;div <br>             ref={ref}<br>             {...props}<br>             className={`snippet-body ${props.className}`}   <br>            &gt;<br>            {props.children}<br>           &lt;/div&gt;);  <br><br>});<br><br>SnippetBody.displayName = &#39;SnippetBody&#39;;<br><br>export default SnippetBody;</pre><p>Nice. Now let’s extract the featured images into their own component:</p><pre>import React from &#39;react&#39;;<br>  <br>const SnippetImage = React.forwardRef(<br>(props, ref) =&gt; {  <br>    const {src, alt, width, height, className} = props;<br><br>    return (<br>        &lt;div <br>            ref={ref}<br>            {...props}<br>            className={`snippet-img ${className}`}&gt;  <br>            &lt;img  <br>                src={src} <br>                alt={alt} <br>                width={width} <br>                height={height} <br>             /&gt;<br>        &lt;/div&gt;<br>    );<br>});<br><br>SnippetImage.displayName = &#39;SnippetImage&#39;;<br><br>export default SnippetImage;</pre><p>Ok, let’s stop for a moment and put into use the new React goodies we’ve created.</p><p>What would the first code snippet look like?</p><pre>import React, { useEffect, useState } from &#39;react&#39;;<br><br>export default function FeaturedPostsSection() {<br>    const [posts, setPosts] = useState([]);<br>    <br>    useEffect( () =&gt; {<br>        fetch(&quot;https://buhalbu.com/api/blog/featured&quot;)<br>            .then(response =&gt; response.json())<br>            .then(featuredPosts =&gt; setPosts(posts))<br>            .catch(error =&gt; console.log(error.message));<br>    }, []);<br><br>    return (<br>        &lt;section className=&quot;blog-featured-posts&quot;&gt;<br>            &lt;div className=&quot;container&quot;&gt;<br>                {posts.map(({slug, featuredMedia, category, path, title, author}) =&gt;<br>                        &lt;div key={slug} className=&quot;snippet&quot;&gt; <br>                            {featuredMedia &amp;&amp;  &lt;SnippetImage <br>                                src={featuredMedia.url}<br>                                alt={title}<br>                                width={428}<br>                                height={285}<br>                            /&gt;} <br>                            &lt;SnippetImgOverlay&gt; <br>                                &lt;Badge&gt;{category.name}&lt;/Badge&gt; <br>                                &lt;SnippetTitle href={path}&gt;{title}&lt;/SnippetTitle&gt;<br><br>                                &lt;SnippetText&gt;{author.name}&lt;/SnippetText&gt; <br>                            &lt;/SnippetImgOverlay&gt; <br>                        &lt;/div&gt;<br>                )}<br>            &lt;/div&gt;<br>        &lt;/section&gt;<br>    )<br>}</pre><p>It looks a lot better, doesn’t it?</p><p>But we can extract at least two more components: One named Snippet that will wrap all the other snippet parts and one called “Section” that will hold a set of snippets.</p><p>Let’s do it:</p><pre>import React from &#39;react&#39;;<br><br>export const Snippet = React.forwardRef((props, ref) =&gt; {<br>    return &lt;div ref={ref} {...props} className=&quot;snippet&quot;&gt;{children}&lt;/div&gt;;<br>});<br><br>Snippet.displayName = &#39;Snippet&#39;;<br><br>export default Snippet;</pre><pre>import React from &#39;react&#39;;<br><br>export const Section = React.forwardRef((props, ref) =&gt; {<br>    return (<br>        &lt;section ref={ref} {...props} &gt;<br>            &lt;div&gt;<br>              {props.children}<br>            &lt;/div&gt;<br>        &lt;/section&gt;<br>    );<br>});<br><br>Section.displayName = &#39;Section&#39;;<br><br>export default Section;</pre><p>But why I’m creating this section component when I have FeaturedPostsSection?</p><p>Well, I want to decouple the presentation logic from the business logic. You may already know that there are three general types of components: Container, Presentation, and Higher-Order Components.</p><p>In our case, I’m extracting the JSX markup into its own functional component so it can be reused elsewhere.</p><p>For example, suppose I don’t want to feature on my homepage blog posts but on website pages. In that case, I can create a new container component named “FeaturedPagesSection” and put all the other stuff we made without substantial changes.</p><p>Let’s see the final result of our work:</p><pre>import React, { useEffect, useState } from &#39;react&#39;;<br><br><br>export default function FeaturedPostsSection() {<br>    const [posts, setPosts] = useState([]);<br>    <br>    useEffect( () =&gt; {<br>        fetch(&quot;https://buhalbu.com/api/blog/featured&quot;)<br>            .then(response =&gt; response.json())<br>            .then(featuredPosts =&gt; setPosts(featuredPosts))<br>            .catch(error =&gt; console.log(error.message));<br>    }, []);<br><br><br><br>    return (<br>        &lt;Section className=&quot;blog-featured-posts&quot;&gt;  <br>                {posts.map(({slug, featuredMedia, category, path, title, author}) =&gt;<br>                        &lt;Snippet key={slug}&gt; <br>                            {featuredMedia &amp;&amp;  &lt;SnippetImage <br>                                src={featuredMedia.url}<br>                                alt={title}<br>                                width={428}<br>                                height={285}<br>                            /&gt;} <br>                            &lt;SnippetImgOverlay&gt; <br>                                &lt;Badge&gt;{category.name}&lt;/Badge&gt; <br>                                &lt;SnippetTitle href={path}&gt;{title}&lt;/SnippetTitle&gt;<br><br>                                &lt;SnippetText&gt;{author.name}&lt;/SnippetText&gt; <br>                            &lt;/SnippetImgOverlay&gt; <br>                        &lt;/Snippet&gt; <br>                )}<br><br>        &lt;/Section&gt; <br>    )<br>}</pre><p>Well, that looks fine for now. It’s better than the initial code snippet. Maybe, in the feature, we’ll need to improve it, but I consider it “good enough.”</p><h3>Brief Overview of The Applied Principles</h3><p>So it took us 20 or 30 minutes more to transform a bad first draft into something that will make our life easier in the future.</p><p>Why?</p><p>Because we have got a couple of ready-for-reuse components, meaning we will write less code to achieve similar results. And all of them allow easier further improvements.</p><p>We put into use three general principles:</p><ul><li>Separation of Concerns — We split the big component into several others of three types: Container, Presentation, and Higher-Order Components.</li><li>From Specific to Abstract — We climbed one or two steps up on the ladder of Abstraction, meaning we took some ultra-specific components (PostSnippetTitle, FeaturedPostsSection) and made them more abstract (SnippetTitle, Section), that way we can use them with different content entities (Posts, Pages, Products, Services)</li><li>Flatten Props — We chose to pass data through stand-alone properties and not as plain objects, that way, you know at first glance what data the component needs, and it’s more convenient.</li></ul><p>I hope you liked this tutorial. Please don’t hesitate to ask in the comment section below if you have any questions.</p><pre>Want to Connect?<br><br>If you enjoyed this article, there is some chance to enjoy the other free stuff<br>I write or create for <a href="https://medium.com/buhalbu.com">my newsletter about the full-stack story of JavaScript</a>, too.<br><br>Check it out :)</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8d8143cdff08" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What If “Burning Out” Is Our Soul Crying For Adventure?]]></title>
            <link>https://medium.com/@sashevuchkov/what-if-burning-out-is-our-soul-crying-for-adventure-f26028e4f25d?source=rss-218e437d7519------2</link>
            <guid isPermaLink="false">https://medium.com/p/f26028e4f25d</guid>
            <category><![CDATA[burnout]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Sashe Vuchkov]]></dc:creator>
            <pubDate>Thu, 29 Dec 2022 00:18:56 GMT</pubDate>
            <atom:updated>2022-12-30T19:01:30.507Z</atom:updated>
            <content:encoded><![CDATA[<p>Dear JavaScript Aficionado,</p><p>Do you feel bored sometimes when you follow your daily routine?</p><p>Work — Party — Sleep… Work -Party — Sleep…</p><p>That’s one hell of a cycle!</p><p>And if you’re a family guy or hard-core introvert, then probably the middle of this cycle is missing.</p><h4>So it becomes even more monotonous…</h4><p>There is no surprise that so many of us fall victim to this nasty condition, “burnout.” And it’s no joke… I’m “lucky” to experience its gray nuances and depressing feelings somewhat more frequently than average, so I know it’s no joke.</p><p>In the past, it made me do things I still regret, like quitting a fantastic job or leaving behind a profession just before it starts paying off big.</p><p>So I had to find a way to counter this condition. And counter it before the slightest sign of its symptoms.</p><h4>And I found many!</h4><p>I found a plethora of ways to keep myself on track. They help me finish big projects, persist in my long-term goals, and live a hundred times more exciting life than before.</p><p>We’re not talking about extreme sports, screwing around, or substance abuse, though (in my opinion, constantly drinking beer or whisky is not a productive way to save yourself from burnout).</p><p>Anyway…</p><p>I mention one of my latest “remedies” in my newsletter article “Roadmap to Success: 3 lessons I learned from 61 of the most influential JavaScript developers”. Almost all 61 developers practice it (83.6% of the researched ones). And even the thought of it can shake your whole body.</p><p>Imagine how intense it can be when it happens for real.</p><h4>And that’s not the only benefit…</h4><p>It offers traveling to exotic destinations (sometimes for free), meeting lots of interesting, smart, sexy people, and true challenges that the crowd may talk about for years.</p><p>What’s best — all this involves web development.</p><p>I have yet to experience this kind of adventure on a big scale. It’s not something you can do when you decide to do it. You need to prepare yourself. You need time and many additional skills. But that’s precisely why it is so exciting.</p><h4>It’s part of the game…</h4><p>If you’re curious about that adventure, click the link below and sign up for my newsletter. You will receive a sample issue for free and discover this exciting stuff mentioned in Lesson 2.</p><p><a href="https://bhbu.link/9851c7c">Roadmap to Success: 3 lessons I learned from 61 of the most influential JavaScript developers - Posts - Stream - BuhalBu.com</a></p><p>Be Happy,<br>Sashe</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f26028e4f25d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Should You Focus on JavaScript or WordPress?]]></title>
            <link>https://medium.com/@sashevuchkov/should-you-focus-on-javascript-or-wordpress-b6ce25506403?source=rss-218e437d7519------2</link>
            <guid isPermaLink="false">https://medium.com/p/b6ce25506403</guid>
            <category><![CDATA[wordpress-web-development]]></category>
            <category><![CDATA[javascript-development]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[wordpress]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Sashe Vuchkov]]></dc:creator>
            <pubDate>Sun, 23 Oct 2022 18:14:13 GMT</pubDate>
            <atom:updated>2022-10-23T18:14:13.134Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7-vI1eDD02ZnZA3kfJSg-g.jpeg" /></figure><p>It depends on your preference…</p><p>I have been focusing on JavaScript for the past 2 years, and I’m totally satisfied with my decision to switch from PHP/WordPress to JavaScript/React.Js/Next.Js.</p><p><strong>Don’t get me wrong!</strong></p><p>I really love PHP and WordPress… I built many awesome projects with these technologies. Still, before I switched, I was constantly worrying about PHP losing ground as a preferred backend choice. This programming language is strongly specialized for server-side scripting.</p><p>And it constantly gets improved…</p><p>The thing is, many other languages like (Node.js/Python/Golang) have entered the competition in that area and are stealing market share. If you check PHP in Google Trends, you will notice it’s losing popularity.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*9yUr4Q_AmYxB2kVW" /></figure><p>On the other hand, some people say WordPress powers nearly 40% of all websites. So there are many opportunities here: from making and optimizing websites to distributing themes and plugins.</p><p>You will never be hungry if you become a decent WordPress developer.</p><p>Moreover, as more and more people hop on the JavaScript and Python “bandwagons,” there will be increased demand for PHP developers, and the salaries will start growing.</p><p>But bear in mind that not many cool projects use those technologies. You will handle a lot of legacy code, and the “wp style” of coding is uber quirky. It still needs to catch up with the PHP Standard Recommendations (PSR), any proper OOP concepts, etc.</p><p>So if you want to write modern, clean code for a rising startup… using a programming language on the crest of the wave…</p><p>Then WordPress shouldn’t be your primary focus.</p><p>You should focus on JavaScript…</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b6ce25506403" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Next.Js Security: Ooh, You Aren’t Supposed To Access That]]></title>
            <link>https://medium.com/@sashevuchkov/next-js-security-ooh-you-arent-supposed-to-access-that-a8e6eb24f58e?source=rss-218e437d7519------2</link>
            <guid isPermaLink="false">https://medium.com/p/a8e6eb24f58e</guid>
            <category><![CDATA[nextjs]]></category>
            <category><![CDATA[typescript]]></category>
            <category><![CDATA[reactjs]]></category>
            <category><![CDATA[security]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Sashe Vuchkov]]></dc:creator>
            <pubDate>Fri, 14 Oct 2022 05:38:24 GMT</pubDate>
            <atom:updated>2022-10-14T05:38:24.715Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*6NU_OVEwhf9o-yEQ.jpg" /></figure><p>Dear Next.js Afficionado,</p><p>Are you aware that there are bad people who make money by getting access to expensive stuff like online courses, software, etc., and later reselling them for peanuts?</p><p><strong>What shm**ks, right?</strong></p><p>So if you have valuable files that you want to give away to subscribers or customers only, then you need to protect those files.</p><p>For example, let’s say your employer creates a detailed guide that helps the customers solve a specific problem. They want to put this guide on the website and collect emails in exchange for it.</p><p><strong>So how do you stop the bad actors from getting its URL and putting it on social media, blogs, forums, and other public online places?</strong></p><p>That’s the topic of my newsletter this week…</p><p>I wrote for a similar use case where I needed to restrict access to <a href="https://buhalbu.com/nextjs/templates/nextjs-portfolio-template">a free template</a>.</p><p>So if you are interested, <a href="https://buhalbu.com/nextjs/issues/nextjs-download-file">click here and discover</a> the following:</p><ul><li>Three feasible ways to protect a file</li><li>How to choose the proper protection</li><li>Lots of code snippets</li><li>Why you should never put valuable files in Next.Js’ public folder</li><li>What’s a “signed URL,” and when it’s useful</li></ul><p>This newsletter issue almost hits the 1000-word mark, so if you’re not in the mood for heavy reading… don’t have time… or opened this email on your smartphone, then you can bookmark it for later.</p><p>It’s not super urgent. Just the <a href="https://buhalbu.com/nextjs/issues/nextjs-download-file">typical stuff</a> every geek likes to read about.</p><p>Be happy,<br>Sashe Vuchkov</p><p><em>Originally published at </em><a href="https://buhalbu.com/nextjs/articles/next-js-security-ooh-you-arent-supposed-to-access-that"><em>https://buhalbu.com</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a8e6eb24f58e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Super Easy & Profitable “Pro Hack” For Amazing Websites With NextJs — Stream — BuhalBu.com]]></title>
            <link>https://medium.com/@sashevuchkov/super-easy-profitable-pro-hack-for-amazing-websites-with-nextjs-stream-buhalbu-com-ddb30ee3202a?source=rss-218e437d7519------2</link>
            <guid isPermaLink="false">https://medium.com/p/ddb30ee3202a</guid>
            <category><![CDATA[nextjs]]></category>
            <category><![CDATA[web-design]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[website]]></category>
            <dc:creator><![CDATA[Sashe Vuchkov]]></dc:creator>
            <pubDate>Thu, 21 Jul 2022 22:00:14 GMT</pubDate>
            <atom:updated>2022-07-21T22:04:08.421Z</atom:updated>
            <content:encoded><![CDATA[<h3>Super Easy &amp; Profitable “Pro Hack” For Amazing Websites With NextJs</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*-TH4Ncma0oy_9mIv.png" /></figure><p>Dear Next.Js Aficionado,</p><p>So you wanna build a beautiful website, right?</p><p>A website that shows your high level of web development skills and one that helps you get the best job offers or freelance gigs, or that attracts users for your cool app.</p><p>Nice, we all want that!</p><p>But often we don’t get it because we make a common big mistake.</p><p>It’s so widespread that even sessional professionals fall victim to it. No matter their high achievements or their years of experience. Once they go for their own website, many times they create something ultra-functional. Something well-coded.</p><p>But something with…</p><h3>ZERO marketing or design value…</h3><p>It’s just plain ugly.</p><p>No offense, but we — all web developers, must learn that we’re not some extraordinary guys who can handle every possible challenge in the world.</p><p>We’re not superhumans!</p><p>Anyway.</p><p>The point is — we’re not web designers. We’re not UX experts either.</p><p>So we shall not try to be one!</p><p>The “super easy and profitable pro hack” is to start working with web designers or at least — use professional templates. You will see a drastic improvement in your ability to put online fast whatever projects you want that make you look BIG POTATO in the industry.</p><p>It’s not criminal to be a small potato, though…</p><p>But why be one when you have all the opportunities you need to look larger than life?</p><h3>And the best part?</h3><p>You can get wonderful free HTML templates right now! The internet is full of them.</p><p>Just pick something beautiful and turn it into a piece of Next.Js (React.Js) art.</p><p>Cheers,</p><p>Sashe Vuchkov</p><p>PS. I offer <a href="https://buhalbu.com/stream/next-js-free-blog-template">a free template</a>, too. It’s nothing fancy, but I put in it all of my marketing knowledge. The knowledge that inundates me with job and partnership offers to this day.</p><p>If you’re curious about how I structure my own portfolio websites for maximum success, you can download it on Gumroad in exchange for your email.</p><p><em>Originally published at </em><a href="https://buhalbu.com/stream/super-easy-profitable-pro-hack-for-amazing-websites-with-nextjs"><em>https://buhalbu.com</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ddb30ee3202a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Next.Js Adventures: How a Couple Of Embedded YouTube Videos Screwed My Performance Scores]]></title>
            <link>https://medium.com/@sashevuchkov/next-js-adventures-how-a-couple-of-embedded-youtube-videos-screwed-my-performance-scores-96f8498ec8e3?source=rss-218e437d7519------2</link>
            <guid isPermaLink="false">https://medium.com/p/96f8498ec8e3</guid>
            <category><![CDATA[web-performance]]></category>
            <category><![CDATA[nextjs]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[seo]]></category>
            <dc:creator><![CDATA[Sashe Vuchkov]]></dc:creator>
            <pubDate>Thu, 14 Jul 2022 18:55:00 GMT</pubDate>
            <atom:updated>2022-07-14T18:55:00.889Z</atom:updated>
            <content:encoded><![CDATA[<p>Dear Next.Js Aficionado,</p><p>Recently I’ve been working hard to prepare my humble startup for a ProductHunt launch.</p><p>So the other day, I decided that the homepage needs a couple of videos that show the app in action. I don’t have a budget for fancy stuff, so I made three screencasts, synced them with cool music, and uploaded them on YouTube.</p><p>Later, I embedded the videos on the page.</p><p>Obviously, some old lessons I had learned years ago were forgotten.</p><p>The next day I was preparing another screencast when I was surprised by this “nice view”:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*4U7iXwouhWwqa6MO.jpg" /></figure><p>I was stunned…</p><p>It was not how I left the page. The last time I checked, everything besides PWA was colored in green.</p><p>So I started debugging, and right away, I noticed the cause for those bad scores was the embedded YouTube videos.</p><h3>What an embarrassment!</h3><p>I was claiming I knew something about Technical SEO and how to achieve better website performance, and I failed to foresee the awful impact those videos would have on my webpage.</p><p>Anyway…</p><p>After some research (a.k.a googling) and some creative pondering, I’ve come up with the following react component:</p><pre>import {useRef} from &#39;react&#39;;</pre><pre>export type Props = {<br>    video: string;<br>    width: string,<br>    height: string,<br>    thumbnailQuality: &#39;default&#39; | &#39;hqdefault&#39; | &#39;mqdefault&#39; | &#39;sddefault&#39;<br>}</pre><pre>export default function YouTubeFrame({video, width, height, thumbnailQuality}: Props) {<br>    const divRef = useRef&lt;HTMLDivElement|null&gt;(null);</pre><pre>    const onClick = () =&gt; {<br>        const iframe = document.createElement( &quot;iframe&quot; );<br>        iframe.setAttribute( &quot;frameborder&quot;, &quot;0&quot; );<br>        iframe.setAttribute( &quot;allowfullscreen&quot;, &quot;1&quot;);<br>        iframe.setAttribute(&#39;allow&#39;, &#39;accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture&#39;);<br>        iframe.style.width = width;<br>        iframe.style.height = height;<br>        iframe.setAttribute( &quot;src&quot;, `https://www.youtube.com/embed/${video}?rel=0&amp;showinfo=1&amp;autoplay=1` );<br>        if (divRef.current) {<br>            divRef.current.innerHTML = &quot;&quot;;<br>            divRef.current.appendChild(iframe);<br>        }<br>    }<br></pre><pre>    return (<br>        &lt;div ref={divRef} className=&quot;youtube-frame position-relative&quot;&gt;<br>            &lt;span onClick={onClick} className=&quot;ti-control-play position-absolute display-1 text-white&quot; /&gt;<br>            &lt;img onClick={onClick} loading=&quot;lazy&quot; src={`https://img.youtube.com/vi/${video}/${thumbnailQuality}.jpg`} alt=&quot;YouTube Video Thumbnail&quot; width={width} height={height} className=&quot;shadow&quot; /&gt;<br>        &lt;/div&gt;<br>    );<br>}</pre><p>As you can see, the component accepts the video slug, the preferred thumbnail size, and the desired dimensions as parameters. Instead of embedding the video right away, I’m putting a placeholder (its thumbnail), so the video’s iframe is appended only after a click on that placeholder.</p><p>It’s nothing genius, but it did restore the balance in the universe…</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*3GhLsEGQ8QwwClCE.jpg" /></figure><p>This case study is evidence that Next.Js is an “SEO-friendly” framework but not “SEO-ready.”</p><p>We, as web developers, have plenty of room to screw things, so we must be careful. We must measure the performance of our website every time we’re about to make substantial changes. And we must measure it after the changes.</p><p>This additional monitoring is the only way to know the real impact of our work.</p><p>Cheers,<br>Sashe Vuchkov</p><p>P.S. If you want to view the screencasts I made, just visit <a href="https://buhalbu.com/">BuhalBu’s homepage</a>…</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=96f8498ec8e3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Next.js Adventures: Some Blasphemy Against The Holy Image Component]]></title>
            <link>https://medium.com/@sashevuchkov/next-js-adventures-some-blasphemy-against-the-holy-image-component-aabc14f90a95?source=rss-218e437d7519------2</link>
            <guid isPermaLink="false">https://medium.com/p/aabc14f90a95</guid>
            <category><![CDATA[rant]]></category>
            <category><![CDATA[nextjs]]></category>
            <dc:creator><![CDATA[Sashe Vuchkov]]></dc:creator>
            <pubDate>Sun, 10 Jul 2022 01:41:44 GMT</pubDate>
            <atom:updated>2022-07-10T01:41:44.085Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*eSyEv-72rMOcfYhZ.jpg" /></figure><p>Dear Next.Js Aficionado,</p><p>I don’t want to spoil the party, you know…</p><p>So if you believe that the component is the finest solution for handling images ever invented, then I suggest you stop reading and go find other exciting stuff.</p><p>I’m about to tell a “horror story” involving the component, and I don’t want to destroy the happy bubble you’re living in.</p><p>####</p><h3>You’re still here?</h3><p>Good.</p><p>I’m glad you’ve chosen to be informed…</p><p>In the end, everything in this world has its pros and cons. The image component isn’t an exception to the rule. And there’s nothing wrong with pausing for a moment and talking about the possible pitfalls.</p><p>First, it’s important to mention that <a href="https://buhalbu.com/">my website</a> isn’t deployed with <a href="https://vercel.com/">Vercel</a>.</p><p>So all the cool stuff that comes automatically with their service isn’t available to me — the special image loader, the edge network optimization, etc.</p><h3>Those are out of reach…</h3><p>My website’s containerized and deployed with<a href="https://cloud.google.com/run"> Google’s Cloud Run</a>.</p><p>If you’re not familiar with the service, it’s “a managed compute platform that enables you to run containers that are invocable via requests or events.” Cloud Run is serverless, but it’s a kind of middle ground.</p><p>It’s not a cloud function nor — a virtual machine.</p><p>My favorite feature is the automatic scaling. That means my new site runs on a single instance most of the time. It’s super cost-effective.</p><p>But when a traffic spike happens, Cloud Run automatically creates new instances up to the maximum number I’ve set.</p><h3>And here comes the kick…</h3><p>If <a href="https://nextjs.org/">Next.Js</a> uses the default image loader, which creates a local cache of the optimized copies, then the new instances don’t have access to that cache and need to optimize every image by themself.</p><p>So you have traffic ups and downs… Cloud Run constantly starts and kills new app instances… and each new app instance optimizes every image anew.</p><p>Yeah, pretty bad setup…</p><p>We need a custom loader in that scenario.</p><p>And when we use a custom loader, we need to apply the optimizations ourselves because 60% of the fantastic image handling features are unavailable.</p><p>However, don’t take this short article personally.</p><p>I’m not saying that the component isn’t handy. After all, many smarter than me people talk about it very favorably, like the authors of the article “ <a href="https://web.dev/image-component/">Building an Effective Image Component.</a> “</p><p>But we need to be careful…</p><p>Cheers,<br>Sashe Vuchkov</p><p><em>Originally published at </em><a href="https://buhalbu.com/stream/next-js-adventures-some-blasphemy-against-the-holy-image-component"><em>https://buhalbu.com</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=aabc14f90a95" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[NextJs SEO Checklist: The Ultimate Roadmap To A Fast, SEO-ready Website]]></title>
            <link>https://medium.com/@sashevuchkov/nextjs-seo-checklist-the-ultimate-roadmap-to-a-fast-seo-ready-website-b6623aec925?source=rss-218e437d7519------2</link>
            <guid isPermaLink="false">https://medium.com/p/b6623aec925</guid>
            <category><![CDATA[nextjs-with-seo]]></category>
            <category><![CDATA[nextjs]]></category>
            <category><![CDATA[nextjs-seo]]></category>
            <category><![CDATA[nextjs-tutorial]]></category>
            <dc:creator><![CDATA[Sashe Vuchkov]]></dc:creator>
            <pubDate>Mon, 13 Jun 2022 23:57:37 GMT</pubDate>
            <atom:updated>2022-06-13T23:57:37.994Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*_8p2qp0qHJ_OE1NF.jpg" /></figure><p>Dear NextJs Aficionado,</p><p>So you want to build a fast and well-optimized website that makes you feel proud, and that shows to the world your high level of NextJs development skills?</p><p><strong>Well, you are at the right place!</strong></p><p>Optimizing your nextjs project for higher performance, better user experience, and high conversion rates can be challenging. It won’t be easy and will demand hard work from you, but the result is worth it.</p><p>Why?</p><p>Because in the end, you will be able to put on the web something better than 95% of everything else. Something that loads fast, looks sleek and attracts free traffic from search engines like a magnet.</p><p>It will be based on the most trendy web technologies… And it will demonstrate your superb skills in creating web assets capable of generating profits easier.</p><p>That’s the fundament of every successful online business…</p><p>Who wouldn’t get impressed by such things?</p><p>If there is anybody like that, obviously they don’t understand anything about the modern web, and we shouldn’t care about their opinion.</p><p>So are you ready to start optimizing?</p><h3>General SEO: The Fundaments of Well-Optimized NextJs Site</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fKJkOR27ZfJ6oFlQFFy0pQ.jpeg" /></figure><p>Some of the stuff we’ll discuss later will be NextJs specific. Still, Search Engine Optimization is not dependent on the programing language, the framework in use, or any other implementation details.</p><p>Most SEO strategies, tactics, and recommendations are just as relevant to a Nextjs website as they are to a Laravel website or a Django website.</p><p>In other words, they are universal…</p><p>So I congratulate you on your wise decision to improve your web development skills regarding SEO. They will serve you well your whole life.</p><p>One of the first things you need to do is place the fundaments of a well-optimized site, and here’s precisely what that means:</p><h4>1. Install SSL Certificate</h4><p>Once upon a time, the web was considered to be a safer place. Plus, people didn’t need encryption or other security measures because they chatted anonymously with friends and wrote their blogs.</p><p>Now we use our credit cards on the web, and you hardly can find a website or a web app that doesn’t collect personal information. Also, some apps collect sensitive data like health status, financial information, etc.</p><p>So we need to take security measures to protect that information right away. The most basic way to protect it is by installing an SSL Certificate.</p><p>It used to be expensive and challenging to do it in the past when only a handful of trusty companies were offering those certificates, but nowadays, it’s a piece of cake. And what’s more — it can be free in a case where you’re just starting and don’t process sensitive data.</p><p>When the communication between the browser and the server happens over a secure HTTPS connection, it’s less likely somewhere along the way that communication to be intercepted and tampered with ill intentions.</p><h4>2. Sitemap XML</h4><p>Search engine bots discover the pages of your website in 3 general ways:</p><ul><li>By crawling it page by page and visiting each link, they find</li><li>By visiting your pages from links they found somewhere on the web</li><li>By processing a particular file you sent them, named “Sitemap.”</li></ul><p>The sitemap is an XML (Extensible Markup Language) document that lists all website pages.</p><p>When you add new pages, the XML sitemap gets updated automatically, prompting the search engine bot to come back again. There’s no guarantee it will return right away, and there’s no guarantee it will process all URLs in a sitemap.</p><p>Still, it’s a good idea always to provide one.</p><h4>3. Install Analytics Tool</h4><p>One of the main benefits of SEO is that it’s performance-based, which means site owners can measure (most of the time) the results of their actions.</p><p>To do so, they need to collect data about their visitors — their number, country, pages visited, forms filled, etc. That data is collected by tools like Google Analytics or Matomo Analytics. There are many web analytics solutions.</p><p>Your goal is to find out what solution must be implemented and make it work correctly so the site owners and SEO specialists can access the precious usage stats.</p><h4>4. Set up a Google Search Console Property</h4><p>One of the main targets of SEO is to make the website attractive for organic traffic from Google. Google’s the biggest search engine in the world, and according to Statista, it has a market share of 85.55%.</p><p>That’s huge…</p><p>Nobody can afford to ignore The Big G if they want cheaper traffic.</p><p>The good news is Alphabet provides the so-called Google Search Console, a tool that tells us stats about the organic visits from the search engine and much other helpful information that helps us keep our website in good shape.</p><p>So there is no surprise you need to set up a Google Search Console for your project.</p><h4>5. Provide a robots.txt</h4><p>robots.txt is a file that must be accessible from the root of your domain (https://your-domain.com/robots.txt). It holds special instructions for search engine bots like where they can find a sitemap, which pages they can visit, and more.</p><p>It’s a good idea to provide such a file, especially when your website offers private areas and many admin page URLs that shouldn’t be crawled or indexed.</p><p>That way, you save hosting resources and help the bot be more efficient.</p><h4>6. Proper 404 pages</h4><p>When a page works as planned, the HTTP code must be exactly 200. And respectively, if the user requests a page that doesn’t exist, the code to be 404 while the URL remains unchanged.</p><p>If there is a server error and the page can’t be served temporarily, then the code must be 500. And if the page is moved away to a new address, there must be a 301 redirect.</p><p>Later we will talk more about the proper HTTP Codes.</p><h4>7. WWW or Non-WWW</h4><p>Usually, you can access your website in two ways — entering the www subdomain or without it. I believe it’s a matter of preference which one to be the primary one, but you must choose between them.</p><p>So if you choose the primary one to be the shorter version of your domain (non-www), then you must redirect (301) all requests to that primary domain.</p><p>Otherwise, search engine bots will find the same content on two separate URL addresses and “think” of it as “duplicate content.”</p><p>It’s terrible for your SEO.</p><h3>Web Performance: Business Impact and Recommendations For Achieving Higher Speed</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*J5lTy-Rt4qeAdaMaMxuLyg.jpeg" /></figure><p>A good website performance means several important things about you or the site owners in case you don’t optimize it for yourself:</p><ul><li>Fast websites sell better. For example, when <a href="https://www.digitalcommerce360.com/2010/08/19/web-accelerator-revs-conversion-and-sales-autoanything">retailer AutoAnything reduced page load time</a> by half, they saw an increase of 12% to 13% in sales.</li><li>Fast websites attract more traffic. For example, when <a href="https://medium.com/pinterest-engineering/driving-user-growth-with-performance-improvements-cfc50dafadd7">Pinterest reduced perceived wait times by 40%</a>, they witnessed an increased search engine traffic and sign-ups by 15%;</li><li>Performant websites generate lower hosting expenses. There aren’t popular case studies on the topic, but it’s conventional wisdom. If your website needs less RAM and utilizes less CPU time, then its operational costs will be lower.</li></ul><p>So it’s that important for you to create something fast. It will shine in your CV if you do it for somebody else and will definitely bring you measurable business results otherwise.</p><p>Let’s see what you can do…</p><h4>8. Optimize for better Core Web Vitals</h4><p>You can first analyze selected pages from your website with tools like Page Speed Insights or BuhalBu’s Kit and find your current CWVs.</p><p>If you need more information on what they are, you can find some explanation in my previous article, “ <a href="https://buhalbu.com/stream/technical-seo-intricacies-what-are-the-all-important-page-speed-metrics">Technical SEO Intricacies: What Are The All-Important “Page Speed Metrics”</a>?”</p><p>So basically, you run the tool, get suggestions and then implement them to achieve better numbers. I promise to provide more detailed tutorials on this topic soon.</p><h4>9. Good Lighthouse/PageSpeed Insights/BuhalBu’s Kit Scores</h4><p>The Core Web Vitals are not the only helpful information you can get from tools like the three mentioned in the subtitle. They will give you many more suggestions on making your website faster and with a better user experience.</p><p>They use the same API, so the suggestions they give you will be very similar or, in other words, interchangeable.</p><p>Here are the main differences:</p><ul><li><a href="https://web.dev/measure/">Google Lighthouse</a> analyzes your web pages on the go and gives you the so-called “Lab Data.” It’s data that is collected during the analysis.</li><li><a href="https://pagespeed.web.dev/">Page Speed Insights</a> is one more tool from Google that will show your Core Web Vitals if available. If they’re not available, it will show you Lab Data.</li><li><a href="https://buhalbu.com/">BuhalBu’s Kit</a> is my SEO tool that gives you a handy user interface on top of the widely available Page Speed Insights API. It gives you almost the same data, but you can analyze URLs in bulk (which saves time) and allows you to save your reports for referencing in the future (you can even rerun them to get fresh data).</li></ul><p>So you put your tool into action and then implement most of the suggestions until all scores get colored in green. (Again, I will provide more detailed tutorials soon.)</p><h4>10. Setup a CDN service</h4><p>The Wikipedia definition for CDN is the following:</p><p>“A content delivery network, or content distribution network (CDN), is a geographically distributed network of proxy servers and their data centers. The goal is to provide high availability and performance by distributing the service spatially relative to end-users. “</p><p>Source: <a href="https://en.wikipedia.org/wiki/Content_delivery_network">Wikipedia</a></p><p>It says that if you are using such a network, there are many servers around the world that cache your web pages. And when your users are geographically closer to one of these “proxy servers,” they get the cached content and get it way faster.</p><p>So this is one handy trick to improve the website’s speed quickly.</p><h4>11. Implement gzip/brotli Compression</h4><p>One way to make your site load faster is by reducing the page weight, so there is less information that travels back as a response to an HTTP request.</p><p>The first way to achieve less page weight is by reducing the HTML code and its textual content, resizing your images and leaving some things to be loaded dynamically.</p><p>The second way to achieve the same result is by minifying and compressing your assets — HTML documents, CSS files, js files, etc.</p><p><a href="https://nextjs.org/docs/api-reference/next.config.js/compression">Next.js provides gzip compression by default</a>, but there are some additional considerations.</p><p>If you use a” reverse proxy” like Nginx or you have put in place a CDN service, you may be able to leave the compressing for these services and offload them from the Node.js process.</p><h4>12. Optimize your NextJs code</h4><p>Next.Js is a superb React Framework that makes our life way easier.<br>And precisely because we can easily do so much stuff, sometimes we create heavy pages.</p><p>In a case like that, we can use solutions like <a href="https://buhalbu.com/stream/next-js-dynamic-import-the-definitive-guide-on-how-to-use-it-for-better-app-performance">Dynamic Imports</a>; We can run a bundle analyzer in a search for unused code; We can replace external libraries with custom solutions; And more.</p><p>You need to understand that Next.Js is SEO-friendly, but it’s not SEO-ready. I hope this long article proves to you my last statement.</p><h3>Titles &amp; Metadata: How to Help Search Engine Bots and Browsers Better Understand Your Web Pages, Part I</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EZ29GFJttrnOJjvHqmRuHg.png" /></figure><p>As intelligent human beings, we can understand what we look at. We use our past experience and knowledge to make sense of the world. Also, we use the surrounding context to get a clearer understanding; And we are capable of sophisticated means of communication like talking, writing, and reading to pass information to one another.</p><p>The machines are still way behind us…</p><p>In some areas, they really excel, but most of the time, they are not capable of the same “level of understanding” as us, so they need a little help.</p><p>For example, we can clearly understand the topic of an article by reading just its summary. We can even judge the content’s quality from those couple of sentences.</p><h4>That’s not so easy for a bot…</h4><p>It can do more work in magnitudes and eventually be an indispensable helper in processing significant amounts of documents, but it can’t “feel” the subtle nuances. It can’t judge what’s true and what’s false; What’s good and what’s wrong. It just can’t make sense of the world. Yet.</p><p>We help it by providing it with additional information in the form of titles, meta tags, links, and semantic HTML. The first three live in the HEAD tag of HTML Documents, and the last one resides inside the BODY tag.</p><p>So if we want all search engine bots to understand well our web pages, we need to do the following:</p><h4>13. Provide a Unique Title Tag for Each Page</h4><p>The Title Tag is one of the strongest SEO signals, so it always must be in place. It must be unique, so there is no other page titled like that on our website and, preferably, on the whole web.</p><p>It must be not too short nor too long (15–70 chars).</p><p>Also, it’s a good idea to implement a way to edit the page titles separately from the document’s headline because the latter may be way longer than 70 chars, and the two shouldn’t be identical.</p><h4>14. Provide a Unique Meta Description</h4><p>The meta description tag is not a major SEO signal, but it helps humans and bots understand better what your web page is about so they can make an informed decision to visit or not the page.</p><p>That’s why every page must have a unique meta description between 60 and 320 characters. The content of the tag should be provided by the page’s author and not generated automatically, although there are cases where some automation is unavoidable.</p><h4>15. Proper Char Encoding</h4><p>Nowadays, UTF8 encoding is the web standard for character encoding. It encompasses most alphabets and many other characters like emoticons, etc.</p><h3>16. No Meta Refresh Tags</h3><p>Using a meta refresh tag is an outdated way to update stale content on a web page or force the page to redirect to another URL. It’s not SEO-friendly, and it’s firmly advisable never to use it.</p><p>There are better ways to get the same results.</p><h4>17. Viewport Tag</h4><p>As described in the docs:</p><p>“The browser’s viewport is the area of the window in which web content can be seen. This is often not the same size as the rendered page, in which case the browser provides scrollbars for the user to scroll around and access all the content.</p><p>Some mobile devices and other narrow screens render pages in a virtual window or viewport, which is usually wider than the screen, and then shrink the rendered result down so it can all be seen at once. Users can then pan and zoom to see different areas of the page. For example, if a mobile screen has a width of 640px, pages might be rendered with a virtual viewport of 980px, and then it will be shrunk down to fit into the 640px space.”</p><p>source: <a href="https://developer.mozilla.org/en-US/docs/Web/HTML/Viewport_meta_tag">developers.mozilla.org</a></p><p>So every web page must have a Viewport Tag if we want it to be properly served on mobile devices.</p><p><a href="https://kinsta.com/mobile-vs-desktop-market-share">Mobile devices generate 54% of the web traffic in 2022</a>, which is a big reason to make our website mobile-friendly.</p><h4>18. Provide a lang attribute</h4><p>It’s a way to tell the machines in what language is the content on the page. Not that they can’t figure it out alone, but it’s better to help them out.</p><h4>19. Doctype Declaration</h4><p>There was a time when we needed to choose between several versions of HTML. There was HTML 4.2, HTML 5 and <a href="https://simple.wikipedia.org/wiki/XHTML">XHTML </a>(which I really liked).</p><p>Thank god we now have the “living standard,” and life is much easier.</p><p>But still…</p><p>Let’s put that Doctype declaration in place.</p><h4>20. Provide a Canonical Link</h4><p>“If you have a single page that’s accessible by multiple URLs, or different pages with similar content (for example, a page with both a mobile and a desktop version), Google sees these as duplicate versions of the same page. Google will choose one URL as the canonical version and crawl that, and all other URLs will be considered duplicate URLs and crawled less often.</p><p>If you don’t explicitly tell Google which URL is canonical, Google will make the choice for you, or might consider them both of equal weight, which might lead to unwanted behavior, as explained in Reasons to choose a canonical URL.”</p><p>Source: <a href="https://developers.google.com/search/docs/advanced/crawling/consolidate-duplicate-urls">Google</a></p><h3>Content Structure: How to Help Search Engine Bots and Browsers Better Understand Your Web Pages, Part II</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jVOdAhTDV8UbkxktET31AA.jpeg" /></figure><p>As I mentioned, bots need help to understand the content better. That’s why we provide metadata, style sheets, scripts, etc.</p><p>But all this is not enough…</p><p>The content must be formatted and tagged correctly.</p><p>That includes…</p><h4>21. A Unique H1 headline</h4><p>Each website page must have precisely one H1 headline that is unique sitewide. It must be not too short, nor too long. There are no specific recommendations for its length, but it must be long enough to communicate the page’s topic.</p><h4>22. Proper Headline Hierarchy</h4><p>It’s also essential for the rest of the headline tags (H2-H6) to be appropriately used for creating a hierarchical structure of topics and subtopics. (Screen readers really depend on that too).</p><p>In the past, those tags were often used for styling purposes, which is no more advisable. If it’s not denoting a subtopic as part of the main content, it must not be used just to make the title bolder or bigger.</p><h4>23. HTML Semantic Elements</h4><p>Elements like DIV or SPAN don’t imply any additional information about their content so they are general, non-semantic elements. On the other hand, elements like ARTICLE, MAIN, FOOTER, NAV, etc. have a specific role in the overall document structure so they are semantic elements.</p><p>Semantic elements help search engine bots understand the content.</p><h4>24. No Mixed Content</h4><p>“Mixed content occurs when initial HTML is loaded over a secure HTTPS connection, but other resources (such as images, videos, stylesheets, scripts) are loaded over an insecure HTTP connection.”</p><p>Source: <a href="https://web.dev/what-is-mixed-content/">web.dev</a></p><p>This means there are no links, no images, no videos, or whatever else that loads over a non-secure HTTP connection.</p><h4>25. Well-coded Anchors</h4><p>There’s no upper limit of anchors that a webpage can have in the body, but those anchors should be carefully curated — all of them must point to secure and safe URL addresses.</p><p>All of them must have a meaningful anchor text describing the target page’s content. And if an anchor points to an external webpage, it must have the value “noopener” for its rel attribute.</p><h3>Proper URLs: How to Help Search Engine Bots and Browsers Better Understand Your Web Pages, Part III</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*n5bS4wnWOn9PYjhc1vxqAQ.jpeg" /></figure><p>Every resource on the web has a unique identifier that helps us find and access it — its URL. So those URLs must be structured in an SEO-friendly way.</p><p>Moreover, search engine bots analyze the page’s URL to get more of the content’s context.</p><p>That’s why…</p><h4>26. Allow URL Management by Users</h4><p>There are various requirements like these:</p><ul><li>The target keyword must be included in the URL</li><li>The URL mustn’t include underscores</li><li>The URL mustn’t have too many URL parameters</li><li>The URL must be as short as possible</li></ul><p>Many of the rules for SEO-friendly URLs can’t be applied automatically, so the users need a way to do it manually.</p><h4>27. No Too Long URLs</h4><p>Generally, all of them must be as short as possible, but sometimes the underlying structure, placed by the web developer, adds bloat.</p><p>Bad Example:</p><pre><a href="https://buhalbu.com/knowledgebase/category/nextjs-seo/article/some-really-long-automatic-article-slug-thats-not-seo-friendly">https://buhalbu.com/knowledgebase/category/nextjs-seo/article/some-really-long-automatic-article-slug-thats-not-seo-friendly</a></pre><p>Good Example:</p><pre><a href="https://buhalbu.com/kb/nextjs-seo/some-article-slug">https://buhalbu.com/kb/nextjs-seo/some-article-slug</a></pre><h4>28. No Duplicates</h4><p>Every URL must point to a unique page on the website. If two URLs load the same content, it’s considered “duplicated,” which can lead to negative consequences.</p><p>This point can be seen as an extension of point 7 (General SEO), where we redirected the www subdomain.</p><h3>Image Optimization: The Big Impact Elements On The Page</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-4tc71SIqgLed-0oHRX7NQ.jpeg" /></figure><p>According to HTTP Archive, images make up more than 60% of the data loaded on web pages, so their file size significantly impacts the page loading speed. If you want to have a faster website — use smaller in size images.</p><p>Next.Js offers a convenient react component for images that applies automatically many of the best SEO practices regarding image resources.</p><p>Still, bear in mind the following:</p><h4>29. Optimize The Largest Contentful Paint</h4><p>“You should add the priority property to the image that will be the Largest Contentful Paint (LCP) element for each page. Doing so allows Next.js to specially prioritize the image for loading (e.g. through preload tags or priority hints), leading to a meaningful boost in LCP.</p><p>The LCP element is typically the largest image or text block visible within the viewport of the page. When you run next dev, you’ll see a console warning if the LCP element is an without the priority property.”</p><p>source: <a href="https://nextjs.org/docs/basic-features/image-optimization">nextjs.org</a></p><h4>30. Don’t Overdepend On The Image Component</h4><p>This component is so handy, and we often surrender to the idea that it can handle whatever images we pass to it.</p><p>That’s far from the truth…</p><p>If you don’t process your images beforehand… If you don’t normalize them and don’t persist the optimized copies, Next.Js will optimize them after every deployment on a serverless infrastructure, which will cost you lots of CPU time.</p><h4>31. Allow Users To Manage the Image’s Alt Attribute</h4><p>One of the age-old SEO rules says that every IMG tag must have defined a proper alt attribute. Several more rules related to this attribute guide the user in what information they should provide as a valid alternative to the actual image.</p><p>So there must be a mechanism that allows manual input of the alt attribute for every image.</p><h4>32. Don’t Play With The Filenames</h4><p>Once upon a time, replacing the filename with something that’s automatically generated, like a combination of the image’s MD5 hash and the upload date, was trendy.</p><p>Nowadays, the filenames must include the target keywords as an additional hint for search engine bots about the page’s topic, so it’s considered a bad SEO practice to rename the image file.</p><h4>33. Drink a Beer… You made it!</h4><p>It’s time to celebrate! Call your friends and go get some fun.</p><h3>Outro: Checklist Completed, A Website Optimized</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oTwUM9HUJE372pNic0QPLA.jpeg" /></figure><p>For the last several minutes, we talked about 33 things you must bear in mind when optimizing a nextjs project for search engines. I put all of my focus on the technical side of optimization (NextJs Technical SEO).</p><p>Besides these 33 optimization techniques, there is at least equal optimization related to building backlinks, PR activities, local SEO, etc.</p><p>We’ll talk about all this in future articles.</p><p>I consider the technical part of having the biggest priority because if your website doesn’t work correctly and isn’t structured well, it would be a huge SEO drawback that hinders its success.</p><p>Something that now has no chance of happening if you complete this checklist.</p><p>Perhaps I proved my point that NextJs SEO isn’t easy and requires work, but once you complete the list, you will have a fast, well-optimized website that really shines in your CV or portfolio.</p><p>Cheers,<br>Sashe Vuchkov</p><p><em>Originally published at </em><a href="https://buhalbu.com/stream/nextjs-seo"><em>https://buhalbu.com</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b6623aec925" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[3 Short Tips for Faster WordPress Site]]></title>
            <link>https://medium.com/@sashevuchkov/3-short-tips-for-faster-wordpress-site-a18f2cc8ca1d?source=rss-218e437d7519------2</link>
            <guid isPermaLink="false">https://medium.com/p/a18f2cc8ca1d</guid>
            <category><![CDATA[wordpress]]></category>
            <category><![CDATA[seo]]></category>
            <category><![CDATA[technical-seo]]></category>
            <dc:creator><![CDATA[Sashe Vuchkov]]></dc:creator>
            <pubDate>Sat, 30 Apr 2022 10:04:30 GMT</pubDate>
            <atom:updated>2022-04-30T10:05:47.930Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vODVRrZz33nPs59O_Z6Uow.jpeg" /></figure><p>Dear WordPress Aficionado,</p><p>If you want your WordPress site to be faster, there are many “optimizations” you can apply to achieve that goal.</p><p>Here are some that will have a big impact:</p><h3>1. Install a caching plugin</h3><p>Every time a user opens a page on your site, your WordPress generates an HTML document. If you use a <a href="https://buhalbu.com/stream/lets-wave-a-magic-wand-and-give-your-wordpress-site-more-speed">caching plugin</a>, that document gets saved and reused for a certain period.</p><p>Caching plugins are indispensable helpers, and often they cost you nothing to use them.</p><p>Of course, later, you can decide your WordPress website needs more advanced caching features and thus purchase a premium version. That’s how the creators of the plugins make money and support themselves.</p><h3>2. Set up a CDN service</h3><p>Using a CDN service can speed up your website and lower your hosting expenses because it fetches the content of your website and then serves it from locations closer to the users.</p><p>Some<a href="https://buhalbu.com/stream/the-awful-leisure-activity-of-evaluating-cdn-vendors-for-your-wordpress-site"> CDN providers</a> offer free plans, and others offer only paid plans.</p><p>My strategic approach is to use a free CDN when I create a website, and later, if the site’s web traffic takes off, I purchase a better plan with lots of other performance and security features.</p><h3>3. Optimize your images</h3><p>According to HTTP Archive, images make up more than 60% of the data loaded on web pages, so their file size significantly impacts the page loading speed. If you want to have a faster website — use smaller in size images.</p><p>Many WordPress plugins can be used for image optimization. Some CDN services offer automatic image optimization too, but mostly with their paid plans.</p><p>In the early stages of my website, I optimize my images manually with the help of Photoshop. It’s a paid software, but I have it installed because I use it to create logos, icons, backgrounds, and graphics for social media.</p><h3>Conclusion</h3><p>In the future, I will share with you many more tips on optimizing your WordPress site for better loading speed and usability. I start with these three tips because they can make a big difference for your site.</p><p>Cheers,</p><p>Sashe Vuchkov<br>The Code &amp; Marketing Combinator</p><p><em>Originally published at </em><a href="https://buhalbu.com/stream/faster-wordpress-site"><em>https://buhalbu.com</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a18f2cc8ca1d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Top of The Top CDNs: A Curated List of The Most Recommended CDN Vendors]]></title>
            <link>https://medium.com/@sashevuchkov/top-of-the-top-cdns-a-curated-list-of-the-most-recommended-cdn-vendors-cae1b80cb10c?source=rss-218e437d7519------2</link>
            <guid isPermaLink="false">https://medium.com/p/cae1b80cb10c</guid>
            <category><![CDATA[wordpress-seo]]></category>
            <category><![CDATA[technical-seo]]></category>
            <category><![CDATA[wordpress]]></category>
            <category><![CDATA[cdn]]></category>
            <dc:creator><![CDATA[Sashe Vuchkov]]></dc:creator>
            <pubDate>Thu, 21 Apr 2022 10:48:41 GMT</pubDate>
            <atom:updated>2022-04-21T10:48:41.638Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*HvSegPrMykUej3jW.jpg" /></figure><p>Dear WordPress Aficionado,</p><p>Have you ever felt energized like The Dude on slow cadence?</p><p>The Big Lebowski is one of my favorite movies, and every time I lower the tempo, I start seeing myself in the future so bored from messing around aimlessly that at some point, I’m chasing mobs to compensate me for an old rug.</p><p>That’s one of the reasons I’m writing to you now…</p><p>I want to save myself from that misfortune even though I’m not so excited right now. The other reason is the stress from looking at my endless list of scheduled content ideas, knowing I will probably never check them as finished.</p><p><strong>So I devised a little cheat…</strong></p><p>It’s called “meta-analysis.” In simple terms, I opened the best-ranking articles on the topic, reviewed their recommendations, and compiled the following “Top of The Top CDNs” List.</p><p>I will start with the recommendations, and then I will list my sources too so you can review the ones you like by yourselves.</p><h3>Top 1 Most Recommended Free CDN</h3><p><a href="https://www.cloudflare.com/">Cloudflare </a>is the only CDN provider that offers a FREE plan and is mentioned in all of my seven sources. It’s the one I use myself, so I’m biased toward recommending it.</p><p>I have never used other providers than Cloudflare and Google CDN so take my words with a grain of salt.</p><p>This vendor is ranked number 1 by three of my sources, including Hubspot and Techradar. It averages position 2.</p><h3>Top 1 Most Recommended CDN By Top 1 Ranked Reviewer</h3><p>When I googled “best cdn,” the first result was <a href="https://www.business2community.com/search-engine-optimization/18-top-cdn-service-providers-to-speed-up-your-website-02203978">an article by Sandipan Mukherjee on WPForms Blog</a>. They rank StackPath as best of the best CDN providers.</p><p>“It comes with multiple data centers across the world, so it helps you improve the loading speed of your website. Plus, it comes with a private EdgeSSL certificate for free with their plan.</p><p><a href="https://www.stackpath.com/">Stackpath </a>is very easy to set up and allows you to monitor real-time analytics. It also comes with features like an intelligent caching system, Gzip compression, 301 redirects, and much more,” says Sandipan.</p><p>The author points out that the provider doesn’t offer a free plan as the main con.</p><h3>7 Reputable Sources And Which Provider They Rank As Number 1</h3><p>In no particular order, I will list all of my sources and which CDN provider they claim is the best choice in 2022.</p><ul><li>The editorial staff of wpbeginner.com ranks <a href="https://bunny.net/">Bunny.net</a> on the top of their list of <a href="https://www.wpbeginner.com/showcase/best-wordpress-cdn-services/">“7 Best WordPress CDN Services in 2022 (Compared)”</a>;</li><li>The <a href="https://www.gartner.com/reviews/market/global-cdn">community of gartner.com</a> ranks <a href="https://www.fastly.com/products/site-delivery">Fastly Deliver</a> as number 1;</li><li>The <a href="https://www.g2.com/categories/content-delivery-network-cdn">community of g2.com</a> ranks Cloudflare CDN as their number one choice;</li><li>Mike Williams and Desire Athow recommend Cloudflare as the best <a href="https://www.techradar.com/news/best-cdn-providers">choice too in their article “Best CDN providers of 2022 to speed up any website”</a> on techradar.com;</li><li>In their article <a href="https://wpforms.com/best-cdn-providers/">“[2022] The 8 Best CDN Providers That Speed Up Your Website”</a> on wpforms.com the author Sandipan Mukherjee ranks StackPath as number 1.</li><li>Aby League mentions MaxCDN (acquired by StackPath) as the leading CDN Provider in their article <a href="https://www.business2community.com/search-engine-optimization/18-top-cdn-service-providers-to-speed-up-your-website-02203978">“18 Top CDN Service Providers To Speed Up Your Website”</a> on business2community.com.</li><li>And the best CDN Provider, according to Ivelisse Rodriguez and their article <a href="https://blog.hubspot.com/website/best-free-cdn-services-to-speed-up-wordpress">“10 Best Free CDN Services to Speed Up Your WordPress Website”</a> on Hubspot, is again Cloudflare CDN.</li></ul><p>As you can see, nothing stops you from coming up with creative ideas for content, even when you are feeling like The Dude on slow cadence. I hope you gained a clear vision of the worthiest CDN providers today.</p><p>Still…</p><p>Choose wisely!</p><p>Cheers,</p><p>Sashe Vuchkov<br>The Code &amp; Marketing Combinator</p><p>P.S. If you missed my column on <a href="https://buhalbu.com/stream/the-awful-leisure-activity-of-evaluating-cdn-vendors-for-your-wordpress-site">choosing the best CDN provider for your WordPress</a>, click the link, and you will get five useful criteria to judge them all by.</p><p><em>Originally published at </em><a href="https://buhalbu.com/stream/top-of-the-top-cdns-a-curated-list-of-the-most-recommended-cdn-vendors"><em>https://buhalbu.com</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cae1b80cb10c" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>