<?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[mamitech - Medium]]></title>
        <description><![CDATA[Daily Notes of Mamikos Tech Team - Medium]]></description>
        <link>https://medium.com/mamitech?source=rss----dce23f01daac---4</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>mamitech - Medium</title>
            <link>https://medium.com/mamitech?source=rss----dce23f01daac---4</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 17 Nov 2026 20:13:13 GMT</lastBuildDate>
        <atom:link href="https://medium.com/feed/mamitech" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Migrating OpenVPN from Full Tunnel to Split Tunneling: For Reduce Cost]]></title>
            <link>https://medium.com/mamitech/migrating-openvpn-from-full-tunnel-to-split-tunneling-for-reduce-cost-7f56c92f66b6?source=rss----dce23f01daac---4</link>
            <guid isPermaLink="false">https://medium.com/p/7f56c92f66b6</guid>
            <category><![CDATA[cost-optimization]]></category>
            <category><![CDATA[vpn]]></category>
            <dc:creator><![CDATA[amanualt]]></dc:creator>
            <pubDate>Tue, 29 Sep 2026 08:24:19 GMT</pubDate>
            <atom:updated>2026-09-29T08:24:18.550Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*14qRRmVxT6ixerBzCLUkBg.png" /></figure><p>Changing the public IP route to Internet Routing revealed OpenVPN as the main source of bandwidth and cost fluctuations.</p><h3>Background</h3><p>In our infrastructure, OpenVPN is used to connect team laptops to an internal network (172.20.0.0/16) where various internal services run. However, the previous configuration made the VPN server act as the gateway for <strong>all client traffic</strong> including regular browsing to Google, YouTube, or any other site that had nothing to do with the internal network. This drove bandwidth usage on the OpenVPN server up significantly, since there was no way to control individual users’ traffic. We had even installed Dnsmasq to block certain high-bandwidth sites like Netflix, YouTube, and Spotify, but it wasn’t particularly effective at keeping bandwidth in check.</p><p>This pattern is called <strong>full tunnel</strong>, and while it’s secure, it comes with a significant downside: every byte of data a client downloads or uploads regardless of destination rides on the VPN server’s bandwidth. The more clients there are and the heavier their internet usage, the greater the load on the server, and consequently, the higher the associated infrastructure cost.</p><p>This article documents our migration to <strong>split tunneling</strong>, where only traffic that genuinely needs to reach the internal network (which sits in the same VPC as the VPN server) goes through the VPN, while general internet traffic exits directly via the client’s own ISP. Along with this, it covers the unexpected issues that surfaced afterward and how we resolved them.</p><p>The result: the daily cost of internet-bound VPN traffic dropped by <strong>roughly 99.6%</strong> after the migration. Details and the underlying numbers are in the “Cost Impact” section below.</p><h3>Target Topology</h3><pre>                    ┌── Google/Internet (direct, no VPN)<br>Laptop ── en0 ──────┤<br>                    │<br>                    └── ISP<br><br>Laptop ── tun4 ── OpenVPN ── 172.20.0.0/16 (via VPN)</pre><p><strong>Note:</strong> We used the following installer for our OpenVPN setup: <a href="https://github.com/angristan/openvpn-install">https://github.com/angristan/openvpn-install</a></p><h3>Step 1: Disable Redirect Gateway</h3><p>The main cause of full-tunnel behavior in OpenVPN is usually this single line in server.conf:</p><pre>push &quot;redirect-gateway def1 bypass-dhcp&quot;</pre><p>This option forces the client to accept two additional routes from the server: 0.0.0.0/1 and 128.0.0.0/1. Combined, these two routes mathematically cover the <strong>entire IPv4 address space</strong>, and since a /1 prefix is more specific than the default route (/0), the client’s operating system will always prefer these routes forcing all traffic, including traffic to Google, through the VPN tunnel.</p><p>The fix is straightforward: disable that line and push only the routes for the subnets that actually need to go through the VPN:</p><pre>#push &quot;redirect-gateway def1 bypass-dhcp&quot;<br>push &quot;route 172.20.0.0 255.255.0.0&quot;</pre><h3>Pitfall #1: Restarting the Wrong Service</h3><p>After commenting out the redirect-gateway line, the change didn’t take effect immediately the client kept receiving the old push options. The cause turned out to be trivial but easy to overlook: there are two similarly named systemd units.</p><pre>systemctl status openvpn.service</pre><p>This unit turned out to be a dummy (ExecStart=/bin/true), not the process actually running the server. The active OpenVPN process was in fact managed through a systemd template unit:</p><pre>systemctl restart openvpn-server@server</pre><p>We verified this with ps aux | grep openvpn. If the process start time still showed an old date, it meant the restart hadn’t actually taken effect.</p><p><strong>Lesson learned:</strong> always check which process is actually running (ps aux), rather than assuming based on a service name that merely <em>sounds</em> correct.</p><h3>Verifying Split Tunnel Success</h3><p>Here’s the routing table from the laptop <strong>before</strong> the fix, while connected to the VPN:</p><pre>netstat -rn | grep -E &quot;utun4|default&quot;</pre><pre>0/1                10.8.0.1           UGScg               utun4       <br>default            192.168.1.1        UGScg                 en0       <br>10.8/24            10.8.0.2           UGSc                utun4       <br>10.8.0.1           10.8.0.2           UHr                 utun4       <br>128.0/1            10.8.0.1           UGSc                utun4       <br>default            fe80::%utun0       UGcIg               utun0       <br>default            fe80::%utun1       UGcIg               utun1       <br>default            fe80::%utun2       UGcIg               utun2       <br>default            fe80::%utun3       UGcIg               utun3</pre><p>And here’s the routing table <strong>after</strong> the change and service restart:</p><pre>netstat -rn | grep -E &quot;utun4|default&quot;</pre><pre>default            192.168.1.1        UGScg                 en0       <br>10.8/24            10.8.0.2           UGSc                utun4       <br>10.8.0.1           10.8.0.2           UH                  utun4       <br>20.24.12.119/32    10.8.0.1           UGSc                utun4       <br>52.237.91.176/32   10.8.0.1           UGSc                utun4       <br>137.116.142.46/32  10.8.0.1           UGSc                utun4       <br>172.20             10.8.0.1           UGSc                utun4       <br>default            fe80::%utun0       UGcIg               utun0       <br>default            fe80::%utun1       UGcIg               utun1       <br>default            fe80::%utun2       UGcIg               utun2       <br>default            fe80::%utun3       UGcIg               utun3</pre><p>The 0/1 and 128.0/1 routes are gone. Functional tests confirmed the fix:</p><pre>curl ifconfig.me<br># Should return the client&#39;s own public ISP IP, NOT the VPN server&#39;s IP</pre><pre>route -n get 8.8.8.8<br># The gateway should go through the local interface (en0), not utun4</pre><pre>curl -i https://&lt;internal-domain-only-reachable-via-vpn&gt;<br># The internal service should still be reachable through the VPN (HTTP 200)</pre><p>All three tests passed. Internet traffic now goes directly through the ISP, while traffic to 172.20.0.0/16 still goes through the tunnel.</p><h3>Cost Impact: How Much Did We Actually Save?</h3><p>Functional verification is one thing, but the real motivation for this migration was cost. Our cloud billing breaks VPN-related egress down by routing preference, and the <strong>“Routing Preference: Internet”</strong> line item, traffic that exits through the VPN server’s public IP to reach general internet destinations is exactly the category that full-tunnel routing was inflating.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Wnjn5jKnGsjwhkTjUKh3kg.png" /></figure><p>Looking at daily costs for that line item across the migration window:</p><pre>Period                              Days      Total Cost      Daily Average<br>---------------------------------------------------------------------------<br>Before (2026–08–18 → 2026–09–04)    18        $37.27          $2.07/day <br>After  (2026–09–05 → 2026–09–12)    8         $0.073          $0.009/day</pre><p>That’s a <strong>~99.6% reduction</strong> in the daily average cost of this line item. Extrapolated to a full month, the “Internet” routing preference cost drops from roughly <strong>$62/month to under $0.30/month. </strong>The small residual amount comes entirely from the host-route exceptions described in Pitfall #2 below (traffic to services that still whitelist the VPN server’s IP), not from general browsing anymore.</p><h3>Pitfall #2: Services That Whitelist the VPN Server’s IP</h3><p>Split tunneling worked flawlessly for most cases until a new problem surfaced. Some services, such as our internal Metabase instance and Azure Database for PostgreSQL, were accessed via <strong>public IPs</strong> rather than private ones. For example, the domain used by Metabase wasn’t configured through Azure’s private DNS zone; instead, it used a different domain managed on Cloudflare, where the registered IP was the resource’s public IP rather than its private one. As a result, these services suddenly became unreachable, even though everything worked fine back when we were on full tunnel.</p><p>Symptoms:</p><ul><li>Accessing from a <strong>laptop with the VPN active</strong> → timeout</li><li>Accessing <strong>directly from the VPN server</strong> → works normally</li></ul><p>This is a fairly telling pattern. The cause: both services use <strong>IP whitelisting</strong> on their firewalls (Azure Access Restrictions for the App Service, and Azure PostgreSQL firewall rules), and the IP that had been whitelisted was the <strong>VPN server’s public IP</strong> not the client’s. This made sense historically: back when we were on full tunnel, all client traffic exited to the internet under the VPN server’s IP identity. Once split tunneling was enabled, traffic to these public-facing services instead exited via the client’s own ISP, which the destination firewall didn’t recognize and blocked accordingly.</p><h3>Solution: Selective Host Routes per IP</h3><p>Rather than reverting to full tunnel (which would once again burden the server’s bandwidth with all traffic), we chose to add specific <strong>host routes</strong> (<em>/32</em>) for the IPs whose firewalls whitelist the VPN server’s IP:</p><pre>push &quot;route 172.20.0.0 255.255.0.0&quot;<br>push &quot;route &lt;metabase_IP&gt; 255.255.255.255&quot;<br>push &quot;route &lt;postgresql_IP&gt; 255.255.255.255&quot;</pre><p>This way, only traffic destined for those specific IPs is forced through the VPN tunnel (exiting under the server’s IP identity, which the destination firewall already recognizes). All other traffic — to Google, general browsing, and so on—continues to go directly through the client’s ISP.</p><h3>How to Find the IPs That Need Whitelisting</h3><p>The destination IP can be obtained through ordinary DNS resolution no special tools are required:</p><pre>dig +short domain-name.com</pre><p>Alternatively, it can be read from the output of tools like telnet or curl, which by default display the resolved IP before connecting (<em>Trying &lt;ip&gt;…</em>).</p><h3>Important Note: IP Stability</h3><p>This manual host-route approach has one drawback: it depends on the IP being <strong>static</strong>. For resources like an Azure Database for PostgreSQL Flexible Server without a Virtual Network Endpoint enabled, the public IP can potentially change during maintenance, failover, or configuration changes on Azure’s side. When that happens, the old route becomes invalid and needs to be manually updated.</p><p>More durable alternatives for this kind of scenario include:</p><ul><li><strong>Azure Private Endpoints</strong> with VNet integration provide a stable private IP, but require additional network setup on the Azure side.</li><li><strong>DNS-based dynamic routing</strong> (e.g., combining dnsmasq with ipset) routes are automatically updated whenever the domain resolves to a new IP, which suits services whose IPs change frequently.</li></ul><p>For our current needs, we opted for the manual host-route approach, given its implementation simplicity and the small number of affected services.</p><h3>Summary</h3><pre>+------------------------------+------------------------+----------------------------+<br>| Aspect                       | Full Tunnel (Before)   | Split Tunnel (After)       |<br>+------------------------------+------------------------+----------------------------+<br>| General internet traffic     | Through the VPN server | Directly through the.      |<br>|                              |                        |  client&#39;s ISP              |<br>+------------------------------+------------------------+----------------------------+<br>| Traffic to 172.20.0.0/16     | Through the VPN        | Through the VPN            |<br>+------------------------------+------------------------+----------------------------+<br>| Traffic to public services   | Automatically          | Requires a manual          |<br>| whitelisting the server&#39;s IP | through the VPN        | host route                 |<br>+------------------------------+------------------------+----------------------------+<br>| Server bandwidth load        | High (all traffic)     | Low (only internal traffic |<br>|                              |                        | + whitelisted services)    |<br>+------------------------------+------------------------+----------------------------+<br>| General browsing latency     | Higher (extra hop)     | Lower (direct)             |<br>+------------------------------+------------------------+----------------------------+</pre><h3>Conclusion</h3><p>Migrating from full tunnel to split tunneling looks simple in theory just remove a single redirect-gateway line. But in practice it surfaced two hidden issues that only became apparent after implementation: restarting the wrong service target, and an implicit assumption baked into other services that had been relying on the VPN server’s public IP as a form of network “trust.” Both issues are a reminder that even a seemingly small change to network architecture needs to be thoroughly tested against every dependency that might silently rely on the old behavior.</p><p>Despite those bumps along the way, the outcome justified the effort: internet-bound VPN traffic costs dropped by roughly <strong>99.6%</strong>, from an estimated <strong>$62/month down to under $0.30/month</strong> for that line item alone, with internal service access and the handful of IP-whitelisted exceptions remaining fully functional throughout.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7f56c92f66b6" width="1" height="1" alt=""><hr><p><a href="https://medium.com/mamitech/migrating-openvpn-from-full-tunnel-to-split-tunneling-for-reduce-cost-7f56c92f66b6">Migrating OpenVPN from Full Tunnel to Split Tunneling: For Reduce Cost</a> was originally published in <a href="https://medium.com/mamitech">mamitech</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How We Plan Improvements for Our Core Frontend System]]></title>
            <link>https://medium.com/mamitech/how-we-plan-improvements-for-our-core-frontend-system-571227cd52ac?source=rss----dce23f01daac---4</link>
            <guid isPermaLink="false">https://medium.com/p/571227cd52ac</guid>
            <category><![CDATA[planning]]></category>
            <category><![CDATA[productivity]]></category>
            <category><![CDATA[tech]]></category>
            <category><![CDATA[roadmaps]]></category>
            <category><![CDATA[frontend]]></category>
            <dc:creator><![CDATA[Tri Hargianto]]></dc:creator>
            <pubDate>Tue, 21 Oct 2025 07:33:53 GMT</pubDate>
            <atom:updated>2025-10-21T07:33:48.991Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jH1zJbrDbKi6U4Wh0wUb8A.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/photos/a-couple-of-women-standing-in-front-of-a-white-board-KQ3z-IIel2s">Walls.io</a></figcaption></figure><p>At <a href="https://mamikos.com/">Mamikos</a>, we faced a common problem that many growing startups encounter: we were great at shipping features but terrible at maintaining the systems that made those features possible.</p><p>Our build times crept from 2 minutes to 8 minutes. Our test suite became flaky. Our component library turned into a mess of inconsistent patterns.</p><p>Then we realized we needed a <strong>systematic approach</strong> to improving our frontend core infrastructure — not just “let’s refactor when we have time” promises, but real, dedicated planning and execution.</p><p>This isn’t about customer-facing features — it’s about the foundation that makes those features possible.</p><p>Here’s the framework we built:</p><h3>The Four-Step Framework</h3><p>Our process for planning Core Frontend improvements consists of four phases:</p><ol><li><strong>Review the previous roadmap</strong> — Learn from past infrastructure work.</li><li><strong>Gather new ideas</strong> — Collect improvement initiatives from the team.</li><li><strong>Prioritize and create a timeline</strong> — Rank internal improvements strategically.</li><li><strong>Monitor execution</strong> — Track infrastructure improvements consistently.</li></ol><p>Let me break down how this works in practice.</p><h4>Step 1: Review the Previous Roadmap</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NwhepiEXwHvv_KPta5UzuA.png" /><figcaption>Reviewing the past quarter initative session</figcaption></figure><p>Before planning what’s next, we look back at what actually happened last quarter. I learned the hard way that skipping this step means repeating the same mistakes. The goal is to identify successful internal improvements and unfinished initiatives.</p><p>In one quarter, we implemented automated code formatting with Prettier. It seemed small, but it eliminated 90% of code review comments about style. That’s a win worth understanding and repeating.</p><p>Sometimes, infrastructure work gets pushed aside the moment a feature deadline appears. When we find unfinished tasks, we ask ourselves: is it still worth continuing, or have priorities shifted? Sometimes the answer is “no,” and that’s okay.</p><p>Additionally, failures aren’t always bad. Any failures during the quarter should also be reviewed so we can learn from them and avoid repeating them in the future.</p><h4>Step 2: Gather New Ideas</h4><p>After reviewing the past quarter’s initiatives, we collect new ideas for improving our frontend infrastructure, developer experience, and code quality from each team member.</p><p>We set a 15-minute timer for everyone to write down their ideas. To make sure the initiatives aren’t too broad, we defined clear categories that align with company goals:</p><ul><li><strong>Reliability</strong> — Reduce production errors and improve system stability.</li><li><strong>Increase Productivity</strong> — Shorten development cycles and improve workflows.</li><li><strong>Cost Efficiency</strong> — Reduce build times, dependencies, or resource usage.</li><li><strong>AI-Oriented Innovation</strong> — Explore how AI can enhance our engineering process.</li><li><strong>Make Productivity Possible</strong> — Simplify internal tools and automation.</li><li><strong>Performance</strong> — Make the product faster and more responsive.</li></ul><p>We used a simple <a href="https://www.atlassian.com/software/confluence/whiteboards">Confluence Whiteboard</a> page where anyone could submit ideas. No approval needed, no judgment — just write it down.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pxT8N5itvVkmpvSJFoDcSA.png" /><figcaption>Brainstorming idea session</figcaption></figure><p>After everyone shared their ideas, I asked each member:</p><ol><li>Could you explain the idea you wrote?</li><li>What problem does your idea solve?</li><li>What could be the impact if we worked on it?</li></ol><p>Each question was discussed without judgment. If we agreed that some ideas weren’t valid because of low priority or high effort, we simply skipped them.</p><h4>Step 3: Prioritize The Initiative</h4><p>Now comes the hard part: deciding what actually makes it onto the roadmap.</p><p>After a single brainstorming session, we often came up with too many ideas. We couldn’t do them all. We had to make choices — and those choices needed to be strategic, not just based on who complained the loudest.</p><p>We evaluated each initiative across four criteria:</p><ul><li><strong>Lowest Priority</strong>: Low impact, high effort.</li><li><strong>Low Priority</strong>: Low impact, low effort.</li><li><strong>Medium Priority</strong>: High impact, high effort.</li><li><strong>High Priority</strong>: High impact, low effort.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jSMUE99m-yMLdVUu1mLAAQ.png" /></figure><p>We grouped all initiatives based on these criteria. Most of the time, the lowest-priority items weren’t included in the quarterly roadmap, while the high-priority ones became our top focus.</p><h4>Step 4: Progress Monitoring</h4><blockquote>You can plan all you want, but if you don’t monitor execution, plans stay plans.</blockquote><p>Initiatives work has a way of being pushed aside when an urgent feature lands. Then someone from product says, “The CEO wants this feature by Friday,” and suddenly that refactor gets postponed. Again.</p><p>As a Principal Engineer, my job was to protect the initiative time and remove blockers.</p><ul><li><strong>Protected Time</strong>: When someone tried to pull a developer off infrastructure work, I pushed back: “<em>This time is allocated. Let’s find another solution.</em>”</li><li><strong>Communication Support</strong>: When changes affected other teams, I helped communicate the “why” so people understood the value.</li></ul><p>To monitor the initiatives, we had a simple daily check-in — a 15-minute standard meeting:</p><ul><li>What infrastructure work did you do this week?</li><li>Are you blocked on anything?</li><li>Do you need help?</li></ul><p>This wasn’t micromanagement. It was showing that infrastructure work mattered as much as feature work. And when people got stuck, we could help them immediately instead of discovering issues at the end of the quarter.</p><h3>Why This Framework Works</h3><p>After two years of using this approach, I can tell you what made it successful.</p><h4>It legitimizes infrastructure work</h4><p>When infrastructure improvements are planned, estimated, and tracked like features, people stop treating them as optional. They become part of how we work, not something we do “when we have time.”</p><h4>It’s collaborative</h4><p>The best ideas came from everyone, not just senior engineers. That junior developer who struggled through onboarding? She knew exactly what was confusing — and her insights led to great improvements.</p><h4>It’s evidence-based.</h4><p>We stopped guessing and started learning from what actually worked. That quarterly retrospective saved us from repeating the same mistakes.</p><p>Most importantly, it acknowledges that a healthy codebase doesn’t happen by accident — it requires intentional, consistent investment.</p><h3>Key Takeaways</h3><p>If you’re struggling with infrastructure improvements on your team, start with one question:</p><blockquote><em>Are we treating infrastructure work as seriously as feature work?</em></blockquote><p>Here are some things you can try:</p><ul><li><strong>Allocate dedicated time</strong>: Even one day per sprint makes a difference. Protect it.</li><li><strong>Give people a voice</strong>: Create a simple way for developers to propose improvements.</li><li><strong>Prioritize honestly</strong>: Not all technical debt is urgent. Focus on what actually hurts.</li><li><strong>Monitor consistently</strong>: Check in regularly. Show that this work matters.</li></ul><p>You don’t need to implement everything at once. Start small. Maybe next quarter, try allocating just one day per sprint to infrastructure work. See what happens.</p><p>What I learned at <a href="https://mamikos.com/">Mamikos</a> is that healthy codebases aren’t the result of occasional heroic refactors, they’re the result of consistent, intentional investment. Small improvements, done regularly, compound over time.</p><p>Your codebase will thank you. Your team will thank you.</p><p>I hope this framework helps your team as much as it helped ours.</p><p>Thank you for reading 👋</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=571227cd52ac" width="1" height="1" alt=""><hr><p><a href="https://medium.com/mamitech/how-we-plan-improvements-for-our-core-frontend-system-571227cd52ac">How We Plan Improvements for Our Core Frontend System</a> was originally published in <a href="https://medium.com/mamitech">mamitech</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Unpacking Native CSS Nesting]]></title>
            <link>https://medium.com/mamitech/unpacking-native-css-nesting-0bdb94fc3fbe?source=rss----dce23f01daac---4</link>
            <guid isPermaLink="false">https://medium.com/p/0bdb94fc3fbe</guid>
            <category><![CDATA[stylesheets]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[web]]></category>
            <category><![CDATA[css]]></category>
            <category><![CDATA[web-design]]></category>
            <dc:creator><![CDATA[Giga Prakosa Hikmata]]></dc:creator>
            <pubDate>Fri, 21 Jun 2024 03:55:43 GMT</pubDate>
            <atom:updated>2024-06-21T03:55:43.483Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*k-kPTn98TPVKTWKK" /><figcaption>Photo by <a href="https://unsplash.com/@didsss?utm_source=medium&amp;utm_medium=referral">Didssph</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>If you’ve spent any time wrestling with CSS (and let’s be honest, who hasn’t?), you know it can get a bit chaotic. Selectors piling up, rules scattered all over the place, and it’s enough to make any developer crave for a simpler way.</p><p>Well, good news, guys! Our pleas have been heard. We now have <strong>native CSS nesting</strong>. It might sound like a bird’s cozy home, but trust me, it’s way cooler than that.</p><h4><strong>What’s the Big Deal?</strong></h4><p>In the olden days (okay, a few years ago), if you wanted to nest your CSS rules to make them more organized, you had to use a preprocessor like Sass or Less. These tools were great, but they added an extra step to your workflow. You had to compile your code before the browser could understand it.</p><p>Native CSS nesting lets you nest your rules directly in your CSS files, without needing any extra tools. It’s like finally getting that built-in cabinet organizer you’ve always wanted (everything has its place), and it’s so much easier to find what you need.</p><h4><strong>Show Me the Code!</strong></h4><p>Okay, enough talk, let’s see how this works with some examples:</p><p><strong>Basic Nesting:</strong></p><pre>/* Without Nesting */<br>.card { background-color: white; padding: 20px; }<br>.card h2 { font-size: 24px; }<br>.card p { line-height: 1.6; }<br>.card a { color: blue; }<br><br><br>/* With Nesting */<br>.card {<br>  background-color: white;<br>  padding: 20px;<br><br>  h2 { font-size: 24px; }<br>  p { line-height: 1.6; }<br>  a { color: blue; }<br>}</pre><p><strong>Nesting with Pseudo-classes:</strong></p><pre>/* Without Nesting */<br>.btn { /* ...button styles... */ }<br>.btn:hover { background-color: #0056b3; color: white; }<br>.btn:active { box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125); }<br><br><br>/* With Nesting */<br>.btn {<br>  /* ...button styles... */<br><br>  &amp;:hover {<br>    background-color: #0056b3;<br>    color: white;<br>  }<br><br>  &amp;:active {<br>    box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);<br>  }<br>}</pre><p><strong>Nesting with Media Queries:</strong></p><pre>/* Without Nesting */<br>.container { width: 960px; margin: 0 auto; }<br>@media (max-width: 768px) {<br>  .container { width: 100%; padding: 0 15px; }<br>}<br><br><br>/* With Nesting */<br>.container {<br>  width: 960px;<br>  margin: 0 auto;<br><br>  @media (max-width: 768px) {<br>    width: 100%;<br>    padding: 0 15px;<br>  }<br>}</pre><h4><strong>Why You Should Embrace the Nest</strong></h4><ul><li><strong>Readability:</strong> Nesting keeps related styles together, making your code easier to read and understand (and who doesn’t love clean code?).</li><li><strong>Maintainability:</strong> When you need to change something, it’s much simpler to find the relevant rules.</li><li><strong>Less Repetition:</strong> You don’t have to keep typing the same parent selector over and over. (Let’s be honest, we all have better things to do.)</li><li><strong>Efficiency:</strong> Native CSS nesting can even lead to slightly smaller file sizes, as you’re eliminating repetitive selectors.</li></ul><h4><strong>A Few Caveats</strong></h4><ul><li><strong>Browser Support:</strong> Nesting is fairly new, so make sure you check which browsers support it before going all-in. (You can use tools like <a href="https://caniuse.com/">caniuse.com</a> to check compatibility.)</li><li><strong>Over-Nesting:</strong> Don’t go too crazy with nesting. Too many levels can make your code harder to follow. (Find the nesting level that’s “just right” for your project.)</li></ul><h4>Let’s Get Nested!</h4><p>Native CSS nesting is a simple but powerful way to improve the structure and readability of your stylesheets. So, what are you waiting for? Start nesting and see the difference it makes in your workflow.</p><p>Dive into the documentation to explore more about Native CSS Nesting:</p><ul><li><a href="https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_nesting">https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_nesting</a></li><li><a href="https://developer.chrome.com/docs/css-ui/css-nesting">https://developer.chrome.com/docs/css-ui/css-nesting</a></li></ul><p>And hey, if you found this helpful, don’t forget to follow me! I like to share tips, insights, and updates about Software Engineering, especially in the exciting world of web development. Happy styling!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0bdb94fc3fbe" width="1" height="1" alt=""><hr><p><a href="https://medium.com/mamitech/unpacking-native-css-nesting-0bdb94fc3fbe">Unpacking Native CSS Nesting</a> was originally published in <a href="https://medium.com/mamitech">mamitech</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How We Built Our Learning Culture]]></title>
            <link>https://medium.com/mamitech/the-journey-of-our-learning-culture-8837806f18e4?source=rss----dce23f01daac---4</link>
            <guid isPermaLink="false">https://medium.com/p/8837806f18e4</guid>
            <category><![CDATA[team]]></category>
            <category><![CDATA[culture]]></category>
            <category><![CDATA[mamikos]]></category>
            <category><![CDATA[learning]]></category>
            <category><![CDATA[tech]]></category>
            <dc:creator><![CDATA[Arif H Rezaldy]]></dc:creator>
            <pubDate>Fri, 14 Jun 2024 23:19:26 GMT</pubDate>
            <atom:updated>2024-06-15T04:40:16.513Z</atom:updated>
            <content:encoded><![CDATA[<p>In this rapidly evolving tech landscape, continuous learning and adaptability are not just advantageous but also essential needs. At Mamikos, the emphasis on cultivating a robust learning culture within the tech department has been a journey of growth, adaptation, and shared knowledge.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*tW4rBYSev5a2_RZ-" /><figcaption>Photo by <a href="https://unsplash.com/@brett_jordan?utm_source=medium&amp;utm_medium=referral">Brett Jordan</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Here’s an insight into how Mamikos tech team has built and sustained this culture over the years.</p><h4>History and Background</h4><p>Mamikos has always valued learning, a sentiment ingrained in its culture since its inception in 2015. Initially, new developers were provided with <a href="https://laracasts.com/">Laracasts</a> courses to help them get up to speed. The arrival of <a href="https://medium.com/@gilbok">Gilbok Lee</a> as CTO marked a significant shift, allowing each division to select their preferred learning platforms. Backend developers continued with Laracasts, frontend developers opted for <a href="https://www.vuemastery.com/">Vue Mastery</a>, mobile developers chose <a href="https://www.kodeco.com/">Kodeco</a> (previously Raywenderlich), and other teams utilized <a href="https://www.udemy.com/">Udemy</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ztLILy5AI7gskq9O317zgQ.png" /><figcaption>Laracasts website</figcaption></figure><p>From 2019 to 2020, there was a significant push towards automation testing practices, led by the QA team under the guidance of an external expert, <a href="https://www.toptal.com/resume/piyushkumar-patel">Piyush</a>. This initiative highlighted the importance of not only learning itself but also sharing knowledge. As a result, in 2021, “Learn-Improve-Share” became an OKR for the all tech teams. Although this specific OKR was later deprecated, the practice of regular knowledge sharing continued across all tech divisions.</p><h4>Current Learning Culture</h4><p>Today, Mamikos tech department continues to foster a vibrant learning environment through several initiatives:</p><ol><li><strong>Online Courses</strong>: Tailored to each division or technology stack.</li><li><strong>Monthly Sharing Sessions</strong>: Encouraging routine knowledge sharing within and across teams.</li><li><strong>Engineering Mentorship Program</strong>: Launched initially within the frontend division and now expanded across the entire tech department, fostering cross-division learning.</li><li><strong>Mamitech on Medium</strong>: A platform for the team to share insights and contribute to a collective knowledge base.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1023/1*vh_M4UsafJ18zBvMgzQ3YA.jpeg" /><figcaption>Documentation of our very first MamiTechTalk (internal sharing session event)</figcaption></figure><h4>Impact and Results</h4><p>The impact of these learning initiatives is evident in the engineering performance metrics. For example:</p><ul><li><strong>Reduced Bugs Found</strong>: Regression tests now reveal significantly fewer bugs (0–3 compared to 20+ previously).</li><li><strong>Faster Testing</strong>: Web regression testing time has been reduced from several days to just a few hours.</li><li><strong>Smaller App Sizes</strong>: The Android app size decreased from 40 MB to 26 MB, and the iOS app from 115 MB to 55 MB.</li><li><strong>Improved Server Performance</strong>: Average server response times have dropped from 400 ms to 100 ms, and server resource usage has been optimized.</li><li><strong>Better Developer Experience:</strong> Happy developers increase their productivity.</li></ul><h4>Looking Ahead</h4><p>Mamikos is committed to maintaining and enhancing its learning culture. Future plans include:</p><ul><li><strong>Ongoing Programs</strong>: Continuation of existing initiatives.</li><li><strong>Guest Speakers</strong>: Inviting tech leaders from other companies to share their experiences.</li><li><strong>New Initiatives</strong>: Exploring innovative ways to further embed learning and knowledge sharing into the tech department’s DNA.</li></ul><p>This ongoing commitment to learning and development not only helps in keeping up with the fast-changing tech landscape but also ensures that Mamikos remains a dynamic and forward-thinking company. The journey of never-ending learning continues, driven by the passion and dedication of its tech team.</p><blockquote>By maintaining a strong focus on learning and knowledge sharing, Mamikos is not just preparing its tech department for the future but also setting an example of how continuous development can drive success and innovation.</blockquote><p><strong>Join the Conversation on Medium!</strong></p><p>To stay updated on our latest insights and achievements, follow us on Medium at <a href="https://medium.com/mamitech">Mamitech</a>. We regularly post articles that showcase our projects, share our learnings, and engage with the wider tech community.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8837806f18e4" width="1" height="1" alt=""><hr><p><a href="https://medium.com/mamitech/the-journey-of-our-learning-culture-8837806f18e4">How We Built Our Learning Culture</a> was originally published in <a href="https://medium.com/mamitech">mamitech</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Automatic dependency updates using Renovate on Mamikos Self-hosted GitLab]]></title>
            <link>https://medium.com/mamitech/automatic-dependency-updates-using-renovate-on-mamikos-self-hosted-gitlab-42e77f168937?source=rss----dce23f01daac---4</link>
            <guid isPermaLink="false">https://medium.com/p/42e77f168937</guid>
            <category><![CDATA[dependencies]]></category>
            <category><![CDATA[renovate]]></category>
            <category><![CDATA[self-hosted]]></category>
            <category><![CDATA[gitlab]]></category>
            <category><![CDATA[front-end-development]]></category>
            <dc:creator><![CDATA[Roy Margasa]]></dc:creator>
            <pubDate>Wed, 17 Apr 2024 09:18:19 GMT</pubDate>
            <atom:updated>2024-04-17T11:06:40.421Z</atom:updated>
            <content:encoded><![CDATA[<h3>Automatic Dependency Updates Using Renovate on Mamikos Self-hosted GitLab</h3><figure><img alt="Two people renovating a building" src="https://cdn-images-1.medium.com/max/1000/0*ioI-_oAW4EYy5TPl" /><figcaption>Illustration taken from <a href="https://unsplash.com/@thebarlemy">https://unsplash.com/@thebarlemy</a></figcaption></figure><h3>Background</h3><p>Like the other usual frontend tech stacks, Mamikos has a lot of web applications that use Nodejs and their packages. As time goes on, a lot of our Node dependencies have security vulnerabilities and the dreadful of all: deprecated. To avoid these problems, we need to check and update each existing dependency. Without additional tools to automatically update the dependencies, that task will be very manual and will be very time consuming.</p><p>Because Mamikos is using self-hosted Gitlab, the most suitable tool for our needs is <a href="https://docs.renovatebot.com/">Renovate</a> (<a href="https://gitlab.com/dependabot-gitlab/dependabot">Dependabot</a> is still in WIP for Gitlab). Unfortunately, the tutorial for Renovate for self-hosted Gitlab is very rare and a little bit outdated. Therefore, this article was written and hopefully can provide a streamlined guide.</p><p>What are our expectations for implementing Renovate on Mamikos’ repos?</p><ul><li>Check dependencies version automatically and periodically</li><li>Automatically assign MR assignee and reviewer</li><li>Detect and update based on patch, minor, and major version changes</li><li>Give informations if there’s package vulnerability</li><li>Can be limited to only frontend tech stack (or only for package.json)</li></ul><p>The initialization for this Renovate bot is quite puzzling because <a href="https://docs.renovatebot.com/">Renovate’s own documentation</a> is too verbose so it’s very difficult to learn at first and there is an example but with very short explanation on <a href="https://gitlab.com/renovate-bot/renovate-runner">Gitlab’s Renovate runner example</a>.</p><h3>Implementation</h3><p>Based on the result of our research, here are the setup steps that we need to carry out:</p><h4>1. Create a new repo on Gitlab for the Renovate bot</h4><p>Simple enough, create an empty project/repository. This repo will be used to <a href="https://gitlab.com/renovate-bot/renovate-runner/-/tree/main?ref_type=heads#create-a-new-runner-project">run and configure Renovate</a>. Clone this new repo to our local machine.</p><h4>2. Add new CI/CD variables on the Renovate bot repo</h4><p>From our new repository on GitLab, open Settings → CI/CD → Variables menu and add these <a href="https://gitlab.com/renovate-bot/renovate-runner/-/tree/main?ref_type=heads#configure-cicd-variables">3 new variables</a>:</p><ul><li>RENOVATE_TOKEN: The value for this variable can be obtained from GitLab’s User Settings → Access Token menu. It’s advisable that this token should be generated from a specific Gitlab account that will be used for automation and that account must have access to the target repo.</li><li>GITHUB_COM_TOKEN: This token is used so the bot can retrieve the dependency’s changelog. The value can be obtained from Github Settings → Developer Settings → Personal access token menu.</li><li>RENOVATE_EXTRA_FLAGS: Filled with the name of the GitLab project that we want to check. If there’s more than one project, separate the project names with white space.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/753/1*4LM--9a-dgsCwUCHuw0Ljg.png" /><figcaption>An example of project name</figcaption></figure><h4>3. The Renovate Configurations</h4><p>Create a renovate.gitlab-ci.yml on the root directory of the Renovate Bot repo. This file will be used on the Gitlab pipeline setup. Here’s the content of the file:</p><pre>variables:<br>  RENOVATE_BASE_DIR: $CI_PROJECT_DIR/renovate<br>  RENOVATE_ENDPOINT: $CI_API_V4_URL<br>  RENOVATE_PLATFORM: gitlab<br>  RENOVATE_ONBOARDING_CONFIG: &#39;{&quot;$$schema&quot;: &quot;https://docs.renovatebot.com/renovate-schema.json&quot;, &quot;extends&quot;: [&quot;config:recommended&quot;] }&#39;<br>  RENOVATE_OPTIMIZE_FOR_DISABLED: &#39;true&#39;<br>  RENOVATE_REPOSITORY_CACHE: &#39;enabled&#39;<br>  RENOVATE_LOG_FILE: renovate-log.ndjson<br>  RENOVATE_LOG_FILE_LEVEL: debug<br>  CI_RENOVATE_IMAGE: ghcr.io/renovatebot/renovate:37.279.3@sha256:fc6ab8d230170fd405a02aa29f8708d3c5dbb6f543a948671446235b479d0bd3<br><br>.renovate:<br>  cache:<br>    key: ${CI_COMMIT_REF_SLUG}-renovate<br>    paths:<br>      - renovate/cache/renovate/repository/<br>  image: ${CI_RENOVATE_IMAGE}<br>  script:<br>    - renovate $RENOVATE_EXTRA_FLAGS<br><br>renovate:<br>  extends: .renovate<br>  stage: deploy<br>  resource_group: production<br>  rules:<br>    - if: &#39;$CI_PIPELINE_SOURCE == &quot;schedule&quot;&#39;<br>  artifacts:<br>    when: always<br>    expire_in: 1d<br>    paths:<br>      - &#39;$RENOVATE_LOG_FILE&#39;</pre><p>Create a default.json file and fill it with <a href="https://docs.renovatebot.com/config-presets/#shareable-config-presets">the Renovate configuration</a>. For Mamikos&#39; needs, we can break it down into:</p><ul><li>Only develop branch that <a href="https://docs.renovatebot.com/configuration-options/#basebranches">needs to be checked</a> on target repo</li></ul><pre>&quot;baseBranches&quot;: [<br>  &quot;develop&quot;<br>],</pre><ul><li>Only npm and nvm <a href="https://docs.renovatebot.com/configuration-options/#enabledmanagers">need to be checked</a></li></ul><pre>&quot;enabledManagers&quot;: [<br>  &quot;npm&quot;,<br>  &quot;nvm&quot;<br>],</pre><ul><li>Create a “dependencies” <a href="https://docs.renovatebot.com/configuration-options/#labels">label</a> for merge requests created by Renovate</li></ul><pre>&quot;labels&quot;: [<br>  &quot;dependencies&quot;<br>],</pre><ul><li>Auto assign merge request’s <a href="https://docs.renovatebot.com/configuration-options/#assignees">assignee</a> and <a href="https://docs.renovatebot.com/configuration-options/#reviewers">reviewer</a></li></ul><pre>&quot;assignees&quot;: [<br>  &quot;roy&quot;<br>],<br>&quot;reviewers&quot;: [<br>  &quot;tri&quot;<br>],</pre><ul><li>Create merge requests for dependencies that have <a href="https://docs.renovatebot.com/configuration-options/#vulnerabilityalerts">vulnerabilities</a></li></ul><pre>&quot;vulnerabilityAlerts&quot;: {<br>  &quot;labels&quot;: [<br>    &quot;security&quot;<br>  ]<br>},</pre><ul><li>We want to create the merge requests <a href="https://docs.renovatebot.com/configuration-options/#dependencydashboardapproval">manually</a> because we need to check if our application can be built or not if the package is updated</li></ul><pre>&quot;dependencyDashboardApproval&quot;: true,</pre><p>If we combine the previous config, our default.json content will be:</p><pre>{<br>  &quot;$schema&quot;: &quot;https://docs.renovatebot.com/renovate-schema.json&quot;,<br>  &quot;extends&quot;: [<br>    &quot;config:recommended&quot;,<br>    &quot;:dependencyDashboard&quot;<br>  ],<br>  &quot;baseBranches&quot;: [<br>    &quot;develop&quot;<br>  ],<br>  &quot;enabledManagers&quot;: [<br>    &quot;npm&quot;,<br>    &quot;nvm&quot;<br>  ],<br>  &quot;labels&quot;: [<br>    &quot;dependencies&quot;<br>  ],<br>  &quot;assignees&quot;: [<br>    &quot;roy&quot;<br>  ],<br>  &quot;reviewers&quot;: [<br>    &quot;tri&quot;<br>  ],<br>  &quot;vulnerabilityAlerts&quot;: {<br>    &quot;labels&quot;: [<br>      &quot;security&quot;<br>    ]<br>  },<br>  &quot;dependencyDashboardApproval&quot;: true,<br>}</pre><h4>4. Create a .gitlab-ci.yml file</h4><p>.gitlab-ci.yml file is a configuration file that will be used to run the GitLab pipeline. The content of the file will be taken from <a href="https://gitlab.com/renovate-bot/renovate-runner/-/tree/main?ref_type=heads#create-a-gitlab-ci-file">the guide on Gitlab Renovate</a>. The value for the project will be the name of the Renovate bot repo, and the value for the file is the previous step 3.</p><pre>include:<br>    - project: &#39;mamikos/renovate-runner-bot&#39;<br>      file: &#39;/renovate.gitlab-ci.yml&#39;</pre><p>Finally, we have finished our configuration for the Renovate bot repository, we need to create the pipeline scheduler. (If you want to run pipeline without scheduler, you must add new rule in renovate.gitlab-ci.yml file, or the pipeline won’t run at all.)</p><p>Here’s an example of our working pipeline:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/760/1*CLi59aeFuT-EkZj1_mQH6A.png" /><figcaption>SCV good to go, sir.</figcaption></figure><h3>Initializing Renovate on Existing Mamikos’ Projects</h3><p>After the pipeline is triggered, Renovate will make a merge request on our target repository.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/714/1*TOu_8eGMtbR5pjKutbeYFw.png" /><figcaption>Renovate onboarding MR</figcaption></figure><p>The content of this merge request is only a renovate.json file. Because we already created and have a default.json file, we need to edit this renovate.json. We need to add a new .nvmrc file to lock the project’s Node version and let Renovate know what’s the current Node version.</p><p>Using the <a href="https://docs.renovatebot.com/config-presets/#local-presets">local presets</a> reference, the content of renovate.json will be changed from:</p><pre>{<br>  &quot;$schema&quot;: &quot;https://docs.renovatebot.com/renovate-schema.json&quot;,<br>  &quot;extends&quot;: [<br>    &quot;config:recommended&quot;<br>  ]<br>}</pre><p>Into:</p><pre>{<br>  &quot;$schema&quot;: &quot;https://docs.renovatebot.com/renovate-schema.json&quot;,<br>  &quot;extends&quot;: [<br>    &quot;local&gt;mamikos/renovate-runner-bot&quot;<br>  ]<br>}</pre><p>And then, don’t forget to merge the MR.</p><h3>Review the Dependency Dashboard by Renovate Bot</h3><p>On the next triggered scheduled pipeline, Renovate will create an issue with “Dependency Dashboard” as the title.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/701/1*ear8T9T3KU8Z0R52XeVT8w.png" /><figcaption>It’s alive! It’s aliiiiiive!</figcaption></figure><p>As the title suggests, this issue will be our dashboard to decide which package we want to update, which MR(s) that Renovate already generated, and ignored MR or package.</p><p>After we checked the package checkbox that we wanted to update, we needed to wait for the Renovate bot scheduled pipeline to be triggered again.</p><p>After the pipeline is triggered, the Renovate will create an update package MR that we already checked previously:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/698/1*uNPJFl9JlG-ykfR60odnlw.png" /><figcaption>Toasty!</figcaption></figure><p>What is the meaning of the Age, Adoption, Passing, and Confidence label? The explanation for these labels is on <a href="https://docs.renovatebot.com/merge-confidence/#merge-confidence">merge confidence</a> Renovate documentation:</p><ul><li><strong>Age</strong>: The age of the package</li><li><strong>Adoption</strong>: The percentage of this package’s users (within Renovate) who are using this release</li><li><strong>Passing</strong>: The percentage of updates that have passed tests for this package</li><li><strong>Confidence</strong>: The confidence level for this update</li></ul><p>The confidence level is <a href="https://docs.renovatebot.com/merge-confidence/#confidence-levels-and-their-meaning">a result of the Renovate algorithm</a> that can be used as a rough reference if the package is safe to be updated without manual checking.</p><h3>Conclusion</h3><p>Does the Renovate that we have set up meet the expectations that we mentioned in the background section of this article?</p><ul><li>Check dependencies version automatically and periodically ✅<br>Regular checking can be done using the GitLab pipeline scheduler.</li><li>Automatically assign MR assignee and reviewer ✅<br>Using assignees and reviewers. configuration option.</li><li>Detect and update based on patch, minor and major version changes ✅<br>Renovate dashboard has separate checkboxes for minor and major versions. Unfortunately, Renovate can’t separate between patch and minor versions.</li><li>Information if there’s package vulnerability ❓<br>Even though there’s a configuration for vulnerability alerts, so far there’s no MR that’s related to vulnerability.</li><li>Can be limited to only frontend tech stack (or only for package.json) ✅<br>Using enabled managers configuration. For a more comprehensive list, you can check it on the <a href="https://docs.renovatebot.com/modules/manager/#supported-managers">supported </a>managers’ documentation page.</li></ul><p>Even though we already using Renovate, there are 3 things that must be done manually:</p><ul><li>Some dependencies have breaking changes update, so we must do manual checking in our local machine first.</li><li>Can’t detect vulnerability at the sub-dependency level, so we must depend on <a href="https://trivy.dev/">Trivy</a> and resolutions in package.json.</li><li>Auto merge <a href="https://docs.renovatebot.com/configuration-options/#matchconfidence">based on confidence level</a> must use the <a href="https://docs.mend.io/bundle/mend_sast/page/api_token.html">Mend API key</a> and it’s not free.</li></ul><p>There are still many things that can be learned from Renovate, the configuration is so exhaustive. But for the current needs of Mamikos’ front end, it is sufficient for now.</p><p>Hopefully, this article helps those who want to set up Renovate configuration but feel overwhelmed by reading Renovate documentation. Cheers! 🍻</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/612/1*zUJ0PYabHvjrEALHwqefuQ.png" /><figcaption>Mamikos’ Renovate Bot</figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=42e77f168937" width="1" height="1" alt=""><hr><p><a href="https://medium.com/mamitech/automatic-dependency-updates-using-renovate-on-mamikos-self-hosted-gitlab-42e77f168937">Automatic dependency updates using Renovate on Mamikos Self-hosted GitLab</a> was originally published in <a href="https://medium.com/mamitech">mamitech</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[From Tracking to Privacy: A Simple Guide to be Ready for the End of Third-Party Cookies]]></title>
            <link>https://medium.com/mamitech/from-tracking-to-privacy-a-simple-guide-to-be-ready-for-the-end-of-third-party-cookies-b8f030d826ab?source=rss----dce23f01daac---4</link>
            <guid isPermaLink="false">https://medium.com/p/b8f030d826ab</guid>
            <category><![CDATA[frontend-development]]></category>
            <category><![CDATA[cookies]]></category>
            <category><![CDATA[browsers]]></category>
            <category><![CDATA[web]]></category>
            <category><![CDATA[privacy]]></category>
            <dc:creator><![CDATA[Giga Prakosa Hikmata]]></dc:creator>
            <pubDate>Tue, 04 Jul 2023 05:05:15 GMT</pubDate>
            <atom:updated>2023-07-04T05:05:15.836Z</atom:updated>
            <content:encoded><![CDATA[<p>As we enter the second half of 2023, it’s important to be ready for the upcoming changes concerning third-party cookies. These cookies, which have been widely used for tracking across different websites, are now facing significant limitations imposed by popular web browsers. According to the <a href="https://privacysandbox.com/open-web/#the-privacy-sandbox-timeline">Privacy Sandbox’s Timeline</a>, the transition away from third-party cookies will happen gradually, starting around the middle of 2024. Let’s explore practical steps to audit our codebase for third-party cookies and discuss actions we can take to adapt.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VmNwblouFchi0Xd4fSD9uw.jpeg" /><figcaption>AI-generated image using <a href="https://www.bing.com/images/create">bing.com/images/create</a></figcaption></figure><h3>First Things First</h3><p>To effectively prepare for the eventual end of third-party cookies, let’s break it down into several steps:</p><ol><li>Identify first-party and third-party cookies in our code.</li><li>Audit the usage of third-party cookies and assess their impact on our site.</li><li>Explore alternative solutions provided by the Privacy Sandbox project to replace third-party cookies.</li><li>Implement the necessary changes to ensure a seamless transition.</li></ol><h3>Identifying First-Party and Third-Party Cookies</h3><p>Before we proceed, let’s understand the distinction between first-party and third-party cookies within the user’s context.</p><h4>First-Party Cookies</h4><p>First-party cookies are associated with the site that sets them and are used exclusively within that site. To identify first-party cookies in our code, we can look for cookies set without the SameSite attribute or with SameSite set to “Lax” or “Strict.” Here’s an example of a first-party cookie:</p><pre>document.cookie = &quot;cookie-name=value; SameSite=Lax;&quot;;</pre><p>To ensure consistent behavior across browsers, we should set the appropriate SameSite attribute for our first-party cookies. Consider using the following practice:</p><pre>document.cookie = &quot;__Host-cookiename=value; Secure; Path=/; SameSite=Lax;&quot;;</pre><p>Few examples of commonly used first-party cookies:</p><ol><li><strong>Authentication Cookies</strong>: These cookies track whether a user is logged in or not, allowing websites to maintain their session.</li><li><strong>Personalization Cookies</strong>: Cookies are used to remember user preferences and personalize the website experience, such as preferred categories or personalized recommendations.</li><li><strong>Form Auto-fill Cookies</strong>: When users fill out forms on websites, cookies can be used to remember their entered information and make it convenient for future form submissions.</li></ol><h4>Third-Party Cookies</h4><p>Third-party cookies are used in cross-site contexts, such as iframes or subresource requests. To identify third-party cookies in our code, we can search for cookies containing the SameSite=None attribute. Here’s an example of a third-party cookie:</p><pre>document.cookie = &quot;cookie-name=value; SameSite=None; Secure;&quot;;</pre><p>Identifying third-party cookies is crucial as they will require action to ensure they continue to function correctly.</p><p>Few examples of commonly used third-party cookies:</p><ol><li><strong>Advertising Cookies</strong>: These cookies track users’ browsing habits across different websites to show them relevant ads based on their interests.<br>Popular services: Google AdSense, Facebook Pixel</li><li><strong>Social Media Cookies</strong>: These cookies enable social media platforms to provide sharing buttons on our websites, allowing users to easily share content on their social media profiles.<br>Popular services: Facebook Connect, LinkedIn Share</li><li><strong>Analytics Cookies</strong>: These cookies collect data on how users interact with our website, helping us understand our audience.<br>Popular services: Google Analytics, Mixpanel</li></ol><h3>Auditing Third-Party Cookies</h3><p>To prepare for the end of third-party cookies, let’s audit their usage and assess their impact on our site. Here are some steps we can follow:</p><ol><li>Review our codebase and identify all instances where third-party cookies are set or accessed.</li><li>Examine the use cases for which third-party cookies are employed, such as embedded content or personalized content tracking.</li><li>Verify that any third-party cookies we rely on are set with the SameSite=None attribute and the “Secure” flag to adhere to browser policies.</li><li>Test our site with third-party cookies blocked and use browser developer tools to identify any potential issues caused by the absence of third-party cookies.</li></ol><h3>Alternative Solutions: Privacy Sandbox</h3><p>To replace the functionality provided by third-party cookies, the <a href="https://privacysandbox.com/">Privacy Sandbox</a> project offers several alternative APIs. These APIs aim to maintain user privacy while enabling essential use cases. Let’s explore some key alternatives:</p><h4>Partitioned Cookies</h4><p>Partitioned cookies, introduced through the CHIPS (Cookies Having Independent Partitioned State) mechanism, allow third-party cookies to be partitioned by top-level sites. This approach reduces the risk of cross-site data leaks. Consider implementing partitioned cookies if the service is used as a component across multiple sites. Here’s an example of how to set a partitioned cookie:</p><pre>document.cookie = &quot;cookie-name=value; SameSite=None; Secure; Path=/; Partitioned;&quot;;</pre><h4>First-Party Sets</h4><p>First-Party Sets (FPS) enable limited cross-site cookie access by declaring relationships among sites. By declaring our sites as part of a First-Party Set, we can use the Storage Access API (SAA) and the requestStorageAccessFor API to request access to cookies across these sites. Here’s an example of using the requestStorageAccessFor API:</p><pre>if (&#39;storageAccess&#39; in window) {<br>  window.storageAccess.requestStorageAccessForOrigin(&#39;https://mamikos.com&#39;)<br>    .then(() =&gt; {<br>      // Access granted, continue the operations<br>    })<br>    .catch((error) =&gt; {<br>      console.error(&#39;Storage access request failed:&#39;, error);<br>    });<br>}</pre><h4>Other Privacy Sandbox APIs</h4><p>Apart from partitioned cookies and First-Party Sets, the Privacy Sandbox project offers various APIs to address specific use cases. For example, the <a href="https://developer.chrome.com/docs/privacy-sandbox/trust-tokens/">Private State Tokens</a> API helps combat fraud while preserving user privacy. Explore these APIs to find suitable replacements for current use of third-party cookies.</p><h3>Implementing the Necessary Changes</h3><p>Once we’re done with the essential steps above, it’s time to implement the necessary changes. We can follow this step-by-step process:</p><ol><li>Update our code to ensure first-party cookies have the appropriate SameSite attribute (Lax or Strict).</li><li>Replace third-party cookies with alternative solutions such as partitioned cookies or First-Party Sets where applicable.</li><li>Update our code to utilize Privacy Sandbox APIs that align with our use cases.</li><li>Thoroughly test our site after making the changes to identify any issues caused by the removal of third-party cookies.</li></ol><p>Embracing these changes proactively will ensure a smooth transition and help create a more privacy-centric web ecosystem.</p><h3>References</h3><ul><li><a href="https://io.google/2023/program/8303ebff-01bd-4474-8161-fe8c00a4b26f/">Google I/O 2023: Preparing for the end of third-party cookies</a></li><li><a href="https://developer.chrome.com/docs/privacy-sandbox/third-party-cookie-phase-out/">Chrome Developers: Prepare for phasing out third-party cookies</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b8f030d826ab" width="1" height="1" alt=""><hr><p><a href="https://medium.com/mamitech/from-tracking-to-privacy-a-simple-guide-to-be-ready-for-the-end-of-third-party-cookies-b8f030d826ab">From Tracking to Privacy: A Simple Guide to be Ready for the End of Third-Party Cookies</a> was originally published in <a href="https://medium.com/mamitech">mamitech</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Journey to Reduce PHPUnit Running Time]]></title>
            <link>https://medium.com/mamitech/journey-to-reduce-phpunit-running-time-f7744c6fe84d?source=rss----dce23f01daac---4</link>
            <guid isPermaLink="false">https://medium.com/p/f7744c6fe84d</guid>
            <category><![CDATA[parallel-testing]]></category>
            <category><![CDATA[mamikos]]></category>
            <category><![CDATA[php]]></category>
            <category><![CDATA[unittest]]></category>
            <category><![CDATA[phpunit]]></category>
            <dc:creator><![CDATA[Arif H Rezaldy]]></dc:creator>
            <pubDate>Fri, 19 May 2023 10:18:10 GMT</pubDate>
            <atom:updated>2023-05-19T10:18:10.491Z</atom:updated>
            <content:encoded><![CDATA[<p>Unit testing is the process of testing individual components of a software application in isolation. By isolating and testing individual units, such as functions or methods, unit testing allows developers to identify and fix defects early in the development process, ensuring a robust and reliable final product.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RdZB8hkVWdTv9YHQYH79YQ.png" /></figure><p>Creating unit tests is a part of Mamitech development habit, we also set up CI (Continuous Integration) pipeline to run unit test on every new commit pushed to the code repository. As more and more features added, the source code also grows, let alone the number of test cases needed to be executed on unit test pipeline.</p><p>This article will tell about our journey to reduce unit test running time, and we use PHPUnit (Backend) for use case.</p><h3>Parallel Testing</h3><p>Back in around 2020, the number of our PHPUnit test cases already more than 3K. And it run for around 20–30 minutes long. It is unacceptable. Backend developer need to wait for half hour to see the result. If there were failures, the iteration got longer.</p><p>So we try to run unit test using <a href="https://github.com/paratestphp/paratest">ParaTest</a>.</p><blockquote>The objective of ParaTest is to support parallel testing in PHPUnit. Provided you have well-written PHPUnit tests, you can drop paratest in your project and start using it with no additional bootstrap or configurations!</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HFRxd24zsEdVYFM1HFNbIg.jpeg" /><figcaption>Parallel Universe</figcaption></figure><p>But, it turns out not that easy. We found many errors about deadlock.</p><pre>SQLSTATE[40001]: Serialization failure: 1213 Deadlock found when try to get lock; try restarting transaction</pre><p>That’s because we use same database for all paralleled test. Many test cases try to access the same table.</p><p>The solution is simple, actually. We just need to set up different database for each parallel process.</p><p>And it works! By paralleling unit test into 4 processes, our PHPUnit only running for no more than 10 minutes.</p><h3>Utilize PHPUnit Test Suite and Run Them Separately</h3><p>One year later, in 2021, the number of test case doubled and running time also back to 20–30 minutes long, even though we already use ParaTest.</p><p>At that time, we use default PHPUnit Test Suite. It means, we only run it on 1 CI pipeline. Here is what our phpunit.xml looks like:</p><pre>&lt;phpunit&gt;<br>  &lt;testsuites&gt;<br>    &lt;testsuite name=&quot;unittest&quot;&gt;<br>      &lt;directory suffix=&quot;Test.php&quot;&gt;./tests/app&lt;/directory&gt;<br>    &lt;/testsuite&gt;<br>  &lt;/testsuites&gt;<br>&lt;/phpunit&gt;</pre><p>So, let’s separate it into multiple Test Suites.</p><pre>&lt;phpunit&gt;<br>  &lt;testsuites&gt;<br>    &lt;testsuite name=&quot;unittest-1&quot;&gt;<br>      &lt;directory suffix=&quot;Test.php&quot;&gt;./tests/app/FolderA&lt;/directory&gt;<br>      &lt;directory suffix=&quot;Test.php&quot;&gt;./tests/app/FolderB&lt;/directory&gt;<br>    &lt;/testsuite&gt;<br>    &lt;testsuite name=&quot;unittest-2&quot;&gt;<br>      &lt;directory suffix=&quot;Test.php&quot;&gt;./tests/app/FolderC&lt;/directory&gt;<br>      &lt;directory suffix=&quot;Test.php&quot;&gt;./tests/app/FolderD&lt;/directory&gt;<br>    &lt;/testsuite&gt;<br>    &lt;testsuite name=&quot;unittest-3&quot;&gt;<br>        &lt;directory suffix=&quot;Test.php&quot;&gt;./tests/app&lt;/directory&gt;<br>        &lt;exclude&gt;./tests/app/FolderA&lt;/exclude&gt;<br>        &lt;exclude&gt;./tests/app/FolderB&lt;/exclude&gt;<br>        &lt;exclude&gt;./tests/app/FolderC&lt;/exclude&gt;<br>        &lt;exclude&gt;./tests/app/FolderD&lt;/exclude&gt;<br>    &lt;/testsuite&gt;<br>  &lt;/testsuites&gt;<br>&lt;/phpunit&gt;</pre><p>Then, we set up 3 CI pipeline to run each Test Suite simultaneously.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/874/1*CeyvAf7Y4KpXR68S2nTaeA.png" /><figcaption>Running 3 PHPUnit Test Suites simultaneously</figcaption></figure><p>And it works!! Again, we can reduce overall running time into no more than 10 minutes long.</p><p>Now, another 1 year has passed since our last treatment. We have almost 10K test cases now, and overall PHPUnit running time becomes more than 10 minutes. Well, we can split them into more processes and our DevOps team already ensured the <a href="https://medium.com/mamitech/how-we-reduced-our-autoscaling-gitlab-runner-costs-by-58-a461effedd14">Autoscaling gitlab runner</a> using AWS Spot instances, so we can reduce the pipeline running time again and again without big cost increase.</p><p>If you have more idea on how to speed it up, feel free to share your feedback in the comment.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f7744c6fe84d" width="1" height="1" alt=""><hr><p><a href="https://medium.com/mamitech/journey-to-reduce-phpunit-running-time-f7744c6fe84d">Journey to Reduce PHPUnit Running Time</a> was originally published in <a href="https://medium.com/mamitech">mamitech</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Shortest Path to Replace Docker with Podman for “Laravel Sail”]]></title>
            <link>https://medium.com/mamitech/the-shortest-path-to-replace-docker-with-podman-for-laravel-sail-b02d184a1b72?source=rss----dce23f01daac---4</link>
            <guid isPermaLink="false">https://medium.com/p/b02d184a1b72</guid>
            <category><![CDATA[sail]]></category>
            <category><![CDATA[podman]]></category>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[laravel-sail]]></category>
            <dc:creator><![CDATA[Gilbok Lee]]></dc:creator>
            <pubDate>Thu, 16 Mar 2023 04:48:19 GMT</pubDate>
            <atom:updated>2024-03-21T08:34:42.913Z</atom:updated>
            <content:encoded><![CDATA[<p>First of all, this article is written for “Laravel Sail” users. And this idea is valid for both MacOS and Windows, but I will focus on MacOS.</p><p>If you need to use docker on MacOS or Windows for your work in the company, simply you have 2 options. One is to use Docker Desktop by paying a license fee (Team plan starting at $9/user/month), and the other is to use a free alternative.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tYS3nZnkhM_a43frYmy5xQ.png" /><figcaption>An image I created using the MidJourney prompt “A kitten putting one pill on each paw and waiting for me to choose one. The one pill is half-transparent red and the other pill is half transparent blue.”, Cropped.</figcaption></figure><p>If you prefer the second option, you could try <a href="https://podman.io/">podman</a>. The shortest path is here.</p><p>1. (optional) Uninstall Docker Desktop if it is already installed. Don’t forget to delete ~/.docker directory, too.</p><p>2. Install podman and docker-compose</p><pre>brew install podman<br>brew install docker-compose</pre><p>3. Start podman</p><pre>podman machine init<br>podman machine set --rootful<br>podman machine start</pre><p>4. Edit your ~/.bashrc (in my case, ~/.zshrc) to define an alias docker and save it</p><pre># goto alias section and add this<br>docker=podman</pre><p>5. Apply your changes</p><pre>source ~/.zshrc</pre><p>6. Test docker</p><pre>$ docker --version<br>podman version 4.4.2</pre><p>7. Add this config into your .env to avoid “<strong>Docker is not running</strong>” error when you execute sail up</p><pre>SAIL_SKIP_CHECKS=true</pre><p>Done. It’s time to <strong>sail with podman</strong>!</p><p>Now you can try sail up . If you want to rebuild containers, then run sail up --build .</p><h3>Troubleshooting</h3><p><strong>Error “Updates for this repository will not be applied” during “sail up”</strong></p><p>When you experience the error like below:</p><blockquote>#0 19.45 E: Release file for <a href="http://ports.ubuntu.com/ubuntu-ports/dists/jammy-updates/InRelease">http://ports.ubuntu.com/ubuntu-ports/dists/jammy-updates/InRelease</a> is not valid yet (invalid for another 6min 25s). Updates for this repository will not be applied.</blockquote><p>Solution: Restarting podman to fix time-sync.</p><pre>podman machine stop<br>podman machine start<br>sail up</pre><p><strong>Cannot connect to the Docker daemon at unix:///Users/your-username/.local/share/containers/podman/machine/podman-machine-default/podman.sock. Is the docker daemon running?</strong></p><p>You need to edit your shell rc file (for me, it’s ~/.zshrc) to edit path for `DOCKER_HOST`, you can get the valid path when you run `podman machine start`, please use it.</p><pre>export DOCKER_HOST=&#39;unix:///Users/katombo/.local/share/containers/podman/machine/qemu/podman.sock&#39;</pre><p>After update DOCKER_HOST, don’t forget to run source path-to-your shell rc file</p><pre>source ~/.zshrc</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b02d184a1b72" width="1" height="1" alt=""><hr><p><a href="https://medium.com/mamitech/the-shortest-path-to-replace-docker-with-podman-for-laravel-sail-b02d184a1b72">The Shortest Path to Replace Docker with Podman for “Laravel Sail”</a> was originally published in <a href="https://medium.com/mamitech">mamitech</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Deciding the Minimum Browser Versions to be Supported in Mamikos.com]]></title>
            <link>https://medium.com/mamitech/deciding-the-minimum-browser-versions-to-be-supported-in-mamikos-com-e493d2d04caf?source=rss----dce23f01daac---4</link>
            <guid isPermaLink="false">https://medium.com/p/e493d2d04caf</guid>
            <category><![CDATA[mamikos]]></category>
            <category><![CDATA[browser-support]]></category>
            <dc:creator><![CDATA[Tri Hargianto]]></dc:creator>
            <pubDate>Mon, 05 Dec 2022 08:57:59 GMT</pubDate>
            <atom:updated>2022-12-05T08:57:59.742Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wuCPMMdxC1hM0SFXsonEXw.jpeg" /></figure><p>As a Web Developer, one of the biggest challenges is making our web app compatible and working well for as many browsers as possible. Even though for me it’s impossible. Based on Google Analytics data, at least from May to November 2022, there are <strong>180 types of browsers and 4.865 different versions</strong> that have visited our site.</p><p>So, we need a clear strategy about how far we should support the variety of browsers and versions.</p><h3>Problems</h3><p>Not having a clear strategy and which minimum browser versions to be supported causing some problems as a Web Developer:</p><h4>1. Not confident to use new web technology features</h4><p>Until this time, we’re not sure whether it’s safe to use <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Grid_Layout">CSS Grid</a> or not, and we never know the answer. It’s just an example, there are tons of new web technology features out there but we don’t have any confidence to use them because we are afraid our website will be broken on some old browsers.</p><p>Without any data, we can just assume that our website is working well on users’ browsers.</p><h4>2. Providing unnecessary Polyfill</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/709/1*tMKqPm0qSSHij55xodJz3A.png" /><figcaption>Lighthouse tells us that we provide unnecessary Polyfill to modern browsers</figcaption></figure><p>We always think that we need to support old browsers by providing tons of <a href="https://developer.mozilla.org/en-US/docs/Glossary/Polyfill">Polyfill</a> in our Web app, or always transpile our modern code into <a href="https://www.javatpoint.com/es5-vs-es6">ES5</a>.</p><p>Before this research is written, how we provide Polyfill is by monitoring errors from our error monitoring platforms such as <a href="https://sentry.io/">Sentry</a>. If there are some errors reported related to our modern code, then we’ll provide the Polyfill. Sadly, we’re only able to know once our web apps are released to production 😢.</p><h4>3. Wasting our time</h4><p>Forcing our efforts to support legacy browsers without any clear rule or reason can make our development process cumbersome. Let’s say we’re developing a feature and pushing our limit to make sure that our feature is working on Internet Explorer that only has 0.00001% of users. It’ll be a waste of time.</p><h3>Tools</h3><p>To be able to make a good decision based on the problems above, there are some tools I’ll be using in this research.</p><ol><li><a href="https://analytics.google.com/analytics/web/"><strong>Google Analytics</strong></a>: to know how the users behave.</li><li><a href="https://github.com/browserslist/browserslist"><strong>Browserslist</strong></a><strong>:</strong> to see what browsers our potential users use.</li><li><a href="https://caniuse.com/"><strong>Caniuse</strong></a><strong>: </strong>to see what technologies different browsers support.</li></ol><h3>Caniuse’s Global Data</h3><p><a href="https://caniuse.com/">Caniuse</a> has a browser usage database that is used by global users. We can utilize those data to find out how many users are using some types of browsers. To see Caniuse’s data, we need to use another tool, which is <a href="https://github.com/browserslist/browserslist">Browserslist</a>.</p><p>Browserslist has a unique query to get the data. It also has a special keyword called <strong>defaults</strong>, which is a shortcut for &gt; 0.5%, last 2 versions, Firefox ESR, not dead.</p><p>But what it means?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/768/1*13mZEmfM-dUSvMlqLC97hQ.png" /><figcaption>Browserslist defaults query meaning</figcaption></figure><p>To try the query, we can visit <a href="https://browsersl.ist/">https://browsersl.ist</a>, or running browserslists command via Terminal</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KF7Iv6JfF_fl8yqLY2vfEA.png" /><figcaption>Browsers that have more than 0.5% audience worldwide</figcaption></figure><p>Data produced on the Terminal has some unique code names. For example, and_chr is for Android Chrome, and_ff is for Android Firefox, and so on. <a href="https://github.com/browserslist/browserslist#browsers">Click here</a> for the others.</p><h3>Mamikos.com’s Google Analytics Data</h3><p>We’ve gathered 6-month data from Google Analytics.</p><h4>Operating System</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/768/1*xvXPYfY4RjaN-aQL-gOD7g.png" /></figure><p>As you can see, Mobile web users have more than 85% (iOS + Android). This is really an indicator that we need to prioritize building &amp; test our web app to be mobile-first.</p><p>—</p><h4>Browser Vendor</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/768/1*sHoaI7Y_4ljCovUxymKSsw.png" /></figure><p>Google Analytics tracks more browsers than that, but we just put the browsers that at least have more than 0.1% of users. The excluded browsers are <a href="https://www.puffin.com/">Puffin</a>, <a href="https://browser.yandex.com/">YaBrowser</a>, <a href="https://phoenix-browser.com/">Phoenix Browser</a>, etc.</p><p>We also include Internet Explorer in the table to show you that the fact, there are Internet Explorer users who accessed our site, even though only 667 users.</p><p>—</p><h4>Browser Version</h4><p>There are too many browser’ versions tracked by Google Analytics and we can’t show all of them here.</p><p>Fortunately, those data can be exported into a CSV file. After getting the CSV file, we’re able to convert it into a format that is recognized by Browserslist by using <a href="https://github.com/browserslist/browserslist-ga-export">browserslist-ga-export</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YFRRonxZPL876_HaJGGZaA.png" /><figcaption>Browsers that have more than 0.5% audience in our Google Analytics data</figcaption></figure><h3>Discussion</h3><p>We need to combine the data from Google Analytics and global data from Caniuse. Google Analytics can be our source to know users that have visited our site, and global data can be our source to know the global audience that has not visited our site yet.</p><p>So, let’s combine them. We just put the minimum version into the table because features that worked on Chrome version 101 surely worked well on Chrome 107.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/770/1*9Op3lVu7ObZQDN4nIOwl3A.png" /></figure><p>—</p><h4>Deciding minimum percentage query</h4><p>As I’ve explained above, defaults keyword in Browserslist means it’ll show browsers that have at least more than 0.5% users. In the table above, we can see that most of the users using Chrome below version 101 are less than 0.5%.</p><p>But, then a question pops up in my mind. Do we really don’t need to support users that are not included in &gt; 0.5% criteria? To answer, we need to find out how many are them. Google Analytics reports that 0.03% means more than 10K users. That’s quite a lot actually.</p><p>So, let’s try to decrease our criteria from &gt; 0.5% become &gt; 0.01%</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/769/1*-vV-nH_Mg5t9A6UMVqhGpg.png" /><figcaption>0.01% criteria</figcaption></figure><p>Using &gt; 0.01% query, now we know that Chrome 79 is the oldest browser for Chrome Desktop. But actually, this is quite interesting. I’m not quite sure how many percentages are should we use.</p><p>Should we use &gt; 0.01% or &gt; 0.5%? How should we decide it? We always think that the more browsers we support will gain more revenue, right? But again, we need to check the data.</p><p>From what we’ve found, these are the data browser versions that did submit bookings from January to November 2022.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/770/1*ItB_HfSi3P86Z1ViRwxaGg.png" /></figure><p>The oldest browser version that submit bookings is slightly different from 0.01% criteria. But, we think it’s still acceptable to use the 0.01% criteria with some notes:</p><ol><li>We need to manually specify the version for Android Chrome and Android Webview because we think the data is not accurate.</li><li>For iOS Safari, the usage for version 604.* is quite high on Google Analytics. But apparently, <a href="https://github.com/browserslist/browserslist-ga-export">browserslist-ga-export</a> can’t parse iOS Safari 604.* properly (604.* actually <a href="https://en.wikipedia.org/wiki/Safari_version_history#Safari_11">is a WebKit version for iOS Safari 11</a>).</li></ol><p>—</p><h4>Final Browserslist Query</h4><p>Now we got the data, let’s compose the Browserslist query.</p><pre>&gt;= 0.01% in my stats, last 2 version, not dead, ChromeAndroid &gt;= 50, Android &gt;= 60, ios_saf &gt;= 11</pre><p>How we choose the ChromeAndroid and Android minimum version is by manually reading the Google Analytics report. We choose 50 and 60 because they have more than 10.000 users.</p><p>—</p><h4>User Coverage</h4><p>We also can get the total users&#39; coverage by providing --coverage option</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PlA_ya3x7BBCfI04c8Vq2g.png" /><figcaption>User Coverage</figcaption></figure><p>We’re able to get <strong>95.49% user coverage</strong> by using 0.01% criteria and specifying the minimum version for ChromeAndroid and Android Webview.</p><h3>How About the Unsupported Browsers?</h3><p>Based on what we’ve discussed above, there’s one more question left. Let’s say we only support some browsers and the rest are unsupported. How should we handle the unsupported browsers properly?</p><p>There are two approaches that we can implement:</p><ol><li><strong>First approach: </strong>Block the UI, show the unsupported browser message, and make users not able to use the website completely until they update their browsers.</li><li><strong>Second approach: </strong>Warn the users if there is a possibility some features won’t work properly until they update their browsers. They will be still able to use the site though. We surely know that not all users will update their browsers even though they saw the message. This is far better than not telling them that their browsers are outdated. Also, updating the browser is the users’ responsibility and we can’t force them to do that. Other than that, there is still a possibility that the unsupported browsers will be able to use some features on our website.</li></ol><h3>Conclusion</h3><p>Now, we have the data on which browser versions we should prioritize and support. This data unlocks several benefits:</p><ol><li>QA Engineers now have a clear direction on which browser version to be supported, so the website has a chance to be more stable on those targeted browsers.</li><li>We know which web technologies we can use (and shouldn’t use). Improving the development process confidence.</li><li>Reducing development time and effort to support unnecessary browser versions.</li><li>We also can tell the users if their browser is outdated so they have a reason if our website is broken on their end.</li><li>Many more… 😁</li></ol><p>There are a lot of benefits in deciding the minimum browser versions for our site rather than not, and I think that is what you &amp; your team also should do 🙂.</p><p>Thank you for reading 👋</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e493d2d04caf" width="1" height="1" alt=""><hr><p><a href="https://medium.com/mamitech/deciding-the-minimum-browser-versions-to-be-supported-in-mamikos-com-e493d2d04caf">Deciding the Minimum Browser Versions to be Supported in Mamikos.com</a> was originally published in <a href="https://medium.com/mamitech">mamitech</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Using Yarn Link to Develop a Library Locally]]></title>
            <link>https://medium.com/mamitech/using-yarn-link-to-develop-a-library-locally-7939a1ecbd16?source=rss----dce23f01daac---4</link>
            <guid isPermaLink="false">https://medium.com/p/7939a1ecbd16</guid>
            <category><![CDATA[mamikos]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[yarn]]></category>
            <category><![CDATA[npm]]></category>
            <category><![CDATA[frontend]]></category>
            <dc:creator><![CDATA[Ahmad Alfan Fatoni]]></dc:creator>
            <pubDate>Fri, 07 Oct 2022 06:47:56 GMT</pubDate>
            <atom:updated>2022-10-07T06:47:56.406Z</atom:updated>
            <content:encoded><![CDATA[<h3>Using yarn link to develop a library locally</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*NoMC-Z2UhRQp-7UNK89o0w.png" /></figure><h3><strong>Introduction</strong></h3><p>Imagine you are a web developer, and you have your own libraries that are used in your application. Separating specific features as a library package has a lot of advantages.</p><p>For example, let’s say we have a library for chat messages..</p><p>Isolating chat features in a separate project and building it as a library will make it easier to maintain and will be more flexible to use in our app ecosystem.</p><p><strong>But there’s one question..</strong></p><p>When we develop a new feature for that library, how can we make sure that our new feature is integrated well with other projects as expected, without waiting for the package to be published? Since this package needs to be released first then we can integrate it into our main application.</p><p>The answer is pretty simple, we just need to build our package locally!</p><p><strong>What does ‘build locally’ mean?</strong></p><p>Instead of publishing our package, we can utilize yarn link command and run it in the package directory. By doing this, we’ll register our package locally.</p><p>After that, we just need to go to our main application directory and run yarn link &quot;packageName&quot; , this process will create a symlink to our local copy that will be resolved before the copy is installed by yarn.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/612/1*caIwKUjtkjf1QqIXUBjDDw.png" /><figcaption><em>common package import</em></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/612/1*kFUOyODF2L1FTO_AGikKQw.png" /><figcaption>Our app linked to our local version of the library</figcaption></figure><h3><strong>Sample Case</strong></h3><p>Let’s say in Mamikos we have a package library called <strong>Mamichat</strong>.</p><p>In development phase, the package needs to be tested first before we can release it so we don’t break the existing feature and integrate well within our main application.</p><p><strong>How can we do it?</strong></p><p>First, we must register our library to be recognized as the global package locally that will be used in our main project. We can just run yarn link inside this package repository.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JOWiTgPc_PjxBvdAVRndZw.png" /></figure><blockquote>Make sure we build our package with yarn build first, another application will use the build directory as their source.</blockquote><p>After that, we can use this package in our main application, we just need to run yarn link &quot;packageName&quot; in the main app repository.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oZEYpJvoE2p506y-58ZYxQ.png" /></figure><p>Then, we must <em>force re-install</em> all the packages with yarn install --force in our main application.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8HM-xovbdp58X1NbM5dGkQ.png" /></figure><blockquote><strong>WARNING</strong>: if you run yarn, this link might disappear, you’ll need to run yarn link &quot;packageName&quot; again and re-install the package with the above command.</blockquote><p>The defined package will be using local files and ignoring to pull from the package’s server. With this approach, We can integrate and test our library in our main application without any doubt. If there’s any bug, we just need to fix it and <strong>rebuild the package </strong>to get the update. <em>(no need to do </em><em>yarn link process again).</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/900/1*bZBYDMjt33OUQ-ibZYi3HA.jpeg" /></figure><h3><strong>Don’t forget to unlink</strong></h3><p>After the development process and our package are ready to release, don’t forget to unlink the local package from the project. To do this, we can just run yarn unlink &quot;packageName&quot; in our application.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wfoIU1KKdjtJjkEeVxGzyw.png" /></figure><p>And if we want to <em>unregister</em> the package locally, just run yarn unlink inside the package repository.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6Pwm336-rs9UGQ2Vf9Ms7w.png" /></figure><p>This process will <em>invalidate</em> the link status of our package in any other project and will reject local pull when they run yarn install again.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Jcfe-UJ1iB5IkwajfOJwCw.jpeg" /></figure><h3><strong>Conclusion</strong></h3><p>It’s really important to test our library package locally, so we can ensure the integration will not fail with other apps that use it. By using the yarn link command, we can easily achieve a configuration that allows us to test our packages in a local environment, saving time from making for <em>pre-release test</em> <em>versions</em> to check the integration.</p><p>I hope this article will give you some insight. 😉</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7939a1ecbd16" width="1" height="1" alt=""><hr><p><a href="https://medium.com/mamitech/using-yarn-link-to-develop-a-library-locally-7939a1ecbd16">Using Yarn Link to Develop a Library Locally</a> was originally published in <a href="https://medium.com/mamitech">mamitech</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>