<?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 Jonathan on Medium]]></title>
        <description><![CDATA[Stories by Jonathan on Medium]]></description>
        <link>https://medium.com/@johnroze?source=rss-2843945f3200------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>Stories by Jonathan on Medium</title>
            <link>https://medium.com/@johnroze?source=rss-2843945f3200------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 20 Nov 2026 08:29:27 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@johnroze/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[How to avoid and fix FOUC using NextJS and Ant Design.]]></title>
            <link>https://johnroze.medium.com/how-to-avoid-and-fix-fouc-using-nextjs-and-ant-design-088b810b225b?source=rss-2843945f3200------2</link>
            <guid isPermaLink="false">https://medium.com/p/088b810b225b</guid>
            <category><![CDATA[design]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[nextjs]]></category>
            <category><![CDATA[developer]]></category>
            <dc:creator><![CDATA[Jonathan]]></dc:creator>
            <pubDate>Fri, 13 Sep 2024 19:47:51 GMT</pubDate>
            <atom:updated>2024-09-13T19:47:51.858Z</atom:updated>
            <content:encoded><![CDATA[<p>If you’re building a Next.js application with Ant Design and encountering the dreaded Flash of Unstyled Content (FOUC), you’re not alone. This article will guide you through the process of eliminating FOUC and ensuring a smooth, styled loading experience for your users.</p><h3>Understanding FOUC</h3><p>FOUC occurs when a web page loads without styles for a brief moment before applying them. This can create a jarring user experience, especially with component libraries like Ant Design.</p><h4>The Solution: Leveraging Next.js and Ant Design’s CSS-in-JS</h4><p>We’ll use Next.js’s custom _app.tsx and _document.tsx files along with Ant Design’s CSS-in-JS solution to prevent FOUC.</p><h3>Step 1: Install Dependencies</h3><p>First, ensure you have the necessary dependencies:</p><pre>npm install antd @ant-design/cssinjs</pre><h3>Step 2: Configure app.tsx</h3><p>Create or modify your _app.tsx file in the pages directory:</p><pre>import { ConfigProvider } from &#39;antd&#39;;<br>import type { AppProps } from &#39;next/app&#39;<br>import { StyleProvider } from &#39;@ant-design/cssinjs&#39;;<br>import { ThemeConfig } from &#39;antd/es/config-provider/context&#39;;<br><br>// Import your global styles<br>import &#39;../styles/globals.css&#39;<br><br>const myTheme: ThemeConfig = {<br>  token: {<br>    // Your theme customizations<br>    colorPrimary: &#39;#1890ff&#39;,<br>  },<br>  components: {<br>    // Component-specific customizations<br>    Card: {<br>      borderRadiusLG: 0,<br>      colorBorderSecondary: &#39;transparent&#39;,<br>    },<br>  },<br>};<br><br>function MyApp({ Component, pageProps }: AppProps) {<br>  return (<br>    &lt;StyleProvider hashPriority=&quot;high&quot;&gt;<br>      &lt;ConfigProvider theme={myTheme}&gt;<br>        &lt;Component {...pageProps} /&gt;<br>      &lt;/ConfigProvider&gt;<br>    &lt;/StyleProvider&gt;<br>  )<br>}<br><br>export default MyApp</pre><p>This setup wraps your application with Ant Design’s StyleProvider and ConfigProvider, allowing for theme customization and efficient style injection.</p><h3>Step 3: Set Up _document.tsx</h3><p>Create or modify your _document.tsx file in the pages directory:</p><pre>import Document, { Html, Head, Main, NextScript, DocumentContext } from &#39;next/document&#39;;<br>import { createCache, extractStyle, StyleProvider } from &#39;@ant-design/cssinjs&#39;;<br><br>class MyDocument extends Document {<br>  static async getInitialProps(ctx: DocumentContext) {<br>    const cache = createCache();<br>    const originalRenderPage = ctx.renderPage;<br><br>    ctx.renderPage = () =&gt;<br>      originalRenderPage({<br>        enhanceApp: (App) =&gt; (props) =&gt; (<br>          &lt;StyleProvider cache={cache}&gt;<br>            &lt;App {...props} /&gt;<br>          &lt;/StyleProvider&gt;<br>        ),<br>      });<br><br>    const initialProps = await Document.getInitialProps(ctx);<br>    const style = extractStyle(cache, true);<br><br>    return {<br>      ...initialProps,<br>      styles: (<br>        &lt;&gt;<br>          {initialProps.styles}<br>          &lt;style dangerouslySetInnerHTML={{ __html: style }} /&gt;<br>        &lt;/&gt;<br>      ),<br>    };<br>  }<br><br>  render() {<br>    return (<br>      &lt;Html&gt;<br>        &lt;Head /&gt;<br>        &lt;body&gt;<br>          &lt;Main /&gt;<br>          &lt;NextScript /&gt;<br>        &lt;/body&gt;<br>      &lt;/Html&gt;<br>    );<br>  }<br>}<br><br>export default MyDocument;</pre><p>This configuration ensures that Ant Design styles are extracted and injected into the document head, preventing FOUC.</p><h3>Step 4: Use Ant Design Components</h3><p>Now you can use Ant Design components in your pages without worrying about FOUC:</p><pre>import { Button } from &#39;antd&#39;;<br><br>export default function Home() {<br>  return (<br>    &lt;div&gt;<br>      &lt;h1&gt;Welcome to My App&lt;/h1&gt;<br>      &lt;Button type=&quot;primary&quot;&gt;Click me!&lt;/Button&gt;<br>    &lt;/div&gt;<br>  )<br>}</pre><h3>Step 5: Build and Test</h3><p>Run a production build to ensure everything works as expected:</p><pre>npm run build<br>npm start</pre><p>Visit your application in the browser.</p><p>You should now see a smooth loading experience without any unstyled flashes. 🤞🏻</p><p>👋🏻 👋🏻</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=088b810b225b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[AWS — Route 53 — Redirect to another domain (HTTPS)]]></title>
            <link>https://johnroze.medium.com/aws-route-53-redirect-to-another-domain-https-1a3cb944f920?source=rss-2843945f3200------2</link>
            <guid isPermaLink="false">https://medium.com/p/1a3cb944f920</guid>
            <category><![CDATA[https]]></category>
            <category><![CDATA[route-53]]></category>
            <category><![CDATA[aws-certification]]></category>
            <category><![CDATA[cloudfront]]></category>
            <category><![CDATA[aws]]></category>
            <dc:creator><![CDATA[Jonathan]]></dc:creator>
            <pubDate>Fri, 18 Jun 2021 07:24:41 GMT</pubDate>
            <atom:updated>2021-06-18T22:05:17.260Z</atom:updated>
            <content:encoded><![CDATA[<h3>AWS - Route 53 - Redirect to another domain (HTTPS)</h3><p>Want to send your traffic to another domain? A relatively simple procedure in most cases… except in AWS using Route53.</p><p>We will see how to redirect traffic from mywebiste1.com to anotherwebsite.com using Route53.</p><p>You can find a lot of tutorials about this topic, using Amazon S3, but if you want to do this redirection with HTTPS, you may be blocked…</p><p>In order to perform the redirection we will use 3 AWS services</p><ul><li>Route 53</li><li>CloudFront</li><li>Certificate Manager</li></ul><h4>Prerequisites</h4><ul><li>Have a domain configured on Route53</li></ul><p>It’s time to redirect !</p><h3>Step 1</h3><p><em>Certificate Manager</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Q4pvqfXoRWk9WCUkMXZqUw.jpeg" /></figure><p>First step, define the region on “US East (N. Virginia)us-east-1”</p><p>Next, click on “Request a certificate”, select “Request a public certificate” and click on “Request a certificate” again.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Vi3HqPb8bFeTablPtS70tg.png" /></figure><p>Here you have to define the name of the original domain.</p><p>You also can use a wildcard to have a certificate that covers your entire domain (*.mywebsite1.com)</p><p>Then click on Next.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TD23G1Xgz3UyUdZTb_liGA.png" /></figure><p>Here you can choose between validation by DNS or by e-mail, the easiest if you use Route53 is validation by DNS.</p><p>then, just follow the instructions, the process is very simple.</p><h3>Step 2</h3><p><em>CloudFront</em></p><p>Go to the CloudFront service and create a new distribution.</p><p>You will need to change some configurations</p><ul><li><strong>Origin Domain Name</strong></li></ul><p><em>Indicate the url where you want to redirect your visitors<br>In this example, anotherwebsite.com</em></p><ul><li><strong>Viewer Protocol Policy</strong></li></ul><p><em>Set this value to “Redirect HTTP to HTTPS</em></p><ul><li><strong>Alternate Domain Names (CNAMEs)</strong></li></ul><p><em>Here you have to define the domain of origin, in our case “mywebsite1.com”.</em></p><ul><li><strong>SSL Certificate</strong></li></ul><p><em>Select, “Custom SSL Certificate” and choose the certificate created before</em></p><p>And finally, click on “Create distribution”.</p><h3>Step 3 (and the last one…)</h3><p><em>Route53</em></p><p>Now that the whole system is set up, all we need to do is tell Route53 where to send the traffic.</p><p>So, go to Route53 and select your hosted zone.</p><p>and click on “Create a record”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xHA5cgewFsv5qpf4FIm-bw.jpeg" /></figure><ul><li><strong>Record Type</strong></li></ul><p><em>Choose type A</em></p><ul><li><strong>Route traffic To</strong></li></ul><p><em>Enable alias usage, and select “Alias to CloudFront distribution”.</em></p><p><em>Then you can select your CloudFront link.</em></p><p>and… Tadaaaa!</p><p>After a few minutes, you will be able to access your domain and be redirected to your other domain without any worries, and all in HTTPS!</p><p>I hope this little article will help some of you.</p><p>Do not hesitate to ask me questions in comments if it is not clear</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1a3cb944f920" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Noloss, don’t loose your tweaks anymore]]></title>
            <link>https://medium.com/repoleak-info/noloss-don-t-loose-your-tweaks-anymore-12bc5917c6e2?source=rss-2843945f3200------2</link>
            <guid isPermaLink="false">https://medium.com/p/12bc5917c6e2</guid>
            <category><![CDATA[ios]]></category>
            <category><![CDATA[apple]]></category>
            <category><![CDATA[jailbreak]]></category>
            <dc:creator><![CDATA[Jonathan]]></dc:creator>
            <pubDate>Sat, 26 Sep 2015 09:21:58 GMT</pubDate>
            <atom:updated>2015-09-26T09:21:58.403Z</atom:updated>
            <content:encoded><![CDATA[<p><em>A lot of us already noticed there is just a few app to synchronize and save your tweaks ! At Repoleak we have decided to implement this feature and we called it:</em><strong><em>Noloss</em></strong><em>. It’s free and available right now.</em></p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FWHqayRJxzQA%3Ffeature%3Doembed&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DWHqayRJxzQA&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FWHqayRJxzQA%2Fhqdefault.jpg&amp;key=d04bfffea46d4aeda930ec88cc64b87c&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/0fce47b57228d1c75127916a1a1852ff/href">https://medium.com/media/0fce47b57228d1c75127916a1a1852ff/href</a></iframe><p>Since the v1.3, we implemented Noloss, a beautiful tool to synchronizes in the cloud all your iDevices with your Repoleak account. You can get all the tweaks saved on your devices from anywhere.</p><p>Your device is automatically updated and saved (if you accepted to synchronize your device) with the cloud when you start the app.</p><p>With the iOS9 release and the not yet ready jailbreak, with Noloss you are gonna be able to save your tweaks before updating your iOS version and then when the iOS9 jailbreak will be available you are gonna be able to install the tweaks (compatible with iOS 9 of course) back on your devices simply by clicking on “Install”.</p><p>This feature is strongly linked with our other new feature: Context. Then you can see only the tweaks which are compatible with your device (iOS version and device).</p><p>Finally, we are very pleased to announce that Repoleak is now compatible with the iPhone 6 and iPhone 6+ resolutions.</p><p><em>See you soon for more features</em></p><figure><a href="https://twitter.com/Repoleak"><img alt="" src="https://cdn-images-1.medium.com/max/800/1*QzFO2Gzq_rfJas7OV6aFZg.png" /></a></figure><figure><a href="https://www.facebook.com/repoleak"><img alt="" src="https://cdn-images-1.medium.com/max/800/1*uUZkiujb3Z9tlOHqzNI8rw.png" /></a></figure><figure><a href="/service/mailto:contact.repoleak@gmail.com"><img alt="" src="https://cdn-images-1.medium.com/max/800/1*idwkDy4IZqSUl21fhCCh6A.png" /></a></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=12bc5917c6e2" width="1" height="1" alt=""><hr><p><a href="https://medium.com/repoleak-info/noloss-don-t-loose-your-tweaks-anymore-12bc5917c6e2">Noloss, don’t loose your tweaks anymore</a> was originally published in <a href="https://medium.com/repoleak-info">Repoleak Inside</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>