<?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 Jakub Honíšek on Medium]]></title>
        <description><![CDATA[Stories by Jakub Honíšek on Medium]]></description>
        <link>https://medium.com/@honisek.jakub?source=rss-a8716e71fe3b------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*sdU1Sp_UQgPctfbgbGEumg.jpeg</url>
            <title>Stories by Jakub Honíšek on Medium</title>
            <link>https://medium.com/@honisek.jakub?source=rss-a8716e71fe3b------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 01 Dec 2026 11:06:24 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@honisek.jakub/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[Technical SEO: The Basics Every Project Should Have]]></title>
            <link>https://medium.com/@honisek.jakub/technical-seo-the-basics-0be5876991aa?source=rss-a8716e71fe3b------2</link>
            <guid isPermaLink="false">https://medium.com/p/0be5876991aa</guid>
            <category><![CDATA[seo-tips]]></category>
            <category><![CDATA[google]]></category>
            <category><![CDATA[front-end-development]]></category>
            <category><![CDATA[search-engine-optimizati]]></category>
            <category><![CDATA[seo]]></category>
            <dc:creator><![CDATA[Jakub Honíšek]]></dc:creator>
            <pubDate>Sun, 26 Oct 2025 10:23:44 GMT</pubDate>
            <atom:updated>2025-10-26T10:23:44.725Z</atom:updated>
            <content:encoded><![CDATA[<p>I’ve worked on many of web projects where SEO was crucial for the business. Over time I have implemented many different and advanced techniques, but there are a few basic rules that <strong>every</strong> website should follow.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*u_ceLyqhixcQfvyNXAbZMg.png" /></figure><blockquote>You can have great content and a beautiful design. But if Google can’t read it properly, it really doesn’t matter.</blockquote><p>Let’s go through the <strong>core fundamentals</strong> that every modern web project should follow.</p><h3>1. Clean, crawlable URLs</h3><p>Make it easy for Google to understand your site.</p><p>That means:</p><ul><li>Use only one version of your domain (www or non-www, permanently redirect the second one).</li><li>Keep URLs simple and readable. For example, /blog/seo-basics is way better than /article?id=123.</li><li>Use hreflang for multilingual sites.</li><li>Block non-crawlable pages with robots.txt.</li></ul><p>This is the foundation. Without it, nothing else really matters.</p><h3>2. Basic metadata</h3><p>Each page should clearly say <em>what it’s about</em>.</p><p>It should have, at least:</p><ul><li>A unique title and meta description.</li><li>og: and twitter: meta tags for clean link previews.</li></ul><h3>3. Performance still matters</h3><p>Google (and users) loves fast websites.</p><p>Focus on:</p><ul><li><strong>Core Web Vitals</strong>: LCP, CLS, TBT.</li><li>Modern image formats (WebP, Avif), responsive srcset.</li><li>Proper caching, preloading, and lazy loading.</li><li>Avoiding render-blocking JS and massive bundles.</li></ul><h3>4. Server-render all important content</h3><p>Google can render JavaScript, but you should never rely on that.</p><p>Keep important content and metadata <strong>server-rendered</strong>.</p><blockquote>A simple rule: <strong>If it defines what the page is about, render it on the server.</strong></blockquote><h3>5. Canonicals and Redirects</h3><p>Every page should tell Google which version is the “official” one. That’s what the canonical tag is for.</p><p>When you move content, always use <strong>301 redirects</strong> (not 302). For multilingual sites, keep cannonical tags consistent across languages. And never let duplicate URLs compete against each other. It hurts the scoring of both.</p><h3>6. Sitemaps and Indexing</h3><p>A sitemap is a map of your site for search engines. It helps Google to understand your content.</p><ul><li>Include only public, canonical URLs that return 200.</li><li>Submit and validate your sitemap in Google Search Console.</li><li>Update it whenever new content goes live.</li></ul><h3>7. Semantic HTML and Accessibility</h3><p>Use semantic tags like &lt;main&gt;, &lt;article&gt;, &lt;nav&gt;, &lt;footer&gt;. Add proper alt attributes to images. Ensure that your headings follow a logical order (H1, H2, H3).</p><p>Google reads your HTML like a book — structure helps it understand what matters.</p><h3>Final thoughts</h3><p>Technical SEO isn’t about tricks. It’s about respecting the basics.</p><p>You don’t need to be an SEO expert. You just need to make your site <strong>crawlable, fast, structured, and consistent</strong>.</p><p>That’s 90 % of the work done.</p><p>What about you?</p><p>Do you have your own technical SEO checklist before launch? I’d love to hear what’s on it.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0be5876991aa" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[You’re Not Lazy. Procrastination Is Just a Signal.]]></title>
            <link>https://medium.com/@honisek.jakub/youre-not-lazy-336e56c6e042?source=rss-a8716e71fe3b------2</link>
            <guid isPermaLink="false">https://medium.com/p/336e56c6e042</guid>
            <category><![CDATA[productivity]]></category>
            <category><![CDATA[motivation]]></category>
            <category><![CDATA[procrastination]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[self-improvement]]></category>
            <dc:creator><![CDATA[Jakub Honíšek]]></dc:creator>
            <pubDate>Sat, 18 Oct 2025 14:32:55 GMT</pubDate>
            <atom:updated>2025-10-18T14:32:55.266Z</atom:updated>
            <content:encoded><![CDATA[<p>We all know that feeling. You sit down to work, open the task… and then everything else suddenly feels more important. Different task. Messages. Cleaning your desk.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PvZuLASKSlJXRd4Bc6tFsA.png" /></figure><p>This happened to me a few days ago. I opened a project that needed a big refactor. I looked at it and saw how much work it would take, so I closed it again.<br>Not because I was lazy.<br>But because I didn’t know where to start. And I wasn’t sure if it would even work in the end.</p><p>Later, I realized, it wasn’t a motivation problem.<br>It was a signal.<br>Procrastination often means that something isn’t clear, it feels too big, or it looks too risky.</p><p>Once I recognized that, things started to make more sense. I stopped trying to push through it. Instead, I asked myself: “<em>Why I avoid this task? What’s the one small step, that will me start?”</em><br>Something clear. Simple. Actionable.<br>Once I had that, it was easier to get started.</p><p>Now when I catch myself procrastinating, I don’t feel guilty. I get curious. I get curious. Is that unclear? Is it too big? Or am I afraid of failing? Finding the answer usually shows me the next step.</p><p>So, the next time you find yourself avoiding something, don’t fight it.<br>Listen to it.<br>It’s probably trying to tell you what you should do.</p><p>What’s the one small step you could take today?</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=336e56c6e042" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How I Built a Fast and SEO-Friendly Paywall in Next.js]]></title>
            <link>https://medium.com/@honisek.jakub/fast-and-seo-friendly-paywall-in-next-js-62dfd154e466?source=rss-a8716e71fe3b------2</link>
            <guid isPermaLink="false">https://medium.com/p/62dfd154e466</guid>
            <category><![CDATA[seo]]></category>
            <category><![CDATA[nextjs]]></category>
            <category><![CDATA[google]]></category>
            <category><![CDATA[optimization]]></category>
            <category><![CDATA[paywall]]></category>
            <dc:creator><![CDATA[Jakub Honíšek]]></dc:creator>
            <pubDate>Wed, 08 Oct 2025 19:16:23 GMT</pubDate>
            <atom:updated>2025-10-08T19:16:23.670Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Making a paywalled Next.js site fast, secure, and still SEO-friendly.</em></p><p>When you’re building a content site, two things usually matter most: speed and visibility.<br>But once you introduce a <strong>paywall</strong>, everything gets complicated.<br>Now it’s not only about performance — you also need to make sure each visitor sees exactly what they should.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ED91BORTzLb8Ke5xbCdwCQ.png" /></figure><p>That was my challenge some time ago.<br>I had to build a site that’s lightning fast, statically generated, but still hides full articles behind a paywall.</p><p>At the same time:</p><ul><li>Google had to see the full content for SEO,</li><li>logged-in members had to see everything,</li><li>and anonymous users only an article preview.</li></ul><p>SSR wasn’t an option — too slow. Google doesn’t like it. And client-side hiding? Let’s just say that’s a terrible idea.</p><p>So I ended up with something in between: fully static pages, served intelligently depending on who’s asking.</p><p>Every article now has two builds:</p><ul><li>/articles/[slug] → a <strong>preview</strong> for public visitors</li><li>/articles/[slug]/full → the <strong>complete version</strong> for logged-in users and Google</li></ul><p>Both are generated statically using SSG/ISR.</p><p>In the App Router, it looks like this:</p><pre>export const revalidate = 60;<br><br>export default async function Page({ params }) {<br>  const article = await getArticle(params.slug);<br><br>  return &lt;ArticlePage article={article} isPaywalled /&gt;<br>}</pre><p>And a nearly identical one for full version, just rendering the full text instead of the preview.</p><p>No database calls, no runtime logic — just prebuilt HTML.</p><h4>And Here’s the Magic</h4><p>A simple middleware.ts decides which version to show.</p><p>If the request comes from Googlebot or a logged-in user, it rewrites the URL to /full. Everyone else stays on the preview.</p><pre>export function middleware(req) {<br>  // check user-agent and the IP address<br>  if (isGooglebot(req)) {<br>    return NextResponse.rewrite(new URL(req.nextUrl.pathname + &quot;/full&quot;, req.url));<br>  }<br>  // check logged user, I check it by validating JWT token without calling API<br>  if (isLoggedUser(req)) {<br>    return NextResponse.rewrite(new URL(req.nextUrl.pathname + &quot;/full&quot;, req.url));<br>  }<br>  return NextResponse.next()<br>}</pre><p>That’s enough to keep things both fast and safe. All the logic happens before rendering, so it doesn’t break caching or slow down responses.</p><p>To make things clear for Google, I also added structured data describing the paywalled section:</p><pre>{<br>  &quot;@context&quot;: &quot;https://schema.org&quot;,<br>  &quot;@type&quot;: &quot;Article&quot;,<br>  &quot;isAccessibleForFree&quot;: false,<br>  &quot;hasPart&quot;: {<br>    &quot;@type&quot;: &quot;WebPageElement&quot;,<br>    &quot;isAccessibleForFree&quot;: false,<br>    &quot;cssSelector&quot;: &quot;.paywalled&quot;<br>  }<br>}</pre><p>That’s enough for Google to understand the page is restricted but legitimate — no cloaking issues, full SEO benefits.</p><h4>The result?</h4><p>Static speed. Full SEO. Zero leaks.</p><p>Google indexes the full article from the dedicated /full version, logged-in users get instant access after login, and other users stay on the preview.</p><p>All handled with zero SSR overhead.</p><p>So if you’ve ever fought the “SSR vs SEO” dilemma — this approach might save you a few gray hairs.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=62dfd154e466" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Remote vs. Office: What I’ve Learned After Trying Both]]></title>
            <link>https://medium.com/@honisek.jakub/remote-vs-onsite-fcf93d432122?source=rss-a8716e71fe3b------2</link>
            <guid isPermaLink="false">https://medium.com/p/fcf93d432122</guid>
            <category><![CDATA[remote-working]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[growth]]></category>
            <category><![CDATA[onsite]]></category>
            <category><![CDATA[teamwork]]></category>
            <dc:creator><![CDATA[Jakub Honíšek]]></dc:creator>
            <pubDate>Sat, 04 Oct 2025 16:38:11 GMT</pubDate>
            <atom:updated>2025-10-04T16:38:11.871Z</atom:updated>
            <content:encoded><![CDATA[<p>After years of switching between home and office, I’ve learned it’s not about flexibility — it’s about which environment actually helps you grow.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_UXptO-bPWcmydVl5_e0dw.png" /></figure><p>I’ve been through every setup you can imagine — full remote during COVID, everyday office life, and a hybrid phase when most of the team worked from another city while I was still going to the office.</p><p>Each setup taught me something different — about focus, collaboration, and motivation.</p><h3>Communication Wins in Person</h3><p>When you’re in the office and need something, it’s instant. You turn to your teammate, ask, discuss, and move on. A five-minute chat saves an hour of writing and waiting.</p><p>Remotely, everything takes longer. You write, wait, maybe get misunderstood, maybe not. Or you schedule a call that half the team can’t join. That natural rhythm just doesn’t happen the same way online.</p><p>Sure, you can get by with Slack and video calls. But it’s not the same. Collaboration turns into coordination. And that’s not progress, that’s logistics.</p><h3>Learning Happens Between Conversations</h3><p>Some of the best learning moments in my career came from things that weren’t even planned — overhearing how someone explains a problem, watching how others think, or joining a random discussion that turns into a small workshop.</p><p>In the office, that happens naturally. Remote? Not so much. Mentoring calls work, but they feel structured, scheduled — and you lose the spark that comes from those unplanned “aha” moments.</p><p>Especially for juniors, that difference is huge. Sitting next to a senior who can explain something in 30 seconds is irreplaceable. You can’t replicate that dynamic on an online call.</p><h3>Remote Gives You Space, But Not Always Drive</h3><p>Remote days are great for deep work. You can get a lot done without interruptions. But the quiet can turn into isolation pretty fast.</p><p>When I’m in the office, there’s a certain energy in seeing people around me — everyone working, solving problems, creating something together. It keeps me in rhythm.</p><p>At home, I can focus. In the office, I can <em>build momentum</em>.</p><h3>Why I Still Prefer the Office</h3><p>For me, the best balance is being mostly in the office, with occasional remote days for focused work. That mix gives me what I need — collaboration, growth, and the shared energy that makes work actually enjoyable.</p><p>I don’t go to the office because I have to. I go because that’s where the ideas move faster, people grow quicker, and things just… happen.</p><p>In the end, it’s all about what keeps you moving forward.</p><p>So where do <em>you</em> find that energy — at home or in the office?</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fcf93d432122" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[TypeScript for Newbies: An Introduction to Static Typing in JavaScript]]></title>
            <link>https://medium.com/@honisek.jakub/typescript-for-newbies-an-introduction-to-static-typing-in-javascript-9de217aa4f74?source=rss-a8716e71fe3b------2</link>
            <guid isPermaLink="false">https://medium.com/p/9de217aa4f74</guid>
            <category><![CDATA[backend]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[frontend]]></category>
            <category><![CDATA[typescript]]></category>
            <dc:creator><![CDATA[Jakub Honíšek]]></dc:creator>
            <pubDate>Sun, 29 Oct 2023 16:59:49 GMT</pubDate>
            <atom:updated>2023-10-29T16:59:49.475Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lZKNP41Sbp578wBT_vY-uA.png" /></figure><h3>Introduction</h3><p>TypeScript is a powerful, statically-typed superset of JavaScript that has gained popularity among developers for its robust type system, improved code maintainability, and excellent tooling support. In this article, we will introduce TypeScript, discuss the benefits of static typing in JavaScript, and explore the differences between TypeScript and JavaScript.</p><h3>What is TypeScript?</h3><p>TypeScript is an open-source programming language developed and maintained by Microsoft. It extends JavaScript by adding optional static typing, enabling developers to catch type-related errors during the development process rather than at runtime. TypeScript code is transpiled to JavaScript, making it compatible with any platform that supports JavaScript.</p><h3>Benefits of Static Typing</h3><p>Static typing offers several benefits that can improve your overall development experience:</p><ol><li>Error detection: Type-related errors can be caught during the development process, reducing the likelihood of runtime errors and improving overall code quality.</li><li>Code maintainability: Explicit type annotations make the code more readable, allowing developers to understand the structure and intent of the code more easily.</li><li>Editor support: Enhanced autocompletion, refactoring, and error reporting in code editors like Visual Studio Code can significantly speed up development and reduce the likelihood of errors.</li><li>Documentation: Type information serves as built-in documentation, making it easier for developers to understand how to use functions and objects correctly.</li></ol><h3>TypeScript vs. JavaScript</h3><p>While TypeScript is a superset of JavaScript, there are some key differences between the two languages:</p><ol><li>Optional static typing: TypeScript introduces optional static typing, allowing developers to define types for variables, function parameters, and return values.</li><li>Type inference: TypeScript can infer types based on the values assigned to variables or the return values of functions, reducing the need for explicit type annotations.</li><li>Interfaces and classes: TypeScript offers better support for interfaces and classes, enabling more powerful object-oriented programming patterns.</li><li>Generics: TypeScript introduces generics, which enable the creation of reusable, type-safe code.</li><li>Transpilation: TypeScript code must be transpiled to JavaScript before it can be executed in a browser or Node.js environment.</li></ol><h3>Getting Started with TypeScript</h3><p>To start using TypeScript, you’ll need to install the TypeScript compiler and configure your development environment. You can install the TypeScript compiler globally using npm:</p><pre>npm install -g typescript</pre><p>Once the compiler is installed, you can create a tsconfig.json file to configure your TypeScript project. A simple tsconfig.json configuration might look like this:</p><pre>{<br>  &quot;compilerOptions&quot;: {<br>    &quot;target&quot;: &quot;es2017&quot;,<br>    &quot;module&quot;: &quot;commonjs&quot;,<br>    &quot;strict&quot;: true,<br>    &quot;outDir&quot;: &quot;./dist&quot;<br>  },<br>  &quot;include&quot;: [&quot;./src/**/*.ts&quot;]<br>}</pre><p>This configuration tells the TypeScript compiler to target ES2017, use the CommonJS module system, enable strict mode, and output the compiled JavaScript to the dist folder. The include option specifies that TypeScript files in the src folder should be compiled.</p><p>To compile your TypeScript files, run the following command:</p><pre>tsc</pre><h3>Conclusion</h3><p>In this introductory article, we have covered the basics of TypeScript, its benefits over JavaScript, and how to set up a TypeScript project. In the next article of the “TypeScript for Newbies” series, we will dive deeper into TypeScript’s syntax, types, and features. Stay tuned to continue your TypeScript journey and become a more proficient developer.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9de217aa4f74" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Supercharge Your Web Performance with Next.js]]></title>
            <link>https://medium.com/@honisek.jakub/supercharge-your-web-performance-with-next-js-782abe67fe96?source=rss-a8716e71fe3b------2</link>
            <guid isPermaLink="false">https://medium.com/p/782abe67fe96</guid>
            <category><![CDATA[performance]]></category>
            <category><![CDATA[frontend]]></category>
            <category><![CDATA[reactjs]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[nextjs]]></category>
            <dc:creator><![CDATA[Jakub Honíšek]]></dc:creator>
            <pubDate>Fri, 17 Mar 2023 08:47:27 GMT</pubDate>
            <atom:updated>2023-03-17T18:49:23.683Z</atom:updated>
            <content:encoded><![CDATA[<h3>🔥 Supercharge Your Web Performance with Next.js: Exploring Static Site Generation (SSG) and Incremental Static Regeneration (ISR)</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OlTRD2poCByq5N2Id87i1g.png" /></figure><p>In today’s world, performance optimization plays a crucial role in web development, as users expect websites to load almost instantly. A fast-loading site not only delivers a better user experience but also retains visitors and enhances search engine rankings.</p><p>Next.js provides features to elevate web app performance as Static Site Generation (SSG) and Incremental Static Regeneration (ISR). These features enable developers the ability to build high-speed websites with continually updated content.</p><h4>Static Site Generation (SSG)</h4><p>SSG is a technique that generates static HTML files for each page during the build process, removing the need for server-side rendering at runtime. This approach results in faster load times, improved user experience, and better search engine rankings.</p><p>In Next.js, implementing SSG involves two primary functions. The getStaticProps function fetches data during the build process and passes it as props to your page component. This data is then used to generate the static HTML content. Here&#39;s an example of using getStaticProps:</p><pre>export async function getStaticProps() {<br>  const data = await fetchData();<br>  return { props: { data } };<br>}</pre><p>For dynamic pages, the getStaticPaths function specifies which paths should be pre-rendered as static HTML files. By providing a list of paths, Next.js knows which pages to generate during the build process:</p><pre>export async function getStaticPaths() {<br>  const paths = await fetchPaths();<br>  return { paths, fallback: false };<br>}</pre><h4>Incremental Static Regeneration (ISR)</h4><p>ISR is a technique that enables regenerating static pages on-demand, after a certain period, without rebuilding the entire site. With ISR, you can update specific pages without affecting the rest of the site, resulting in fresher content for users. Additionally, ISR reduces server load and ensures optimal performance.</p><p>Implementing ISR in Next.js requires setting a value for the revalidate property in the getStaticProps function, which tells Next.js how often the page should be regenerated:</p><pre>export async function getStaticProps() {<br>  const data = await fetchData();<br>  return {<br>    props: { data },<br>    revalidate: 60, // revalidate after 60 seconds<br>  };<br>}</pre><p>Configuring the fallback property in getStaticPaths allows handling requests for paths not pre-rendered during the build process:</p><pre>export async function getStaticPaths() {<br>  const paths = await fetchPaths();<br>  return {<br>    paths,<br>    fallback: true<br>  };<br>}</pre><p>All the options for fallback property are:</p><ul><li>false: If a requested path is not pre-rendered, it returns a 404 page.</li><li>true: If a requested path is not pre-rendered, it serves a fallback version and then generates the page on the first request.</li><li>&quot;blocking&quot;: If a requested path is not pre-rendered, it generates the page on the first request, but the user has to wait until the page is generated.</li></ul><h4>Use Cases for SSG and ISR</h4><p>SSG and ISR are perfect for sites with large amounts of content that need to be frequently updated, like blogs and news portals. Online stores can benefit from fast-loading pages and up-to-date product listings using ISR. Websites featuring events or other time-sensitive content can take advantage of ISR to keep the information current.</p><h4>Combining SSG and ISR with other Next.js features</h4><p>For pages that require real-time data or user-specific content, Next.js offers Server-Side Rendering (SSR) to render content on the server. Additionally, Next.js API routes provide a convenient way to fetch additional data from external sources or perform server-side operations, complementing the capabilities of SSG and ISR.</p><h4>Conclusion</h4><p>Static Site Generation (SSG) and Incremental Static Regeneration (ISR) in Next.js offer powerful tools for creating high-performing websites with constantly updated content. By pre-rendering pages at build time and regenerating them as needed, these techniques improve page load times, search engine rankings, and overall user experience.</p><p>Incorporating SSG and ISR into your Next.js projects can significantly enhance your website’s performance and user satisfaction. Don’t hesitate to explore and leverage these features in your web development projects to build blazing-fast, engaging, and successful websites. By combining SSG, ISR, and other Next.js features like SSR and API routes, you can create versatile, high-performance web applications.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=782abe67fe96" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Advanced JavaScript Techniques: Using bind() and apply()]]></title>
            <link>https://medium.com/@honisek.jakub/javascript-apply-bind-6b5611281b16?source=rss-a8716e71fe3b------2</link>
            <guid isPermaLink="false">https://medium.com/p/6b5611281b16</guid>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[backend]]></category>
            <category><![CDATA[frontend]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Jakub Honíšek]]></dc:creator>
            <pubDate>Wed, 08 Mar 2023 19:27:08 GMT</pubDate>
            <atom:updated>2023-03-17T18:51:15.672Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oo4ir_pm4Dkl6EkjBGTbig.png" /></figure><p>In JavaScript, bind and apply are two powerful functions that allow developers to control the context in which a function is executed. They are commonly used to modify the value of this and pass arguments to a function. In this article, we<strong>’</strong>ll take a closer look at how these functions work and we explore some use cases where they come in handy.</p><h4>Bind function</h4><p>The bind() function creates a new function with the same body and scope as the original function, but with a different context. The context is the object that is used as the value of this inside the function. The syntax for the bind() function is:</p><pre>function.bind(thisArg[, arg1[, arg2[, ...]]])</pre><ul><li>thisArg: The value of this to be passed to the function.</li><li>arg1, arg2, ...: Optional arguments to be passed to the function.</li></ul><p>Let’s look at an example to better understand the bind() function:</p><pre>const person = {<br>  name: &#39;Peter&#39;,<br>  greet: function() {<br>    console.log(`Hello, my name is ${this.name}`);<br>  }<br>};<br><br>const greet = person.greet.bind(person);<br>greet(); // Output: Hello, my name is Peter</pre><p>In this example, we created an object person with a greet() method that logs a message to the console. We then used the bind() function to create a new function greet that has its context set to the person object. When we call greet(), it outputs the expected message.</p><p>Another use case for the bind() function is when you want to pass arguments to a function. Let&#39;s look at an example:</p><pre>function add(a, b) {<br>  return a + b;<br>}<br><br>const addFive = add.bind(null, 5);<br><br>addFive(3); // Output: 8</pre><p>In this example, we created a function add() that takes two arguments and returns their sum. We used the bind() function to create a new function addFive that always adds 5 to its argument b. When we call addFive(3), it outputs 8.</p><h4>Apply function</h4><p>The apply() function is similar to the bind() function, but instead of creating a new function with a different context, it invokes the function with a specified context and arguments. The syntax for the apply() function is as follows:</p><pre>function.apply(thisArg, [argsArray])</pre><ul><li>thisArg: The value of this to be passed to the function.</li><li>argsArray: An array-like object containing the arguments to be passed to the function.</li></ul><p>Let’s look at an example to better understand the apply() function:</p><pre>const person = {<br>  name: &#39;Peter&#39;,<br>  greet: function(greeting) {<br>    console.log(`${greeting}, my name is ${this.name}`);<br>  }<br>};<br><br>person.greet.apply({ name: &#39;Jess&#39; }, [&#39;Hey&#39;]);<br>// Output: Hey, my name is Jess</pre><p>In this example, we created an object person with a method named greet() hat takes a greeting argument and logs a message to the console. We then used the apply() function to invoke the greet() method with a different context and argument. When we call the apply method, it outputs the expected message.</p><p>Another use case for the apply() function is when you want to pass an array of arguments to a function. Let&#39;s look at an example:</p><pre>function add(x, y) {<br>  return x + y;<br>}<br><br>add.apply(null, [3, 5]); // Output: 8</pre><p>In this example, we have a function add() that takes two arguments and returns their sum. We then used the apply() function to invoke the add() function with an array of arguments [3, 5]. When we call add.apply(null, [3, 5]), it outputs 8.</p><h4>Conclusion</h4><p>The bind() and apply() functions are powerful tools in JavaScript that allow developers to control the context in which a function is executed. They are commonly used to modify the value of this and pass arguments to a function. With the knowledge of how these functions work and their use cases, developers can write more flexible and reusable code.</p><p>Let’s make a short recap of what we covered in this article:</p><ul><li>The bind() function creates a new function with the same body and scope as the original function, but with a different context.</li><li>The apply() function invokes a function with a specified context and arguments.</li><li>The bind() function is used when you want to create a new function with a different context, while the apply() function is used when you want to invoke a function with a specified context and arguments.</li></ul><p>I hope this article helps you understand how the bind() and apply() functions work and gives you a better understanding of their use cases. Happy coding!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6b5611281b16" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Everything You Need to Know About useEffect’s Cleanup Function in React]]></title>
            <link>https://medium.com/bitsrc/everything-you-need-to-know-about-useeffects-clean-up-function-in-react-dfa6bc75f4f3?source=rss-a8716e71fe3b------2</link>
            <guid isPermaLink="false">https://medium.com/p/dfa6bc75f4f3</guid>
            <category><![CDATA[typescript]]></category>
            <category><![CDATA[reactjs]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Jakub Honíšek]]></dc:creator>
            <pubDate>Mon, 06 Mar 2023 19:15:40 GMT</pubDate>
            <atom:updated>2023-10-01T16:06:12.281Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RycJpiuioPdclWtWfrsEGA.png" /></figure><p>React hooks have become increasingly popular over the last few years, and for a good reason. They simplify code, make it easier to understand and give developers more flexibility in how they write code. However, if you’re new to React hooks, it can be challenging to understand how they work, especially when it comes to useEffect.</p><p>UseEffect is a powerful hook that allows developers to manage side effects in their applications. Side effects can include things like fetching data from an API, setting up event listeners, or even subscribing to a WebSocket. These are all actions that can have an impact on the state of your application, and useEffect ensures that they are managed correctly.</p><h4>When is the cleanup function executed?</h4><p>One of the things that can be confusing about useEffect is its cleanup function. While it’s commonly known that the cleanup function runs when a component unmounts, it’s less commonly known that the cleanup function also runs before each re-render.</p><p>This means that, even though the cleanup function is running in the new render, it still has the old prop values since it was declared in the previous render. For instance, if a component renders multiple times, the previous effect is cleaned up before executing the next effect.</p><h4>When to use the cleanup function?</h4><p>The cleanup function can be used for a variety of purposes. One of the most common is to avoid race conditions in async requests. By using the cleanup function to cancel an active request, you can ensure that your application behaves correctly, even when requests return out of order.</p><pre>import { useState, useEffect } from &quot;react&quot;;<br><br>function App() {<br>  const [data, setData] = useState(null);<br>  const [isLoading, setIsLoading] = useState(false);<br>  const [error, setError] = useState(null);<br><br>  useEffect(() =&gt; {<br>    let isMounted = true;<br><br>    const fetchData = async () =&gt; {<br>      setIsLoading(true);<br><br>      try {<br>        const response = await fetch(&quot;https://jsonplaceholder.typicode.com/posts/1&quot;);<br>        const jsonData = await response.json();<br><br>        if (isMounted) {<br>          setData(jsonData);<br>          setError(null);<br>        }<br>      } catch (err) {<br>        if (isMounted) {<br>          setData(null);<br>          setError(err.message);<br>        }<br>      }<br><br>      setIsLoading(false);<br>    };<br><br>    fetchData();<br><br>    return () =&gt; {<br>      isMounted = false;<br>    };<br>  }, []);<br><br>  if (isLoading) {<br>    return &lt;p&gt;Loading...&lt;/p&gt;;<br>  }<br><br>  if (error) {<br>    return &lt;p&gt;Error: {error}&lt;/p&gt;;<br>  }<br><br>  return (<br>    &lt;div&gt;<br>      &lt;h1&gt;{data ? data.title : &quot;No data available&quot;}&lt;/h1&gt;<br>      &lt;p&gt;{data ? data.body : &quot;&quot;}&lt;/p&gt;<br>    &lt;/div&gt;<br>  );<br>}<br><br>export default App;</pre><p>Another use case for the cleanup function is to manage subscriptions in your application. For instance, if you’re using a WebSocket to subscribe to real-time data, you’ll need to ensure that you unsubscribe when the component unmounts. This can be done using the cleanup function.</p><p>Lastly, while React doesn’t have a dedicated unmount hook, you can use the cleanup function with an empty dependency array to achieve the same effect. This can be useful for cleaning up any resources your component is using when it unmounts.</p><pre>useEffect(() =&gt; {<br>  const handleWindowResize = () =&gt; {<br>    console.log(&#39;Window resized!&#39;);<br>  };<br><br>  window.addEventListener(&#39;resize&#39;, handleWindowResize);<br><br>  return () =&gt; {<br>    window.removeEventListener(&#39;resize&#39;, handleWindowResize);<br>  };<br>}, []);</pre><p>Overall, while the cleanup function in useEffect may be confusing at first, it’s an essential feature of the hook that can make your code more robust and reliable. By understanding how the cleanup function works and how to use it effectively, you’ll be able to write more performant and maintainable React applications.</p><h4>Build React Apps with reusable components, just like Lego</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*qvIHOsFo-70CRlBV.png" /></figure><p><a href="https://bit.cloud/"><strong>Bit</strong></a><strong>’s open-source tool </strong>help 250,000+ devs to build apps with components.</p><p>Turn any UI, feature, or page into a <strong>reusable component</strong> — and share it across your applications. It’s easier to collaborate and build faster.</p><p><strong>→ </strong><a href="https://bit.dev/"><strong>Learn more</strong></a></p><p>Split apps into components to make app development easier, and enjoy the best experience for the workflows you want:</p><h4>→ <a href="https://blog.bitsrc.io/how-we-build-micro-front-ends-d3eeeac0acfc">Micro-Frontends</a></h4><h4>→ <a href="https://blog.bitsrc.io/how-we-build-our-design-system-15713a1f1833">Design System</a></h4><h4>→ <a href="https://bit.cloud/blog/how-to-reuse-react-components-across-your-projects-l4pz83f4">Code-Sharing and reuse</a></h4><h4>→ <a href="https://www.youtube.com/watch?v=5wxyDLXRho4&amp;t=2041s">Monorepo</a></h4><h4>Learn more</h4><ul><li><a href="https://blog.bitsrc.io/how-we-build-micro-front-ends-d3eeeac0acfc">How We Build Micro Frontends</a></li><li><a href="https://blog.bitsrc.io/how-we-build-our-design-system-15713a1f1833">How we Build a Component Design System</a></li><li><a href="https://bit.dev/blog/how-to-reuse-react-components-across-your-projects-l4pz83f4/">How to reuse React components across your projects</a></li><li><a href="https://blog.bitsrc.io/5-ways-to-build-a-react-monorepo-a294b6c5b0ac">5 Ways to Build a React Monorepo</a></li><li><a href="https://bit.dev/blog/how-to-create-a-composable-react-app-with-bit-l7ejpfhc/">How to Create a Composable React App with Bit</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=dfa6bc75f4f3" width="1" height="1" alt=""><hr><p><a href="https://medium.com/bitsrc/everything-you-need-to-know-about-useeffects-clean-up-function-in-react-dfa6bc75f4f3">Everything You Need to Know About useEffect’s Cleanup Function in React</a> was originally published in <a href="https://medium.com/bitsrc">Bits and Pieces</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>