<?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 chebbi lamis on Medium]]></title>
        <description><![CDATA[Stories by chebbi lamis on Medium]]></description>
        <link>https://medium.com/@chebbi-lamis?source=rss-a5d5b19f6115------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*IsDmuZGq5WEEUc7VTi5Qfg.jpeg</url>
            <title>Stories by chebbi lamis on Medium</title>
            <link>https://medium.com/@chebbi-lamis?source=rss-a5d5b19f6115------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 01 Dec 2026 22:01:33 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@chebbi-lamis/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[Meet the Angular MCP: Your AI’s Safety Harness]]></title>
            <link>https://medium.com/google-developer-experts/meet-the-angular-mcp-your-ais-safety-harness-04e18981055c?source=rss-a5d5b19f6115------2</link>
            <guid isPermaLink="false">https://medium.com/p/04e18981055c</guid>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[mcp-server]]></category>
            <category><![CDATA[angular]]></category>
            <category><![CDATA[cursor]]></category>
            <category><![CDATA[rules]]></category>
            <dc:creator><![CDATA[chebbi lamis]]></dc:creator>
            <pubDate>Mon, 10 Nov 2025 08:42:31 GMT</pubDate>
            <atom:updated>2025-11-20T19:02:31.397Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pcGJAT1wmX7X8_Yx41R0OA.jpeg" /></figure><p>You know that feeling when AI generates something almost right… but not quite? It writes code confidently, it compiles, it runs and yet, something feels off. In my case, I was generating <strong>Angular applications</strong>, and it was missing conventions, naming style, and Angular’s best practices. That’s when you start thinking about <strong>guardrails, </strong>and your first instinct might be: <strong><em>Rules</em></strong><em>.</em></p><h3>First Line of Defense: Rules</h3><p>Rules are sets of instructions that guide LLMs to follow Angular’s recommended patterns, project structure, and coding standards. They provide critical context to LLMs and define what’s acceptable in your codebase stylistically, technically, and architecturally. For example :</p><blockquote>Signals for State Management: Utilize Angular Signals for reactive state management within components and services.</blockquote><blockquote>Lazy Loading: Implement lazy loading for feature routes to improve initial load times of your application.</blockquote><blockquote>NgOptimizedImage: Use `NgOptimizedImage` for all static images to automatically optimize image loading and performance.</blockquote><p>The Angular team provides ready-to-use Rules files for different AI-enabled IDEs. You can explore and download them for your editor here 👉 <a href="https://angular.dev/ai/develop-with-ai#rules-files">Angular Rules Guide</a></p><h3>🚧 But Here’s the Catch</h3><p><em>“Rules files guide the LLMs but don’t guarantee compliance, tools and agents may not always apply them perfectly.”</em></p><p>In other words, the AI tries to follow the rules, but there’s no guarantee it <em>will</em>. So if Rules are the seatbelt, what about a second safety system, one that <em>checks</em> whether the AI truly respected those rules?</p><h3>🦺 Enter Angular MCP ! The Double Safety Belt</h3><p>That’s where the <strong>Angular MCP Server</strong> comes in. It provides a tool get_best_practicesthat retrieves the Angular Best Practices Guide. This guide is essential for ensuring that all code adheres to modern standards, including standalone components, typed forms, and modern control flow.<br>I decided to use it as my AI’s <strong>supervisor.</strong></p><p>The idea is simple: <em>If </em>Rules<em> tell the AI what to do, the Angular </em>MCP Server<em> verifies whether it actually did it, using Angular’s own brain.</em></p><p>Let me show you how to set it up. Installing MCP in Cursor is straightforward:</p><ol><li>Open Cursor Settings → MCP Servers</li><li>Go to Tools &amp; MCP → New MCP Server</li><li>Paste the following configuration :</li></ol><pre>{<br>  &quot;mcpServers&quot;: {<br>    &quot;angular-cli&quot;: {<br>      &quot;command&quot;: &quot;npx&quot;,<br>      &quot;args&quot;: [&quot;-y&quot;, &quot;@angular/cli&quot;, &quot;mcp&quot;]<br>    }<br>  }<br>}</pre><p>That’s it. Your AI assistant is now connected to Angular’s “guardian angel.”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/674/1*C15RtirRL3YTEy_qeDvnSw.png" /><figcaption>Angualr MCP Configuration in Cursor</figcaption></figure><h4>Now I gave the AI a direct challenge:</h4><blockquote><em>“Scan my project and tell me which Angular best practices are missing according to the official Angular team recommendations.”</em></blockquote><p>And this is what it came back with.<br> <em>(Brace yourself — my project had some confessions to make.)</em></p><h3>🧩 The MCP Audit Results</h3><p>It started by fetching Angular’s best practices and scanning my workspace structure. Then it generated a clear, structured, prioritized report here’s a small extract :</p><h4>🔴 Critical Missing Best Practices</h4><ol><li><strong>Using </strong><strong>input() and </strong><strong>output() functions instead of decorators</strong></li><li><strong>Modern Control Flow Syntax (@if, @for, @switch)</strong></li><li><strong>Using </strong><strong>inject() instead of constructor injection</strong></li><li><strong>Redundant </strong><strong>standalone: true</strong></li></ol><h4>🟡 Important Best Practices</h4><ul><li>Missing OnPush strategy on ~5 components</li><li>&lt;img&gt; tags instead of NgOptimizedImage</li></ul><p>The report even ended with a <strong>priority plan, </strong>from <em>critical modernizations</em> (like control flow and signal-based inputs) to <em>nice-to-have cleanups</em> (like redundant flags).</p><p>That’s when I realized something powerful: <em>The MCP doesn’t just give answers — it gives direction.</em></p><h3>🔐 The Real Value: Controlled AI</h3><p>As a good practice, I highly recommend installing Angular rules and connecting your AI IDE to Angular MCP to benefit from Angular-aware AI assistance.</p><p>In addition to get_best_practices tool, Angular MCP includes also tools like:</p><ul><li>list_projects : lists all applications and libraries in your Angular workspace</li><li>search_documentation : searches the official Angular docs for APIs, tutorials, and best practices</li></ul><p>And this list keeps growing with <strong>Angular 21</strong>, bringing even deeper project understanding and smarter recommendations directly inside your editor</p><p>what are you waiting for? Go install it — and let Angular MCP keep your AI on the right path. 🚀</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=04e18981055c" width="1" height="1" alt=""><hr><p><a href="https://medium.com/google-developer-experts/meet-the-angular-mcp-your-ais-safety-harness-04e18981055c">👮Meet the Angular MCP: Your AI’s Safety Harness</a> was originally published in <a href="https://medium.com/google-developer-experts">Google Developer Experts</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[This journey is worth all the hassle: My book “Reactive Patterns with RxJS for Angular” made it to…]]></title>
            <link>https://medium.com/google-developer-experts/this-journey-is-worth-all-the-hassle-my-book-reactive-patterns-with-rxjs-for-angular-made-it-to-c89dd7d761e3?source=rss-a5d5b19f6115------2</link>
            <guid isPermaLink="false">https://medium.com/p/c89dd7d761e3</guid>
            <category><![CDATA[angular]]></category>
            <category><![CDATA[google]]></category>
            <category><![CDATA[google-developer-expert]]></category>
            <category><![CDATA[books-and-authors]]></category>
            <category><![CDATA[books]]></category>
            <dc:creator><![CDATA[chebbi lamis]]></dc:creator>
            <pubDate>Mon, 13 Mar 2023 17:06:29 GMT</pubDate>
            <atom:updated>2023-03-13T17:06:29.316Z</atom:updated>
            <content:encoded><![CDATA[<h3>This journey is worth all the hassle: My book “Reactive Patterns with RxJS for Angular” made it to BookAuthority’s best new RxJS books</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*RkVhA1R_Idm1MPXJ" /></figure><p>I’m sharing this story to inspire all women to push past the barriers that limit their growth and take action in their lives.</p><p>If you are thinking of writing your own book and afraid of failure, poor judgment, or lack of time or energy. I want to tell you that this journey is worth all the hassle.</p><p>After one year of hard work my book was published and by the end of last year, it made it to BookAuthority’s best new RxJS books.</p><p>The joy of seeing your first book being published with your name on the cover is hard to beat - it was a milestone moment. Then you will start interacting with your readers who will eventually become your loyal fans. Your audience will start growing and your content will not only help developers from all over the world but also will help you evolve. It is not only a transfer of knowledge from one to another, it is a relationship where two people grow together, the reader and the author. You will start to see yourself making an impact in the real world. That feeling of fulfillment and happiness is priceless. Releasing this book to the public is a dream come true!</p><p>It was definitely not an easy journey, a lot of hard work and dedication, sleepless nights and most of all, fears and a commitment to do it.</p><p>Fears are common and normal, but they don’t have to hold you back from writing your book. With support, encouragement, and the right mindset, you can overcome it all.</p><p>Of course we can’t succeed without the help of others. Through my journey I did meet wonderful people who were supportive of my vision and helped me through mentoring and advice. This book would not have been possible without the help of these people.</p><p>I want to thank <a href="https://medium.com/u/5baaf9d38fdf">David Müllerchen</a>(GDE for Angular and Web Technologies) for reviewing this book, <a href="https://medium.com/u/39abb62c7869">Aristeidis Bampakos</a>(GDE for Angular) who helped me along the way from the start to the publication and the Packt family.</p><p>Special thanks to my family for the unconditional love and support, especially my parents.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c89dd7d761e3" width="1" height="1" alt=""><hr><p><a href="https://medium.com/google-developer-experts/this-journey-is-worth-all-the-hassle-my-book-reactive-patterns-with-rxjs-for-angular-made-it-to-c89dd7d761e3">This journey is worth all the hassle: My book “Reactive Patterns with RxJS for Angular” made it to…</a> was originally published in <a href="https://medium.com/google-developer-experts">Google Developer Experts</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[This journey is worth all the hassle]]></title>
            <link>https://chebbi-lamis.medium.com/this-journey-is-worth-all-the-hassle-df46d9e4cceb?source=rss-a5d5b19f6115------2</link>
            <guid isPermaLink="false">https://medium.com/p/df46d9e4cceb</guid>
            <dc:creator><![CDATA[chebbi lamis]]></dc:creator>
            <pubDate>Tue, 07 Mar 2023 11:30:08 GMT</pubDate>
            <atom:updated>2023-03-10T17:44:14.145Z</atom:updated>
            <content:encoded><![CDATA[<h3>This journey is worth all the hassle: My book “Reactive Patterns with RxJS for Angular” made it to Book’s authority best new RxJS books</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*RkVhA1R_Idm1MPXJ" /></figure><p>I’m sharing this story to inspire all women to push past the barriers that limit their growth and take action in their lives.</p><p>If you are thinking of writing your own book and afraid of failure, poor judgment, or lack of time or energy. I want to tell you that this journey is worth all the hassle.</p><p>After one year of hard work my book Apr 29, 2022 was published and by the end of last year made it to Book’s authority best new RxJS books.</p><p>The joy of seeing your first book being published with your name on the cover is hard to beat, it was a milestone moment. Then you will start interacting with your readers who will eventually become your loyal fans. Your audience will start growing and your content will not only help developers from all over the world but also will help you evolve. It is not only a transfer of knowledge from one to another, it is a relationship where two people grow together, the reader and the author. You will start to see yourself making an impact in the real world. That feeling of fulfillment and happiness is priceless. Releasing this book to the public is a dream come true !</p><p>It was definitely not an easy journey, a lot of hard work and dedication, sleepless nights and most of all, fears and a commitment to do it.</p><p>Fears are common and normal, but they don’t have to hold you back from writing your book. With support, encouragement, and the right mindset, you can overcome it all.</p><p>Of course we can’t succeed without the help of others. Through my journey I did meet wonderful people who were supportive of my vision and helped me through mentoring and advice. This book would not have been possible without the help of these people.</p><p>I want to thank <a href="https://medium.com/u/5baaf9d38fdf">David Müllerchen</a>(GDE for Angular and Web Technologies) for reviewing this book, <a href="https://medium.com/u/39abb62c7869">Aristeidis Bampakos</a>(GDE for Angular) who helped me along the way from the start to the publication and the Packt family.</p><p>Special thanks to my family for the unconditional love and support, especially my parents.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=df46d9e4cceb" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Auth0 in Angular : [Part1]Authenticate your Angular app]]></title>
            <link>https://chebbi-lamis.medium.com/auth0-in-angular-part1-authenticate-your-angular-app-20ba722fbe51?source=rss-a5d5b19f6115------2</link>
            <guid isPermaLink="false">https://medium.com/p/20ba722fbe51</guid>
            <category><![CDATA[auth0]]></category>
            <category><![CDATA[authentication]]></category>
            <category><![CDATA[auth0-ambassador]]></category>
            <category><![CDATA[angular]]></category>
            <dc:creator><![CDATA[chebbi lamis]]></dc:creator>
            <pubDate>Sun, 30 Jan 2022 15:05:18 GMT</pubDate>
            <atom:updated>2022-01-31T15:58:13.506Z</atom:updated>
            <content:encoded><![CDATA[<h3>🔑Auth0 in Angular : [Part1]Authenticate your Angular app</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*X00wZ194sKAMTBBH5NWXkA.png" /></figure><p>This is part 1 of the “Auth0 in Angular” beginners series. In this series we will learn how to secure an Angular application using Auth0. This article covers the user authentication with Auth0.</p><p>You won’t become an Auth0 pro after reading this series, but you’ll have a good foundation that will help you start using Auth0 in your everyday Angular development.</p><h3>Step 1 : Configure an Auth0 application</h3><p>After setting up an account in <a href="https://auth0.com/">Auth0</a>, head over to the Applications section on the left menu, click on the Applications sub-menu. Then, click on the “Create Application” button and make sure to choose the Single page web applications option and click on create. I named the application “My App”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EdHRwJMfBPKCjqq_6eF1xA.gif" /><figcaption>Auth0 application creation</figcaption></figure><p>Now that everything is setup correctly, go to the settings tab, you will find :</p><ul><li>Basic information including the domain, client Id, client Secret etc. We will need the Domain and Client ID properties later to configure our Angular app.</li><li>Application properties including the application type, logo, URIs etc</li><li>Tokens properties such as refresh token, ID token etc</li><li>Advanced properties such as Grant Types, Certificates, Ws-Federation etc</li></ul><p>We will need to set the Callback URLs , Logout URLs and Allowed Web origins properties (available in the “Settings” tab under “Application URIs” section) to <a href="http://localhost:4200./">http://localhost:4200</a> which is the URL of our Angular app and save the changes as follows:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/513/0*ob1YgBqm_VkQRR2t.png" /></figure><h3>Step 2 : Create a User</h3><p>You have to create a user for your application by going to the menu Users under User Management and hit the button “Create User”. A popup will show up, you have to fill your user details and submit.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pOcp6ulnWZL2OfsJhX-pVw.png" /></figure><p>Now that we have configured our Auth0 app and create the user let’s move to the Angular part configuration.</p><h3>Step 3 : Install and register the Auth0 Angular SDK</h3><p>Open your Angular application and install <a href="https://github.com/auth0/auth0-angular">auth0-angular</a> which is a library that helps though providing many utilities integrating Auth0 into an Angular 9+ applications.</p><pre>ng add @auth0/auth0-angular</pre><p>Now let’s register and configure the authentication module in our Angular app as follows :</p><ul><li>Open the app.module.ts file</li><li>Import the AuthModule type from the @auth0/auth0-angular package that contains all the services required for the SDK to work properly.</li><li>Add AuthModule to your imports by calling AuthModule.forRootand pass as a parameter the properties domain and clientId</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/794/1*gSfnFad8-1YF6oO59Anmcw.png" /></figure><p>The values of the properties domain and clientId should match respectively the value of the “Domain” and “Client ID” properties available under the “Settings” tab, section “Basic Information” of the Auth0 application we registered in the Step 1.</p><blockquote>For more details about the forRoot pattern please head to <a href="https://angular.io/guide/singleton-services#the-forroot-pattern">https://angular.io/guide/singleton-services#the-forroot-pattern</a></blockquote><h3>Step 4: Add Login to your Application</h3><p>The Auth0 SDK provides useful apis to quickly implement authentication in your Angular apps, such as the loginWithRedirect() method from the AuthService service class that :</p><ul><li>Redirects your users to the Auth0 Universal Login Page, where Auth0 can authenticate them.</li><li>Redirects your users back to your application when the authentication is successful</li></ul><p>In order to use this method, you should inject the AuthService in your login component and call the method loginWithRedirect()when logging in</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/834/1*FRwmICb4eajBFJN4z1tt7g.png" /></figure><p>Then, you should call the login() method when clicking on the “Log in” button in your LoginComponent template file as follows :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/754/1*BkYyIxHWBZzPSffU5ot7sw.png" /></figure><p>This way when you click on the “Log in” button you will get redirected to the Auth0 Universal Login Page and if the authentication is successful you will get redirected back to your app.</p><p>You can checkout your authentication state by going to the application cookies, the values of the authentication cookies will be true as follows :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*x3Au1IQU6ryAipRB5wuPWA.png" /></figure><p>So far so good ! But with this example the “Log in” button will always be visible even if the authentication is successful. To resolve this we can use the exposed observable isAuthenticated$ from the AuthService to check the authentication state and only display the “Log in” button when the value is false as follows :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nal_csAfHuxGSGGsgU5Qhg.png" /></figure><p>The async pipe subscribes automatically to the input Observable (isAuthenticated$in our case) when the component is created and unsubscribes automatically when the component is destroyed. Besides, it always returns the last value emitted by the input Observable.</p><h3>Step 5: Add Logout to your Application</h3><p>Now for the logout part, it’s the exact same thing as the login except the method to call. This time we will use the logout() method from the AuthService in our LogoutComponent as follows :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oZdsZo9fCjfcuENxsjKmcA.png" /></figure><p>Let’s break down what is happening at the level of this code. We injected the AuthService in our LogoutComponent and implemented a logout() method that calls the method logout()from the AuthService. This method takes as input an optional configuration object of type LogoutOptions. We will use the property ‘returnTo’ from this object to customize the logout redirect URL. In our case we will redirect to the original location available in the “document”. In order to have access to the “document” we injected the document constant available in the @angular/common package as a dependency.</p><p>Now in the LogoutComponent template file we should call the logout() method after clicking on the “Log out”button. The button should only be visible when the user is authenticated.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qJl_8bBAyfU319DHF-70RQ.png" /></figure><p>Now if we look into the browser’s network after performing the logout we will see two ongoing requests. In fact, executing logout() redirects your users to your Auth0 logout endpoint (<a href="https://your_domain/v2/logout">https://YOUR_DOMAIN/v2/logout</a>) and then immediately redirects them to your application.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*r8yoP_z6hIAHpv3sRktkRQ.png" /></figure><p>And That’s it !</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/1*3NivYaVmx88_XGC2ilNkZg.gif" /></figure><p>Thanks for reading 🙂</p><p>In the next article we will explore the user preferences and roles management using Auth0.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=20ba722fbe51" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[RxJs|Pluck: A pound of pluck is worth a ton of map !]]></title>
            <link>https://chebbi-lamis.medium.com/rxjs-pluck-a-pound-of-pluck-is-worth-a-ton-of-map-f7cc600db371?source=rss-a5d5b19f6115------2</link>
            <guid isPermaLink="false">https://medium.com/p/f7cc600db371</guid>
            <category><![CDATA[typescript]]></category>
            <category><![CDATA[angular]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[rxjs]]></category>
            <category><![CDATA[rxjs-6]]></category>
            <dc:creator><![CDATA[chebbi lamis]]></dc:creator>
            <pubDate>Sun, 08 Dec 2019 19:52:32 GMT</pubDate>
            <atom:updated>2019-12-08T20:07:30.377Z</atom:updated>
            <content:encoded><![CDATA[<h3>RxJs|Pluck: A pound of pluck is worth a ton of map !</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*FyK4Ezql535SFizr.png" /></figure><h3>Introduction</h3><p>Our goal today is to get familiar with the <em>pluck </em>operator and learn in which scenarios it should be used instead of the <em>map </em>operator.</p><h3>Map vs Pluck operators</h3><p>The map operator is used to apply a given function to each value emitted by the source Observable. Below an example:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/0ff201a1bc1fec434e99b7cc9ea9f3b9/href">https://medium.com/media/0ff201a1bc1fec434e99b7cc9ea9f3b9/href</a></iframe><p>However, if you only want to pick one of the nested properties of every emitted object, a far better choice is the <strong>pluck</strong> operator !<br>Given the last example, let’s pick only the band’s name from the emitted object:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/01197630348016760b2dd89c1fc92604/href">https://medium.com/media/01197630348016760b2dd89c1fc92604/href</a></iframe><p>Now let’s pick the hit’s title of the best-selling album:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/3c17801abaa484c56dc9933861f0e477/href">https://medium.com/media/3c17801abaa484c56dc9933861f0e477/href</a></iframe><p>As you may have noticed, you can provide one or many properties to the pluck operator. Many properties are provided if you want to pick a nested object’s property. In the previous example pluck will traverse the tree looking for <strong>bestseller.hit.title</strong> and won’t fail if one of the parameters is null, it will return undefined. <strong>Cool right 😉 ?</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/238/1*5oqAfdP52niWeOxony3YNQ.gif" /></figure><p>In this case, using map would be kind of a pain (because of the nullability of bestseller), the solution with pluck is less verbose.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/7125575e0039ca0b8445a16876d44a7c/href">https://medium.com/media/7125575e0039ca0b8445a16876d44a7c/href</a></iframe><h3>Conclusion</h3><p>This article covered the basics of the pluck operator and what makes it different from the map operator. If you are interested I have made another Angular application using the pluck operator, the implementation is detailed in <a href="https://medium.com/@chebbi.lamis/rxjs-pluck-a-pound-of-pluck-is-worth-a-ton-of-map-the-demo-fa3ab32d4f22">this article</a>.</p><p><strong>Live demo </strong><a href="https://stackblitz.com/edit/angular-dhje7n?file=src%2Fapp%2Fapp.component.ts"><strong>here </strong></a>🚀.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f7cc600db371" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[RxJs|Pluck: A pound of pluck is worth a ton of map. The Demo !]]></title>
            <link>https://chebbi-lamis.medium.com/rxjs-pluck-a-pound-of-pluck-is-worth-a-ton-of-map-the-demo-fa3ab32d4f22?source=rss-a5d5b19f6115------2</link>
            <guid isPermaLink="false">https://medium.com/p/fa3ab32d4f22</guid>
            <category><![CDATA[typescript]]></category>
            <category><![CDATA[pluck]]></category>
            <category><![CDATA[rxjs-6]]></category>
            <category><![CDATA[angular]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[chebbi lamis]]></dc:creator>
            <pubDate>Sun, 08 Dec 2019 19:49:08 GMT</pubDate>
            <atom:updated>2019-12-08T19:50:25.749Z</atom:updated>
            <content:encoded><![CDATA[<h3>RxJs|Pluck: A pound of pluck is worth a ton of map. The Demo !</h3><p>In the previous story I explained the usage of the pluck operator with two basic examples, nothing fancy. Now let’s quickly go through the app !</p><p>I found the pluck operator really useful when it comes to traversing HTML events. The demo is simply about coloring the cells of a grid by clicking on them. There are also circles inside the cell that will be colored.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/462/1*46ukyaYkh3AD5v22oIwGWg.gif" /></figure><h3>app.component.html</h3><p>Here is the HTML template. The circles are put in the even cells of the first row and the odd cells of the third row.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/dc11ce879ea6f3cc8bfd42d5bb6d1d45/href">https://medium.com/media/dc11ce879ea6f3cc8bfd42d5bb6d1d45/href</a></iframe><h3>app.component.ts</h3><p>In the ngAfterViewInit() method we will create an Observable that will publish click events on the cell elements using the <a href="https://rxjs-dev.firebaseapp.com/api/index/function/fromEvent"><strong>fromEvent </strong></a>operator. Then thanks to the <strong>pluck </strong>operator we will pick the source element and change the background color.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/8fbe22610dd3431021cc8b4fb2682d59/href">https://medium.com/media/8fbe22610dd3431021cc8b4fb2682d59/href</a></iframe><p>And with a little bit of css we’re done :) ! Check out the <strong>live demo</strong>🚀<a href="https://stackblitz.com/edit/angular-dhje7n?file=src%2Fapp%2Fapp.component.ts">here</a> and here is the <a href="https://github.com/lamisChebbi/ng-color-cells">github repository</a>.</p><h3>Conclusion</h3><p>I hope you liked this article😊 . If you did, please share it with your friends!</p><p>Happy Coding!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fa3ab32d4f22" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Live Angular DataTable? Look no further, RxJS is the answer]]></title>
            <link>https://chebbi-lamis.medium.com/live-angular-datatable-look-no-further-rxjs-is-the-answer-d2f7acc4c0a5?source=rss-a5d5b19f6115------2</link>
            <guid isPermaLink="false">https://medium.com/p/d2f7acc4c0a5</guid>
            <category><![CDATA[websocket]]></category>
            <category><![CDATA[realtime]]></category>
            <category><![CDATA[angular]]></category>
            <category><![CDATA[rxjs]]></category>
            <category><![CDATA[typescript]]></category>
            <dc:creator><![CDATA[chebbi lamis]]></dc:creator>
            <pubDate>Tue, 26 Nov 2019 21:33:15 GMT</pubDate>
            <atom:updated>2019-12-06T15:54:57.533Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*zQ19GQfaD1ZQxYnx" /><figcaption>Photo by <a href="https://unsplash.com/@aronvisuals?utm_source=medium&amp;utm_medium=referral">Aron Visuals</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Have you ever wondered how to handle live updates in your Angular application ? Are you using WebSockets to push periodically a new stream of data to your client? Then, you’ve come to the right place !</p><h3><strong>Prerequisites</strong></h3><p>Basic knowledge of Angular &amp; RxJs is required.</p><h3><strong>Introduction</strong></h3><p>If you have a WebSocket server that pushes the newest version of the data and you want to consume these updates at real time. Look no further, RxJS is the answer ! I will tell you in the following sections how you achieve this step by step.</p><h3>You’ve just said RxJS ?</h3><p>Yes ! what you’ll be really glad to know, is that RxJs ships with the <a href="https://rxjs-dev.firebaseapp.com/api/webSocket/WebSocketSubject">WebSocketSubject </a>which is a wrapper around the w3c-compatible webSocket object available in the browser allowing to both send and receive data via WS connection. WebSocketSubject is a special type of RxJS <a href="https://rxjs-dev.firebaseapp.com/api/index/class/Subject">Subjects</a>. In short, Subjects are observers and observable at the same time.</p><h4><strong>Okay, but how to use it ?</strong></h4><p>In order to use it, all that you have to do is calling the webSocket factory function that produces this special type of subject and takes as a parameter the endpoint of your ws server</p><pre>import { webSocket } from &#39;rxjs/webSocket&#39;;<br>const subject = webSocket(&#39;ws://localhost:8081&#39;);</pre><p>This way you have a ready to use subject that you should subscribe to in order to establish the connection with your endpoint and start receiving and sending some data.</p><p><strong>Simple, right ?</strong></p><p>Now let’s see the main implementation steps.</p><p><strong>Step 1: Isolate the webSocket connection management in a separate service as follows:</strong></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/3f6360d8f1017f97862b963841b78294/href">https://medium.com/media/3f6360d8f1017f97862b963841b78294/href</a></iframe><p><strong>connect()</strong>: creates a WebSocketSubject if no one is created. The URL of the ws endpoint is externalized in the environment file.</p><p><strong>disconnect()</strong>: closes the connection.</p><p><strong>dataUpdates$()</strong>: returns an observable that we will subscribe to.</p><p><em>connect() and disconnect() are private methods that can be used only within the service for security purposes.</em></p><p><strong>Step2: Inject this service in your live Angular component</strong></p><p>In this example my live component is holding a <a href="http://primefaces.org/primeng/#/table">PrimeNG data table</a>. For the sake of this tutorial, I’m using fake financial transactions.</p><pre>constructor(private dataService: DataService) {}</pre><p>Step 3: Declare an Observable👀that will hold the stream of data over time.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/933a232b86eca7baa006d682a360cb5e/href">https://medium.com/media/933a232b86eca7baa006d682a360cb5e/href</a></iframe><p>You can register callbacks to process the incoming messages from the server and get notified when an error happens or when the connection is closed, as implemented in the code above. By default, incoming messages are deserialized using JSON.parse(), however we can apply a custom deserialization strategy using <a href="https://rxjs-dev.firebaseapp.com/api/webSocket/WebSocketSubjectConfig">WebSocketSubjectConfig</a>.</p><p><strong>Step4: Subscribe to that observable in the component’s template.</strong></p><pre>[value]=”transactions$ | async”</pre><p>The pipe async will manage for us the subscription and unsubscription to the observable.</p><p><strong>Step5 : Implement the ngOnDestroy to release the subscription</strong></p><pre>ngOnDestroy() {<br>this.service.disconnect();<br>}</pre><p><strong>Step6: Ice on the cake 🍰 a good change detection strategy 😉</strong></p><p>Use the OnPush change detection strategy to gain in performance</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/890/1*ApdUpa9PAEJwcd9McMYDjQ.gif" /></figure><p><strong>Conclusion</strong></p><p>In just a few steps, we’ve created a live Angular table using RxJS WebSocketSubject: soon we can go deep in catching errors, reconnection policies and state management but this will come in another story. 🎉</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d2f7acc4c0a5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[JSCamp Review: One of the best JS events of 2018]]></title>
            <link>https://chebbi-lamis.medium.com/jscamp-review-one-of-the-best-js-events-of-2018-9960e707475b?source=rss-a5d5b19f6115------2</link>
            <guid isPermaLink="false">https://medium.com/p/9960e707475b</guid>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[webassembly]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[rust]]></category>
            <category><![CDATA[jsconf]]></category>
            <dc:creator><![CDATA[chebbi lamis]]></dc:creator>
            <pubDate>Sun, 02 Dec 2018 21:05:52 GMT</pubDate>
            <atom:updated>2018-12-02T21:05:52.166Z</atom:updated>
            <content:encoded><![CDATA[<p>I have attended this year’s JSCamp that took place in Barcelona. I’m super excited to finally share with you my own personal review. It’s been in the works for quite sometimes now. Let’s get right into it!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LZ4kzlN8M9C5Km6m1la2EQ.jpeg" /></figure><h4>What is the story behind this event ?</h4><p>The event, initially called AngularCamp, emerged from the launch of <a href="https://www.meetup.com/AngularJS-Beers/">AngularBeers </a>meetup. The community organized the first edition of the event in January 2016, the second one was held in July 2016 and the third in July 2017. This year, the conference was renamed to JSCamp to cover more variety of topics around the JS ecosystem. The event was successful, 530 developers from 52 countries have attended to learn more about the latest and the greatest of JS.</p><h4>A tale of two asyncs by Ashley Williams</h4><p>I’m not going to go through all the topics covered in this talk but I will shed some light on one that really got my attention, Rust.</p><p>What is Rust ? Rust is a low level programming language, released in 2015 by Mozilla. It is designed for speed, safety and productivity. It is gaining more and more popularity and was voted the most loved language in <a href="https://insights.stackoverflow.com/survey/2018/#most-loved-dreaded-and-wanted">stackoverflow 2018 survey</a>. Many companies use it in production namely Mozilla, Dropbox, npm ect. You can checkout the full list of Rust’s friends <a href="https://www.rust-lang.org/en-US/friends.html">here</a>. At this level you may be wondering what makes it different from the other languages ? So, it is time to list its strengths:</p><ul><li>Memory Safe: The developer doesn’t do any pointer arithmetic or manage memory, as can be necessary in C or C++ programs.</li><li>Fast</li><li>Multi-paradigm</li><li>Great at concurrent programming</li><li>Has a great community</li></ul><h4><strong>Rise above the framework </strong>by Mike Hartington</h4><p>This quote sums what this talk is all about:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/579/0*_IVvSh79OdOhlzCa" /></figure><p>If you want to build a web application using one of the most popular JS frameworks out there, the first thing you’ll ask yourself is which framework should I use ? JS frameworks are popping up like mushrooms nowadays and you have more than one choice: React, Preact, Angular, Vue, Ember, BackBone ect. You’ll end up by being confused.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/295/1*IbAGhg4iKfcR2AOIGRfooA.gif" /></figure><p>According to Mike Hartington, don’t rely on frameworks just check what you can do with web standards.</p><p>What you really need to build a web app ? Mike broke it down into 3 pieces : Styling technology , Scripting language and the building blocks which are the components. The standard offers the CSS for styling, JavaScript for scripting and for components ? What’s the alternative ? Let’s focus a little bit on this concept.</p><p>Most modern frameworks are interested in components. The first move from MVC to CBA was made by React and then it was adopted by Angular and Vue. The heart of CBA is a desire to provide greater code reusability and abstraction by bundling functionality into small components. Is there a standardized way to extend DOM ? In fact, there is a way : Web Components specification. On the impulse of Google and other companies, the W3C launched the <a href="https://www.webcomponents.org/introduction">WebComponents</a> specification which aims to bring back the concept of custom and reusable tags in the standard.</p><p>Webcomponents are a hot topic today. Some JS frameworks decided to get on board. Angular came up with Angular elements and Vue with Vue targets. But, this is not ideal cause if you use Angular for example you’ll still include a lot of Angular API: Dependency Injection and how it creates DOM nodes. So you are eventually including the framework itself.</p><p>Moral of the story : web standards will save us no matter what. This is the choice that ionic team made with version 4.</p><p>And this makes a lot of sense. On the one hand, <strong>Web standards helps in building better apps with less code. </strong>The less code needed to be sent to the browser, the better and faster the application will run. On the other hand, if you want to migrate from one technology to another you’ll not rewrite all your code. And the truth is that web sites from 1996 still work on modern browsers, and we shouldn’t thank anyone for that.</p><h4>The past, present and future of the web by Steve Klabnik</h4><p>With Steve Klabnik we traveled back in time.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*Rv9sg659MuLE6pYkuYiggQ.gif" /></figure><p>Where we came from ?</p><p>In the beginning it was only HTML. The first website using HTML went live August 6 1991.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*G7GQH-mT4UON6Jmq" /></figure><p>CSS was introduced on October 10, 1994 then JavaScript came along in 1994. Therefore, the core technologies we use to build the web were set 23 years ago. The web remains the same, only refinement was made, not a revolution but things are going to change with the birth of something called “WebAssembly”.</p><p>What is webAssembly or wasm ?</p><ul><li>A new low-level binary format for the web. It is like the bytecode in Java. The bytecode is executed in the Java virtual machine and webassembly in the Javascript virtual machine.</li><li>Compiled from other languages (which means that you can write something like c,c++, Rust and then compile it into webAssembly)</li><li>offer maximized performance (it is designed for speed and is faster than JavaScript).</li><li>has shipped in the four major browsers (Chrome , firefox, Safari, Microsoft Edge)</li></ul><p>It is not designed to replace JS. The two are meant to cooperate. JS in the high level and Wasm in the low level. Today, webpack, google earth and unity are using webAssembly.</p><p>There’s also a project which is under development called “<a href="https://github.com/nebulet/nebulet">Nebulet </a>OS” that aims to create an operating system built with wasm.</p><p>I think many of you are familiar with AutoCAD. The good news is that it has migrated to the web today. Google was showcasing this in <a href="https://www.youtube.com/watch?v=D4fNcX0Q9gA">Google IO 2018</a>.</p><p>Wasm makes us dream about many things, it will have a significant impact on how web applications will be developed in the future.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/685/0*QlbKYfdVEcnBi_P9" /></figure><h4>A tale of types, classes and Maps by Benedikt Meurer</h4><p>Modern JS virtual machines like <strong>V8, SpiderMonkey, Chakra and JavaScript Core </strong>had their spot on the show. This talk was really informative; <em>Benedikt Meurer</em> told us what happens behind the scenes when we run our JS code, the different steps of optimization and compilation, leading ultimately to some tips on how to optimize the code we write.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*6pBYrG8dBpLFfMo5" /></figure><h3>Experience implementing a WebP decoder by Kenneth Christiansen</h3><p>Kenneth Christiansen, showed us how to implement a webP decoder using webassembly and service workers. For those who don’t know, WebP is an efficient image format, designed by Google. It has a better quality and smaller files than jpeg.</p><h3>Break Up With Your Frontend Monolith by Elisabeth Engel</h3><p>This talk was done in a very theatrical way, focused on Micro Frontends. Webapps today tend to become extremely complex. And the frontend layer is getting messier and messier, all in one place. What about thinking of a solution like microservices, this time for the frontend. From this arises the Micro frontends approach. So when they say Micro Frontends what do they mean?</p><ul><li>Breaking a web application into pages and/or features</li><li>Each feature owned by a single team</li><li>Allow each feature to be developed, tested and deployed independently</li></ul><p>But how can we do it ? Elizabeth presented four approaches. The approach that fits the most is the AppShell. More details in the video below:</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2Fvideoseries%3Flist%3DPLB17qI-lepyhGQCeq1bGawXeftOYMZtRj&amp;url=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DJ30MEXMntLM&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FJ30MEXMntLM%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/d226b070b3adcafe51ab0b08b7310009/href">https://medium.com/media/d226b070b3adcafe51ab0b08b7310009/href</a></iframe><h3>WebXR by Michaela Lehr</h3><p>What we call an immersive web has been available for nearly a year now. The API that makes it possible is webVR. But this API has shifted gears and became webXR which includes VR and AR and everything in between. it allows developers to create immersive content that runs on all VR and AR devices. You can find details about WebXR Device API by visiting the <a href="https://github.com/immersive-web/">Immersive Web Community Group</a>.</p><p>This was ultimately the heart of this talk. Michaela Lehr presented two libraries that make it easy to build 3D, 360 and VR experiences in the web: REACT 360 (built on top of React) and A-FRAME (by Mozilla). She showed us also some code to build a simple panorama photos using React 360. For those who are curious about A-Frame, just check out <a href="https://www.youtube.com/watch?v=1MskH9uqOyQ">their awesome showcase</a>.</p><h3>Machine Learning in the browser by Lian Li</h3><p>I believe that many of us are interested in ML. Lian Li spoke about client side machine learning. OMG! The web is evolving in a scary way. What I liked the most about this talk is the simplicity. All the concepts were clear.</p><p>Lian started by explaining the differences between expert system and ML. ML produces rules given input and outputs. However, expert systems produce outputs given inputs and rules. We move then to client side ML which is designed for speed, availability and security. If you can do your predictions in the client side why wait for the server to answer. <a href="https://js.tensorflow.org/">Tensorflow.js API</a> is the open source library that you can use to define, train, and run machine learning models entirely in the browser. It’s the successor to deeplearn.js.</p><h3>Semantic, Searchable Webapps with Angular by Martin Splitt</h3><p>This talk is mainly about SEO! SEO is a very big sea. Martin Splitt started by explaining how googlebot used to work. Googlebot is nothing but a program that uses a browser to go to a website. Extracts a content and then index it. If pages contain links to other pages the cycle continues. But web apps today are built differently. If we take Angular as an example. The first thing we serve is something like this</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/704/1*1eNBi4PRbfr4T9UrSZLZ_g.png" /></figure><p>&lt;app-root&gt; is not a known script tag so googlebot can’t recognize it. He explained different solutions to solve this problem. The ultimate one was server side rendering, which consists in injecting the content of the tag at the server level, this way the tag will be recognized. Then he introduced briefly the project Angular Universal which is the angular solution for server side rendering. React, Vue and Ember has also a SSR story. Here are the main advantages of SSR:</p><ul><li>Better performance of the first page</li><li>Enable indexing your web pages to reference them by the SE</li></ul><p>And finally, some good tips for better web apps by Martin.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/472/0*px9S0OtFFgmgdRp_" /></figure><h3>Keep Betting on JavaScript by Kyle Simpson</h3><p>Last but not least, the one and only Kyle simpson gave an incredible talk about the evolution of Javascript in a period of 23 years.A look back at how far we’ve come to see what the path ahead may look like for JavaScript from ES1 to ES2017. Many things have been added to JS namely Proxy, source map, TypedArray, DataView, Atomics, Babel,..</p><p>He compared also JS the language and JS the machine. He said that they are becoming “two different galaxies”.</p><p>To conclude, every step of the way people have bet against JS, JS keeps winning. This is the heart of the talk.</p><p>Many of you may know the creator of JS, Breindan Eich. He famously said: Always bet on JavaScript.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/804/0*Vga_rYTBsgZXomtP" /></figure><h4>Conclusion</h4><p>I would call it the web in all its glory. It covered a wide variety of topics. The Workshops also were as interesting as the talks. Personally I’ve attended Vue.js workshop and it was an opportunity for me to learn Vue.</p><p>Definitely one of the best events this year. Highly recommended for developers.</p><p>Thank you all for reading this. More articles to come soon.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9960e707475b" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>