<?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[Wibbitz Research &amp; Development - Medium]]></title>
        <description><![CDATA[Behind the Wibbitz video automation technology is a talented team of engineers focused on overcoming challenges and building a platform that is truly the first of its kind. - Medium]]></description>
        <link>https://medium.com/wibbitz-developers?source=rss----9fcefc4eaebb---4</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>Wibbitz Research &amp;amp; Development - Medium</title>
            <link>https://medium.com/wibbitz-developers?source=rss----9fcefc4eaebb---4</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 22 Nov 2026 08:43:10 GMT</lastBuildDate>
        <atom:link href="https://medium.com/feed/wibbitz-developers" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Working as a remote developer at Wibbitz]]></title>
            <link>https://medium.com/wibbitz-developers/working-as-a-remote-developer-at-wibbitz-167c37e4d1ea?source=rss----9fcefc4eaebb---4</link>
            <guid isPermaLink="false">https://medium.com/p/167c37e4d1ea</guid>
            <category><![CDATA[remote-work]]></category>
            <category><![CDATA[remote-working]]></category>
            <category><![CDATA[teamwork]]></category>
            <dc:creator><![CDATA[Martin Blaustein]]></dc:creator>
            <pubDate>Mon, 24 Sep 2018 18:48:59 GMT</pubDate>
            <atom:updated>2018-09-24T19:02:09.315Z</atom:updated>
            <content:encoded><![CDATA[<h3>Working as a remote developer: How we stay connected across continents</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oe2n0S3ljH1U44RmFDDnbQ.jpeg" /></figure><p>A little over 2 years ago, I moved from Argentina to Tel Aviv to find new work opportunities and challenges. I started working at Wibbitz as an intern, and a few months later, was hired as a full-time software developer. I really enjoyed living and working in such an amazing place — it’s not called the startup city for no reason!</p><p>However, after a bit more than a year of being so far away from my roots, I decided it was time to go back… but I really didn’t want to leave my Wibbitz family. I discussed with my team leader about the possibility of remote work, and we decided we would try it out.</p><h3>Moving back &amp; facing new challenges</h3><p>Wibbitz currently holds offices in 4 countries around the world (5, counting me!) so we are used to communicating through different time zones, languages, and even different working days, since in Israel the weekend is on Friday and Saturday. But I realized when I moved back to Argentina that this would be different — because I was not moving into a new office, but on my own as a full-time freelance developer. All my life I’ve worked in an office, so this was a big change for me.</p><p>At Wibbitz we believe that constant communication is of the utmost importance and this is reflected in every level, from our daily chats and stand up meetings with the team, to weekly meetings with management, to quarterly meetings with all the offices to discuss the present and future of the company. So staying in touch would be a top priority.</p><p>Since I was the first (and still only) freelance developer of the company, there were a lot of challenges, to name a few:</p><ul><li>6 hour time difference</li><li>13.000 km</li><li>We speak different native languages</li></ul><p>But in my opinion, the most important challenge to overcome was keeping the friendships that I had made at work fun and interesting. I feared becoming isolated and just answering emails and pushing code every day.</p><p>When working remotely in general, the biggest issue is the lack of community, the loneliness associated with working away from others. So we took this seriously and worked on a way to remain just as close.</p><h3>How we made it work</h3><p>When I was still in Israel, Slack and email were the most common methods of communication. But once I got to Argentina, these tools seemed insufficient — you never see people’s faces! Since I’m not a native Hebrew speaker, I didn’t realize how much body language went into communicating with my peers.</p><p>So we decided to implement an <strong>avatar machine</strong> to work around that. Here’s the laptop that is currently sitting in Tel Aviv for one specific purpose: to be my <strong>personal avatar</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*wf6SEuJsmlP9ykUE" /><figcaption>The current Martin avatar with our NLP developer Lee</figcaption></figure><p>This computer rests on the wall near my team and it’s turned on all day, allowing direct communication, all the time. Plus, <strong>it auto answers</strong> — meaning whenever I call it, it immediately connects to the Tel Aviv office.</p><p>My daily workflow will start with me calling in (after I have drank my first cup of coffee of course), and greeting everyone in the company. And I mean everyone! People will come near the computer or shout from the distance, it’s as close as it gets to actually being there.</p><p>After that I will sync with my team leader and teammates to update each other on the work done the day before, and what we have planned for the rest of the day. <strong>A lot of informal communication </strong>will then take place throughout the day through this avatar. It’s not only meant to be about work, since we have Slack and emails for that, but for just generic office conversations. And it allows me to still feel part of the company even 13.000 km away!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/0*ZeU0rZIclBtO6RlF" /><figcaption>The future Martin avatar</figcaption></figure><p>Having my own avatar also makes meetings easier, since all my coworkers need to do is take my avatar machine with them to the meeting room. And not only work meetings, but also happy hours or specific events I can attend through it.</p><p>Since we have a 5/6 hour time difference depending the time of the year, communication also needs to be asynchronous — so instead of emailing everything, we record and save all of our daily meetings. This way, we can avoid interrupting existing processes, since the only action we need to do is press the record button.</p><h3>Working as part of a whole</h3><p>This whole experience really changed the way I think about remote work. Communicating this way has allowed for a much <strong>deeper connection</strong>, avoid miscommunication (transmitting emotion through emojis only gets you so far) and also saves time.</p><p>At the end of the day, the difference is made not by the technology, but by the people. Having an amazing group of people willing to go out of their way to make me feel part of a whole makes working remote an amazing experience. I never feel left out, and I’m still able to enjoy doing what I love, no matter where I am.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*JI3fHpAO87vDp4eE" /><figcaption>Happy hour with the whole backend team</figcaption></figure><p><em>Looking for a chance to overcome challenges with creative solutions just like this one, with a talented and results-driven team of developers? The Wibbitz Tel Aviv office is hiring both in-house and remote developers! </em><a href="https://www.wibbitz.com/jobs/"><em>Click here to apply.</em></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=167c37e4d1ea" width="1" height="1" alt=""><hr><p><a href="https://medium.com/wibbitz-developers/working-as-a-remote-developer-at-wibbitz-167c37e4d1ea">Working as a remote developer at Wibbitz</a> was originally published in <a href="https://medium.com/wibbitz-developers">Wibbitz Research &amp; Development</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Road to an Agile Data Analytics Solution]]></title>
            <link>https://medium.com/wibbitz-developers/the-road-to-agile-data-analytics-solution-3d40c6911b87?source=rss----9fcefc4eaebb---4</link>
            <guid isPermaLink="false">https://medium.com/p/3d40c6911b87</guid>
            <category><![CDATA[data-visualization]]></category>
            <category><![CDATA[data-warehouse]]></category>
            <category><![CDATA[analytics]]></category>
            <category><![CDATA[big-data]]></category>
            <category><![CDATA[big-data-analytics]]></category>
            <dc:creator><![CDATA[Uri Meirav]]></dc:creator>
            <pubDate>Thu, 30 Nov 2017 22:59:57 GMT</pubDate>
            <atom:updated>2017-12-10T23:20:17.973Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/450/1*A74TlyiQp8CqweNWeFENvA.jpeg" /></figure><p>Like most tech companies who want to quickly grow and continuously improve our product and operations, we realized early on that we needed to be as data-driven as possible. That meant finding all of the best ways to store, collect and analyze data, and build an agile analytics solution that would grow along with us. In this blog post I’m going to share our decision-making process as we searched for the best systems in the market, and give some tips for anyone currently looking for an agile data solution.</p><p>5 years ago, Wibbitz was an early stage startup that faced the need to measure the performance, usage, and everything else that surrounded our product, but lacked the resources to build such a solution on our own. While Google Analytics was really built for website analytics, it offered a generous free tier and simple implementation — so we decided to use it not only for our website, but for our product, which at that time consisted of a web application and a video player. This required some tweaking in how we measured and reported the data.</p><p>With the fast growth of the company, we quickly reached Google Analytic’s free tier limit and decided to go with the fastest upgrade, GAP (Google Analytics Premium). During this shift we also redefined most of our events using custom dimensions and metrics.</p><p>The goal of data is to help different teams in the company make the right decisions — so having a clear dashboard and easy way to query data is critical.</p><p>We noticed we were working too much on adjusting our processes and defining our events to fit Google Analytics constraints. Custom dimensions and metrics are hard to query by and limit the ability to filter reports. You also can not add calculations on dimension or metric columns. Other issues included sampled data and the inability to query real-time data.</p><h3>Choosing the best agile solution</h3><p>We decided to look for a different solution and defined the characteristics we were looking for:</p><ul><li>Agile system that can adapt to company’s changing needs</li><li>Handles over 3 billion events per month</li><li>Lets us easily share data internally and with customers</li><li>Connects data from multiple sources</li><li>Stores data for up to one month and have previous data aggregated</li><li>Events available in under 5 minutes for querying (useful when monitoring gradual releases)</li><li>Events have standard enrichment (Geolocation and Device) and user session information</li><li>We own the data</li><li>Easy for our team to implement</li><li>Affordable pricing</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/765/1*lmGP9hlN_slwR5hGrfzd4A.png" /></figure><p>Analytics solutions consist of the following subsystems:</p><ul><li>Data pipeline solutions</li><li>Data warehouse solutions</li><li>Analysis &amp; presentation solutions</li></ul><p><strong>Agile analytics solutions</strong> have loosely coupled subsystems, and are able to support many protocols and integrations.</p><p>The advantages of having an agile solution:</p><ol><li>It is easy to replace or upgrade every subsystem separately.</li><li>You can have different presentation tools for different roles in your organization that connect to the same data warehouse.</li></ol><h3>Data pipeline solutions</h3><p>Data pipeline solutions move and process data from different sources to your data warehouse. Here are some of the solutions we looked at:</p><p><a href="https://segment.com/"><strong>Segment</strong></a></p><ul><li>Used as a hub that can push your data to many services</li><li>Based on specific DB schema but can be customized</li><li>Data stored in AWS S3 and can be replayed. No pause/play support</li></ul><p><a href="https://www.alooma.com/"><strong>Alooma</strong></a></p><ul><li>Data stored in AWS S3. Support automatic pause in defined cases which can than be replayed.</li><li>Code engine supports real-time calculations, alerts and data enrichment.</li><li>Available client SDKs</li></ul><p><a href="https://snowplowanalytics.com/"><strong>Snowplow</strong></a></p><ul><li>Requires hosting the server</li><li>Realtime loading of data into Elasticsearch, 15–60 minute loading into Redshift</li><li>Available client SDKs</li></ul><p><a href="https://panoply.io/"><strong>Panoply.io</strong></a></p><ul><li>Data hosted and managed by Panoply utilizing storage/model optimization algorithms</li><li>Data stored over Elasticsearch, Redshift and AWS S3</li><li>JS SDK or REST API endpoint for sending data with no data enrichment support</li></ul><h3>Data warehouse solutions</h3><p>We were already using Redshift for our data warehouse solution. Another option was Google’s BigQuery, which might have lower maintenance requirements, but we decided to stick with RedShift to save money and resources.</p><h3>Analysis &amp; presentation solutions</h3><p>We looked at the following solutions:</p><p><a href="https://www.periscopedata.com/"><strong>Periscope Data</strong></a></p><ul><li>SaaS. Gives the power to the data analyst building the views while view users have limited customization options</li><li>Easy to share data and supports embedded views</li><li>Price is calculated by the amount of connected data</li></ul><p><a href="https://www.tableau.com/"><strong>Tableau</strong></a></p><ul><li>Great for data research — easy data visualization and manipulation using drag &amp; drop</li><li>Sharing views (not reports) requires the viewer to have an online user license</li><li>Priced per user (Desktop &amp; Online)</li></ul><p><a href="https://www.sisense.com/"><strong>SiSense</strong></a></p><ul><li>Requires hosting the server</li><li>Relatively high price tag</li></ul><p><a href="https://quicksight.aws/"><strong>AWS QuickSight</strong></a></p><ul><li>Joining data from several sources requires use of one data warehouse</li><li>No embedded views</li></ul><h3>Decision</h3><p>We decided to base our system on <strong>Alooma’s</strong> data pipeline, <strong>Redshift’s</strong> data warehouse, and <strong>Periscope Data’s</strong> presentation solution with the option of adding some <strong>Tableau</strong> seats for our data analysts.</p><p>Alooma web based management interface is powerful and easy to use. With easy schema mapping, real-time data manipulation and enrichment, combined with a friendly and fast responding support team, it makes for a great solution.</p><p>Periscope Data proved to be great for sharing and embedding views, as it gives power to the data analyst building the views and dashboard and less customization options to the end viewer. Plus, views are fast to load due to an internal cache, so you can see when a view was last updated and perform an immediate update.</p><p>How long this setup is going to last? It’s hard to tell. But with fast implementation and the ability to upgrade each part separately, we have everything we need to get started.</p><p>If you want to get some more advice you can reach me at <a href="/service/mailto:uri@wibbitz.com">uri@wibbitz.com</a> or Twitter — @UriNM</p><p><em>Looking for a chance to overcome challenges with creative solutions just like this one, with a talented and results-driven team of developers? Wibbitz is hiring in our Tel Aviv office! </em><a href="https://hubs.ly/H08FwrJ0"><em>Click here to apply.</em></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3d40c6911b87" width="1" height="1" alt=""><hr><p><a href="https://medium.com/wibbitz-developers/the-road-to-agile-data-analytics-solution-3d40c6911b87">The Road to an Agile Data Analytics Solution</a> was originally published in <a href="https://medium.com/wibbitz-developers">Wibbitz Research &amp; Development</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Down The RabbitMQ Hole]]></title>
            <link>https://medium.com/wibbitz-developers/down-the-rabbitmq-hole-11998962891d?source=rss----9fcefc4eaebb---4</link>
            <guid isPermaLink="false">https://medium.com/p/11998962891d</guid>
            <category><![CDATA[backend-development]]></category>
            <category><![CDATA[backend]]></category>
            <category><![CDATA[rabbitmq]]></category>
            <category><![CDATA[debugging]]></category>
            <category><![CDATA[message-queue]]></category>
            <dc:creator><![CDATA[Shlomi Uziel]]></dc:creator>
            <pubDate>Sat, 09 Sep 2017 00:16:11 GMT</pubDate>
            <atom:updated>2017-09-15T18:24:16.351Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SKlcy2D4QxhBrMdNYNCIHA.jpeg" /></figure><p>Working with most queuing systems like RabbitMQ is one of those infrastructure write-once tasks you just expect to perform and forget. However, with a few key points to bear in mind, you could manage this boilerplate coding task with minimal investment of time, unscathed.</p><p>In the following lines I’ll try to portray some tips and major pitfalls we gathered when implementing a simple-yet-robust dispatching mechanism.</p><h4><strong>Robustness is a must</strong></h4><p>The number one priority when implementing a message queue dispatcher should be maintaining a robust connection, and making sure that pushing and dispatching messages will survive even the most unexpected situations.<br>The most naive implementation can poll a process queue using channel’s <em>basicGet </em>method:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/723e59b9bebd50ab55636432904eff8d/href">https://medium.com/media/723e59b9bebd50ab55636432904eff8d/href</a></iframe><p>At first glance, mind the problematic busy-wait, this seems to perfectly serve our needs. But taking a closer look points out a code smell.</p><p>The rabbit channel might get closed for a myriad of reasons — for example, when a message gets published to the wrong exchange. We’ll know this is the case if our attempts to draw messages from the channel results in an <em>AlreadyClosedException</em>. When this happens we should not access <em>channel </em>directly, but should write a getChannel() method to make sure we’re not posting or listening to a broken channel:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/4647631e95504e223c1ed6a3b6e19be1/href">https://medium.com/media/4647631e95504e223c1ed6a3b6e19be1/href</a></iframe><p>While that is nice, it still doesn’t eliminate the need to perform busy-wait. Luckily, RabbitMQ allows us to bind the channel to a queue, and register a <em>Consumer.</em> This implements a<em> handleDelivery </em>callback to take care of incoming messages:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/66317709fc4d7032e5b43e008c068db5/href">https://medium.com/media/66317709fc4d7032e5b43e008c068db5/href</a></iframe><p>For the sake of robustness, this still does not fulfill our needs. Guess what’s going to happen if the connection or the channel gets abruptly terminated?<br>Yep, the consumer will no longer handle incoming messages…</p><p>But fear not, <em>AutorecoveringConnection</em> and <em>AutoRecoveringChannel </em>are here for the rescue! Using this mechanism will assure us that the channel gets recovered, and will allow us to register a <em>RecoveryListener </em>to handle our consumer registration again and resume work.</p><h4><strong>Always keep the model consistent under failures</strong></h4><p>Let’s assume for a moment that our system manages a state for a given object, which travels between several process “phases”. Sending the object back and forth between those phases is maintained using — <em>you guessed right</em> — Rabbit message queues.</p><p>Our model object has a status field to persist its current state, whether it’s on its way to get processed, currently in progress, or finished and sent to the next phase.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*t_2_wpR2MdfvRNZBQBwJ1Q.png" /><figcaption>An object’s lifecycle is managed using a status and queues</figcaption></figure><p>A slightly careless management of those statuses can either lead to messages being processed twice, or to messages getting lost in the oblivion of the rabbit hole. Of course, a normal chain of events within every phase should look like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/711/1*zLVIx15RzUfuxOI4SHRKmQ.png" /></figure><p>Let’s say we just finished “Phase X”. Now we want to change the status to “sentToY”, and send the message over to “Phase Y”.</p><p>Acknowledging the message <strong><em>before </em></strong>a successful queuing of the job to the next phase may result in a lost message in the event of a failure.<br>On the other hand, acknowledging the message <strong><em>after</em> </strong>a successful job queuing will make sure we don’t leave a soldier behind: In that case the job gets requeued to “Phase X”, which should know not to perform its work again, but to reiterate the message queuing to the next phase.</p><p>We should also think about concurrent changes to the status across threads, so a potential lock should be maintained across the object’s status field.</p><h4><strong>Debugging message dispatching does not simulate real life events</strong></h4><p>One last thing to bear in mind is the configuration of heartbeat settings to the <em>ConnectionFactory </em>via the <em>setRequestedHeartbeat </em>method. This will determine the amount of time (in seconds) in which an idle channel will get closed.</p><p>Why is that so important? Because many debugging scenarios may hold back the heartbeat from being issued in time, thus closing down the channel.<br>When not working in the auto-recovery strategy we discussed before, this could be a real pain in debug scenarios, so you should keep that in mind.</p><h4><strong>The rabbit hole is deep, but we’ve got a map for you</strong></h4><p>So, a RabbitMQ dispatching and posting code can be a hassle if not maintained correctly, but I’ve tried to portray some pitfalls for your consideration. Hopefully this will help make that coding task a bit less complex and a whole lot faster for you to go through.</p><blockquote>Looking for a chance to overcome challenges with creative solutions just like this one, with a talented and results-driven team of developers? Wibbitz is hiring in our Tel Aviv office! <a href="https://hubs.ly/H08FwrJ0">Click here to apply.</a></blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=11998962891d" width="1" height="1" alt=""><hr><p><a href="https://medium.com/wibbitz-developers/down-the-rabbitmq-hole-11998962891d">Down The RabbitMQ Hole</a> was originally published in <a href="https://medium.com/wibbitz-developers">Wibbitz Research &amp; Development</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Migrate Angular to React — Services Injection and Dynamic Modals]]></title>
            <link>https://medium.com/wibbitz-developers/migrate-angular-to-react-services-injection-and-dynamic-modals-394a145962dc?source=rss----9fcefc4eaebb---4</link>
            <guid isPermaLink="false">https://medium.com/p/394a145962dc</guid>
            <category><![CDATA[angularjs]]></category>
            <category><![CDATA[dynamic-modal]]></category>
            <category><![CDATA[injection-service]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[react]]></category>
            <dc:creator><![CDATA[Nathan Brudnik]]></dc:creator>
            <pubDate>Wed, 16 Aug 2017 15:53:30 GMT</pubDate>
            <atom:updated>2017-09-15T18:10:53.735Z</atom:updated>
            <content:encoded><![CDATA[<h3>Migrating from Angular to React: Services Injection and Dynamic Modals</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3IiqZ_e9vDvST32nZ7kEBQ.jpeg" /></figure><p>When building a large scale web app using Angular 1, the app may have some performance issues since Angular (as we all know today) just can’t handle the scale.</p><p>For us, Angular’s main issue was that too many watchers were living on the same scope, which was causing poor user experience.<br><a href="https://www.alexkras.com/11-tips-to-improve-angularjs-performance/">Click here for more about Angular’s issues and some solutions</a><br><a href="https://medium.com/@kentcdodds/counting-angularjs-watchers-11c5134dc2ef">Click here for more about counting watchers</a></p><p>Eventually, we decided it was time to migrate our codebase to React and were left with one question — <strong>how?</strong></p><p>This post will focus on the integration between Angular and React and how we solved some of the main problems we encountered during our migration process: <strong>services injection</strong> and <strong>rendering dynamic modals.</strong></p><h3>React &amp; Angular can play together</h3><p>Obviously, rewriting the entire code base is not an option so migrating one component (directive) at a time is the way to go.</p><p><a href="https://github.com/ngReact/ngReact">ngReact</a> is an Angular module that allows using React components within Angular — this is the first step needed to start the migration.</p><p>Let’s take a look at this simple Angular directive called “Hello World”:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/14a0e09ec922045a1a97e051f9ec9d53/href">https://medium.com/media/14a0e09ec922045a1a97e051f9ec9d53/href</a></iframe><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/c3d1bc039c90413896f34aa943058ebe/href">https://medium.com/media/c3d1bc039c90413896f34aa943058ebe/href</a></iframe><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/a43e0ef138ef1dc93814330bdb5bf6d8/href">https://medium.com/media/a43e0ef138ef1dc93814330bdb5bf6d8/href</a></iframe><p>Now let’s take a look at the same directive, written in React:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/50f28ef25b238e162a190385750331a9/href">https://medium.com/media/50f28ef25b238e162a190385750331a9/href</a></iframe><p>Here’s the magic!<br>Check out the directive registration bellow the JSX code.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/80be7491c9060c15ad32d29ab819fd89/href">https://medium.com/media/80be7491c9060c15ad32d29ab819fd89/href</a></iframe><p>Our index.html file can now look like this:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/2a8a94c4ed6a32476705982b097b58cb/href">https://medium.com/media/2a8a94c4ed6a32476705982b097b58cb/href</a></iframe><h3>Angular services Inject into React</h3><p>Angular directives use services, for example, an API service to contact the API. To inject the service to the directive requires the following code:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/4b3c6d756536cc92ec3aaf141c7bc6fb/href">https://medium.com/media/4b3c6d756536cc92ec3aaf141c7bc6fb/href</a></iframe><p>In order to use the same service with ngReact, we’ll have to pass it as a prop to our HelloWorldReact directive. This also means Angular’s parent scope of HelloWorldReact must be injected with the service:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/4faa769b8a7f14f4f8ee7977d598fa6a/href">https://medium.com/media/4faa769b8a7f14f4f8ee7977d598fa6a/href</a></iframe><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/3e640df958225a465f6e3e7b479726a8/href">https://medium.com/media/3e640df958225a465f6e3e7b479726a8/href</a></iframe><p>If we are being realistic, making sure the parent scope is injected with any service we are going to use and then passing it to the directive, would be both <strong>annoying and wrong.</strong></p><p><strong>The best solution</strong> is to add a function so we can easily “inject” services anywhere we want.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/19d12f6b3c0378d3bbbb9a85b4fe300d/href">https://medium.com/media/19d12f6b3c0378d3bbbb9a85b4fe300d/href</a></iframe><p>Now we can do this and use any service we want anywhere in our code.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/d68e14f8354449b30e5bd8995d5eb20f/href">https://medium.com/media/d68e14f8354449b30e5bd8995d5eb20f/href</a></iframe><h3>React Dynamic Modals</h3><p>Before the migration we were using <a href="https://angular-ui.github.io/bootstrap/">UI-Bootstrap for Angular</a>. This package includes a great modal service, and which allowed us to open any type of modal programmatically.</p><p>When migrating to React, none of the Bootstrap packages had this ability. <br>Having to explicitly render the modal (hidden) would look like this:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/1e88fd4dc14132c2edea022df3af17af/href">https://medium.com/media/1e88fd4dc14132c2edea022df3af17af/href</a></iframe><p>Imagine this page would have multiple modals, and other pages may be using the same modals — this would cause a HUGE code duplication.</p><p>Let’s see how we can use templates and open our modals programmatically.<br>We’ll use 3 files:</p><ul><li><strong>ModalService</strong>.js will render the modal to the DOM using renderModal function which will get the actual modal from ModalInstance.</li><li><strong>ModalInstance</strong>.jsx will create the React modal according to the template requested by ModalService.</li><li><strong>ModalStore</strong>.js will be in charge of all general modal logic, currently including only hiding the modal and removing from the DOM.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/646/1*EF9ax28sM0x4BR28bkjy8Q.png" /></figure><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/0ead28e6a72fb6e2c66ffaa3124cbbdc/href">https://medium.com/media/0ead28e6a72fb6e2c66ffaa3124cbbdc/href</a></iframe><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/b810f1662e82cd49ca45bb317482c147/href">https://medium.com/media/b810f1662e82cd49ca45bb317482c147/href</a></iframe><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/5ba69a3f1a0329b0c4b2998d9cb2e412/href">https://medium.com/media/5ba69a3f1a0329b0c4b2998d9cb2e412/href</a></iframe><p><strong><em>Note: </em></strong><em>Our React app is using </em><a href="https://github.com/mobxjs/mobx"><em>MobX</em></a><em> for state management, which allows showing / hiding the modal according to showModal param.</em></p><p>All that’s left is creating the actual modal. Here is an example using ReactBootstrap’s modals, so we can call it when we need it.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/7e3259df5b769600bd2cee0ca3a2786a/href">https://medium.com/media/7e3259df5b769600bd2cee0ca3a2786a/href</a></iframe><p>HelloWorldReact will create an instance of ModalService and will trigger renderModal function:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/f94d1ed0febe00f1934b5262ad96e774/href">https://medium.com/media/f94d1ed0febe00f1934b5262ad96e774/href</a></iframe><p>Our React web app can now render modal programmatically — with no need for any code duplication!</p><h3>How to proceed?</h3><p>Now that Angular and React play well with one another and we can use all of our services until full migration, we can move forward to the next question: <strong>What should we migrate first?</strong></p><p>We decided to migrate the independent components first, as they have no inner angular directives.</p><pre>&lt;div&gt;<br>  &lt;angular-directive&gt;&lt;/angular-directive&gt;<br>&lt;div&gt;</pre><p>Once we had enough migrated components, we were able to migrate directives of this sort:</p><pre>&lt;div class=&quot;complex-directive-name&quot;&gt;<br>  &lt;angular-directive1&gt;&lt;/angular-directive1&gt;<br>  &lt;angular-directive2&gt;&lt;/angular-directive2&gt;<br>  &lt;angular-directive3&gt;&lt;/angular-directive3&gt;<br>  &lt;angular-directive4&gt;&lt;/angular-directive4&gt;<br>&lt;/div&gt;</pre><h3>Conclusion</h3><p>The migration from Angular to React is a long journey that really tests the code quality and architecture of the app.</p><p>Don’t be afraid to make big changes, taking into account the next time you’ll have to migrate (Vue.js?). I believe vanilla Javascript should be used when possible to avoid unnecessary dependencies and make the transition as smooth and as easy as possible.</p><p>This post tackled the main issues we had during our migration. Hopefully this will help you also tackle similar issues.</p><p><strong>Good Luck! :)</strong></p><blockquote><em>Looking for a chance to overcome challenges with creative solutions just like this one, with a talented and results-driven team of developers? Wibbitz is hiring in our Tel Aviv office! </em><a href="https://hubs.ly/H08FwrJ0"><em>Click here to apply.</em></a></blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=394a145962dc" width="1" height="1" alt=""><hr><p><a href="https://medium.com/wibbitz-developers/migrate-angular-to-react-services-injection-and-dynamic-modals-394a145962dc">Migrate Angular to React — Services Injection and Dynamic Modals</a> was originally published in <a href="https://medium.com/wibbitz-developers">Wibbitz Research &amp; Development</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>