<?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 Seb.L. on Medium]]></title>
        <description><![CDATA[Stories by Seb.L. on Medium]]></description>
        <link>https://medium.com/@Seb_L?source=rss-3d231ed7fbc2------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*0bIWc8l8hBgd4B3LXfzzsg.jpeg</url>
            <title>Stories by Seb.L. on Medium</title>
            <link>https://medium.com/@Seb_L?source=rss-3d231ed7fbc2------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 05 Dec 2026 05:09:37 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@Seb_L/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[Typing NextJs router query params with Zod coerce]]></title>
            <link>https://medium.com/@Seb_L/typing-nextjs-router-query-params-with-zod-coerce-e240ab430c2b?source=rss-3d231ed7fbc2------2</link>
            <guid isPermaLink="false">https://medium.com/p/e240ab430c2b</guid>
            <category><![CDATA[router]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[frontend]]></category>
            <category><![CDATA[nextjs]]></category>
            <dc:creator><![CDATA[Seb.L.]]></dc:creator>
            <pubDate>Wed, 14 Dec 2022 09:27:27 GMT</pubDate>
            <atom:updated>2022-12-14T09:27:27.773Z</atom:updated>
            <content:encoded><![CDATA[<p>Strongly type and coerce your router query params data with Zod <a href="https://zod.dev/?id=coercion-for-primitives">https://zod.dev/?id=coercion-for-primitives</a></p><h3>Create a hook to extend <strong>useRouter</strong></h3><p>Here we are getting a Zod schema as an argument to parse (z.parse) and type (z.infer) our query params.</p><pre>import { useRouter } from &quot;next/router&quot;;<br>import { z } from &quot;zod&quot;;<br><br>export const useTypedRouter = &lt;T extends z.Schema&gt;(schema: T) =&gt; {<br>  const { query, ...router } = useRouter();<br><br>  return {<br>    query: schema.parse(query) as z.infer&lt;typeof schema&gt;,<br>    ...router<br>  };<br>};</pre><h3>Usage</h3><p>The <em>routerSchema</em> uses the <strong>coerce</strong> feature from Zod to transform the type of our query string, here boolean and number.</p><pre>const routerSchema = z.object({<br>  someText: z.coerce.string().optional(),<br>  someNumber: z.coerce.number().optional(),<br>  someBool: z.coerce.boolean().optional()<br>});<br><br>export default () =&gt; {<br>  const { query } = useTypedRouter(routerSchema);<br><br>  return (<br>    &lt;div&gt;<br>      ...<br>    &lt;/div&gt;<br>  )<br>}</pre><p>For a URL like <strong>/?someNumber=4<br>query.someNumber</strong> is now a <strong><em>number</em></strong> instead of a <strong><em>string|string[]</em></strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e240ab430c2b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Compose your Turborepo’s Storybooks and deploy them to Vercel]]></title>
            <link>https://medium.com/@Seb_L/compose-your-turborepos-storybooks-and-deploy-them-to-vercel-94befbb78a56?source=rss-3d231ed7fbc2------2</link>
            <guid isPermaLink="false">https://medium.com/p/94befbb78a56</guid>
            <category><![CDATA[storybook]]></category>
            <category><![CDATA[monorepo]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[front-end-development]]></category>
            <category><![CDATA[turborepo]]></category>
            <dc:creator><![CDATA[Seb.L.]]></dc:creator>
            <pubDate>Fri, 09 Dec 2022 23:47:20 GMT</pubDate>
            <atom:updated>2022-12-10T07:50:52.326Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9peVCdgQCG_NGnmFYURvVw.png" /></figure><h3>TLDR; Show me the repo</h3><p>Here is the <a href="https://github.com/Seb-L/turborepo-storybook-composition-starter">starter repo</a>.</p><h3>What are we going to do?</h3><p>We will use the basic Turborepo project <a href="https://turbo.build/repo/docs/getting-started/create-new">generated by the cli</a>, feel free to adapt to your needs.</p><pre>- 📂 apps<br>   - 📂 docs &lt;- This is going to be used as the main storybook project<br>   - 📂 web &lt;- our web app<br>- 📂 packages<br>   - 📂 ui &lt;- the design system<br>- 📄 turbo.json</pre><p>Each project (<em>docs</em>, <em>web</em> and <em>ui</em>) is going to have its own Storybook instance and 3 <strong>package.json</strong> scripts, <strong>storybook:dev</strong>, <strong>storybook:build </strong>and <strong>storybook:move</strong>.</p><p>The <strong>docs</strong> project will be our primary Storybook instance and reference all the other ones.</p><h3>How does it work</h3><p>Storybook has a feature named “<a href="https://storybook.js.org/docs/react/sharing/storybook-composition">Storybook Composition</a>”.</p><p>This allows you to create a main Storybook instance and link other published Storybooks.</p><p>Then each can have its config, add-ons, repo, or even CI pipeline or dev team while having a single entry point for all of them after publishing.</p><p>So how to use this feature when you have your web app, docs and design system in a <a href="https://turborepo.org/">Turborepo</a> monorepo?</p><p>Another way to use this feature is to reference other locally generated Storybooks as “refs” instead of absolute web URLs.</p><p>Then the main Storybook instance will automatically use the generated <strong>stories.json</strong> file from every ref to populate the interface.</p><p>The trick here is to build all the Storybooks projects in a folder accessible by Vercel during deployment.</p><h3>Adding storybook and package.json scripts</h3><p>Add a storybook instance and the script commands to each project (<em>apps/docs</em>, <em>apps/web</em>, <em>packages/ui</em>)</p><p>Ex for <strong>web</strong>:</p><pre>cd apps/web<br>npx storybook init</pre><p>To generate the needed<strong> stories.json</strong> file at build time, we have to activate the <strong>storyStoreV7</strong> feature in all our <strong>.storybook/main.js</strong> files:</p><pre>module.exports = {<br>  features: {<br>     storyStoreV7: true,<br>  },<br>}</pre><p>Then add the following scripts commands to each workspace’s <strong>package.json</strong> file:</p><ul><li><strong>storybook:dev</strong> will be used for our local development</li><li><strong>storybook:build</strong> will trigger the build.</li><li><strong>storybook:move</strong> will move the generated statics to the right folder before publishing on Vercel</li></ul><p><strong>apps/docs/package.json</strong></p><pre>{<br>   // ...<br>   &quot;scripts&quot;: {<br>      // ...<br>      &quot;storybook:dev&quot;: &quot;start-storybook -p 6006&quot;,<br>      &quot;storybook:build&quot;: &quot;build-storybook --quiet&quot;,<br>      &quot;storybook:move&quot;: &quot;mv storybook-static ../../storybook-static&quot;,<br>   },<br>}</pre><p><strong>apps/web/package.json</strong></p><pre>{<br>   // ...<br>   &quot;scripts&quot;: {<br>      // ...<br>      &quot;storybook:dev&quot;: &quot;start-storybook -p 6007&quot;,<br>      &quot;storybook:build&quot;: &quot;build-storybook --quiet&quot;,<br>      &quot;storybook:move&quot;: &quot;mv storybook-static ../../storybook-static/web&quot;,<br>   },<br>}</pre><p><strong>apps/ui/package.json</strong></p><pre>{<br>   // ...<br>   &quot;scripts&quot;: {<br>      // ...<br>      &quot;storybook:dev&quot;: &quot;start-storybook -p 6008&quot;,<br>      &quot;storybook:build&quot;: &quot;build-storybook --quiet&quot;,<br>      &quot;storybook:move&quot;: &quot;mv storybook-static ../../storybook-static/ui&quot;,<br>   },<br>}</pre><h3>Setting up the main Storybook</h3><p>In our <strong>apps/docs/.storybook/main.js</strong> file</p><pre>module.exports = {<br>  &quot;stories&quot;: [<br>    &quot;../**/*.stories.mdx&quot;,<br>    &quot;../**/*.stories.@(js|jsx|ts|tsx)&quot;<br>  ],<br>  refs: [<br>    {<br>      title: &#39;Web&#39;,<br>      url: &#39;web/&#39;,<br>      url: process.env.NODE_ENV === &#39;development&#39;<br>        ? &#39;http://localhost:6007/&#39;<br>        : &#39;web/&#39;,<br>    },<br>    {<br>      title: &#39;Ui&#39;,<br>      url: &#39;ui/&#39;,<br>      url: process.env.NODE_ENV === &#39;development&#39;<br>        ? &#39;http://localhost:6008/&#39;<br>        : &#39;ui/&#39;,<br>    }<br>  ],<br>  // ...<br>}</pre><p>During development, each ref will listen to the dedicated localhost servers, after the build, it will target the <strong>web</strong> and <strong>ui</strong> relative folders to search for the <strong>stories.json</strong> files.</p><h3>Update the turbo.json file and root package.json</h3><p><strong>turbo.json</strong></p><pre>{<br>  &quot;$schema&quot;: &quot;https://turbo.build/schema.json&quot;,<br>  &quot;pipeline&quot;: {<br>    &quot;build&quot;: {<br>      &quot;dependsOn&quot;: [&quot;^build&quot;],<br>      &quot;outputs&quot;: [&quot;dist/**&quot;, &quot;.next/**&quot;]<br>    },<br>    &quot;lint&quot;: {<br>      &quot;outputs&quot;: []<br>    },<br>    &quot;dev&quot;: {<br>      &quot;cache&quot;: false<br>    },<br>    &quot;storybook:dev&quot;: {<br>      &quot;cache&quot;: false<br>    },<br>    &quot;storybook:build&quot;: {<br>      &quot;outputs&quot;: [&quot;storybook-static/**&quot;]<br>    },<br>    &quot;storybook:move&quot;: {<br>      &quot;cache&quot;: false<br>    }<br>  }<br>}</pre><p><strong>package.json</strong></p><pre>{<br>  // ...<br>  &quot;scripts&quot;: {<br>    // ...<br>    &quot;storybook:dev&quot;: &quot;turbo run storybook:dev --parallel&quot;,<br>    &quot;storybook:build&quot;: &quot;turbo run storybook:build --parallel&quot;,<br>    &quot;storybook:move&quot;: &quot;turbo run storybook:move --filter=docs &amp;&amp; turbo run storybook:move --filter=!docs&quot;,<br>    // ...<br>  },<br>}</pre><h3>Dev environment</h3><p>Now by doing <strong>yarn storybook:dev</strong> you will start all the Storybooks (each on a specific port), and by navigating to <strong>localhost:6006</strong> you will see your primary instance that combined all the others.</p><p>To start only one instance, launch <strong>yarn storybook:dev — filter=web</strong> (“web” being the name of your workspace)</p><p>More on workspace filtering in Turborepo <a href="https://turbo.build/repo/docs/core-concepts/monorepos/filtering">here</a>.</p><h3>Build</h3><p>To build our Storybooks, we will use the <strong>yarn storybook:build</strong> command.</p><p>The builds will be started in parallel, or the resulting statics will be retrieved from the cache if no changes have been found (<a href="https://turbo.build/repo/docs/core-concepts/caching">more on Turborepo caching</a>).</p><h3>Publishing to Vercel</h3><p>For Vercel to publish our generated statics, we will have to move them to the same directory.</p><h4>Vercel Build config</h4><p>Create your Vercel project, link your GitHub repo and setup the build config like so.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MwDtihvWORjzxpGniitL8A.png" /></figure><p>The <strong>yarn storybook:build &amp;&amp; yarn storybook:move</strong> command will build our Storybooks as seen earlier, and then move the generated statics to the appropriate directory (output directory).</p><p>Details on our <strong>storybook:move</strong> command in our root package.json:</p><pre>turbo run storybook:move --filter=docs &amp;&amp; turbo run storybook:move --filter=!docs</pre><p>To avoid moving <strong>web</strong> and <strong>ui</strong> before <strong>docs</strong> and risking being replaced, we launch <strong>turbo run storybook:move — filter=docs</strong> to include only the <strong>docs</strong> workspace and then <strong>turbo run storybook:move — filter=!docs</strong> to trigger the move on all the workspace except <strong>docs.</strong></p><p>After <strong>yarn storybook:build</strong>, we have:</p><pre>- 📂 apps<br>  - 📂 docs<br>    - 📂 storybook-static<br>  - 📂 web<br>    - 📂 storybook-static<br>- 📂 packages<br>  - 📂 ui<br>    - 📂 storybook-static</pre><p>After <strong>yarn storybook:move</strong> we have:</p><pre>- 📂 storybook-static (statics of apps/docs)<br>  - 📂 web<br>  - 📂 ui</pre><h3>Result</h3><p>Congratulations, you now have published your composed Storybook.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Rl8uDp7fCUvhgrDmSDNN-Q.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=94befbb78a56" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to behave when you conduct a job interview]]></title>
            <link>https://medium.com/@Seb_L/how-to-behave-when-you-conduct-a-job-interview-4cb709e35fa0?source=rss-3d231ed7fbc2------2</link>
            <guid isPermaLink="false">https://medium.com/p/4cb709e35fa0</guid>
            <category><![CDATA[hiring]]></category>
            <category><![CDATA[hrtech]]></category>
            <category><![CDATA[hr]]></category>
            <category><![CDATA[startup]]></category>
            <dc:creator><![CDATA[Seb.L.]]></dc:creator>
            <pubDate>Sun, 18 Nov 2018 17:11:09 GMT</pubDate>
            <atom:updated>2018-11-18T17:11:09.789Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BpcDnBqkLbklGy_fsPOp0w.jpeg" /><figcaption>Source: <a href="https://www.pexels.com/photo/man-and-woman-handshake-567633/">https://www.pexels.com/photo/man-and-woman-handshake-567633/</a></figcaption></figure><p>During the last 4 years I had the opportunity to conduct a lot of job interviews with tech people, graphic designer or project manager. <br>I also quit my previous job recently and spent almost 3 weeks having multiple interviews every day.</p><p>So here is my opinion on the matter. Some of the points are obvious, but since I experienced them as a co-interviewer or as interviewed I will still cover them.</p><h3>Don’t be a dick</h3><p>Being a dick during an interview to “stress test” someone, to show how much the boss you are, or for whatever reason you have, will only leave a bad impression.</p><p>You may be the first employee the applicant will interact with, if you act like a dick you can be sure that the candidate will spread a bad reputation about your company.</p><h3>Don’t brag…</h3><h4>… about yourself</h4><p>This is not about you. There is no reason for you to talk about yourself more than a simple introduction and some previous experiences unless the applicant ask you about it. <br>Don’t talk about how YOU changed things or add value to the company, there is no “I” only “we”.</p><h4>…about your table football or rooftop</h4><p>This is especially the case in tech startups.<br>Table football, a nice rooftop, parties, etc, are great don’t get me wrong, but don’t use them as a leverage to get someone to join you, he might just think that you’re trying to hide something with goodies and distractions.</p><p>When people are searching for a job, they are looking for challenges, learn new stuff, healthy management, nice coworkers and a reasonable salary, this is 100 times more valuable than a table tennis and free coffee.</p><h3>Inspire</h3><p>Share your vision, talk about the team mindset, the roadmap and how the applicant could fit in and add value to the team and company.</p><h3>Be honest…</h3><h4>…about the company</h4><p>Don’t hide your flaws. If you have a lot of work waiting, an old technical stack, lower than average salary offer, don’t try to avoid it, be honest.</p><h4>…about the job</h4><p>Be honest about the job and responsibilities, no one likes to start a new job and find out later that it’s not what it was supposed to be.</p><h4>…about the applicant</h4><p>If you feel that the applicant won’t fit for the job, tell him/her, use the right words to gently explain why and give some clues on how to improve. <br>Feel free to tell him/her to apply again later if the mindset is good.</p><h3>Hire for attitude, teach for skills</h3><p>Schools and diplomas can be good metrics to know the minimum level of expertise of an applicant, but don’t focus too much on it.</p><p><strong>Don’t underestimate job reconversion! </strong><br>If someone took the risk to start fresh from the beginning there are chances that he/she is very motivated and has already some general work experience.</p><p>Make your decision on the mindset, personality, learning capabilities, motivation and actual level and expertise.</p><p><strong>Skills can be learned, good luck teaching someone how to not be an asshole at work.</strong></p><p>Remember that it takes only one person to ruin your team building.</p><h3><strong>Hire the right person, for the right job</strong></h3><p>The candidate has to feel confortable enough with the job’s missions, but still feel like it’s challenging and rewarding. You don’t want him/her to be bored at work or stressed everyday.</p><p>Don’t hire a “rockstar” thinking that you will be able to cover any possible demands if you don’t really need his expertise.</p><h3>Experiment</h3><p>If you are having trouble to find someone after multiple interviews, maybe it’s time to change your workflow.</p><p>Experiment, have a little tour of the company with the applicant, invite other people from other teams with different skills than yours to the interview.</p><p>There is no silver bullet, you have to find the workflow that fits you and your company values.</p><h3>Conclusion</h3><p>Be friendly, life is difficult enough and interviews are stressful enough, you don’t need to ruin someone else’s day.</p><p>You’re searching for someone to help you for a task as much as the applicant is searching for a job. If you want a healthy relationship with your future team member, you need trust and respect on both sides.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4cb709e35fa0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to build your own vue-cli 3 plugin]]></title>
            <link>https://medium.com/@Seb_L/how-to-build-your-own-vue-cli-3-plugin-be4b1a6bb68b?source=rss-3d231ed7fbc2------2</link>
            <guid isPermaLink="false">https://medium.com/p/be4b1a6bb68b</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[plugins]]></category>
            <category><![CDATA[vuejs]]></category>
            <dc:creator><![CDATA[Seb.L.]]></dc:creator>
            <pubDate>Sun, 22 Apr 2018 16:42:10 GMT</pubDate>
            <atom:updated>2018-05-11T18:51:59.565Z</atom:updated>
            <content:encoded><![CDATA[<p>When the first versions of vue-cli came out it was really easy to generate a working VueJS project in seconds. There was multiple templates available, simple webpack, pwa, you could even make your own, but almost all were forked from the webpack template.</p><p>So when the webpack template changed you had to maintain and update your own, for maybe 3 or 4 files and 3 lines of javascript that adds up to the original template.</p><blockquote>When developing a vue-cli plugin you can focus on what you want to add or update in your generated VueJs project.</blockquote><h4>How to use vue-cli plugins:</h4><p>Be sure you have vue-cli 3 installed globally and create a project using :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nOS3rrGWgfi8MPWJ42g2vQ.png" /></figure><p>Then to use a plugin:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HCNL_xGlqwPc8mqjrCuo3w.png" /></figure><p>It will search for an existing <em>vue-cli-plugin-my-plugin</em> npm package, install it as a dev dependency in your project and invoke it.</p><h3>Build a plugin</h3><p>A vue-cli plugin is basically a readme, a package.json and those 3 files:</p><ul><li>index.js</li><li>generator.js or generator/index.js (optional)</li><li>prompts.js (optional)</li></ul><h4>Service (index.js)</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Q-so_WpWsSKfTuuQOMETxA.png" /></figure><p>This is where you can configure or extend your project webpack configuration to your needs, ‘projectOptions’ are the options defined in the ‘vue.config.js’ file in your generated project (or in your project package.json under the vue key).</p><h4>Generator (generator.js or generator/index.js)</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HtODwrMWs1UEnjB8ONJjLw.png" /></figure><p>This is where you can update the package.json or your main.js file to add another import statement for example, render templates (using ejs) and add files.</p><p>The options argument returns the prompts answers.</p><h4>Prompts (prompts.js)</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*04i-GDsCoa_dgfA9n4ib3g.png" /></figure><p>This is where you can add prompts that will be used by inquireJs when you invoke your plugin, so you can then use the answers in your generator file for configuration purpose.</p><h3>Invoking your plugin locally</h3><p>You now have your plugin ready and you want to try it out.</p><p>Open a terminal in your freshly created vue project folder and install your plugin as a dev dependency (with “file:”)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0a-AeKyTL8k5IGgEiAI_eQ.png" /></figure><p>Then invoke your plugin each time you want to try it:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lythqudoFLoyCq0qTnR7JA.png" /></figure><p>When ready just submit your plugin to npm and anyone would be able to use it with “vue add my-plugin” as seen at the beginning of this post.</p><h3>Resources and existing plugins</h3><ul><li>vue-cli documentation on plugins: <a href="https://github.com/vuejs/vue-cli/blob/dev/docs/plugin-dev.md#service-plugin">https://github.com/vuejs/vue-cli/blob/dev/docs/plugin-dev.md</a></li><li>VueI18n cli plugin: <a href="https://github.com/kazupon/vue-cli-plugin-i18n">https://github.com/kazupon/vue-cli-plugin-i18n</a></li><li>Vuetify cli plugin: <a href="https://github.com/vuetifyjs/vue-cli-plugin-vuetify">https://github.com/vuetifyjs/vue-cli-plugin-vuetify</a></li><li>Element-ui cli plugin: <a href="https://github.com/Seb-L/vue-cli-plugin-element-ui">https://github.com/Seb-L/vue-cli-plugin-element-ui</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=be4b1a6bb68b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Why we chose VueJs over REACT and Angular 2 to replace Angular 1]]></title>
            <link>https://medium.com/@Seb_L/why-we-chose-vuejs-over-react-and-angular-2-to-replace-angular-1-5edeb65448a8?source=rss-3d231ed7fbc2------2</link>
            <guid isPermaLink="false">https://medium.com/p/5edeb65448a8</guid>
            <category><![CDATA[front-end-development]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[angularjs]]></category>
            <category><![CDATA[vuejs]]></category>
            <category><![CDATA[react]]></category>
            <dc:creator><![CDATA[Seb.L.]]></dc:creator>
            <pubDate>Mon, 01 May 2017 20:10:52 GMT</pubDate>
            <atom:updated>2017-05-01T20:14:06.601Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/200/1*bF5q0JaRtr7-0MjgGHjOYA.png" /></figure><p>We have been using AngularJS 1 since 2014 for all our websites at Numberly. Today we are moving to VueJs for our Data Catching Websites.</p><p>Angular was really useful and allowed us to create and work quickly on new projects. We went from Yeoman generator with custom bower libraries to Slush Generator to finally a custom boilerplate.</p><p>As the boilerplate became bigger and more complex, REACT and Angular 2 (then VueJS) became popular in the JS community and we started thinking: “Do we have to switch, and if so what framework/lib do we have to choose?”.</p><p><em>Nb: All those choices are based on the type of projects that we develop at Numberly, in this case, Data Catching websites (from 15 to 25 websites a month). </em><strong><em>It’s not about which is the best or if Typescript is the holy grail or not.</em></strong></p><h4><strong>Our current boilerplate setup:</strong></h4><ul><li>Angular 1.6 (ngAnimate, ngResource, ngCookies, …)</li><li>ui-router (with a lot of custom resolve rules)</li><li>ngStorage</li><li>Gulp with node-sass, autoprefixer, uglify, …</li><li>Bootdtrap-sass</li><li>Custom services/factories/providers/directives</li></ul><h3><strong>Typescript vs ES6</strong></h3><ul><li>In ES6 we can easily switch between Front-end frameworks and Vanilla JS (Front apps or NodeJs apps).</li><li>Typescript may be good but you can’t ignore ES6, since it’s the natural evolution of javascript, so you still have to learn about ES6.</li><li>Is Typescript here to last, and is learning and teaching Typescript to your team a good investment ? (remember Coffeescript ?)</li><li>Do you find more ES6 javascript developer (or a ES5 JS dev and teach him ES6) than a Typescript dev ?</li></ul><p><strong>In our case ES6 wins. <br></strong>Angular 2 pushes developers to switch to Typescript, so <strong>Angular 2 is out</strong>. (and we didn’t event talk about this crazy brackets thing in the templates, providers, injectors, etc…). Our goal is to clean, lighten and adapt the existing boilerplate, not to spend time on over-complicating things.</p><h3>Framework “flavored” syntax</h3><p>Frameworks are great but there are two main issues.</p><ul><li>When you’re searching for a dev you often find a “REACT developer” or an “Angular developer” instead of a JS developer who knows about Angular or REACT Framework.</li><li>The more “flavored” the syntax you use is, the more you forget the vanilla JS syntax (ex: angular.forEach, angular.filter, $timeout…)</li></ul><p>In my opinion the less “flavored” the syntax you’re using is, the better.</p><h4><strong>Angular 1</strong></h4><blockquote>Let’s make a <strong>factory</strong>, oh no I should use a <strong>service</strong>. Oh wait I want it to be configurable in a <strong>config</strong> block, you know the block that runs before the <strong>run</strong> block, so I have to use a <strong>provider</strong>. Then I’ll use <strong>$injector</strong> cuz I can’t directly usemy other factory in the provider when my app is in the config state…</blockquote><h4><strong>REACT</strong></h4><p>A component is defined by a javascript class with some preset methods.</p><h4><strong>VueJS</strong></h4><p>A component is defined by an object with clear attributes to configure your component.</p><p><strong>VueJs wins.<br></strong>The readability is better in VueJs. <br>I really like the “object oriented” component configuration, it’s like having a room with a shelf for each type of “tool” you need, one for methods, one for data, computed data, watched data, components… It’s not because you can do Classes in ES6 that you have to use them everywhere.</p><h3>Templating system</h3><h4><strong>Angular 1</strong></h4><p>HTML with special attributes (ng-click, ng-src, …)</p><h4><strong>REACT</strong></h4><p>Native JS or JSX directly in the js component file, no HTML template. A lot less readable and you can’t split the work in 2 parts: HTML/CSS integration and js development (in case you want 2 team members with different skills on the project).</p><h4><strong>VueJS</strong></h4><p>HTML with special attributes ( “@” for event, “:” for dynamic attributes, v-for, v-if, v-model, easy to remember when you come from Angular 1).<br>I love the Vue file concept: 1 file containing template, scripts and styles.</p><p><strong>VueJs wins.<br></strong>REACT could have been a winner too if we were working on webapps from scratch with larger deadlines.</p><h3>Documentation &amp; Community</h3><h4><strong>REACT</strong></h4><ul><li>The documentation is ok but you often end up searching on Google or StackOverflow.</li><li>Big community</li></ul><h4><strong>VueJs</strong></h4><ul><li>Cristal clear documentation and examples.</li><li>Growing community</li><li>Evan You thought about “everything” (VueJobs, VueRouter, Vuex, Chrome devtools extension, Vue resources listing, …)</li><li>Human readable errors handling</li></ul><p><strong>VueJs wins again!<br></strong>Good documentation, tooling and errors handling are important when you need to release trusted websites quickly and if you want to be sure everyone in your team understand every part of the framework correctly. No time wasted, no dark areas, no “copy/paste” code from StackOverflow without knowing what it is.</p><h3>And the winner is… VueJS!</h3><ul><li>REACT may have a bigger community but VueJs seems to have the pros of both Angular and REACT.</li><li>VueJs clear and minimalist syntax is really pleasant to use alongside ES6.</li><li>Vue file format is useful and allows us to reuse a custom component by only duplicating a single file in a new project.</li><li>With Scoped css (or scss) we can tweak and override css only on a specific component without having to care about the global style declaration.</li><li>It’s easy to switch from Angular 1 to VueJs</li><li>Vuex and Vue-router are perfectly integrated to VueJs</li><li>Easy to extend via the plugin system.</li><li>The chrome devtools extension is a real plus.</li></ul><h4><strong>Our new custom boilerplate setup:</strong></h4><ul><li>VueJS 2</li><li>Vue-router</li><li>Vuex</li><li>Sass-loader</li><li>Post-css</li><li>Axios (http queries)</li><li>Custom plugins, store modules and components</li><li>Vee-validate (form validation)</li></ul><h4>Extras</h4><ul><li>VueJs examples <a href="http://vuejs.org/v2/examples/">http://vuejs.org/v2/examples</a></li><li>VueJs Documentation <a href="http://vuejs.org/v2/api/">http://vuejs.org/v2/api</a></li><li>Vue-cli (ready to use boilerplate generator) <a href="https://github.com/vuejs/vue-cli">https://github.com/vuejs/vue-cli</a></li><li>Vue-router <a href="https://github.com/vuejs/vue-router">https://github.com/vuejs/vue-router</a></li><li>Vuex (state manager) <a href="https://github.com/vuejs/vuex">https://github.com/vuejs/vuex</a></li><li>Vue Chrome DevTools <a href="https://github.com/vuejs/vue-devtools">https://github.com/vuejs/vue-devtools</a></li><li>Vue resources list <a href="https://github.com/vuejs/awesome-vue">https://github.com/vuejs/awesome-vue</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5edeb65448a8" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>