<?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 Miquel Arranz on Medium]]></title>
        <description><![CDATA[Stories by Miquel Arranz on Medium]]></description>
        <link>https://medium.com/@miquelarranz?source=rss-e41cc1c3ab0b------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*dsfoPv_vfxZ8-7sHmIn-AA.png</url>
            <title>Stories by Miquel Arranz on Medium</title>
            <link>https://medium.com/@miquelarranz?source=rss-e41cc1c3ab0b------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 17 Nov 2026 14:29:17 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@miquelarranz/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 enablement through internal talks]]></title>
            <link>https://medium.com/typeforms-engineering-blog/ai-enablement-through-internal-talks-5d91e6a717b3?source=rss-e41cc1c3ab0b------2</link>
            <guid isPermaLink="false">https://medium.com/p/5d91e6a717b3</guid>
            <category><![CDATA[engineering]]></category>
            <category><![CDATA[ai-enablement]]></category>
            <dc:creator><![CDATA[Miquel Arranz]]></dc:creator>
            <pubDate>Tue, 22 Sep 2026 07:48:57 GMT</pubDate>
            <atom:updated>2026-09-22T07:48:57.848Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*VRy76llhxM189jF7bfIaZw.png" /></figure><p>As AI usage grows, organizations benefit from enablement, and this is becoming more and more relevant. At Typeform, <strong>one of the ways we’ve supported this is through our internal talks: Typetalks.</strong> I’m Miquel, the tech lead of one of the product teams, and I’ve been hosting and organizing these sessions for the past two years. In this post, I’ll share what we’ve learned, the challenges we’ve faced, and how Typetalks have helped enable AI across the company.</p><h3>What are these sessions?</h3><p>Typetalks are informal weekly sessions scheduled on an ad-hoc basis. They’re a safe space to share knowledge while also giving visibility into what’s happening across the company. They’re not exclusively technical, we also host product and design-oriented sessions. The format is up to the speaker, and sessions usually last between 30 and 60 minutes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mosoVWvd7UIivgiNXBv5EQ.png" /><figcaption>Some examples of real sessions done this year.</figcaption></figure><h3>How did we introduce AI enablement in these sessions?</h3><p>I’ll be honest: it just happened. After a little over a year of running these sessions, I looked back at what happened last year (2025) to spot any trends. One number stood out (though not entirely): after the summer, half of the sessions were AI-related.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WYLouKNn22X3s-j7DQnHaQ.png" /><figcaption>Some numbers I shared during the State of Typetalks session at a company all-hands.</figcaption></figure><p>That wasn’t a coincidence. It happened alongside the increased use of tools like Claude Code at the end of 2025. That made us consider Typetalks as an AI enablement tool, since speakers were genuinely interested in sharing these topics and attendees were keen to participate.</p><h3>How is it going so far this year?</h3><p>At the time of writing this article, we’ve done 27 Typetalks this year. <strong>14 of them were AI-related, again, more than 50%</strong>. It wasn’t a coincidence; it’s still happening. However, not all of them are about enablement per se. We’ve covered different topics:</p><ol><li><strong>Sessions where speakers show how they use AI in their day-to-day work.</strong> Live demos, some Claude Code utilities, and ways to save costs with caching and other tooling.</li><li><strong>Enablement of internal AI tooling.</strong> A few teams are working on internal tooling, and on enabling the agents engine behind Typeform AI and our <a href="https://www.typeform.com/mcp">Typeform MCP</a>.</li><li><strong>Philosophical sessions about AI’s impact on our jobs.</strong> How trends are changing, how we’re adapting to them and to new tools, and how we still keep traditional ways of doing things in specific areas.</li></ol><h3>Challenges in organizing the sessions</h3><p>Some of these sessions are organized organically, so speakers reach out because they want to share a specific topic, usually something aligned with current trends and what’s happening across the company. However, most of the time, people aren’t willing to speak, or they don’t yet realize they have a topic worth sharing. Everything starts with the discovery phase which includes finding topics interesting to cover and then tracking down the right speakers. <strong>I like to say that the challenge isn’t finding speakers, it’s finding the right topics to engage attendees</strong>.</p><p>In any organization, you’ll find different groups of AI users depending on their expertise and maturity with the tools. I like to categorize them into three groups (though the boundaries can be a bit fuzzy):</p><ol><li>Users who rely on AI heavily in their day-to-day work and try new tools as soon as they come out.</li><li>Users who use AI but don’t have the time or interest to keep trying new tools.</li><li>Users who are skeptical about using AI in some scenarios, or who still don’t know how to leverage it.</li></ol><p>All three groups benefit the talks ecosystem. The first group helps us understand what’s trending and what’s worth featuring in a session. The second groups are also a great source of speakers to show how they use AI in their day-to-day work. The third group helps us identify knowledge gaps.</p><h3>Impact in our organization</h3><p>We don’t have specific numbers on AI adoption because it’s hard to tell whether these sessions were the only driver, but we can share a few examples of their impact:</p><ol><li><a href="https://www.linkedin.com/in/withbowis/">Boris Ballester</a>, one of our engineers, prepared a session on saving costs with Claude Code. This led to an internal initiative to enable tools like caveman or RTK internally by default for all Claude Code users. It also helped us better understand and optimize our budget.</li><li><a href="https://www.linkedin.com/in/pol-borrellas/">Pol Borrellas</a>, one of our product managers, prepared a session showing how he uses AI to write PRDs (Product requirements documents) and save time. It proved useful for other product folks, who began adopting some of the techniques he shared.</li><li><a href="https://www.linkedin.com/in/igor-marques-5a57a16b/">Igor Marques</a>, one of our AI engineers, prepared a session explaining how the agent ecosystem that powers Typeform AI works internally and what its core components are. Not all engineers at Typeform are that exposed to AI features, so it was a great session to enable others and introduce them to the agents internals.</li></ol><h3>Takeaways</h3><ol><li><strong>Internal talks are a great way to share AI knowledge.</strong> It’s hard to keep up with all the new developments, and some people may feel lost about how to improve their own workflows.</li><li><strong>Enablement starts within your organization.</strong> It won’t come only from engineers: you’ll also find people in other roles who want to improve their AI workflows, and who will share what they learn with the rest of the company if you give them the space.</li><li><strong>AI enablement isn’t a one-off effort.</strong> Leverage the people interested in exploring new tools and workflows, give them the space to do so, and then spread the word so others can adopt them as well.</li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5d91e6a717b3" width="1" height="1" alt=""><hr><p><a href="https://medium.com/typeforms-engineering-blog/ai-enablement-through-internal-talks-5d91e6a717b3">AI enablement through internal talks</a> was originally published in <a href="https://medium.com/typeforms-engineering-blog">Typeform&#39;s RnD Blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Experimenting at Typeform from the Engineering perspective]]></title>
            <link>https://medium.com/typeforms-engineering-blog/experimenting-at-typeform-from-the-engineering-perspective-1a0cc23802cd?source=rss-e41cc1c3ab0b------2</link>
            <guid isPermaLink="false">https://medium.com/p/1a0cc23802cd</guid>
            <category><![CDATA[metrics]]></category>
            <category><![CDATA[ab-testing]]></category>
            <category><![CDATA[experiment]]></category>
            <dc:creator><![CDATA[Miquel Arranz]]></dc:creator>
            <pubDate>Mon, 01 Dec 2025 11:49:46 GMT</pubDate>
            <atom:updated>2025-12-01T11:51:52.211Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rIB6ew4_akhb3ekPwcAcdQ.png" /></figure><p>I’m Miquel, an Expert Frontend Engineer at Typeform. When I joined the company in 2021, I landed in a team running experiments across our product. It was my first experience on a data-driven team, and it was completely new to me. <strong>This experimentation mindset helps you better understand the business and how your users behave when you change their habits.</strong></p><p>Since then, I’ve learned how crucial the right experimentation environment is for making a real impact in your organization. In this post, I’ll walk you through <strong>our experimentation lifecycle from an engineering perspective</strong> and share the lessons I’ve learned over the past four years.</p><h3>What is an experiment?</h3><p>Before diving into the lifecycle of an experiment, let’s first define what an experiment is and why we need them. <strong>An experiment — or A/B test — exposes users to different versions of a specific flow or feature in your product</strong>. We compare the current version (the “control”) against one or more new ones (the “variants”).</p><p>Users are randomly assigned to each experience. The goal is to understand <strong>which version performs better</strong>. This helps us iterate on the product in a controlled and safe way, so we can make informed decisions when rolling out new changes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Pb5Rgq4SFdNtrumPSzfeDA.png" /><figcaption>Representation of how the users are assigned to the different experiences.</figcaption></figure><h3>Tools we use</h3><p>At Typeform, we use different tools for each stage of the experiment lifecycle. This is the stack we use for product experiment (we use different tools for our site and email marketing):</p><ul><li><a href="https://launchdarkly.com/"><strong>LaunchDarkly</strong></a><strong>. </strong>We use it to orchestrate experiments and randomly assign users to different experiment groups.</li><li><a href="https://segment.com/"><strong>Segment</strong></a><strong>.</strong> We capture metrics across our platform and send them to Amplitude and Fullstory through Segment.</li><li><a href="https://amplitude.com/"><strong>Amplitude</strong></a>. It provides visualization tools to monitor granular insights and track directional data on ongoing experiments.</li><li><a href="https://www.fullstory.com/"><strong>Fullstory</strong></a><strong>.</strong> It provides heat maps and recorded user sessions that help us understand customer behavior and spot bugs.</li><li><a href="https://www.growthbook.io/"><strong>GrowthBook</strong></a>. We use it for post-experimentation analysis. It’s our source of truth for deciding whether to roll out or roll back an experiment.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_bjjXgeSIIZMdaMCOudDDw.png" /><figcaption>Tools we use at Typeform in the different stages of the experimentation flow.</figcaption></figure><h3>Lifecycle of an experiment</h3><p>The best way to explain the lifecycle of an experiment is through an example. I’ll use a recent experiment from my team to walk through the different steps we followed.</p><p>At Typeform, we recently released a new product called <a href="https://help.typeform.com/hc/en-us/articles/14955071444244-Get-the-most-out-of-Typeform-with-AI">Typeform AI</a>. With Typeform AI, users can create and edit their forms conversationally, helping them build better forms faster. When creating a new typeform, we show customers a few options to speed up content generation — the “Create Wall.” Since Typeform AI is ideal for starting a new form, we decided to make it more prominent in the Create Wall. We created two versions to see which performed better.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TWDTm8Gs-Z_Nq2-1FnZeJA.png" /><figcaption>Example of an experiment done in the “Create Wall” view of the form creation flow.</figcaption></figure><h4>Defining the right metrics</h4><p>Before running an experiment, start by understanding why. Begin with a hypothesis, then define metrics to validate it. <strong>You’ll need a primary metric that captures the experiment’s main goal</strong>, a few secondary metrics you also expect to influence, and guardrail metrics to ensure the test doesn’t introduce negative side effects.</p><blockquote>A metric is your hypothesis translated into math. Uncertainty about what to measure often indicates that the link between the problem and the solution needs to be clearer. — Cecco Mora, Expert Data Analyst at Typeform</blockquote><p>In our example, the hypothesis was: “If Typeform AI helps users create their forms, more users will publish a form, driving publication rate up.” We tracked publication rate as our primary metric, conversion to paid plan as a secondary metric, and adoption of other key features as guardrail metrics.</p><h4>Setting up the experiment</h4><p>Once our metrics are ready, we are ready to set up everything we need to run the experiment. With our stack, we do the following:</p><ol><li><strong>We add tracking events to measure customer interactions.</strong> We do this at the code level and use Segment to send the events to the other tools mentioned above.</li><li><strong>We create the feature flag in LaunchDarkly with three user groups</strong>: “variant” (new experience), “control” (current experience), and “out of experiment” (current experience, but excluded from monitoring and analysis). I’ll explain why we need three groups in the next section.</li><li>We develop the new experience and show it only to users in the “variant” group. At Typeform, we have a set of APIs that tell us if a user is exposed to a specific feature flag.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LPI-x_j9l99C8hplwMC1bw.png" /><figcaption>Feature flag creation modal in LaunchDarkly.</figcaption></figure><h4>Starting the experiment</h4><p>Once we have everything ready, we can start the experiment. We do this directly in LaunchDarkly, but it’s not as simple as clicking a button — there are some important considerations:</p><ul><li><strong>The “control” and “variant” groups must always be balanced.</strong> The “out of experiment” group helps allocate the rest, who are excluded from the analysis. For example, you might expose the experiment to 40% of users — 20% variant and 20% control — with the remaining 60% in the “out of experiment” group.</li><li><strong>You don’t need to expose the experiment to all users at once.</strong> You can start with 10% and gradually increase until you reach 50% variant and 50% control (with 0% out of experiment). Alternatively, you can expose it to a specific subset of users first, such as new sign-ups.</li><li><strong>Experiment duration matters and depends on the number of users exposed</strong> and how visible the feature is, among other metrics. In our case, GrowthBook helps us determine when we have enough data to conclude the experiment.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*toRm7DlKqwCYb1BfdANLOA.png" /><figcaption>Example of group assignment in LaunchDarkly.</figcaption></figure><h4>Monitoring the experiment</h4><p>Our experiment is live! Now it’s time to wait for the results. In the meantime, there are several issues and potential problems we can monitor:</p><ol><li><strong>Unbalanced groups are a problem.</strong> For example, if you see more users allocated to the “variant” than the “control,” the results may be biased and invalid.</li><li><strong>Inconsistent user assignment.</strong> If a user is first assigned to the “variant” group and then switches to the “control” group, something wasn’t configured correctly.</li><li><strong>Variant leakage.</strong> This happens when a user who shouldn’t see the variant experience ends up seeing it.</li><li><strong>Poor tracking.</strong> Sometimes, after the experiment starts, we realize the tracking we set up isn’t enough to understand the impact of the new experience. Don’t panic — it’s completely fine to add the necessary tracking while the experiment is running.</li><li><strong>UX bugs.</strong> Regularly check Fullstory sessions, review Amplitude’s granular funnel views, and monitor reports from your customer support team to spot bugs that may affect the experiment’s results. Amplitude also lets you configure alerts based on sudden metric changes.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cgx1BdgAhesv_N_APz9Oew.png" /><figcaption>Example of a chart in Amplitude showing the users who signed up and published within a 1-day window.</figcaption></figure><h4>Analyzing the results and iterating</h4><p>Once we have enough data, should we roll out the experiment to all users or discard it? The truth is, <strong>even if an experiment doesn’t perform well, we gain valuable learnings that help us iterate</strong> and try different approaches.</p><p>In our case, we use mainly GrowthBook for the post-analysis but it’s also a good practice to combine it with Amplitude and Fullstory to add more context to the decision. GrowthBook is <strong>the source of impact and truth</strong>, and gives you information about each of the metrics of the experiment and how they changed depending on the groups you defined.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xDgr5AS--QnqZ_JrxmGMPQ.png" /><figcaption>Example of how the results of an experiment look in GrowthBook.</figcaption></figure><h3>Takeaways</h3><p>To conclude, I would like to share some key learnings of my experimentation journey that hopefully will be useful for you, whether your organization is already experimenting or not:</p><ol><li>Transforming Typeform into a data-driven organization has helped us <strong>build a culture of trial and error</strong>. It gives you control over metrics while providing learnings to continuously iterate on your product.</li><li>This is the stack that works for us, but many alternatives are available in the market. You don’t need everything set up from the beginning — <strong>the key is to start</strong>, even if it’s only with a specific team.</li><li><strong>Don’t assume new features will be easily adopted by your customers.</strong> Sometimes what we think are trivial changes — or obvious improvements — end up performing poorly. That’s where experimentation is key.</li><li>At some point, once you have been experimenting for a while, it’s a good idea to <strong>standardize the experimentation process</strong>. This creates consistency and enables other teams in your organization to follow the same process.</li></ol><p>Special thanks to Pol Borrellas, Lead Product Manager at Typeform, and Cecco Mora, Expert Data Analyst at Typeform, for their feedback and insights on the topic.</p><p>Happy experimentation!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1a0cc23802cd" width="1" height="1" alt=""><hr><p><a href="https://medium.com/typeforms-engineering-blog/experimenting-at-typeform-from-the-engineering-perspective-1a0cc23802cd">Experimenting at Typeform from the Engineering perspective</a> was originally published in <a href="https://medium.com/typeforms-engineering-blog">Typeform&#39;s RnD Blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Fetch API]]></title>
            <link>https://medium.com/@miquelarranz/fetch-api-fafc299491ce?source=rss-e41cc1c3ab0b------2</link>
            <guid isPermaLink="false">https://medium.com/p/fafc299491ce</guid>
            <category><![CDATA[es6]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[fetch-api]]></category>
            <dc:creator><![CDATA[Miquel Arranz]]></dc:creator>
            <pubDate>Tue, 23 Oct 2018 18:30:35 GMT</pubDate>
            <atom:updated>2018-12-18T21:08:50.360Z</atom:updated>
            <content:encoded><![CDATA[<p><a href="https://caniuse.com/#feat=fetch">Almost all our browsers</a> allow us to use the amazing Fetch API to handle the requests to our resources asynchronously. It is similar to the old <a href="https://developer.mozilla.org/es/docs/Web/API/XMLHttpRequest">XMLHttpRequest (XHR)</a> but with a simplicity that will amaze you.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*J-ck-hHnFR0m0dP7" /><figcaption>Photo by <a href="https://unsplash.com/@kyran12?utm_source=medium&amp;utm_medium=referral">Kyran Aldworth</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><h3>Table of Contents</h3><p><a href="https://medium.com/p/fafc299491ce#435a">Main Advantages</a><br><a href="https://medium.com/p/fafc299491ce#feda">Basic Example</a><br><a href="https://medium.com/p/fafc299491ce#a2eb">Adding Configuration</a><br><a href="https://medium.com/p/fafc299491ce#cd68">Conclusion</a></p><h3>Main Advantages</h3><p>As I said, it does the same thing that XMLHttpRequest but with some differences that will make your code clearer and more understandable.</p><p>🔥 It uses <strong>Promises</strong> to handle the response of our requests. Say bye bye to the <a href="http://callbackhell.com/">callback hell</a>.</p><p>📚 Since it uses Promises, your code will be <strong>cleaner</strong> and <strong>easier to read</strong>.</p><p>😌 You won’t have to see anymore (hopefully) the complex XMLHttpRequest API.</p><h3>Basic Example</h3><p>Let’s take a look at a basic example. We will fetch some data from <a href="https://dog.ceo/dog-api/">Dog API</a>, an open API that provides random dog pictures 🐶</p><pre>function getRandomDog() {<br>    fetch(&#39;https://dog.ceo/api/breeds/image/random&#39;)<br>        .then((response) =&gt; {<br>            return response.json();<br>        })<br>        .catch(function(err) {<br>            console.log(&#39;Something went wrong!&#39;);<br>        });<br>}</pre><p>The syntax is so simple, we call the generic method fetch, which will do a <strong>GET</strong> request to the resource specified on the URL <em>(</em><a href="https://dog.ceo/api/breeds/image/random"><em>https://dog.ceo/api/breeds/image/random</em></a><em>), </em>and it returns a promise that we will handle using <strong>then</strong> (if it is correct) and <strong>catch</strong> for the errors.</p><blockquote><em>If you don’t know how Promises work, take a look at </em><a href="https://medium.com/@miquelarranz/promises-on-javascript-430eb1769f0f"><em>the introduction I wrote some time ago.</em></a></blockquote><p>You may have seen the response.json() detail. The response of the fetch request is a <a href="https://streams.spec.whatwg.org/">Stream</a> of data that we will receive asynchronously. With response.json() we return a promise that will be resolved once all the data has been fetched.</p><h3>Adding Configuration</h3><p>We have seen that the first parameter of the fetch method is the <strong>URL</strong> but we can add a second parameter which is the configuration. There, we can configure the method, the headers, the body of a POST request and a lot of options more. We will see a POST example next (create a dog) but take a look here if you want to find <a href="https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch#Supplying_request_options">more options</a>.</p><pre>function createDog() {<br>    const dog = {<br>        color: &#39;black&#39;,<br>        breed: &#39;rottweiler&#39;<br>    };<br>    <br>    fetch(<br>        &#39;https://somerandomdomain/dog&#39;,<br>        {<br>            method: &#39;POST&#39;,<br>            body: JSON.stringify(dog)<br>        }<br>    )<br>        .then((response) =&gt; {<br>            return response.json();<br>        })<br>        .catch(function(err) {<br>            console.log(&#39;Something went wrong!&#39;);<br>        });<br>}</pre><p>It works the same way, we have only configured the request with a method and the body of the request and that’s all!</p><h3>Conclusion</h3><p>Using the Fetch API is a great idea if you want to keep your code clean and easy to read. It uses promises instead of callbacks, which converts it in a really interesting and powerful API that will allow us to handle all the requests to our servers.</p><p>Happy coding!</p><p><a href="https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch">MDN docs about Fetch</a><br><a href="https://scotch.io/tutorials/how-to-use-the-javascript-fetch-api-to-get-data">A more detailed tutorial about Fetch</a></p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fupscri.be%2F161b6b%3Fas_embed%3Dtrue&amp;dntp=1&amp;url=https%3A%2F%2Fupscri.be%2F161b6b%2F&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=upscri" width="800" height="400" frameborder="0" scrolling="no"><a href="https://medium.com/media/86d53e85126c37b29d14e9bd876e54d3/href">https://medium.com/media/86d53e85126c37b29d14e9bd876e54d3/href</a></iframe><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fafc299491ce" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Strategies To Handle Tables On Mobile Screens]]></title>
            <link>https://medium.com/@miquelarranz/strategies-to-handle-tables-on-mobile-screens-faea6d3eeff8?source=rss-e41cc1c3ab0b------2</link>
            <guid isPermaLink="false">https://medium.com/p/faea6d3eeff8</guid>
            <category><![CDATA[mobile-first]]></category>
            <category><![CDATA[table]]></category>
            <category><![CDATA[responsive-design]]></category>
            <dc:creator><![CDATA[Miquel Arranz]]></dc:creator>
            <pubDate>Mon, 18 Jun 2018 18:42:08 GMT</pubDate>
            <atom:updated>2018-12-18T20:59:33.293Z</atom:updated>
            <content:encoded><![CDATA[<p>When I started to work as a web developer, tables on mobile screens was something I always had to take into account the product of my company had a lot of them. They wanted to have a responsive platform but showing a lot of information on each table. They wanted everything.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*RHWVJkUFyIYbBrD3" /><figcaption>Photo by <a href="https://unsplash.com/@chuttersnap?utm_source=medium&amp;utm_medium=referral">chuttersnap</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><h3>Table Of Contents</h3><p><a href="https://medium.com/p/faea6d3eeff8#b59a">Using Scroll</a><br><a href="https://medium.com/p/faea6d3eeff8#9e3a">Do Not Show Everything</a><br><a href="https://medium.com/p/faea6d3eeff8#a015">A Different Approach</a><br><a href="https://medium.com/p/faea6d3eeff8#0f93">Final Thoughts</a></p><h3>Using Scroll</h3><p>It was my first job as a web developer so instead of looking for options on <a href="https://stackoverflow.com/">Stack Overflow</a> or similar, I tried to reinvent the wheel. They wanted to display a lot of columns, and the view was terrible on mobiles. Everything was overflowing and being hidden due to the small width of the viewport.</p><p>My first approach was to add a horizontal scroll on the table so I could move the table horizontally and see all the content. I think this one is the easiest approach and the fastest to apply. I only had to add overflow-x: scroll (among other small adjustments) to my table.</p><pre>table {<br>    display: block;<br>    overflow: scroll;<br>}</pre><p>Then I could scroll the table with my finger and everything was perfect. It was perfect until I had to work with a huge admin table with a lot of columns. Then I decided to change my strategy.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*FFbTm4mr5lmi9tJ0.png" /></figure><h3>Do Not Show Everything</h3><p>It was an admin table which was used by us to change the configuration of our users. The people responsible to do these changes wanted to see all the information of the user to be able to respond to each support ticket with as much accuracy as they could. They wanted to do it on their mobile phones as well, so they could reduce the response time to the user and make them happier 🙂</p><p>It made sense, but I couldn’t display everything on mobile because it was crazy to navigate in that situation moving my finger. I decided that the solution was to hide some columns. After a meeting with the support team, we realized that they only needed some specific columns. Instead of adding a horizontal scroll again, I decided to hide the unnecessary columns to avoid distractions. Some media queries and display: none and I got it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Ctukf_O1MCQVqgLq.png" /></figure><h3>A Different Approach</h3><p>Some years later, I was just playing with some mobile-first code and I decided to convert an accordion to a table. So I realized that this could be another great alternative to the tables problem on mobile screens. So, instead of hiding columns or using a scroll, you can just convert the table into another (and completely different) element.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*L-Me8sJHmccg646l.png" /></figure><h3>Final Thoughts</h3><p>There are a lot of ways to handle the problem with tables on mobile devices but sometimes the best way is to be creative. However, be careful about reinventing the wheel because it can be sometimes risky. We have seen some alternatives but this is more like art so feel free to share your ideas as well. They are more than welcome!</p><p>Happy coding!</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fupscri.be%2F161b6b%3Fas_embed%3Dtrue&amp;dntp=1&amp;url=https%3A%2F%2Fupscri.be%2F161b6b%2F&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=upscri" width="800" height="400" frameborder="0" scrolling="no"><a href="https://medium.com/media/86d53e85126c37b29d14e9bd876e54d3/href">https://medium.com/media/86d53e85126c37b29d14e9bd876e54d3/href</a></iframe><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=faea6d3eeff8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Promises on Javascript]]></title>
            <link>https://medium.com/@miquelarranz/promises-on-javascript-430eb1769f0f?source=rss-e41cc1c3ab0b------2</link>
            <guid isPermaLink="false">https://medium.com/p/430eb1769f0f</guid>
            <category><![CDATA[promises]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[es6]]></category>
            <dc:creator><![CDATA[Miquel Arranz]]></dc:creator>
            <pubDate>Mon, 21 May 2018 21:07:43 GMT</pubDate>
            <atom:updated>2019-05-28T18:46:40.488Z</atom:updated>
            <content:encoded><![CDATA[<h3>Promises On Javascript</h3><p>Let’s imagine that you have a blog web application which needs some server data. The application does an HTTP request to ask for the posts to an API and, after some seconds, it receives the response. Let’s say that we want to do some kind of logic with the posts and then display them to the user. We need to handle this asynchronism somehow. Using <em>Promises</em> is a way to do it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*xmwj0wFvarLuV80c" /><figcaption>Photo by <a href="https://unsplash.com/@abarro?utm_source=medium&amp;utm_medium=referral">Alberto Barrera</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><h3>Table of Contents</h3><p><a href="https://medium.com/p/430eb1769f0f#a9c5">Introduction</a><br><a href="https://medium.com/p/430eb1769f0f#9a7f">Creating Promises</a><br><a href="https://medium.com/p/430eb1769f0f#5ecc">Handling Promises</a><br><a href="https://medium.com/p/430eb1769f0f#d6b3">Chaining Promises</a><br><a href="https://medium.com/p/430eb1769f0f#debe">Final Thoughts</a></p><h3>Introduction</h3><p>A <em>Promise</em> represents the result of an asynchronous operation, which may fail, be in progress or succeed. It will give us also the result of the operation and an easy way to handle it. It is true that using <em>Promises</em> is not the only way to handle asynchronism (i.e. <a href="https://developer.mozilla.org/en-US/docs/Glossary/Callback_function"><em>Callbacks</em></a>), but is more clear and less susceptible to having weird scenarios and results.</p><p>I won’t start a discussion now, because I want to focus this post on the <em>Promise</em> option but if you feel curious about the differences between these two methods and why we should use <em>Promises</em> instead of <em>Callbacks</em> I let you <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises">here</a> and <a href="https://basarat.gitbooks.io/typescript/docs/promise.html#callback-style-code">here</a> (I strongly recommend you to read this one) more information.</p><h3>Creating Promises</h3><p>You can create a <em>Promise</em> using the new Promise constructor which accepts a handler as a parameter that contains the two functions that will allow us to change the status of the <em>Promise</em>, which may be <strong>resolve</strong> or <strong>reject</strong>. Let&#39;s see an example (I&#39;m using ES6 syntax):</p><pre>PostsRepository.getAll(); // This method will return a Promise</pre><pre>// PostsRepository.js</pre><pre>getAll() {<br>    return new Promise((resolve, reject) =&gt;<br>        // Do the request to a server and handle the response<br>        if (/* the process went well */) {<br>            resolve(/* some value to return */);<br>        } else {<br>            reject(/* error */); // Something went wrong<br>        }<br>    });<br>}</pre><p>When we create a <em>Promise</em>, its status is <strong>Pending</strong>. If we resolve it by calling the <em>resolve</em> function, the status will change to <strong>Fulfilled</strong>. However, if something goes wrong, we will reject it calling the <em>reject</em> function and the <em>Promise</em> status will change to <strong>Rejected</strong>. We will have all the control during the process, <em>Promises</em> are not black magic, don’t worry!</p><h3>Handling Promises</h3><p>We have seen how to create a <em>Promise</em> and how it can change its status, which is pretty easy. Now it’s time to see how to handle the result of each status after resolving or rejecting the <em>Promise</em>. We will see it following the previous example:</p><pre>PostsRepository.getAll(); // This method will return a Promise</pre><pre>// PostsRepository.js</pre><pre>getAll() {<br>    return new Promise((resolve, reject) =&gt;<br>        // Do the request to a server and handle the response<br>        if (/* the process went well */) {<br>            resolve(/* some value to return */);<br>        } else {<br>            reject(/* error */); // Something went wrong<br>        }<br>    });<br>}</pre><p>When a <em>Promise</em> is resolved we can get a notification about its resolution through the then function. If the <em>Promise</em> is rejected, then we can capture the errors through the catch function. Both return a parameter, which is the result of the error, depending on what we have returned as a parameter when we have called the <strong>resolve</strong> and <strong>reject</strong> functions.</p><h3>Chaining Promises</h3><p>Another cool thing about <em>Promises</em> is chaining. We can chain <em>Promise’s</em> handlers as we wish. Let me put an example:</p><pre>PostsRepository.getAll()<br>    .then((posts) =&gt; {<br>        // Do some kind of action over our posts<br>        // return the resulted posts<br>    })<br>    .then((prettyfiedPosts) =&gt; {<br>        // Do another action like increasing a counter<br>    })<br>    .catch((error) =&gt; {<br>        // Handle the errors displaying an alert<br>    })</pre><p>Every handler returns a <em>Promise</em> with the value returned, so if we do some action over the result of the first handler (first then) and we return the result, the second then will have as a parameter the result of the first then. This is really powerful if we want to do different actions and we want to divide them into different functions to have a cleaner code.</p><h3>Final Thoughts</h3><p><em>Promises</em> are a must if you are working with Javascript. They will make your life as a developer easier since your code will be cleaner, easier to read and less susceptible to failure. We have seen how to create them, how to handle them and how to chain them, so what are you waiting for? Let’s start using <em>Promises</em>!</p><p>Happy coding!</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fupscri.be%2F161b6b%3Fas_embed%3Dtrue&amp;dntp=1&amp;url=https%3A%2F%2Fupscri.be%2F161b6b%2F&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=upscri" width="800" height="400" frameborder="0" scrolling="no"><a href="https://medium.com/media/86d53e85126c37b29d14e9bd876e54d3/href">https://medium.com/media/86d53e85126c37b29d14e9bd876e54d3/href</a></iframe><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=430eb1769f0f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Getting Started With ES6]]></title>
            <link>https://medium.com/@miquelarranz/getting-started-with-es6-f4e85004375a?source=rss-e41cc1c3ab0b------2</link>
            <guid isPermaLink="false">https://medium.com/p/f4e85004375a</guid>
            <category><![CDATA[es6]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Miquel Arranz]]></dc:creator>
            <pubDate>Tue, 13 Feb 2018 21:00:00 GMT</pubDate>
            <atom:updated>2018-11-12T22:35:36.091Z</atom:updated>
            <content:encoded><![CDATA[<p>It has been a while since ES6 was launched but I am pretty sure that you are not aware of all the benefits that it may bring to us as developers. Today I want to introduce you to some of the main features of ES6. I will start presenting you a Javascript code example and then we will migrate it to ES6.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2jQn87JDCpa89fqRGXXGMA.jpeg" /></figure><h3>Table Of Contents</h3><p><strong>Part I</strong><br><a href="https://medium.com/p/f4e85004375a#1950">Javascript Example</a><br><a href="https://medium.com/p/f4e85004375a#8701">What Is ES6?</a><br><a href="https://medium.com/p/f4e85004375a#0eff">Let And Const</a><br><a href="https://medium.com/p/f4e85004375a#244d">Template Literals</a><br><a href="https://medium.com/p/f4e85004375a#1c8f">Destructuring</a><br><a href="https://medium.com/p/f4e85004375a#5068">Conclusions</a><br><a href="https://medium.com/p/f4e85004375a#b80c">Homework</a></p><p><strong>Part II<br></strong>Classes<br>Arrow Functions<br>Spread<br>Conclusions<br>Homework</p><p><em>While I was writing the post, I decided to divide it into </em><strong><em>two parts</em></strong><em> since it was really long, but the table of contents includes all the features that I will present between both parts.</em></p><h3>Javascript Example</h3><p>First of all, let me introduce you the example. I’ve extracted it from an old project because I wanted to use a real case. I’ve added some extra code to cover all the cases I want to show you throughout the post.</p><pre>var ageNotDefined = &#39;Not defined&#39;;<br><br>function User (email, name, age) {<br>  this.email = email;<br>  this.name = name;<br>  this.age = age;<br>  this.books = [];<br>}<br><br>User.prototype.getAge = function () {<br>  return (this.age) ? this.age + &#39; year(s)&#39; : ageNotDefined;<br>};<br><br>User.prototype.addBooks = function (books) {<br>  this.books = this.books.concat(books);<br>};<br><br>User.prototype.getBook = function (position) {<br>  var title = this.books[position].title;<br>  var author = this.books[position].author;<br><br>  return title + &#39; by &#39; + author;<br>};<br><br>// These lines will help you to test the example<br>var user = new User(&#39;john.doe@email.com&#39;, &#39;John&#39;, 22);<br>user.addBooks([<br>    { title: &#39;Getting Started With ES6&#39;, author: &#39;John Doe&#39; },<br>    { title: &#39;Javascript Superhero&#39;, author: &#39;John Doe&#39; }<br>]);<br><br>console.log(user.getAge()); // 22 year(s)<br>console.log(user.getBook(0)); // Getting Started With ES6 by Jhon Doe</pre><p>As you can see, it’s the typical class that defines a user of your web application. The user has <strong>four attributes</strong> (email, name, books and, age) and <strong>three methods</strong> that allow us to manage the books and get the age of the user. I want to keep it simple, so I’ve deleted and cleaned a lot of code. Feel free to download the example and read the <a href="https://github.com/miquelarranz/getting-started-with-es6/blob/master/README.MD">instructions</a> on the following <a href="https://github.com/miquelarranz/getting-started-with-es6/tree/example">Github Repository</a>.</p><h3>What Is ES6?</h3><p>Before starting, you may not know what is ES6 (or ECMAScript 6). It is basically Javascript. It’s a <strong>new language specification of Javascript</strong> that includes changes and features that may do our lives as developers simpler. But, again, <strong>it’s just Javascript</strong> so don’t be afraid. I won’t cover all the new features but I’ve selected the ones that I consider more important to learn when you’re getting started with ES6. Ready?</p><h3>Let And Const</h3><p><strong>Let</strong> and <strong>const</strong> are two new ways to declare a variable with ES6, but first, we need to understand what is <strong>hoisting</strong>. Hoisting is a result of how Javascript is interpreted by your browser. Before any execution, all the variables are raised to the top of the function scope. Hoisting may cause unexpected and weird results sometimes. Let me put an example:</p><pre>var firstName = &quot;John&quot;;<br>alert(firstName + &#39; &#39; + lastName);<br>var lastName = &quot;Doe&quot;;<br>alert(firstName + &#39; &#39; + lastName);</pre><p>And this is how the code will be interpreted by our browser:</p><pre>var firstName;<br>var lastName;<br>firstName = &quot;John&quot;;<br>alert(firstName + &#39; &#39; + lastName);<br>lastName = &quot;Doe&quot;;<br>alert(firstName + &#39; &#39; + lastName);</pre><p>It’s about time to replace the var variables in our example code for let or const. But which is the difference between <strong>let</strong> and <strong>const</strong>?</p><ul><li><strong>Let</strong> declared variables can be reassigned, but can’t be redeclared in the same scope.</li><li><strong>Const</strong> declared variables must have a value assigned when declared but can’t be redeclared in the same scope (and can’t be reassigned either!).</li></ul><p>So we will do the following changes (I will only change the class code here, not the one provided to test the example):</p><pre>const ageNotDefined = &#39;Not defined&#39;; // It is a constant, won&#39;t change.<br>...<br>User.prototype.getBook = function (position) {<br>  let title = this.books[position].title; // It may be modified<br>  let author = this.books[position].author;<br>  ...<br>};<br>...</pre><p>You can find the changes <a href="https://github.com/miquelarranz/getting-started-with-es6/blob/let-const/script.js">here</a>.</p><h3>Template Literals</h3><p>The way we have to concatenate strings with previous versions to ES6 may be a real nightmare when reading and understanding a piece of code. ES6 presents us a new way to do it that, in my opinion, is cleaner (a lot). Let’s see how it works.</p><pre>console.log(title + &#39; by &#39; + author);<br><br>// Using template literals<br><br>console.log(`${title} by ${author}`); // You have to use ` instead of &#39; or &quot;</pre><p>We don’t need to use the + anymore so it looks a bit more readable. It&#39;s not a big difference, but let&#39;s see a multiline example (you will understand everything).</p><pre>let note = name + &#39;,\n\n&#39; +<br>  &#39;Please excuse me&#39; + &#39;.\n&#39; +<br>  &#39;I had an accident with the car so that I couldn\&#39;t finish the task.\n\n&#39; +<br>  &#39;Thank you,\n&#39; +<br>  student;<br><br>let note = `${name},<br><br>  Please excuse me<br>  I had an accident with the car so that I couldn&#39;t finish the task.<br><br>  Thank you,<br>  ${student}`;</pre><p>Since it’s something easy to change I encourage you to do it by yourself on the example code and then check in the <a href="https://github.com/miquelarranz/getting-started-with-es6/blob/template-literals/script.js">repository</a> if it’s correct.</p><h3>Destructuring</h3><p>Destructuring is a way to extract data from arrays and objects but simplifying the code (a lot). Instead of doing something like this (it’s not clean) to extract the data from an array:</p><pre>const users = [&#39;John&#39;, &#39;James&#39;, &#39;Mike&#39;]<br><br>const firstUser = user[0];<br>const secondUser = user[1];</pre><p>With this technique it would be something like this:</p><pre>const users = [&#39;John&#39;, &#39;James&#39;, &#39;Mike&#39;]<br>const [firstUser, , secondUser] = participants;</pre><p>Simpler, right? It’s really useful when we have a lot of variables that we need to extract from an array. It works the same way with objects:</p><pre>const user = {<br>  name: &#39;John&#39;,<br>  age: 24<br>};<br><br>const {name, age} = user;</pre><p>In our example, we would apply the following changes:</p><pre>...<br>var { title, author} = this.books[position];<br>...</pre><p>You can find the changes <a href="https://github.com/miquelarranz/getting-started-with-es6/tree/destructuring">here</a>.</p><h3>Conclusions</h3><p>So through this post, we have seen what is ES6 and we have migrated some cool code to ES6. We have seen what is <strong>hoisting</strong> and why <strong>let</strong> and <strong>const</strong> make our life easier. We have also seen how <strong>template literals</strong> work and how powerful and cleaner is <strong>destructuring</strong> for our code. We will see more in the second part!</p><h3>Homework</h3><p>If you are still here, I have prepared a small task for you in order to review all the concepts seen in the post. You will find the Javascript example <a href="https://github.com/miquelarranz/getting-started-with-es6/blob/homework-part-1/homework-part-1.js">here</a> and the goal is to migrate as many code as possible to ES6. Feel free to send me your resulting code to <a href="/service/mailto:miquelarranz@gmail.com">miquelarranz@gmail.com</a> and I will give you some feedback. If you want the solution, contact me as well.</p><p>Happy coding!</p><p><a href="https://eu.udacity.com/course/es6-javascript-improved--ud356">Udacity ES6 Course</a><br> <a href="http://es6-features.org/">The official ES6 site</a><br> <a href="http://blog.teamtreehouse.com/get-started-ecmascript-6">A cool post</a><br> <a href="https://atendesigngroup.com/blog/getting-started-es6">Another cool post</a></p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fupscri.be%2F161b6b%3Fas_embed%3Dtrue&amp;dntp=1&amp;url=https%3A%2F%2Fupscri.be%2F161b6b%2F&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=upscri" width="800" height="400" frameborder="0" scrolling="no"><a href="https://medium.com/media/86d53e85126c37b29d14e9bd876e54d3/href">https://medium.com/media/86d53e85126c37b29d14e9bd876e54d3/href</a></iframe><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f4e85004375a" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>