<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Mohamed MOKHTARI on Medium]]></title>
        <description><![CDATA[Stories by Mohamed MOKHTARI on Medium]]></description>
        <link>https://medium.com/@mohamed.mokhtari?source=rss-963b73e92f25------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*sUjpoGzjCTl24GkwhVo3kw.png</url>
            <title>Stories by Mohamed MOKHTARI on Medium</title>
            <link>https://medium.com/@mohamed.mokhtari?source=rss-963b73e92f25------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 18 Nov 2026 21:23:57 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@mohamed.mokhtari/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[AI writes your components. Not your culture.]]></title>
            <link>https://www.designsystemscollective.com/ai-writes-your-components-not-your-culture-d1c8ab68d01f?source=rss-963b73e92f25------2</link>
            <guid isPermaLink="false">https://medium.com/p/d1c8ab68d01f</guid>
            <category><![CDATA[ux-design]]></category>
            <category><![CDATA[design-systems]]></category>
            <category><![CDATA[user-interface]]></category>
            <category><![CDATA[figma]]></category>
            <category><![CDATA[ai]]></category>
            <dc:creator><![CDATA[Mohamed MOKHTARI]]></dc:creator>
            <pubDate>Thu, 12 Nov 2026 17:13:41 GMT</pubDate>
            <atom:updated>2026-11-14T21:42:26.881Z</atom:updated>
            <content:encoded><![CDATA[<h4>AI solved the button problem. Shame it was never the problem. Culture, Quality, Metrics: back to the basics of a design system people actually use.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hEPfQ7NVs9jKb6MY10OLew.png" /></figure><p>Tuesday morning. Lukewarm coffee, Slack blinking. You ask your coding assistant for a button. Four seconds… and there it is. Variants, hover states, ARIA attributes, a unit test thrown in. Clean. Almost too clean.</p><p>Then you scroll up the #design-system channel. Julie, from the payments team, asked a question on Monday: &quot;Do we have a button in the DS? Ours kind of does its own thing.&quot; Fourteen people saw it. Nobody replied. On Thursday, she made the call: &quot;OK. We&#39;ll keep ours.&quot;</p><p>That’s it. That’s the whole story.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PFB95LiN4u-QQPPPiXwRyg.png" /><figcaption>Fig. 01. The component is sorted. The conversation, not so much.</figcaption></figure><p>We’ve never built design systems this fast. And we’ve never struggled this much to keep them alive. The button was never the problem… It wasn’t before AI either. AI just made it impossible to ignore.</p><h3>Where we’re coming from</h3><p>Before we start lecturing anyone, a word about us. We’re not gurus. We’re enthusiasts. More than seven years living inside design systems, and not just one: a large corporate group’s, the French government’s, a legal-tech scale-up’s. Worlds apart… and yet, always the same stories.</p><p>At first, we thought our job was components. We wanted them perfect: the right framework, the leanest bundle, the smartest build. We compared bundle sizes down to the kilobyte… Justifiably proud.</p><p>And yet. Teams kept rebuilding their buttons in their own corner. Not out of spite. They didn’t know ours existed, or they didn’t trust it, or nobody had answered when they asked. We’d built a gorgeous kitchen, and everyone was ordering pizza.</p><p>And it wasn’t some local curse. Corporate, public sector or scale-up: we watched the same movie everywhere.</p><p>That’s when a very simple idea landed: <strong>a design system isn’t a library. It’s an organisation that shares a library.</strong> And you can’t npm install an organisation.</p><h3>The finding: we like you, but…</h3><p>You could think that was just our problem. The <a href="https://report.zeroheight.com/2026">zeroheight Design Systems Report 2026</a>, which surveys practitioners worldwide every year, says otherwise. For the fifth year in a row, <strong>adoption is the number one challenge for design system teams.</strong> Not tech. Not tooling. Adoption.</p><p>The funny part: trust isn’t the issue. 91% of respondents report moderate or high trust in their design system. Only 38% say most teams actually use it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LdIb4uPQeRaXaiW_vLI7zA.png" /><figcaption>Fig. 02. They trust it. They don’t use it. Source: zeroheight, Design Systems Report 2026.</figcaption></figure><p>In other words, people think your design system is great. They’d recommend it to a friend. They just don’t use it.</p><p>Meanwhile, on the resourcing side:</p><ul><li><strong>61%</strong> of design system teams don’t have enough people to meet their goals;</li><li>only <strong>32%</strong> are satisfied with their leadership buy-in, down from 42% the year before;</li><li>just <strong>5%</strong> measure their design system’s ROI.</li></ul><p>None of this gets fixed with a better component.</p><h3>AI, the brilliant intern who copies everything</h3><p>Let’s be honest: AI is great news for design systems. Documentation, migrations, tests, scaffolding… Everything that wore out understaffed teams gets lighter. The practitioners zeroheight surveyed are refreshingly pragmatic about it: excited about automation, sceptical about AI-generated design.</p><p>But AI has one personality trait we tend to forget. It’s like a brilliant intern: fast, tireless… and copying, with great care, everything it finds in the repo. The good and the bad.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mvBtSzl6VtkmIW_avGliUQ.png" /><figcaption>Fig. 03. AI doesn’t fix your foundations. It amplifies them.</figcaption></figure><p>Well-named tokens, up-to-date docs, written conventions? It generates consistent code, first time. Three names for the same green, docs from 2023 and two Modal components fighting a duel? It generates the same debt, three times faster. With great confidence.</p><p>The report quotes Gartner, who puts it their own way: a codified design system is becoming essential to make generative AI work. Loose translation: <strong>AI doesn’t replace your foundations. It depends on them.</strong></p><p>And those foundations haven’t moved. Basic, really. Almost boring.</p><h3>The CQM recipe: three ingredients, no shortcut</h3><p>After hitting enough walls, we sorted what actually worked into three boxes. We called them Culture, Quality, Metrics. CQM, because we needed an acronym and had no branding budget.</p><p>Each pillar answers one simple question:</p><ul><li><strong>Culture</strong>: do teams <em>want</em> to use it?</li><li><strong>Quality</strong>: do they <em>trust</em> it?</li><li><strong>Metrics</strong>: can you <em>prove</em> its value?</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Jb8uQKrJf4Yy-ABeXTwaSQ.png" /><figcaption>Fig. 04. Three ingredients. No shortcut.</figcaption></figure><p>Nothing revolutionary in there. That’s precisely the point.</p><h3>C is for Culture: people first</h3><p>Culture isn’t something you announce at launch, between two slides and a cake. You build it by being there, responsive, transparent. Every day. Especially on the days you don’t feel like it.</p><p>For us, it took four shapes.</p><p><strong>Human.</strong> Dedicated time for questions, and one golden rule: an answer within twenty-four hours. Even if the answer is “we don’t know yet”. Silence is what drives people away. Julie didn’t leave because there was no button. She left because nobody answered.</p><p><strong>Agile.</strong> On-demand releases, feedback folded in fast. When a team reports a bug and sees the fix ship that week, they come back. When they wait for the quarterly release, they fork.</p><p><strong>Transparent.</strong> A public changelog, code reviews open to everyone, and a habit we kept from day one: show your work. Research, prototypes, failed choices. We shared everything with the community: a Slack channel, a weekly sync, GitHub to track decisions. The result: developers from the community started contributing on their own, without anyone asking.</p><p><strong>Passionate.</strong> Clear guidelines, copy-paste-ready examples. Passion isn’t enthusiasm on slides. It’s the example that works first time, at 6 p.m. on a Friday.</p><p>And then there are office hours. Not one more meeting: a slot where you come with your problem and leave with a fix. We tried a few formats; five stuck.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VZecVPrPMBQ8jOWtjQfGKQ.png" /><figcaption>Fig. 05. Culture isn’t announced. It’s scheduled.</figcaption></figure><p>The number that stings: 44% of design system teams say they don’t invest in community building, and only a third run office hours. No AI is going to run your office hours for you… or grab a coffee with the payments team.</p><p><strong>What we got wrong.</strong> For a long time, we confused communication with culture. Newsletters, polished changelogs, big announcements… skimmed at best. Culture really started the day we stopped broadcasting and started answering.</p><h3>Q is for Quality: predictable beats perfect</h3><p>Quality isn’t about being perfect on paper. It’s what makes a team pick you over Tailwind, Material or their homegrown code: they know what to expect from the next release. They can upgrade without praying.</p><p>We lean on four levers, always the same.</p><p><strong>Standards.</strong> Responsive, accessible from the start, fast, with conventions written down in black and white. Not “we’ll see in QA”.</p><p><strong>Automation.</strong> Unit tests, visual regression, accessibility checks, Storybook, CI. Anything a machine can check, a machine should check. Keep the humans for the real questions.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GzXcVDYe-k08zoJKQt444w.png" /><figcaption>Fig. 06. Predictable beats perfect. CI says yes first. Example pipeline, durations are indicative.</figcaption></figure><p><strong>Documentation.</strong> Not just components: governance, how to contribute, the quality charter. What gets decided, who decides, and how to propose.</p><p><strong>Shared foundations.</strong> Design tokens, templates, shared configs. One source of truth, from Figma to code to docs.</p><p>This is where AI changes the game. All that work becomes context for your assistants. Up-to-date docs and well-structured tokens are exactly what a model needs to generate the right code. Yet 60% of teams have no token automation at all… They copy tokens by hand between Figma, code and docs. The brilliant intern copies whatever it finds. Might as well give it something good.</p><p><strong>What we got wrong.</strong> Web Components lock their CSS inside a shadow DOM. On paper, perfect: nothing leaks. In real life, teams couldn’t tweak a single style anymore. We had to add customisation hooks after the fact. Lesson learned: quality is also what users can do with it, not just what the tests check.</p><h3>M is for Metrics: numbers, not opinions</h3><p>Until someone measures, the most convincing person wins the meeting, not the most accurate. And when budgets tighten, “everyone loves the design system” doesn’t weigh much against a dashboard. It weighs nothing, actually.</p><p>We track three families of metrics:</p><ul><li><strong>Adoption</strong>: who uses what, and where? Products on the latest major version, design system components versus homegrown ones in the code, active teams.</li><li><strong>Product</strong>: is it better? UI bugs per release, accessibility issues caught, time to ship a screen.</li><li><strong>Value</strong>: what is it worth? Hours saved per sprint, cost avoided (those hours times the day rate), developer onboarding time.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IWOoiZCsp357xO5DxTaBog.png" /><figcaption>Fig. 07. Three families, three or four numbers. Not fifty.</figcaption></figure><p>You don’t need fifty KPIs. A dashboard that looks like an A380 cockpit leaves everyone wondering where to look. You need three or four, tracked over time, and a story to tell leadership. Because leadership doesn’t read dashboards. It listens to a story with three numbers in it.</p><p>And it’s urgent. Only 5% of teams measure ROI… and the share of practitioners dissatisfied with their leadership buy-in almost doubled in a year.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4Ix8DM1X0Oib2FgbARuCTQ.png" /><figcaption>Fig. 08. Meanwhile, leadership is checking out. Source: zeroheight, Design Systems Report 2026.</figcaption></figure><p>We’re not saying one causes the other. We’re saying a budget is hard to defend without numbers.</p><p><strong>What we got wrong.</strong> We started measuring too late, on the day we had to justify the team. Measuring in a hurry means measuring what’s easy, not what matters. If we did it again, we’d set the first three metrics on the day of the first commit.</p><h3>All three at once, or nothing</h3><p>It’s tempting to pick one pillar and stick with it. We tried, obviously.</p><ul><li>Culture without quality is a friendly design system nobody trusts.</li><li>Quality without culture is a flawless library nobody uses.</li><li>Metrics without the other two is measuring a failure very precisely.</li></ul><p>Everyone knows the vicious circle. No measured ROI, so less buy-in, so fewer people, so less adoption, so even less ROI. Round and round.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qEiQAgLXQUv3GMQr-Cf4uQ.png" /><figcaption>Fig. 09. All three at once, or nothing.</figcaption></figure><p>CQM flips the circle. Culture drives adoption. Quality builds trust. Metrics earn legitimacy. And legitimacy funds what comes next.</p><h3>The limits, because there are some</h3><p>We’re not selling a miracle method. CQM has limits, and we’d rather put them on the table.</p><ul><li><strong>It takes time.</strong> Culture is built over months, not sprints. If you need results for next week’s steering committee, start with metrics: they’re the only ones that show quickly.</li><li><strong>It needs people.</strong> 61% of teams are understaffed. CQM doesn’t create headcount. It helps you prioritise, and make the case for more.</li><li><strong>AI moves fast.</strong> What we write today about coding assistants may be dated in six months. The three pillars have held for seven years. We’re betting they’ll keep holding.</li></ul><h3>Monday morning, three questions</h3><p>You don’t need a reorg to get started. Grab a coffee, a real one, and ask yourself these three questions.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uJx85kMOsXPbtyliu_eJ7A.png" /><figcaption>Fig. 10. Monday, 9 a.m. One coffee. Three questions.</figcaption></figure><ol><li><strong>Culture</strong>: when someone asks a question about the design system, how long do they wait for an answer?</li><li><strong>Quality</strong>: could your next release break a product without anyone noticing before production?</li><li><strong>Metrics</strong>: if leadership asked tomorrow what the design system delivered this year, what would you say?</li></ol><p>If one of those made you wince… you know where to start.</p><p>AI’s got your components covered. Come work on the rest.</p><p>I co-founded FrontLine Coders, which runs a two-day workshop on design system adoption in Paris on 15–16 December 2026 (in French): <a href="https://frontlinecoders.com/formations/session-presentielle/">frontlinecoders.com/formations</a></p><p><em>Thanks to everyone who contributed, tested, complained and answered in the channel over all these years. This piece owes you a lot.</em></p><p><em>Mohamed Mokhtari, co-founder of FrontLine Coders</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d1c8ab68d01f" width="1" height="1" alt=""><hr><p><a href="https://www.designsystemscollective.com/ai-writes-your-components-not-your-culture-d1c8ab68d01f">AI writes your components. Not your culture.</a> was originally published in <a href="https://www.designsystemscollective.com/">Design Systems Collective</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Your design system has a new user. It doesn’t read the docs.]]></title>
            <link>https://medium.com/@mohamed.mokhtari/your-design-system-has-a-new-user-it-doesnt-read-the-docs-6eefc4bfb583?source=rss-963b73e92f25------2</link>
            <guid isPermaLink="false">https://medium.com/p/6eefc4bfb583</guid>
            <category><![CDATA[frontend-development]]></category>
            <category><![CDATA[svelte]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[web-components]]></category>
            <category><![CDATA[design-systems]]></category>
            <dc:creator><![CDATA[Mohamed MOKHTARI]]></dc:creator>
            <pubDate>Wed, 04 Nov 2026 10:07:58 GMT</pubDate>
            <atom:updated>2026-11-04T10:14:16.002Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mn3I5DWvyHWyyKPWCp-Jiw.png" /></figure><p><em>Why I built Ambre, an open-source design system for teams, and for the AI agents that now write half of their UI.</em></p><p>Thursday evening. I ask a coding assistant for a settings form. Ten seconds later it’s there: three fields, a checkbox, a submit button, all using my own components. Clean. It even remembered the amb- prefix.</p><p>One line catches my eye:</p><pre>&lt;amb-checkbox name=&quot;weekly&quot; checked=&quot;false&quot;&gt;Weekly digest&lt;/amb-checkbox&gt;</pre><p>It looks right. It isn’t. In HTML, a boolean attribute is true the moment it exists. checked=&quot;false&quot; means checked. Every user of that form would have been subscribed to a newsletter they never asked for, and the assistant would have sworn it did exactly what I asked.</p><p>Nobody’s fault, really. The assistant did what it always does: it guessed, with great confidence, from what it found.</p><p>That’s the moment I understood that my design system had a new user. A fast one, a tireless one, and one that never reads the documentation.</p><h3>Where I’m coming from</h3><p>A word about me first. I’ve spent the last seven years inside design systems. Six of them on a multi-brand system for a large European retail group, where I built the web components library in Svelte and watched it travel into Vue, Angular, React and mobile apps. Now at an AI-first legal-tech scale-up.</p><p>On paper, my job was components. In reality it was people. Teams didn’t adopt the system because it was well built. They adopted it because somebody answered their questions, because the next release didn’t break their product, because they could see what it was worth. I’ve written about that elsewhere: culture, quality, metrics.</p><p>Then coding agents arrived, and a new kind of consumer started using every design system I know. It doesn’t come to office hours. It doesn’t ask in the Slack channel. It reads whatever is in the repository, fills the gaps with plausible guesses, and ships.</p><p>So I asked a simple question: what would a design system look like if agents were treated as first-class users, alongside people?</p><p>Ambre is my answer.</p><h3>What Ambre is, in one paragraph</h3><p>Ambre is an open-source design system. One library of web components, built with Svelte 5, that work the same in React, Vue, Svelte, Angular and plain HTML. A brand is one file: colour, type, radius, spacing, control size, focus, motion and depth are semantic tokens, and switching the preset restyles every component without touching the markup. Five brands ship in the box, from an enterprise data look to an editorial one. Accessibility is the floor, not a feature: WCAG 2.2 AA, native roles, the APG keyboard patterns, reduced motion, forced colours, and 40 contrast pairs checked in every brand and theme on every build.</p><p>That part is a good design system. The interesting part is what it does for the new user.</p><h3>Three decisions that matter for agents</h3><h4>1. The contract is the source of truth</h4><p>Every component has a contract: its attributes, slots, events with the shape of their data, parts and tokens. Not documentation written after the fact. A file the build reads.</p><p>CI fails when the code drifts from the contract. The TypeScript types and the component manifest are generated from it. The documentation pages are generated from it. And, as we’ll see, so is everything an agent knows about Ambre.</p><p>For humans, this means the docs never lie. For an agent, it means there is exactly one place to look, and that place is always right.</p><h4>2. Events that behave the way people expect</h4><p>This one is less glamorous, but it’s where I learned the most.</p><p>A native change event doesn&#39;t cross a shadow root. Fired by the input inside a web component, it stops at the component&#39;s edge. So a listener on &lt;amb-checkbox&gt; never heard anything. Some controls fired their own custom events, each built by hand, each slightly different.</p><p>Today every Ambre event goes through one helper. It bubbles, it crosses the shadow root, and it carries its data in event.detail. Names follow the platform: change, input, toggle, close. And events report what people did: setting a value from code fires nothing, exactly like native elements, so two-way bindings can&#39;t loop.</p><p>Boring? Absolutely. But an agent writing an event listener needs the platform’s rules to hold. Every exception is a hallucination waiting to happen.</p><h4>3. An MCP server, so agents ask instead of guess</h4><p>This is the heart of it. Ambre ships an MCP server, one command to connect:</p><pre>claude mcp add ambre -- npx -y @ambre-ds/mcp</pre><p>From there, Claude, Cursor, Copilot and others can ask Ambre directly:</p><ul><li><strong>find the right component</strong> for a need, in plain words;</li><li><strong>get its exact API</strong>: attributes, slots, events and their data, keyboard behaviour, minimal markup;</li><li><strong>get complete examples</strong> of real screens to adapt;</li><li><strong>validate the markup they just wrote</strong>, with every problem, its line, and how to fix it.</li></ul><p>Remember the checkbox? Here is what the validator says:</p><pre>2 errors.<br>- Error, line 1, &lt;amb-checkbox&gt;: `checked=&quot;false&quot;` makes it true …<br>- Error, line 1, &lt;amb-checkbox&gt;: &lt;amb-checkbox&gt; has no label …</pre><p>The agent doesn’t need to be smarter. It needs a colleague it can ask, and a reviewer that catches it before a human has to.</p><p>The same checks run as a linter, ambre-lint, on HTML, Svelte, Vue, JSX and Astro templates, and as a GitHub Action that annotates the pull request. And for tools that don&#39;t speak MCP, the whole reference is published as llms.txt.</p><p>All of it is generated from the contracts. One source of truth, for people and for machines.</p><h3>What I got wrong</h3><p><strong>I put the styles in the wrong place.</strong> The first version wrote styles inside each Svelte component. It was quick, and it didn’t scale: no shared layers, no way to enforce rules, hex values creeping in. I moved everything to Sass, organised with ITCSS and named with BEM, compiled into one constructable stylesheet shared by every instance of an element. A token() function is now the only way to read a token, and it fails the build on a name that doesn&#39;t exist. Lesson learned twice: what a human can get wrong, an agent will get wrong faster.</p><p><strong>I trusted events to sort themselves out.</strong> See above. Seven controls were silently swallowing their change event. No test caught it, because every test listened on the inner input. Users would have caught it. Agents would have papered over it with workarounds, three times, in three different styles.</p><p><strong>I thought the docs were enough.</strong> They weren’t, even good ones. An agent doesn’t browse a documentation site. It needs the same knowledge in a shape it can query, and a way to check its own work.</p><h3>The limits, because there are some</h3><p><strong>It’s young.</strong> Ambre is at 0.3. The API will still move, and I’d rather say it than have you discover it.</p><p><strong>It’s one person’s system.</strong> The presets are opinionated, and five brands are not your brand. The preset builder exists for exactly that, but expect to adjust.</p><p><strong>Web components have trade-offs.</strong> Server rendering needs care: customElements doesn&#39;t exist on the server, so you register on the client and render tags and text on the server. Some teams will prefer a framework-native library, and that&#39;s fine.</p><p><strong>MCP is moving fast.</strong> What I write today about agent tooling may age quickly. The principle underneath, one contract feeding people, docs, types and machines, is the part I’m betting on.</p><h3>Try it</h3><pre>npm install @ambre-ds/tokens @ambre-ds/ui</pre><pre>claude mcp add ambre -- npx -y @ambre-ds/mcp</pre><p>Then ask your assistant for a form, and watch it ask Ambre first.</p><ul><li>Code: <a href="https://github.com/mohamedMok/ambre">github.com/mohamedMok/ambre</a></li><li>Documentation and preset builder: <a href="https://mohamedmok-ambre.surge.sh/">mohamedmok-ambre.surge.sh</a></li></ul><p>If you build design systems, I’d love your feedback, especially the critical kind. And if your system already has agents among its users, I’d love to hear how you handle them.</p><p>AI writes the components now. The least we can do is give it a design system it can actually follow.</p><p><em>Mohamed Mokhtari, Design System &amp; Front-end Lead, AI Ambassador at Jus Mundi, creator of Ambre.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6eefc4bfb583" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Accessibility Act Is Not About Compliance. It’s About Dignity.]]></title>
            <link>https://medium.com/@mohamed.mokhtari/the-accessibility-act-is-not-about-compliance-its-about-dignity-0360c947b5d4?source=rss-963b73e92f25------2</link>
            <guid isPermaLink="false">https://medium.com/p/0360c947b5d4</guid>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[digital-transformation]]></category>
            <category><![CDATA[ux-design]]></category>
            <category><![CDATA[inclusive-design]]></category>
            <category><![CDATA[accessibility]]></category>
            <dc:creator><![CDATA[Mohamed MOKHTARI]]></dc:creator>
            <pubDate>Fri, 19 Sep 2025 07:05:29 GMT</pubDate>
            <atom:updated>2025-09-19T07:05:29.912Z</atom:updated>
            <content:encoded><![CDATA[<p>Imagine trying to order groceries online with low vision.<br>The buttons aren’t labeled, the font is tiny, and pop-ups block the checkout screen. What takes most of us five minutes could stretch into forty-five — or end in giving up entirely.</p><p>Or picture attending an online training while hard of hearing.<br> There are no captions, no transcript, and the audio quality is poor. What should have been an equal opportunity to learn feels like being left out of the room.</p><p>These aren’t edge cases. They’re everyday experiences for millions of people.</p><p>That stayed with me. Because when we design without accessibility in mind, we are not just creating friction. We are creating barriers — barriers invisible to some, but painfully obvious to others.</p><p>And that’s what the <strong>European Accessibility Act (EAA)</strong> is here to address.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-fpNR1eWKcc__6S8_SS2Rw.png" /><figcaption>A11y illustration</figcaption></figure><h3>More Than Compliance</h3><p>By June 2025, businesses across Europe must comply with new accessibility requirements in digital products and services.</p><p>But let’s be honest: if we approach this as just another compliance exercise, we miss the deeper point.</p><p>Accessibility isn’t about <em>working more</em>. It’s about <em>working better</em>.</p><ul><li>Better design: simpler, clearer, more consistent.</li><li>Better development: structured, reusable, standards-aligned.</li><li>Better collaboration: not “designing for” people with disabilities, but <em>designing with</em> them.</li></ul><p>It’s not extra work. It’s smarter work.</p><h3>A Cultural Shift</h3><p>Think back to the mobile-first revolution. At first, it seemed like a constraint: smaller screens, new breakpoints, new behaviors to account for. But very quickly, it became the foundation of good design.</p><p>Accessibility is on the same path. What feels like a regulation today will become tomorrow’s baseline for excellence.</p><p>The choice is simple: treat accessibility as a burden — or embrace it as an accelerator of quality, trust, and innovation.</p><h3>My Perspective</h3><p>In my work, I’ve seen two recurring patterns:</p><ol><li><strong>Teams overwhelmed by acronyms</strong> — WCAG, EN 301 549, ARIA — unsure how to translate them into daily practice.</li><li><strong>Leaders who want to do the right thing</strong>, but worry it means slowing down, adding cost, or complicating processes.</li></ol><p>The truth is different. When done right, accessibility streamlines. It forces us to focus on essentials: clarity, consistency, empathy.</p><p>It’s not an afterthought. It’s a philosophy of design — one that benefits everyone.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zf3XT6MwmhicKd1oBDfTKw.png" /><figcaption>EAA — Compliance illustration</figcaption></figure><h3>A Guide, and a Partnership</h3><p>That’s why I created a whitepaper on the EAA. Not as a checklist, but as a <strong>guide and a compass</strong>.</p><ul><li>It translates legal text into human terms.</li><li>It maps standards to real-world use cases.</li><li>It offers a framework for teams to embed accessibility into workflows — from design systems to CI/CD pipelines.</li></ul><p>But the document is just a starting point.</p><p>My work goes further: <strong>I help teams think accessibly, build accessibly, and evolve their platforms to stay compliant</strong>. It’s not about one-time fixes; it’s about creating lasting capability inside organizations.</p><p>Accessibility isn’t a box to tick — it’s a discipline to nurture.</p><p>If you’re curious, you can explore it here: <a href="https://mohamedmok.github.io/eaa-enterprise-playbook-site">EAA Enterprise Playbook</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LXIx-QzFE0n1DQDCMKg2YQ.png" /><figcaption>Screenshot of EAA Entreprise Playbook</figcaption></figure><h3>Building With, Not For</h3><p>The future of accessibility isn’t “us” building for “them.”<br> It’s about building <strong>with people who experience the world differently</strong> — through co-design, co-testing, and continuous feedback loops.</p><p>When we do this, something shifts:</p><ul><li>Accessibility stops being a regulation to follow.</li><li>It becomes an <strong>engine of innovation</strong> — a way to uncover friction points that make products better for everyone.</li><li>It builds empathy into code, into design, into strategy.</li></ul><p>This approach changes teams, too. Designers learn to question assumptions. Developers learn to spot barriers before they exist. Leaders discover that inclusivity is not a limitation but a <strong>competitive edge</strong>.</p><p>In the end, accessibility isn’t charity, and it isn’t compliance theater.<br> It’s the blueprint for building digital experiences that last.</p><h3>The Road Ahead</h3><p>June 2025 is not the end. It’s the beginning of a cultural transformation.</p><p>Accessibility is not a box to tick. It’s a mindset to adopt. It’s the chance to build technology that is more human, more resilient, more inclusive.</p><p>Not because the law says so.<br>But because dignity demands it.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0360c947b5d4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Choosing the Right Rendering Strategy for Your Business: SSR, CSR, or Hybrid?]]></title>
            <link>https://medium.com/@mohamed.mokhtari/choosing-the-right-rendering-strategy-for-your-business-ssr-csr-or-hybrid-27ab98cecca7?source=rss-963b73e92f25------2</link>
            <guid isPermaLink="false">https://medium.com/p/27ab98cecca7</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[website-development]]></category>
            <category><![CDATA[nextjs]]></category>
            <category><![CDATA[technology]]></category>
            <dc:creator><![CDATA[Mohamed MOKHTARI]]></dc:creator>
            <pubDate>Mon, 25 Nov 2024 09:45:42 GMT</pubDate>
            <atom:updated>2024-11-25T09:45:42.118Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HRpTKb7NQsMYB6l38idA3g.jpeg" /></figure><h3>Introduction: The Critical Role of Rendering Strategies in Modern Web Development</h3><p>Think of Amazon and Netflix. Amazon uses <strong>Server-Side Rendering (SSR)</strong> to ensure fast, SEO-friendly product pages that load instantly and rank high in search results. Where <strong>Client-Side Rendering (CSR)</strong> powers Netflix’s interactive video streaming experience, delivering smooth browsing and watching after the initial load.</p><p>These choices — SSR, CSR, or a hybrid model — aren’t just technical decisions, they directly impact your business. A slow-loading e-commerce site might lose customers before they even see a product, while a slow SaaS app could frustrate users and damage your brand.</p><p>In this guide, I’ll help you choose the right rendering strategy for your project, aligning it with your business goals. Whether it’s SEO, performance, or scalability. The right choice isn’t just about technology, it’s about setting your business up for success</p><h3>1. Understanding the Basics: What Are SSR, CSR, and Hybrid Approaches?</h3><h4>1.1 Server-Side Rendering (SSR)</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1pVy2YOWubNLKMKFjmrJBA.png" /></figure><p><strong>Definition</strong>:<br>In Server-Side Rendering (SSR), the web page is rendered on the server before it’s sent to the browser. This means that when a user requests a page, the server processes the content, creates a fully-rendered HTML page, and then sends it to the browser, which can display the page almost immediately.</p><p><strong>Advantages</strong>:</p><ul><li><strong>SEO-friendly</strong>: Since the content is fully rendered on the server, search engines can crawl the page and index it easily. This is crucial for sites where organic search traffic is important.</li><li><strong>Fast initial load</strong>: The browser receives a fully-formed page, so users see the content almost immediately, which is especially important for mobile users who often experience slower load times.</li></ul><p><strong>Drawbacks</strong>:</p><ul><li><strong>Higher server costs</strong>: Rendering pages on the server requires more processing power, which can increase server costs, especially with high traffic.</li><li><strong>Potential latency for post-render interactions</strong>: After the page is loaded, interactive elements (like buttons or forms) need to be “hydrated” on the client side, which can introduce delays in the user experience.</li></ul><p><strong>Real-world example</strong>:</p><ul><li><strong>E-commerce</strong>: <strong>Amazon</strong> uses SSR to optimize SEO and deliver fast, server-rendered pages that help products show up in search engine results. This reduces load time and improves the overall user experience. The SSR approach helps Amazon ensure product pages are SEO-friendly and ready for instant interaction when users start browsing.</li></ul><p><strong>Code example:</strong></p><p>Here’s a simple SSR setup using Next.js to render product pages.</p><p>Tech Stack:</p><ul><li><strong>Next.js</strong> for SSR</li><li><strong>React</strong> for UI components</li><li><strong>Node.js</strong> for server-side execution</li></ul><p>The getServerSideProps function is executed on the server, fetching product data before the page is sent to the browser, making the page SEO-friendly and fast to load initially.</p><pre>// pages/product/[id].js<br>import React from &#39;react&#39;;<br><br>// Fetch product data server-side<br>export async function getServerSideProps(context) {<br>  const { id } = context.params;<br>  const res = await fetch(`https://api.example.com/products/${id}`);<br>  const product = await res.json();<br><br>  return {<br>    props: { product },<br>  };<br>}<br><br>const ProductPage = ({ product }) =&gt; {<br>  return (<br>    &lt;div&gt;<br>      &lt;h1&gt;{product.name}&lt;/h1&gt;<br>      &lt;p&gt;{product.description}&lt;/p&gt;<br>      &lt;p&gt;Price: ${product.price}&lt;/p&gt;<br>    &lt;/div&gt;<br>  );<br>};<br><br>export default ProductPage;</pre><h4>1.2 Client-Side Rendering (CSR)</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rac1EnmpF6m7hmWjhZDYpQ.png" /></figure><p><strong>Definition</strong>:<br>Client-Side Rendering (CSR) works by sending a minimal HTML page and JavaScript to the browser. The browser then downloads the JavaScript application and builds the user interface locally. This means that the page itself is mostly empty at first, and the content is dynamically loaded by the client-side code.</p><p><strong>Advantages</strong>:</p><ul><li><strong>Smooth and interactive experience</strong>: Once the application is loaded, CSR provides a seamless, fluid user experience, where interactions like button clicks, form submissions, and dynamic content updates are fast and responsive.</li><li><strong>Lower server load</strong>: Since the rendering happens on the client side, the server’s job is lighter, only sending data and assets rather than fully-rendered HTML. This reduces the load on the server and can be more cost-effective in high-traffic situations.</li></ul><p><strong>Drawbacks</strong>:</p><ul><li><strong>Poor SEO without additional tools</strong>: Since the initial HTML page is largely empty, search engines may struggle to index the content. Without SEO configurations, CSR can hurt search engine visibility.</li><li><strong>Longer initial loading time</strong>: The browser must download and execute JavaScript before it can display the content, which means the first page load can be slower compared to SSR, especially on slower networks or devices.</li></ul><p><strong>Real-world example</strong>:</p><ul><li><strong>SaaS applications</strong>: <strong>Trello</strong> and <strong>Slack</strong> both use CSR to offer rich, interactive user experiences. These apps rely on real-time updates and dynamic interactions, where the user interface responds instantly to changes. CSR allows for faster, more fluid interactions after the initial load, making the experience feel more like a native app than a website.</li></ul><p><strong>Code example:</strong></p><p>Here’s a simple CSR implementation using Vue.js.</p><p>Tech Stack:</p><ul><li><strong>Vue.js</strong> for client-side rendering</li><li><strong>Vue Router</strong> for handling routes</li><li><strong>Express (optional)</strong> for backend API serving product data</li></ul><p>When the page is loaded, Vue.js takes care of rendering the content dynamically by making an API request from the client side. This is ideal for apps that prioritize interactivity and dynamic content.</p><pre>// src/components/ProductPage.vue<br>&lt;template&gt;<br>  &lt;div&gt;<br>    &lt;h1&gt;{{ product.name }}&lt;/h1&gt;<br>    &lt;p&gt;{{ product.description }}&lt;/p&gt;<br>    &lt;p&gt;Price: {{ product.price }}&lt;/p&gt;<br>  &lt;/div&gt;<br>&lt;/template&gt;<br><br>&lt;script&gt;<br>export default {<br>  data() {<br>    return {<br>      product: null,<br>    };<br>  },<br>  mounted() {<br>    // Fetch product data on the client-side<br>    fetch(`/api/products/${this.$route.params.id}`)<br>      .then((response) =&gt; response.json())<br>      .then((data) =&gt; {<br>        this.product = data;<br>      });<br>  },<br>};<br>&lt;/script&gt;</pre><h4>1.3 Hybrid Approaches</h4><p><strong>Definition</strong>:<br>A hybrid approach combines both <strong>Server-Side Rendering (SSR)</strong> and <strong>Client-Side Rendering (CSR)</strong>, using SSR for the initial page load to optimize SEO and performance, and CSR for more interactive, dynamic elements. This allows for a fast, SEO-friendly initial render, while still enabling the rich, interactive experience users expect from modern web apps.</p><p><strong>Advantages</strong>:</p><ul><li><strong>Best of both worlds</strong>: A hybrid approach offers the SEO benefits of SSR for the initial load, ensuring search engines can crawl and index the content. Meanwhile, CSR takes over for interactive elements, enabling a fast, dynamic, and fluid user experience as users interact with the page.</li><li><strong>Tailored solutions</strong>: A hybrid strategy can be customized to suit different parts of the application. For example, a blog or product page might use SSR for SEO optimization, while a dashboard or user profile page could use CSR for dynamic content and interactivity.</li></ul><p><strong>Drawbacks</strong>:</p><ul><li><strong>Increased complexity</strong>: Implementing a hybrid approach requires more sophisticated frameworks like <strong>Next.js</strong> or <strong>Nuxt.js</strong>, which can introduce additional complexity to the development process.</li><li><strong>Higher development cost</strong>: Building and maintaining a hybrid solution typically requires more time, expertise, and resources, as it involves both server-side and client-side logic.</li></ul><p><strong>Real-world example</strong>:</p><ul><li><strong>Content platforms</strong>: <strong>The New York Times</strong> uses a hybrid approach to balance SEO and interactivity. The static content on their pages is server-rendered for SEO, while interactive elements like comments, video players, and dynamic news updates are handled client-side, providing a smooth user experience while still ensuring the page is indexed and discoverable by search engines.</li></ul><p><strong>Code example :</strong></p><p>Here’s an example of a hybrid approach where SSR is used for SEO-friendly content, while CSR handles dynamic content like user reviews.</p><p>Tech Stack:</p><ul><li><strong>Next.js</strong> for Hybrid SSR/CSR rendering</li><li><strong>React</strong> for component-based UI</li><li><strong>Node.js</strong> for backend API handling</li></ul><p>The static content (like the product name and description) is pre-rendered server-side using getServerSideProps, while the dynamic content (reviews) is fetched and displayed on the client side using React&#39;s useEffect.</p><pre>// pages/product/[id].js<br>import React, { useState, useEffect } from &#39;react&#39;;<br><br>// Server-side data fetching for static content (SEO)<br>export async function getServerSideProps(context) {<br>  const { id } = context.params;<br>  const res = await fetch(`https://api.example.com/products/${id}`);<br>  const product = await res.json();<br><br>  return {<br>    props: { product },<br>  };<br>}<br><br>const ProductPage = ({ product }) =&gt; {<br>  const [reviews, setReviews] = useState([]);<br><br>  // Client-side data fetching for dynamic content (reviews)<br>  useEffect(() =&gt; {<br>    fetch(`/api/products/${product.id}/reviews`)<br>      .then((response) =&gt; response.json())<br>      .then((data) =&gt; setReviews(data));<br>  }, [product.id]);<br><br>  return (<br>    &lt;div&gt;<br>      &lt;h1&gt;{product.name}&lt;/h1&gt;<br>      &lt;p&gt;{product.description}&lt;/p&gt;<br>      &lt;p&gt;Price: ${product.price}&lt;/p&gt;<br>      &lt;h2&gt;Reviews&lt;/h2&gt;<br>      &lt;ul&gt;<br>        {reviews.map((review) =&gt; (<br>          &lt;li key={review.id}&gt;{review.comment}&lt;/li&gt;<br>        ))}<br>      &lt;/ul&gt;<br>    &lt;/div&gt;<br>  );<br>};<br><br>export default ProductPage;</pre><h3>2. Project Types and Recommended Strategies</h3><h4>2.1 Marketing Websites and Blogs</h4><p><strong>Needs</strong>:<br>Marketing websites and blogs typically prioritize <strong>SEO</strong> and fast <strong>page load times</strong>. These sites often feature <strong>static content</strong> like articles, landing pages, and product showcases. Since SEO is crucial for driving organic traffic, ensuring that content is easily crawled and indexed by search engines is a top priority.</p><p><strong>Recommendation</strong>:<br>For projects focused on SEO and static content, <strong>Server-Side Rendering (SSR)</strong> or <strong>Static Site Generation (SSG)</strong> are the most effective strategies. SSR ensures fast loading times and SEO-friendly pages, while SSG allows content to be pre-rendered at build time, delivering static HTML pages that are instantly served to users and search engines. Both approaches are highly efficient for marketing websites that don’t rely heavily on dynamic content or user interactions.</p><p><strong>Suggested Technologies</strong>:</p><ul><li><strong>Next.js</strong>: Supports both SSR and SSG, making it a flexible choice for marketing websites and blogs. It allows for static pages with the potential for dynamic content as needed.</li><li><strong>Astro</strong>: A modern framework designed for building fast static websites with a focus on performance and SEO. It allows developers to mix static HTML with JavaScript-driven interactivity.</li><li><strong>Gatsby</strong>: A static site generator that leverages React and GraphQL to create fast, SEO-optimized websites. Gatsby is ideal for content-rich websites like blogs and marketing sites, offering seamless integration with CMSs and data sources.</li></ul><p><strong>Example</strong>:<br>A <strong>personal portfolio site</strong> showcasing a developer’s work, a <strong>design agency landing page</strong>, or even a <strong>design system documentation site</strong> would benefit from SSR or SSG. Design system documentation often involves static content like design principles, component libraries, and usage guidelines, all of which can be pre-rendered to ensure fast load times and easy SEO optimization. A site like <strong>Material-UI</strong> or <strong>Carbon Design System</strong> can leverage SSG to pre-render the documentation pages while providing a seamless, fast experience for users.</p><h4>2.2 E-Commerce Websites</h4><p><strong>Needs</strong>:<br>E-commerce websites require <strong>fast loading times</strong> to maximize <strong>conversion rates</strong>. A slow-loading product page can lead to cart abandonment, so minimizing load times is critical. Additionally, these sites have <strong>dynamic content</strong> — product listings, pricing, and inventory — making it important to efficiently manage and update content in real-time.</p><p><strong>Recommendation</strong>:<br>For e-commerce sites, <strong>Server-Side Rendering (SSR)</strong> with caching or <strong>Incremental Static Regeneration (ISR)</strong> offers a strong solution. SSR ensures fast, SEO-friendly initial page loads, while caching or ISR helps efficiently manage the dynamic content (like product availability) by pre-rendering static parts of the page and updating only the necessary sections. <strong>ISR</strong> allows for pages to be statically generated but re-rendered incrementally on the server as updates occur. This means the content stays fresh without the need for a full site rebuild, making it ideal for e-commerce sites with frequently changing content.</p><p><strong>Suggested Technologies</strong>:</p><ul><li><strong>Next.js</strong>: With support for SSR, ISR, and caching, Next.js is ideal for e-commerce sites that need dynamic content and SEO optimization. The framework allows for efficient content updates and faster load times, which are crucial for e-commerce performance.</li><li><strong>Nuxt.js</strong>: A Vue.js framework that supports SSR and static site generation, Nuxt.js can be a great choice for e-commerce platforms, providing excellent SEO and performance, along with support for dynamic product pages.</li></ul><p><strong>Example</strong>:</p><ul><li><strong>Amazon</strong>, <strong>Zalando</strong>, and <strong>Ikea</strong> are all examples of e-commerce giants using SSR to optimize their sites for fast, dynamic content delivery. These platforms feature real-time product availability, price changes, and personalized recommendations, all delivered with near-instant page loads.</li></ul><h4>2.3 SaaS Applications</h4><p><strong>Needs</strong>:<br>SaaS applications often require <strong>complex interactivity</strong> and a <strong>rich user experience</strong>, with features like real-time updates, user dashboards, and dynamic data. These sites are generally less concerned with SEO since much of their content is behind user logins or depends on user-specific data. The focus is more on providing a smooth, fast, and responsive experience once the application is loaded.</p><p><strong>Recommendation</strong>:<br>For SaaS applications, <strong>Client-Side Rendering (CSR)</strong> is typically the best approach, as it allows for highly interactive and dynamic user interfaces. CSR enables the app to load once and then update the content dynamically without requiring page reloads, providing a fluid, app-like experience. However, for pages that are relevant for SEO, like the homepage, marketing pages, or blog sections, a <strong>hybrid approach</strong> (using SSR for SEO-critical content and CSR for the rest) may be a better choice.</p><p><strong>Suggested Technologies</strong>:</p><ul><li><strong>Vue.js (CSR)</strong>: Vue is a great choice for building SaaS applications that require complex interactivity. Its reactive data-binding and component-based architecture make it easy to create dynamic user interfaces that update in real time. Vue works excellently for CSR, providing a seamless, interactive experience for users.</li><li><strong>Next.js (Hybrid)</strong>: Next.js can be used to build hybrid applications, combining SSR for SEO-friendly pages (like landing pages, blogs, etc.) with CSR for dynamic SaaS features (like dashboards or user settings). This approach ensures fast, SEO-optimized pages alongside a rich user experience for the rest of the application.</li></ul><p><strong>Example</strong>:</p><ul><li><strong>Notion</strong> and <strong>Trello</strong> are both excellent examples of SaaS applications that rely on CSR to deliver a dynamic, interactive experience. These platforms allow users to create, update, and interact with complex data in real-time. For these applications, SEO is not as critical for the main app, as the value lies in the features and user interactions. However, they may still use a hybrid approach with SSR for SEO-relevant marketing pages, ensuring visibility in search engines while still providing dynamic, client-rendered content for the core application.</li></ul><h3>3. Impact on Performance and User Experience</h3><h4>3.1 Core Web Vitals and Their Role in Choosing a Strategy</h4><p><strong>Overview of Key Metrics</strong>:<br>When deciding on the best rendering strategy (SSR, CSR, or Hybrid), it’s essential to consider <strong>Core Web Vitals</strong>, which are a set of metrics that measure the user experience of a website, particularly in terms of <strong>performance</strong> and <strong>interactivity</strong>. These metrics are important because Google uses them as ranking factors in search results.</p><p>Here are the key Core Web Vitals:</p><ul><li><strong>LCP (Largest Contentful Paint)</strong>: Measures the time it takes for the largest piece of content on the page (usually an image or block of text) to load and be visible to the user. A fast LCP (under 2.5 seconds) means the page feels quick to load.</li><li><strong>FID (First Input Delay)</strong>: Measures the time between the first interaction (e.g., clicking a button, typing in a field) and the browser’s response. A low FID (under 100 milliseconds) means the page feels responsive and interactive.</li><li><strong>CLS (Cumulative Layout Shift)</strong>: Measures visual stability. It tracks how much the page’s content shifts around as it loads. A low CLS (under 0.1) means that the content doesn’t jump around while loading, providing a smooth visual experience.</li></ul><h4>How Each Approach Affects These Metrics:</h4><p><strong>Server-Side Rendering (SSR)</strong>:</p><ul><li><strong>LCP</strong>: SSR generally improves <strong>LCP</strong> because the page is fully rendered on the server and sent to the browser as a complete HTML page. This results in a faster initial load, meaning the user sees the page’s main content faster.</li><li><strong>FID</strong>: However, <strong>FID</strong> may suffer in SSR because once the page is loaded, it still requires a process called <strong>hydration</strong>. Hydration is when the client-side JavaScript takes over and adds interactivity to the page. This step can cause delays, making the page feel less responsive at first, even though the content loads quickly.</li><li><strong>CLS</strong>: SSR typically results in a stable layout with minimal shifting since the page is fully rendered on the server.</li></ul><p><strong>Client-Side Rendering (CSR)</strong>:</p><ul><li><strong>LCP</strong>: CSR generally results in <strong>slower LCP</strong> because the browser has to download the JavaScript and build the page’s content dynamically, which takes more time. The page may initially appear blank until the JavaScript has fully loaded and rendered the content.</li><li><strong>FID</strong>: However, CSR performs much better on <strong>FID</strong>. Once the page has loaded and the JavaScript is fully initialized, the page is very responsive to user input, resulting in excellent interactivity and quick responses to clicks, typing, or scrolling.</li><li><strong>CLS</strong>: CSR can potentially suffer from <strong>higher CLS</strong> if not properly optimized because elements of the page may shift or load asynchronously. This can cause layout shifts as the page loads, negatively impacting the user experience.</li></ul><h3>Summary:</h3><p>When choosing between SSR and CSR, consider the following:</p><ul><li><strong>SSR</strong> excels at delivering fast <strong>LCP</strong>, providing a quicker first impression of the page. However, <strong>FID</strong> can be impacted by hydration delays, and there may be minor shifts in content during page load.</li><li><strong>CSR</strong> offers a smoother, more interactive experience after loading, with <strong>excellent FID</strong>. However, it may have slower initial load times (affecting <strong>LCP</strong>) and potential layout shifts (<strong>CLS</strong>) if not optimized properly.</li></ul><p>Understanding these metrics and how they relate to your rendering strategy can help you choose the approach that best fits your project’s goals for performance and user experience.</p><h3>Case Study: How Airbnb Optimizes Performance with a Hybrid Approach</h3><p><strong>Airbnb</strong> is a prime example of a company that uses a <strong>hybrid rendering approach</strong> to optimize performance for both SEO and user experience. They use <strong>Server-Side Rendering (SSR)</strong> for key pages like the homepage, listing pages, and search results, which are critical for SEO and fast initial loads. These pages are pre-rendered on the server to ensure that content is indexed by search engines and users can view the main content quickly.</p><p>However, for the interactive components of the website, such as booking forms, user dashboards, and dynamic filters, <strong>Client-Side Rendering (CSR)</strong> is used. This ensures that the user interface remains highly interactive and responsive once the page has loaded.</p><p>By combining <strong>SSR</strong> and <strong>CSR</strong>, Airbnb achieves:</p><ul><li><strong>Fast load times for SEO-friendly pages</strong>, improving <strong>LCP</strong> and ensuring content is immediately available for search engines.</li><li><strong>Interactive and responsive features</strong> for the user, maintaining <strong>excellent FID</strong> and a seamless experience once the page is loaded.</li><li><strong>A balance between performance and SEO</strong>, making sure both the initial load time and user interactivity are optimized.</li></ul><p>In essence, Airbnb uses a hybrid approach to get the best of both worlds, ensuring both fast loading times and an engaging, responsive experience for users.</p><h3>4. Cost of Development and Maintenance</h3><h4>4.1 Analyzing Direct and Indirect Costs</h4><p>Let’s talk numbers! Choosing the right rendering strategy isn’t just a technical decision — it’s also balancing your budget. Here’s the breakdown of costs for each approach, with some “ballpark figures” to help you visualize the impact.</p><h4>Server-Side Rendering (SSR): High Power, High Costs</h4><p><strong>Direct Costs</strong>:</p><ul><li>Hosting and server expenses can range from <strong>$200–$500/month</strong> for moderate traffic (~1 million page views). Servers do the heavy lifting by generating and delivering pre-rendered HTML.</li><li>Backend development requires experienced developers, often making SSR projects <strong>20–30% more expensive</strong> to build upfront.</li></ul><p><strong>Indirect Costs</strong>:</p><ul><li>Maintenance can be demanding — think regular server updates and ensuring stability during high traffic spikes.</li></ul><p>💡 Great for SEO and fast initial load, but be ready to pay for the speed.</p><h4>Client-Side Rendering (CSR): Lighter on the Server, Heavier on the Frontend</h4><p><strong>Direct Costs</strong>:</p><ul><li>Hosting costs are much lower, typically around <strong>$50–$150/month</strong> for the same traffic, since most rendering happens in the browser.</li><li>Development shifts to frontend optimization, which can extend project timelines by <strong>10–20%</strong> for smooth interactivity and performance tuning.</li></ul><p><strong>Indirect Costs</strong>:</p><ul><li>Poor initial load on slow devices or networks can hurt the user experience, potentially leading to hidden costs like lower engagement or higher churn.</li></ul><p>💡 Cheaper infrastructure, but your frontend team needs to work hard to make it shine.</p><h4>Hybrid Rendering: Pay More Upfront, Save in the Long Run</h4><p><strong>Direct Costs</strong>:</p><ul><li>Hosting costs land between SSR and CSR, around <strong>$100–$300/month</strong>, as some pages are pre-rendered while others rely on CSR.</li><li>Development is more complex, requiring frameworks like Next.js or Nuxt.js, often adding <strong>30–40%</strong> to initial development budgets.</li></ul><p><strong>Indirect Costs</strong>:</p><ul><li>Maintenance is smoother in the long run, with tailored strategies for performance, scalability, and user experience.</li></ul><p>💡 Combines the best of both worlds — but at a premium.</p><h4>4.2 How to Optimize Costs with the Right Tools</h4><p>Smart optimizations can significantly reduce the costs of your rendering strategy while boosting performance. Here’s how:</p><ul><li><strong>Edge Rendering</strong>: Platforms like <strong>Vercel</strong> and <strong>Cloudflare</strong> allow pages to be rendered and served from servers located closer to your users (the “edge” of the network). This reduces latency, speeds up load times, and lightens the load on your primary server, making it especially effective for global audiences.</li><li><strong>Caching Solutions</strong>: Tools like <strong>Redis</strong> (for database queries) or <strong>Content Delivery Networks (CDNs)</strong> like Cloudflare or Fastly can store frequently accessed pages or data. This reduces the number of requests hitting your server, cuts server costs, and ensures users get content faster by serving it from a location closer to them.</li></ul><h3>5. Decision Framework: Choosing the Right Strategy</h3><p>Alright, let’s make this fun and straightforward! Choosing between <strong>Server-Side Rendering (SSR)</strong>, <strong>Client-Side Rendering (CSR)</strong>, and a <strong>Hybrid Approach</strong> is a little like choosing the best car for your needs: Do you need speed, comfort, or efficiency? Let’s break it down in a way that makes sense for your project.</p><h4>1. Does your project rely heavily on SEO?</h4><ul><li><strong>Yes</strong>: If SEO is your project’s lifeblood (you’re building a blog, an e-commerce site, or anything where ranking in Google matters), you’ll want <strong>SSR</strong>. Why? Because search engines love content that’s visible from the get-go. <strong>SSR</strong> delivers a fully rendered page right from the server, making it easy for crawlers to find and index your content. If you want the best of both worlds, go for a <strong>Hybrid Approach</strong> — <strong>SSR</strong> for the SEO-heavy pages (like the homepage or product pages) and <strong>CSR</strong> for the dynamic, interactive parts.</li><li><strong>No</strong>: If your project doesn’t rely much on SEO (like a private app or a membership site), then <strong>CSR</strong> can do the job. It won’t worry about crawling, but it will keep the experience super fast and interactive once the page loads.</li></ul><h4>2. Do users interact frequently with the interface?</h4><ul><li><strong>Yes</strong>: Is your app a playground of real-time updates, dynamic data, and interactive features? If so, <strong>CSR</strong> or <strong>Hybrid</strong> is your friend. With <strong>CSR</strong>, the page loads and then becomes a smooth, app-like experience where interactions happen without page reloads. If you need to balance SEO with user engagement, use <strong>Hybrid</strong> — SSR for pages that need search visibility, CSR for the fun, interactive bits.</li><li><strong>No</strong>: If your site is more of a “look-and-see” experience, where users just browse static content (like a portfolio, a blog, or a product catalog), <strong>SSR</strong> will make the most sense. It gives you that super-fast initial load time and ensures everything’s ready to go when the page hits the browser.</li></ul><h4>3. What’s your budget for server infrastructure?</h4><ul><li><strong>Limited budget</strong>: If you’re tight on resources and can’t spend much on server power, <strong>CSR</strong> is probably your best option. Why? Because most of the heavy lifting is done by the browser, which reduces strain on your servers. If your traffic spikes, CSR is easier on the wallet.</li><li><strong>Generous budget</strong>: Got the funds for top-tier performance? Then <strong>SSR</strong> could be your go-to, especially if SEO and fast initial load time are critical to your site’s success. But remember, <strong>SSR</strong> can get pricey because your server is doing a lot of the work, so keep your budget in mind.</li></ul><h3>Tech Stack Breakdown for Each Rendering Approach</h3><p><strong>SSR (Server-Side Rendering)</strong>:</p><ul><li><strong>Frameworks</strong>: Next.js, Nuxt.js (Vue)</li><li><strong>Back-End</strong>: Node.js, Express, PHP, Ruby on Rails</li><li><strong>Hosting</strong>: Vercel, AWS, DigitalOcean, Netlify</li><li><strong>Caching</strong>: Redis, CDN (Cloudflare, Akamai, Fastly)</li></ul><p><strong>CSR (Client-Side Rendering)</strong>:</p><ul><li><strong>Frameworks</strong>: Vue.js, React (Create React App, Vite), Angular</li><li><strong>Back-End</strong>: Node.js, Express, Django, Flask</li><li><strong>Hosting</strong>: Vercel, Netlify, Firebase Hosting</li><li><strong>Caching</strong>: LocalStorage, Service Workers (for offline support)</li></ul><p><strong>Hybrid Rendering</strong>:</p><ul><li><strong>Frameworks</strong>: Next.js (React), Nuxt.js (Vue)</li><li><strong>Back-End</strong>: Node.js, Express, GraphQL APIs, REST APIs</li><li><strong>Hosting</strong>: Vercel, AWS Lambda, Netlify</li><li><strong>Caching</strong>: Redis, CDN (Cloudflare, Fastly)</li></ul><h3>The Decision Tree: A Fun Visual Aid</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*U8U1cJKvIcF7dJnuONpUCw.png" /></figure><p><strong>SEO Priority?</strong></p><ul><li><strong>Yes</strong> → Go to question 2.</li><li><strong>No</strong> → <strong>CSR</strong> (Great for dynamic, interactive sites, with minimal SEO focus).</li></ul><p><strong>Frequent user interaction?</strong></p><ul><li><strong>Yes</strong> → <strong>Hybrid</strong> (SSR for SEO-friendly pages + CSR for the interactive parts).</li><li><strong>No</strong> → <strong>SSR</strong> (Speedy initial load + SEO-friendly content).</li></ul><p><strong>Limited budget?</strong></p><ul><li><strong>Yes</strong> → <strong>CSR</strong> (Low server load, budget-friendly).</li><li><strong>No</strong> → <strong>SSR</strong> or <strong>Hybrid</strong> (If you have the server budget, go for optimized performance).</li></ul><h3>Conclusion: The Right Choice Depends on Your Business Priorities</h3><p>When it comes to rendering strategies, there’s no one-size-fits-all solution. <strong>Server-Side Rendering (SSR)</strong> is your go-to for SEO and fast initial loads, <strong>Client-Side Rendering (CSR)</strong> shines in highly interactive apps, and <strong>Hybrid Approaches</strong> balance the two when you need the best of both worlds.</p><p>The key is to align your choice with your business goals — whether it’s attracting organic traffic, delivering a seamless user experience, or managing costs effectively.</p><p>But remember: this isn’t a set-it-and-forget-it decision. Test, measure performance, and iterate based on <strong>user feedback</strong>.</p><h3>Next Steps:</h3><ol><li><strong>Explore Tools</strong>: Dive into frameworks like <strong>Next.js</strong> for SSR and Hybrid, <strong>Vue</strong> or <strong>React</strong> for CSR, or <strong>Astro</strong> for static sites.</li><li><strong>Test Before Committing</strong>: Use tools like Lighthouse or WebPageTest to evaluate how each approach performs for your specific needs.</li><li><strong>Prototype First</strong>: Build a small-scale version of your site to see how different strategies work in practice.</li></ol><p>Making the right choice is less about technology and more about how it serves your users and your business. Choose wisely — and adapt as you go.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=27ab98cecca7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Evolution of JavaScript Frameworks: From jQuery to Svelte, with React and Vue Along the Way]]></title>
            <link>https://medium.com/@mohamed.mokhtari/the-evolution-of-javascript-frameworks-from-jquery-to-svelte-with-react-and-vue-along-the-way-a5393fc0f628?source=rss-963b73e92f25------2</link>
            <guid isPermaLink="false">https://medium.com/p/a5393fc0f628</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[framework]]></category>
            <category><![CDATA[front-end-development]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[react]]></category>
            <dc:creator><![CDATA[Mohamed MOKHTARI]]></dc:creator>
            <pubDate>Fri, 15 Nov 2024 15:59:49 GMT</pubDate>
            <atom:updated>2024-11-15T15:59:49.140Z</atom:updated>
            <content:encoded><![CDATA[<p>Ah, JavaScript… This scrappy little language, cobbled together by Brendan Eich in just ten days, has become a giant. Once scorned, mocked, and relegated to basic form validations, it went on to conquer the world. And what about the frameworks built on its shoulders? A saga. A revolution. Sometimes, a circus.</p><p>We begin with jQuery, the Swiss Army knife of the DOM, leap to React, flirt with Vue, and finally arrive at Svelte — the prodigal child so light it dreams of vanishing. But every era has its heroes, and they all deserve their moment in the spotlight.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RahVqPr88IMlmARZrs-lhQ.png" /></figure><h3>jQuery: The Craftsman of the Early Days</h3><p>In the beginning, there was chaos. Browsers were at war, and developers — poor souls — struggled with DOM APIs as consistent as a neighborhood association meeting. Then, in 2006, jQuery appeared, a tiny library promising to unite Internet Explorer, Firefox, and the gang. And believe me, it almost did.</p><p>With its magical $() and beloved chaining syntax, jQuery simplified everything. Animations? Two lines. AJAX? Three lines. Most importantly, no more praying for your code to work on all browsers (even the dreaded IE6).</p><p>But while jQuery was perfect for animating buttons on a landing page, it struggled as web applications grew ambitious. The DOM became a battlefield, and jQuery wasn’t equipped to handle the chaos.</p><pre>// Select an element and change its text<br>$(&#39;#myButton&#39;).click(function () {<br>  $(&#39;#myText&#39;).text(&#39;jQuery is amazing!&#39;);<br>});<br><br>// AJAX request in a snap<br>$.ajax({<br>  url: &#39;/api/data&#39;,<br>  method: &#39;GET&#39;,<br>  success: function (data) {<br>    console.log(data);<br>  }<br>});</pre><h3>The Evolution of Browsers: When Everyone Finally Got Along</h3><p>Talking about frameworks is fine, but let’s not forget the real villains of the early days: the browsers. Once upon a time, Chrome didn’t exist (imagine that!), Firefox tried in vain to dethrone the insufferable Internet Explorer, and Safari had just made its debut.</p><p>Then, a miracle happened. JavaScript engines like Chrome’s <strong>V8</strong> made scripts faster. ECMAScript standards, long ignored, gained traction. In 2015, ECMAScript 6 delivered a massive facelift: classes, modules, promises — a toolbox worthy of the modern web.</p><p>With this, frameworks could finally stop fighting browsers and focus on what mattered: making developers’ lives easier.</p><h3>React: The Age of Reactivity</h3><p><strong>2013 | </strong>Facebook introduces a strange new idea: <br><strong>React</strong>. A framework (or library, let’s not anger the purists) designed to solve a major issue: inefficient DOM manipulation. Its secret weapon? The virtual DOM, a lightweight simulation that ensures only necessary updates are applied to the real DOM. The result? Faster and cleaner.</p><p>React also ushered in the era of <strong>components</strong>: reusable, self-contained chunks of UI that snapped together like LEGO bricks. Developers loved it. But React isn’t a walk in the park. Between <strong>hooks</strong> and managing state with tools like Redux (or React’s newer APIs), learning React feels a bit like driving a Formula 1 car: insanely powerful, but not exactly intuitive.</p><pre>// A functional component in React<br>function App() {<br>  const [count, setCount] = React.useState(0);<br><br>  return (<br>    &lt;div&gt;<br>      &lt;h1&gt;{`Count: ${count}`}&lt;/h1&gt;<br>      &lt;button onClick={() =&gt; setCount(count + 1)}&gt;Increase&lt;/button&gt;<br>    &lt;/div&gt;<br>  );<br>}<br><br>// Render it to the DOM<br>ReactDOM.render(&lt;App /&gt;, document.getElementById(&#39;root&#39;));</pre><h3>Vue.js: Simplicity with a Touch of Charm</h3><p>In 2014, Evan You, a former Google developer, had had enough of overcomplicated frameworks. He created <strong>Vue.js</strong>, a simpler, more flexible alternative that’s just as powerful.</p><p>Vue lets you start small. A single &lt;script&gt; tag in your HTML file, and voilà—you’re ready to build reactive applications. Its progressive approach lets you scale up only when you need to.</p><p>Vue is pragmatic. It doesn’t force you into a particular programming paradigm. Object-oriented? Functional? Vue shrugs and says, “Whatever works for you.”</p><p>While Vue isn’t as dominant in the West as React, it’s a superstar in Asia, particularly in China, where companies like Alibaba and Xiaomi swear by it.</p><pre>&lt;div id=&quot;app&quot;&gt;<br>  &lt;h1&gt;{{ message }}&lt;/h1&gt;<br>  &lt;button @click=&quot;updateMessage&quot;&gt;Change Message&lt;/button&gt;<br>&lt;/div&gt;<br><br>&lt;script&gt;<br>const app = Vue.createApp({<br>  data() {<br>    return { message: &#39;Hello Vue!&#39; };<br>  },<br>  methods: {<br>    updateMessage() {<br>      this.message = &#39;You clicked me!&#39;;<br>    }<br>  }<br>});<br><br>app.mount(&#39;#app&#39;);<br>&lt;/script&gt;</pre><h3>Svelte: Escaping the Runtime</h3><p>Now, enter the new kid on the block: <strong>Svelte</strong>. Not just a framework, but a revolution. Svelte’s philosophy? “Why use a framework at runtime when we can compile everything upfront?”</p><p>Instead of loading a heavy library with your app, Svelte compiles your code into pure JavaScript during build time. The result? Blazing-fast performance and featherweight apps.</p><p>For developers, it’s a joy. No complex hooks, no endless state injections. You write plain JavaScript like you’re telling a story, and Svelte handles the rest.</p><p>But there’s a caveat: Svelte’s ecosystem is still young, and its community, while enthusiastic, is tiny compared to the giants.</p><pre>&lt;script&gt;<br>  let count = 0;<br>&lt;/script&gt;<br><br>&lt;h1&gt;Count: {count}&lt;/h1&gt;<br>&lt;button on:click={() =&gt; count++}&gt;Increase&lt;/button&gt;</pre><h3>So, What Should You Choose Today? Numbers, Context, and Hard Truths</h3><p>When choosing a JavaScript framework, it all boils down to <strong>what you’re building, who’s building it, and the environment you’re working in</strong>. That said, the numbers tell an interesting story:</p><ul><li><strong>React</strong> is the undisputed champion, used by <strong>over 40% of developers</strong> according to Stack Overflow and State of JS. It’s everywhere — Facebook, Netflix, Airbnb — thanks to its scalability and massive ecosystem. Need a complex, high-performance, modular app? React is your go-to.</li><li><strong>Vue.js</strong> wins about <strong>20% of developers</strong>, with massive adoption in Asia (used by Alibaba and Xiaomi). Its key strength? Simplicity. Perfect for startups or projects where speed is king.</li><li><strong>Angular</strong>, Google’s heavyweight, holds <strong>15% of the market</strong>, thriving in enterprise settings. Its strict structure and built-in tools (routing, state management, testing) make it ideal for large-scale, team-driven projects. But its steep learning curve can scare off smaller teams or beginners.</li><li><strong>Svelte</strong>, though small (just <strong>6–7%</strong> usage), boasts the <strong>highest satisfaction rate</strong> among developers: over <strong>90%</strong> love working with it. Its performance and simplicity make it ideal for projects where speed and efficiency matter most — like dashboards or lightweight web apps.</li><li><strong>jQuery</strong>, surprisingly, is still alive, powering <strong>28% of active websites</strong>. It’s rarely chosen for new projects, but it remains a reliable tool for maintaining legacy codebases or simple sites.</li></ul><h3>Which One Is Right for You?</h3><p>There’s no one-size-fits-all answer, but here are some guidelines:</p><ol><li><strong>Building a complex, scalable app with an experienced team?</strong><br>Choose <strong>React</strong> or <strong>Angular</strong>. React for flexibility; Angular for an all-in-one, TypeScript-friendly solution.</li><li><strong>Flying solo or working with tight deadlines in a startup?</strong><br>Go with <strong>Vue.js</strong>. It’s easy to learn and quick to prototype.</li><li><strong>Need a super-lightweight, high-performance app or love exploring new tech?</strong><br>Try <strong>Svelte</strong>. Its performance is unmatched, but its ecosystem is still growing.</li><li><strong>Maintaining legacy code or a basic site with minimal interactivity?</strong><br>Don’t dismiss <strong>jQuery</strong>. It’s old, but it still gets the job done.</li><li><strong>Enterprise-grade app with strict requirements and big teams?</strong><br><strong>Angular</strong> is a solid bet, especially if your team thrives on structure.</li></ol><h3>Final thoughts</h3><p>Frameworks come and go, but your choice should depend on your <strong>needs</strong>, <strong>constraints</strong>, and <strong>goals</strong>. Popularity and trends are helpful, but the right tool is the one that fits your project like a glove.</p><p>Whether you’re building a cathedral or a cabin, pick the tools that get the job done. And remember, even the best framework won’t replace an inspired and well-organized team.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a5393fc0f628" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[L’évolution des Frameworks JavaScript : Voyage de jQuery à Svelte, en passant par React et Vue]]></title>
            <link>https://medium.com/@mohamed.mokhtari/l%C3%A9volution-des-frameworks-javascript-voyage-de-jquery-%C3%A0-svelte-en-passant-par-react-et-vue-0b65db2407a4?source=rss-963b73e92f25------2</link>
            <guid isPermaLink="false">https://medium.com/p/0b65db2407a4</guid>
            <category><![CDATA[front-end-development]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[vuejs]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Mohamed MOKHTARI]]></dc:creator>
            <pubDate>Fri, 15 Nov 2024 14:18:57 GMT</pubDate>
            <atom:updated>2024-11-15T14:18:57.525Z</atom:updated>
            <content:encoded><![CDATA[<h3>L’évolution des Frameworks JavaScript : Voyage de jQuery à Svelte, en passant par React et Vue</h3><p>Ah, JavaScript… ce petit langage de bric et de broc, inventé en dix jours par Brendan Eich, est devenu un titan. Il a d’abord été regardé de haut, moqué, relégué à des petits scripts de validation de formulaires, avant de conquérir le monde. Et que dire des frameworks qui se sont bâtis sur ses épaules ? Une saga. Une révolution. Et parfois, un vrai cirque. On commence avec jQuery, ce couteau suisse du DOM, on virevolte avec React, on flirte avec Vue, et enfin, on arrive à Svelte, l’enfant prodige qui rêve d’être si léger qu’il pourrait s’évaporer. Mais chaque époque a ses héros, et ils méritent qu’on leur rende justice.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RahVqPr88IMlmARZrs-lhQ.png" /></figure><h3>jQuery ou l’artisan des débuts</h3><p>Au commencement, il y avait le chaos. Les navigateurs se livraient à une guerre ouverte, et les développeurs, ces pauvres âmes, se débattaient avec des API DOM aussi cohérentes qu’une réunion de copropriété. Puis vint <strong>jQuery</strong>, en 2006, une petite bibliothèque qui promettait de réconcilier Internet Explorer, Firefox, et leurs copains. Et croyez-moi, elle y est presque arrivée.</p><p>Avec ses $() magiques et son fameux « chaining » (enchaînement d’actions), jQuery simplifiait tout. Animation ? Deux lignes. AJAX ? Trois lignes. Et surtout, plus besoin de prier pour que votre code fonctionne sur tous les navigateurs (même sur le maudit IE6). Mais voilà, si jQuery était parfait pour ajouter un bouton animé sur un site vitrine, il a vite montré ses limites quand les applications web sont devenues plus ambitieuses. Le DOM devenait un vrai champ de bataille, et jQuery ne savait pas comment gérer cette pagaille.</p><pre>// Select an element and change its text<br>$(&#39;#myButton&#39;).click(function () {<br>  $(&#39;#myText&#39;).text(&#39;jQuery is amazing!&#39;);<br>});<br><br>// AJAX request in a snap<br>$.ajax({<br>  url: &#39;/api/data&#39;,<br>  method: &#39;GET&#39;,<br>  success: function (data) {<br>    console.log(data);<br>  }<br>});</pre><h3>L’évolution des navigateurs, ou comment tout le monde s’est calmé</h3><p>C’est bien joli de parler de frameworks, mais souvenez-vous, les navigateurs étaient, à une époque, une bande de sales gosses indisciplinés. Chrome n’existait pas encore (imaginez !), Firefox essayait tant bien que mal de détrôner l’insupportable Internet Explorer, et Safari venait d’entrer sur scène.</p><p>Puis, miracle ! Les moteurs de rendu JavaScript, comme V8 (le moteur de Chrome), ont commencé à accélérer la vitesse des scripts. Les standards ECMAScript, longtemps ignorés, ont gagné en importance. En 2015, avec <strong>ECMAScript 6</strong>, le langage a reçu un lifting spectaculaire : des classes, des modules, des promesses… bref, des outils dignes du XXIe siècle. Grâce à cela, les frameworks pouvaient enfin arrêter de se battre contre les navigateurs et se concentrer sur ce qui comptait vraiment : faciliter la vie des développeurs.</p><h3>React ou l’âge de la réactivité</h3><p><strong>2013 | </strong>Facebook débarque avec une idée bizarre :</p><p><strong>React</strong>. Un framework (ou plutôt une librairie, ne fâchons pas les puristes) qui promet de résoudre un problème majeur : la manipulation inefficace du DOM. Leur arme secrète ? Le DOM virtuel. Une petite simulation en mémoire qui permet de n’appliquer que les changements nécessaires sur le DOM réel. Effet ? C’était plus rapide, plus propre.</p><p>React, c’est aussi l’ère des <strong>composants</strong> : des morceaux d’interface autonomes, réutilisables, organisés comme des briques LEGO. Les développeurs adorent ça. Mais attention, React n’est pas une promenade de santé. Entre les <strong>hooks</strong> et la gestion d’état avec Redux (ou maintenant avec ses propres API), c’est un peu comme apprendre à conduire une Formule 1 : super rapide, mais pas intuitif.</p><pre>// A functional component in React<br>function App() {<br>  const [count, setCount] = React.useState(0);<br><br>  return (<br>    &lt;div&gt;<br>      &lt;h1&gt;{`Count: ${count}`}&lt;/h1&gt;<br>      &lt;button onClick={() =&gt; setCount(count + 1)}&gt;Increase&lt;/button&gt;<br>    &lt;/div&gt;<br>  );<br>}<br><br>// Render it to the DOM<br>ReactDOM.render(&lt;App /&gt;, document.getElementById(&#39;root&#39;));</pre><h3>Vue.js ou le charme de la simplicité</h3><p>En 2014, un ancien développeur de Google, Evan You, décide qu’il en a assez de la complexité des frameworks. Il crée <strong>Vue.js</strong>, une alternative plus simple, plus flexible, mais tout aussi puissante.</p><p>Avec Vue, pas besoin d’un manuel de 300 pages pour démarrer. Vous prenez un fichier HTML, ajoutez une petite balise &lt;script&gt;, et vous voilà prêt à créer des applications réactives. Son approche progressive permet de commencer petit, puis d’ajouter des fonctionnalités selon vos besoins.</p><p>Vue, c’est aussi un certain pragmatisme. Pas de guerre sainte entre programmation orientée objet et fonctionnelle, juste un cadre flexible qui s’adapte à votre style. Pourtant, Vue n’est pas aussi dominant que React, notamment en Occident. Mais en Asie, c’est une superstar, particulièrement en Chine.</p><pre>&lt;div id=&quot;app&quot;&gt;<br>  &lt;h1&gt;{{ message }}&lt;/h1&gt;<br>  &lt;button @click=&quot;updateMessage&quot;&gt;Change Message&lt;/button&gt;<br>&lt;/div&gt;<br><br>&lt;script&gt;<br>const app = Vue.createApp({<br>  data() {<br>    return { message: &#39;Hello Vue!&#39; };<br>  },<br>  methods: {<br>    updateMessage() {<br>      this.message = &#39;You clicked me!&#39;;<br>    }<br>  }<br>});<br><br>app.mount(&#39;#app&#39;);<br>&lt;/script&gt;</pre><h3>Svelte ou l’évasion du runtime</h3><p>Et maintenant, place au dernier-né, <strong>Svelte</strong>. Ce n’est pas juste un framework, c’est une révolution. Pourquoi ? Parce que Svelte dit : « Pourquoi utiliser un framework au runtime si on peut tout compiler à l’avance ? »</p><p>L’idée est simple : au lieu de charger une tonne de bibliothèques avec votre application, Svelte transforme tout en JavaScript pur lors de la compilation. Résultat : des performances impressionnantes et des applications ultra-légères.</p><p>Côté développeurs, c’est un plaisir. Pas de hooks compliqués ni d’injections d’état à n’en plus finir. Vous écrivez du JavaScript comme si vous racontiez une histoire, et Svelte s’occupe du reste. Mais attention : son écosystème est encore jeune, et sa communauté, bien qu’enthousiaste, reste petite comparée à celles de React ou Vue.</p><pre>&lt;script&gt;<br>  let count = 0;<br>&lt;/script&gt;<br><br>&lt;h1&gt;Count: {count}&lt;/h1&gt;<br>&lt;button on:click={() =&gt; count++}&gt;Increase&lt;/button&gt;</pre><h3>Et aujourd’hui, qu’est-ce qu’on choisit ? Le poids des chiffres et des contextes</h3><p>Face à la galaxie des frameworks JavaScript, un constat s’impose : choisir <em>le bon</em> dépend de <strong>ce que vous construisez</strong>, <strong>qui le construira</strong>, et <strong>dans quel environnement</strong>. Pourtant, les chiffres d’utilisation éclairent les tendances. Voici un tour d’horizon basé sur les données récentes :</p><ul><li><strong>React</strong> continue de dominer la scène avec une adoption massive : <strong>plus de 40 % des développeurs professionnels l’utilisent activement</strong> selon les sondages de Stack Overflow et State of JS. Il est omniprésent dans les grandes entreprises comme Facebook (son créateur), Netflix, et Airbnb, grâce à son écosystème robuste et sa scalabilité. Si vous avez besoin de créer une application complexe, hautement performante et modulable, React est un choix sûr.</li><li><strong>Vue.js</strong>, quant à lui, séduit environ <strong>20 % des développeurs</strong>, avec un succès marqué dans des régions comme l’Asie (Alibaba, Xiaomi l’utilisent). Son atout majeur ? Sa simplicité d’apprentissage et sa flexibilité. Vue est parfait pour les startups et les projets où la vitesse de développement prime sur la complexité des outils.</li><li><strong>Angular</strong>, le vénérable dinosaure de Google, garde son public avec environ <strong>15 % d’utilisation active</strong>. Surtout présent dans les environnements d’entreprise, Angular excelle dans des projets de grande échelle où les équipes sont nombreuses, grâce à sa structure stricte et à son intégration complète (routeur, gestion d’état, outils de test). Cependant, sa complexité rebute souvent les petites équipes ou les débutants.</li><li><strong>Svelte</strong>, le nouveau venu, ne représente que <strong>6 à 7 % d’utilisation</strong>, mais son taux de satisfaction est le plus élevé : plus de <strong>90 % des développeurs disent adorer travailler avec</strong>. Les applications construites avec Svelte sont légères, rapides et parfaites pour les projets où chaque milliseconde et chaque kilobyte comptent (imaginez des sites vitrines ou des dashboards haute performance).</li><li>Et enfin, <strong>jQuery</strong>, même s’il semble poussiéreux, est toujours utilisé dans <strong>28 % des sites web actifs</strong> (oui, vous avez bien lu). Sa simplicité et sa compatibilité avec des projets hérités en font un survivant étonnant, mais il est rarement choisi pour de nouveaux projets.</li></ul><h3>Alors, lequel choisir ?</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/300/1*uoydfFNvsitOWEcg1vyG5g.gif" /></figure><p>Il n’y a pas de réponse universelle. Voici quelques pistes pour vous aider à trancher :</p><ol><li><strong>Vous développez une application complexe et modulable, avec une équipe expérimentée ?</strong><br>Allez avec <strong>React</strong> ou <strong>Angular</strong>. React si vous voulez plus de flexibilité, Angular si vous préférez une structure tout-en-un et un environnement typé.</li><li><strong>Vous travaillez seul, ou dans une startup avec des délais serrés ?</strong><br>Prenez <strong>Vue.js</strong>. Simple à apprendre, rapide à prototyper, c’est le framework idéal pour démarrer sans prise de tête.</li><li><strong>Vous voulez une application ultralégère et performante, ou vous êtes un explorateur dans l’âme ?</strong><br>Essayez <strong>Svelte</strong>. C’est moderne, élégant, et les performances parlent d’elles-mêmes. Attention cependant à l’écosystème encore jeune.</li><li><strong>Vous travaillez sur un projet hérité ou un site simple avec peu d’interactivité ?</strong><br>Ne méprisez pas <strong>jQuery</strong>. Il est toujours là pour sauver la mise dans certains cas.</li><li><strong>Vous développez dans un contexte d’entreprise, avec des normes rigoureuses ?</strong><br><strong>Angular</strong> est un candidat solide, surtout si vos équipes maîtrisent TypeScript et préfèrent une architecture stricte.</li></ol><h3>Conclusion</h3><p>Le choix d’un framework n’est pas qu’une question de popularité ou de mode. Ce qui compte, c’est de prendre celui qui répond le mieux à vos besoins, à vos contraintes, et à vos ambitions. Les chiffres sont éclairants, mais au bout du compte, c’est votre projet qui décide.</p><p>Vous êtes développeur, architecte du web : que vous construisiez une cathédrale ou une cabane, choisissez les bons outils. Et souvenez-vous, même le meilleur framework ne remplacera jamais une équipe inspirée et bien organisée.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0b65db2407a4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ADEO Design System: Building a Web Component library with Svelte and Rollup]]></title>
            <link>https://medium.com/adeo-tech/adeo-design-system-building-a-web-component-library-with-svelte-and-rollup-72d65de50163?source=rss-963b73e92f25------2</link>
            <guid isPermaLink="false">https://medium.com/p/72d65de50163</guid>
            <category><![CDATA[libraries]]></category>
            <category><![CDATA[web-components]]></category>
            <category><![CDATA[tech]]></category>
            <category><![CDATA[design-systems]]></category>
            <category><![CDATA[svelte]]></category>
            <dc:creator><![CDATA[Mohamed MOKHTARI]]></dc:creator>
            <pubDate>Tue, 28 Jun 2022 13:34:12 GMT</pubDate>
            <atom:updated>2022-06-28T13:46:02.543Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*j3_MxaWEPB7cNnPloFO6Mg.png" /></figure><h3>Introduction:</h3><p>In this article, we showcase how we built a Web-Component library at ADEO, using SvelteJS, Typescript, and Rollup and how we integrated them with the popular JS frameworks Angular, Vue, and React. Also, we discuss the pain points and the challenges we faced.</p><p>Readers needing a reminder about the Web Component philosophy may check out this article: <br><a href="https://medium.com/adeo-tech/web-components-learnings-from-adeo-design-system-9414acc1d1e2">https://medium.com/adeo-tech/web-components-learnings-from-adeo-design-system-9414acc1d1e2</a></p><p>Four years ago, we started a Design System at ADEO (ADS) to achieve the following goals: create a coherent customer experience on the web, shorten the team’s delivery time and improve the quality of deliverables.</p><p>Powered by inputs like Design, Tech, Business, and Inclusion, ADS is used by the corporate platforms, Communities, and Business Units (e.g. Leroy Merlin). With ADS, we provide a constantly evolving system that answers the corporate’s needs.</p><p><a href="https://mozaic.adeo.cloud/">Welcome to Mozaic Design System</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tOXPeYXJkORcy7VGvcDSaw.png" /><figcaption>ADEO Design System libraries</figcaption></figure><p>Web Components has been around for almost 10 years now, but it seems to have been adopted only recently by developers.</p><p>Starting with new frameworks can be complicated and time costly, in reading articles and tutorials. In our case, we felt like we were the early adopters and few resources related to our stack were available.</p><p>That leads us to our first part, how did we choose our stack?</p><h3>How we choose our Tech Stack</h3><p>When we decided to build our ADS Web Components library, we had to define criteria to validate other choices.</p><p>During our spike, we defined 3 main criteria:</p><ul><li><strong>Bundle size</strong>: Web performance is an important driver at ADEO. We want to make sure that the framework used is the smallest in size.</li><li><strong>Community &amp; repo activities</strong>: It is nice to have a framework with great features, but a dedicated community was really important for us.</li><li><strong>Easy for contribution:</strong> Inner source is the key to success for our Design System. The chosen framework must be easy to understand and learn.</li></ul><p>Focusing on the processes is the ADS team’s DNA. To ensure we have the strongest stack we’ve put these actions in place:</p><ul><li><strong>Create a dev community</strong> | They must be willing to spend time on the project, have enough experience to question choices, and are open for discussion. We have more than 15 developers who contributed to the library.</li><li><strong>Show your work | </strong>From research, spikes, and POC, we share and show our work to the community and encourage feedback.</li><li><strong>Facilitate the discussion | </strong>Slack discussions are set up, weekly meetings to follow progress, and Github tools are used to keep track of changes.</li></ul><p>Thanks to our early adopters and community members, we were able to implement this stack.</p><h3>Our Tech Stack</h3><p>After much research, proof of concept, and discussion, we were able to find our winners.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NmMMmwkOjWio8YDxmRI20Q.png" /><figcaption>ADS Web Component stack</figcaption></figure><p><strong>SvelteJS</strong>:</p><p>A JavaScript framework to help developers create user interfaces.</p><p><a href="https://svelte.dev/">https://svelte.dev/</a></p><p><strong>Typescript</strong>:</p><p>It adds a system type to JavaScript. It has been adopted to enhance code quality and help developers with autocomplete functionality.</p><p><a href="https://www.typescriptlang.org/">https://www.typescriptlang.org/</a></p><p><strong>Rollup</strong>:</p><p>A build tool for bundling JavaScript applications and libraries.</p><p><a href="https://rollupjs.org/">https://rollupjs.org/</a></p><p><strong>Storybook</strong>:</p><p>Used in all our libraries, it showcases our components and lets users interact with them thanks to controls.</p><p><a href="https://storybook.js.org/">https://storybook.js.org/</a></p><h3>ADS Web Components</h3><p>Now that we have our technical stack and a group of devoted and highly knowledgeable developers, we are almost ready to start coding. All we need now is to find the right architecture for the project and define ground developing rules.</p><h4>Project Anatomy</h4><p>An organized project structure allows contributors to dive easily into the development process.</p><ul><li><strong>Package.json</strong></li></ul><p>The first and foremost thing to check in a JS project is the `package.json` file. It will tell you everything about what is required. This is where we defined all our scripts (lint, build, package..), all dependencies and our lint staged (script to run on each commit)</p><ul><li><strong>SRC folder</strong></li></ul><p>It is clearly the heart of the project, where you will find all the needed source files for each component under the “components” folder. Also, we’ve decided to create a utility folder with all reusable methods. And finally, a stories folder is used to showcase components in the storybook.</p><ul><li><strong>Config files</strong></li></ul><p>All our config files are in the root folder, from code linting config to building config. All these files are highly sensitive.</p><ul><li><strong>Storybook</strong></li></ul><p>We’ve tried to keep the storybook config as easy as possible. We’ve added the essential plugins and some basic styles.</p><h4>Component Anatomy</h4><p>Following the official Svelte documentation, we’ve split our Svelte component into 4 parts.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/d47158cbd26ab7d2f27bf003a0854cb2/href">https://medium.com/media/d47158cbd26ab7d2f27bf003a0854cb2/href</a></iframe><ul><li><strong>Svelte options</strong></li></ul><p>It provides a way to pass options to the compiler. We used it to pass the tag name of the web component expected</p><p>In most cases, our component is defined at ‘null’ to let the user create their tag name to avoid name collision.</p><ul><li><strong>Scripts</strong></li></ul><p>In this part, you will find all the defined props and specific methods for a component.</p><ul><li><strong>DOM</strong></li></ul><p>Thanks to our design system, we have written all the HTML for each component. We had to manage dynamic behaviors and styles.</p><ul><li><strong>Style</strong></li></ul><p>Thanks to ADS core libraries, JS libraries do not need to add any styles to components. The component will be styled only by importing the component SCSS file from ADS core libraries.</p><h3>Integrate with the main framework</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dPobHozinrDPXCVPL1qaHA.png" /><figcaption>ADS Web Component usages</figcaption></figure><p>Knowing that frameworks are evolving rapidly, I encourage you to check the latest news from your favorite framework. A complete article could be written about how each framework works with Web Components. <br> <br>To make it clear and concise, I’ve created a project on each framework, and I focused on these actions</p><ul><li>Installed and config ADS Web Component library</li><li>Basic data binding</li><li>Event handling.</li></ul><p>All these showcase repositories are open and can be challenged.</p><p>Visit our showcase website using WebComponent in Vue.</p><p><a href="https://mohamedmok.github.io/vue-ads-webc-showcase/">https://mohamedmok.github.io/vue-ads-webc-showcase/</a></p><h4>1 — Angular</h4><p><a href="https://github.com/mohamedMok/ng-ads-webc-showcase">GitHub - mohamedMok/ng-ads-webc-showcase: Showcase ADS web component usage in Angular project</a></p><p><strong>Installation and configuration: (Angular &gt;= v.10)</strong></p><p>Angular installation and configuration are pretty simple and well documented on the main sites. By adding the following to your App.module.ts, you will be able to use custom elements on your application.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/dcd0e625ebc0bc85f93f65fea74a3aba/href">https://medium.com/media/dcd0e625ebc0bc85f93f65fea74a3aba/href</a></iframe><p><strong>Data binding:</strong></p><p>The one-way binding, from the source to the view works out of the box using expression.<br>Two-way data binding was not working out of the box, Web Components are being considered as HTML native elements. Angular manages two-way data binding only for Angular components. With advanced Angular developers, we are creating directives to handle two-way data binding for our Web Component.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/afb915b5a0f57b9311b387c81aada35f/href">https://medium.com/media/afb915b5a0f57b9311b387c81aada35f/href</a></iframe><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/a4e862fbf775e2e984b06375d37fd998/href">https://medium.com/media/a4e862fbf775e2e984b06375d37fd998/href</a></iframe><p><strong>Event handler:</strong></p><p>Custom events are well managed in Angular. Out of the box, it is possible to listen to native and custom events emitted by our Web Components.</p><p>A code example showing data and event:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/f4b7dc7d3797f2b4042ed2ba82002888/href">https://medium.com/media/f4b7dc7d3797f2b4042ed2ba82002888/href</a></iframe><p>Easy to use out of the box, Angular manages the basics pretty well. To go further and have more dynamic usage, developers will need to implement a wrapper around the Web Component to handle two-way data binding.</p><h4>2 — VueJS</h4><p><a href="https://github.com/mohamedMok/vue-ads-webc-showcase">GitHub - mohamedMok/vue-ads-webc-showcase: Showcase web component with Vue</a></p><p><strong>Installation and configuration: (Vue &gt;= v.3)</strong></p><p>No configuration is needed to use Web Components in Vue3. Once the library is installed (by NPM or Yarn), you only need to import Web Components into your main.ts file. Pretty simple indeed!</p><p><strong>Data binding:</strong></p><p>Same as that we have for Angular, one-way data binding is well managed by Vue.</p><p><strong>Event handler:</strong></p><p>The native event works fine, but custom events don’t work out of the box. Developers will need to write specific wrappers to catch the custom event.</p><p>A nice integration and easy to use for basic Web Components. You will need to write specific code to manage events and slots to make the most of the library.</p><p>To further on the web component usage with Vue, follow this documentation: <br><a href="https://vuejs.org/guide/extras/web-components.html">https://vuejs.org/guide/extras/web-components.html</a></p><h4>3 — ReactJS</h4><p><a href="https://github.com/mohamedMok/react-ads-webc-showcase">GitHub - mohamedMok/react-ads-webc-showcase: Showcase web component usage using React</a></p><p><strong>Installation and configuration: (React &gt;= v.18)</strong></p><blockquote>React is a library, not a framework. For this tests purposes we used CRA CLI tool.</blockquote><p>React added features in their new version to improve Web Components support and no configuration is needed. Once the library is installed (by NPM or Yarn), you only need to import the Web Components via the index.ts file.</p><p><strong>Data binding:</strong></p><p>Using React State feature makes it easy to bind data with Web Components.</p><p><strong>Event handler:</strong></p><p>As for Vue, React works fine with the native events, but doesn’t handle custom events. Developers will need to write a specific wrapper to support custom events. <br>For further information, follow this article: <br><a href="https://css-tricks.com/3-approaches-to-integrate-react-with-custom-elements/">https://css-tricks.com/3-approaches-to-integrate-react-with-custom-elements/</a></p><p>React’s latest version manages Web Components well. Unfortunately for more advanced usage, developers will need to write wrappers to better handle data and events.</p><p>Overall the 3 main JS frameworks handle Web Components with hardly any configuration. For more complex usages we advise our developers to write wrappers to make sure they fully control the Web Components. <br><a href="https://custom-elements-everywhere.com/">https://custom-elements-everywhere.com/</a></p><h3>Lessons learnt</h3><p>After developing more than 30 components with Svelte and Rollup, we learned a lot and faced some challenges. This is a summary of the most important takeaways.</p><h4>Props</h4><p>With Web Components, we use <a href="https://open-wc.org/guides/knowledge/attributes-and-properties/">attributes</a> and not properties. Both are key/value pairs. On one hand, attributes pertain to HTML elements and take string values only. On the other hand, properties pertain to JS objects and take any JS object as a value.</p><ul><li>Naming:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*U4Q_4Qd8ToJL5PugLsOhHQ.png" /><figcaption>Do and don’ts for attribute naming</figcaption></figure><p>It is mostly accepted to name properties using camelCase or kebab-case. Unfortunately using Svelte with Web Components, both won’t work. Properties will need to be defined as full lowercase.</p><ul><li>Boolean props:</li></ul><p>HTML specification defines that a boolean attribute presence will represent the True value.</p><p>Users need to make sure to remove or put undefined for the boolean attributes to have the False value.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/cb08eb0968166108fb3668c50e8cc44b/href">https://medium.com/media/cb08eb0968166108fb3668c50e8cc44b/href</a></iframe><ul><li>Complex props</li></ul><p>All attributes passed to Web Components must be in string format. For arrays and object properties, the developer must stringify the props before passing them. If the data is huge and complex, this step slows the rendering.</p><pre>JSON.stringify(myprops)</pre><h4>Event handler</h4><p>Svelte offers a SvelteDispatcher, but unfortunately, it doesn’t simultaneously emit a custom DOM event. Since we use both Svelte and Web Components, we created an EventHandler utility method to chain together SvelteDispatcher and dispatchEvent methods to raise a Svelte custom event and a DOM custom event simultaneously.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/d08d43f0adfd06001a7982b1300c5aa0/href">https://medium.com/media/d08d43f0adfd06001a7982b1300c5aa0/href</a></iframe><h4>Nested components</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XVltTbWR5AqLJca6WnGzAw.png" /><figcaption>Nested component example</figcaption></figure><p>In a Design System library, nested components are a must to have. Some components need to be used only inside other components such as the Svelte component. Meanwhile, other components need to be generated as Web Components. To manage this part, you must customize your Rollup configuration.</p><p>Components that are nested must have a specific extension ‘.nested.svelte’, Rollup will then exclude them from the web component build.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/43005015bc8a7eec970646fcdf48ba56/href">https://medium.com/media/43005015bc8a7eec970646fcdf48ba56/href</a></iframe><h3>Limitations</h3><h4>Named Slots</h4><p>For complex components such as the data table, declaring a named slot in a loop will not work, as specified in the Svelte documentation. Several issues are still open on the subject. Let us know if you found a way for this!</p><h4>Style | User customization</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/720/1*xrj-trQBuDYecO3KzOzo0g.png" /><figcaption>Shadow-root of ADS Badge Web Component</figcaption></figure><p>Using the Web Component approach, the CSS will be encapsulated inside the shadow root. It means the user won’t have access to the style to override it in their application. We have to add it to the root component.</p><h4>Bundle size</h4><p>Svelte offers a tremendous final build. At ADS we have more than 40 components and more than 900 icons. Releasing only a single bundle with all the components and icons can be overkill in some projects. We decided to have a bundle file and also an individual file for each component and icon. The size of an average component is between 10Ko to 15Ko without using compression tools (e.g. GZIP or Brotli).</p><h3>Conclusion</h3><p>On our journey to building a Web Component library using Svelte, today we successfully offer more than 40 components including forms, charts, and more complex ones, both as Web Components and Svelte components. Along the way, a strong and vibrant dev community has been created in the ADEO group; they enjoy great developer experiences both as contributors and as users of the library.</p><p>I think our journey is not finished. We want to offer more support for specific frameworks and add even more components. So do tell us what you think and what new features you would like to see in the ADS Web Components library.</p><p>I would like to give a big shout-out to all the devs that contributed and helped us make this library happen.</p><p>Want to join us in a company with amazing projects? Here are some jobs listing from <a href="https://jobs.adeoservices.com/jobs?department=IT%2F+Data&amp;role=Software+developer&amp;query=">ADEO services</a> &amp; <a href="https://recrute.leroymerlin.fr/jobs?facetJobCategory=14">Leroy Merlin France</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=72d65de50163" width="1" height="1" alt=""><hr><p><a href="https://medium.com/adeo-tech/adeo-design-system-building-a-web-component-library-with-svelte-and-rollup-72d65de50163">ADEO Design System: Building a Web Component library with Svelte and Rollup</a> was originally published in <a href="https://medium.com/adeo-tech">ADEO Tech Blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>