<?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 Bugsnag on Medium]]></title>
        <description><![CDATA[Stories by Bugsnag on Medium]]></description>
        <link>https://medium.com/@Bugsnag?source=rss-815e417c7cc8------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*fBakNybhoaI28dlxMaKqaw.png</url>
            <title>Stories by Bugsnag on Medium</title>
            <link>https://medium.com/@Bugsnag?source=rss-815e417c7cc8------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 17 Nov 2026 00:03:58 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@Bugsnag/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[Using Envoy to Load Balance gRPC Traffic]]></title>
            <link>https://medium.com/envoyproxy/using-envoy-to-load-balance-grpc-traffic-a8a42e37e9a4?source=rss-815e417c7cc8------2</link>
            <guid isPermaLink="false">https://medium.com/p/a8a42e37e9a4</guid>
            <category><![CDATA[engineering]]></category>
            <category><![CDATA[performance]]></category>
            <category><![CDATA[infrastructure]]></category>
            <dc:creator><![CDATA[Bugsnag]]></dc:creator>
            <pubDate>Wed, 10 Jan 2018 00:00:00 GMT</pubDate>
            <atom:updated>2018-01-17T16:50:06.327Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ddhto6-LmBxmFxDSdvPeNg.png" /></figure><p>At <a href="https://www.bugsnag.com/">Bugsnag</a>, we recently launched the <a href="https://blog.bugsnag.com/release-health-and-visibility/">Releases dashboard</a> for tracking the health of releases. It was a large undertaking, but as we built out the backend to support it we paid particular attention to performance. One of the key areas we focused on was the latency associated with our backend service calls and, in the end, we chose to switch out <a href="https://en.wikipedia.org/wiki/Representational_state_transfer">REST</a> for Google’s blisteringly fast <a href="https://grpc.io/">gRPC</a> framework.</p><p>In order to successfully migrate to gRPC, we first needed to rethink our load balancing strategy to ensure that it properly supported gRPC traffic. This blog post outlines how we ultimately arrived at our decision to add Lyft’s feature rich <a href="https://www.envoyproxy.io/">Envoy proxy</a> into our stack and how it fits into Bugsnag’s architecture.</p><h3>Some background on Bugsnag’s architecture</h3><p>Behind the scenes, Bugsnag has a pipeline of microservices responsible for processing the errors we receive from our customers that are later displayed on the dashboard. This pipeline currently handles hundreds of millions of events per day. To support the new Releases dashboard, we needed to expand the pipeline to begin receiving user sessions — something that represented a massive increase in traffic. Performance would be key for this project, and is one of the main reasons we adopted the gRPC framework.</p><p>In terms of deployment, Bugsnag’s microservices are deployed as <a href="https://www.docker.com/">Docker</a> containers in the cloud using Google’s excellent <a href="https://kubernetes.io/">Kubernetes</a> orchestration tool. Kubernetes has built in load balancing via its <a href="https://kubernetes.io/docs/reference/generated/kube-proxy/">kube-proxy</a> which works perfectly with HTTP/1.1 traffic, but things get interesting when you throw HTTP/2 into the mix.</p><p>gRPC uses the performance boosted <a href="https://developers.google.com/web/fundamentals/performance/http2/">HTTP/2 protocol</a>. One of the many ways HTTP/2 achieves lower latency than its predecessor is by leveraging a <a href="https://http2.github.io/faq/#why-just-one-tcp-connection">single long-lived TCP connection</a> and to multiplex request/responses across it. This causes a problem for <a href="https://en.wikipedia.org/wiki/OSI_model#Layer_4:_Transport_Layer">layer 4</a> (L4) load balancers as they operate at too low a level to be able to make routing decisions based on the type of traffic received. As such, an L4 load balancer, attempting to load balance HTTP/2 traffic, will open a single TCP connection and route all successive traffic to that same long-lived connection, in effect cancelling out the load balancing.</p><p>Kubernetes’ kube-proxy is essentially an L4 load balancer so we couldn’t rely on it to load balance the gRPC calls between our microservices.</p><h3>Why not make the clients do the work?</h3><p>One of the options we explored was using <a href="https://github.com/grpc/grpc/blob/master/doc/load-balancing.md">gRPCs client load balancer</a> which is baked into the gRPC client libraries. That way each client microservice could perform its own load balancing. However, the resulting clients were ultimately brittle and required a heavy amount of custom code to provide any form of resilience, metrification, or logging, all of which we would need to repeat several times for each of the different languages used in our pipeline.</p><p>What we really needed was a <em>smarter</em> load balancer.</p><h3>Choosing a smarter load balancer</h3><p>We needed a <a href="https://en.wikipedia.org/wiki/OSI_model#Layer_7:_Application_Layer">layer 7</a> (L7) load balancer because they operate at the application layer and can inspect traffic in order to make routing decisions. Most importantly, they can support the HTTP/2 protocol.</p><p>There are many different options for L7 load balancers including <a href="https://www.nginx.com/">NGINX</a> and <a href="http://www.haproxy.org/">HAProxy</a>, but most proved too heavyweight to easily drop into our microservice architecture. We whittled down the choice to two key contenders — <a href="https://www.envoyproxy.io/">Envoy</a> and <a href="https://linkerd.io/">Linkerd</a>. Both were developed with microservice architectures in mind and both had support for gRPC.</p><p>Whilst both proxies had many desirable features, our ultimate decision came down to the footprint of the proxy. For this, there was one clear winner. Envoy is tiny. Written in <a href="https://en.wikipedia.org/wiki/C%2B%2B11">C++11</a>, it has none of the enterprise weight that comes with Java based Linkerd.</p><p>Once we’d decided on Envoy, we started drilling down into its feature set, and there was a lot to like.</p><h3>So what makes Envoy so good?</h3><p>Envoy was <a href="https://eng.lyft.com/announcing-envoy-c-l7-proxy-and-communication-bus-92520b6c8191">written and open sourced by Lyft</a>, and is the direct result of years of battling with complex routing issues that typically occur in microservice architectures. It was essentially designed to fit our problem and boasts:</p><ul><li>First class support for HTTP/2 and SSL in either direction</li><li>High transparency with excellent metrification</li><li>A mature <a href="https://www.envoyproxy.io/docs/envoy/latest/">documentation set</a></li><li>No dependency on any given language</li></ul><p>That last one was a big one for us. It chimed with Bugsnag’s polyglot microservice architecture.</p><h3>Fitting Envoy into our infrastructure</h3><p>In Kubernetes, a group of one or more containers is known as a <a href="https://kubernetes.io/docs/concepts/workloads/pods/pod/">pod</a>. Pods can be replicated to provide scaling and are wrapped in abstractions known as <a href="https://kubernetes.io/docs/concepts/services-networking/service/">services</a> which provide a stable IP address for accessing the underlying pods. Since Kubernetes 1.2 the default behaviour on hitting a service IP is that <a href="https://kubernetes.io/docs/concepts/services-networking/service/#proxy-mode-iptables">a random backend pod will be returned</a>. However you can reconfigure your services to be <a href="https://kubernetes.io/docs/concepts/services-networking/service/#headless-services">headless</a> so that the service IP will instead return the entire list of available pod IPs, allowing you to perform your own service discovery.</p><p>Envoy was designed to be run as a <a href="http://blog.kubernetes.io/2015/06/the-distributed-system-toolkit-patterns.html">sidecar container</a> where it sits alongside the client container, supplementing its functionality in a modular way. In Kubernetes, this translated to running the client container and the Envoy container within the same pod. We configured our services to be headless to provide endpoints for Envoy to use for service discovery. And thanks to the large amount of metrics output by Envoy, we were able to easily observe the round-robin load balancing of successive gRPC calls to confirm that it was working as expected.</p><p>Whilst we chose to run an Envoy sidecar for each of our gRPC clients, companies like Lyft run a sidecar Envoy for <strong>all</strong> of their microservices, <a href="https://www.microservices.com/talks/lyfts-envoy-monolith-service-mesh-matt-klein/">forming a service mesh</a>. This approach is incredibly powerful, allowing you to adjust traffic parameters at the domain level, and it is something we’ll look to capitalize on at Bugsnag.</p><h3>Alternative solutions</h3><p>Whilst Envoy fit our requirements well, there were a few alternative solutions worthy of mention. Some of these we explored, but they were either too immature or didn’t quite fit our architecture at the time:</p><ul><li><a href="https://istio.io/">Istio</a> — A joint collaboration of <a href="https://developer.ibm.com/dwblog/2017/istio/">IBM, Google and Lyft</a> that forms a complete solution for load-balancing micro services. It has Envoy at its heart and runs out-of-the-box on Kubernetes platforms.</li><li><a href="https://github.com/Netflix/ribbon">Ribbon</a> — The open-sourced <a href="https://en.wikipedia.org/wiki/Inter-process_communication">IPC</a> library offering from Netflix, a company that has proven to be a true heavyweight in microservice related DevOps tooling.</li><li><a href="https://github.com/kubernetes/ingress-gce">Kubernetes Ingress Controllers</a> — Whilst this feature relies on a beta Kuberenetes resource, it represents a possibility for realizing L7 load balancing within Kuberenetes.</li></ul><p>Overall, we’ve been impressed with Envoy and will continue to explore its features as we build out and expand Bugsnag. One thing’s for sure, this space is hot in the DevOps world right now and we’re excited to see how the future landscape develops.</p><p><em>Originally published at </em><a href="https://blog.bugsnag.com/envoy/"><em>blog.bugsnag.com</em></a><em> on January 10, 2018.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a8a42e37e9a4" width="1" height="1" alt=""><hr><p><a href="https://medium.com/envoyproxy/using-envoy-to-load-balance-grpc-traffic-a8a42e37e9a4">Using Envoy to Load Balance gRPC Traffic</a> was originally published in <a href="https://medium.com/envoyproxy">Envoy Proxy</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Why we revamped our onboarding process at Bugsnag]]></title>
            <link>https://medium.com/@Bugsnag/why-we-revamped-our-onboarding-process-at-bugsnag-9c611bf4a84c?source=rss-815e417c7cc8------2</link>
            <guid isPermaLink="false">https://medium.com/p/9c611bf4a84c</guid>
            <category><![CDATA[onboarding]]></category>
            <category><![CDATA[error-monitoring]]></category>
            <category><![CDATA[developer]]></category>
            <category><![CDATA[hiring]]></category>
            <category><![CDATA[startup]]></category>
            <dc:creator><![CDATA[Bugsnag]]></dc:creator>
            <pubDate>Wed, 15 Jun 2016 15:06:06 GMT</pubDate>
            <atom:updated>2016-06-15T15:06:06.965Z</atom:updated>
            <content:encoded><![CDATA[<p>I joined <a href="https://bugsnag.com/">Bugsnag</a> as the first Office Manager in July of 2015. Over the next six months we doubled in size, opened an <a href="http://blog.bugsnag.com/bugsnag-bath-office">international office in Bath, England</a>, and moved into a bigger HQ office in San Francisco. It was an exciting time and we were growing fast, but it reached a point where I knew we weren’t offering the best onboarding experience we could for new hires.</p><p>Hiring is crucial for any company, but even more so in a startup where bringing in talented people who are also a great team fit is essential. At Bugsnag, we already offered great perks and a fun, friendly work environment, but I knew we could do even better. I wanted us to create a thoughtful onboarding that would help our new team members ramp up through a streamlined process.</p><h3>Our main goals for onboarding</h3><p>First, I wanted to find a way to extend the excitement of accepting an offer through to the first day at Bugsnag. Many times you sign an offer and don’t join the new company for several weeks, and I didn’t want the excitement to die off in between. This helps us create a great first day which is really important.</p><p>Second, I wanted to centralize every step of the process in one place. We had checklists and documents, but there was definitely a way to combine it all for quick access and efficiency.</p><p>Third, as our team grew, we’d made changes to the ways we work, like weekly team planning meetings and setting up project management tools across teams. These changes are important and help our team collaborate effectively, but weren’t being addressed in the new hire experience. I wanted to make sure new hires understood our collaborative working style from the start.</p><h3>Picking the right tool for the job</h3><p>Finding the right tool was really important because in addition to making sure that onboarding worked well for new hires, I also needed multiple people to be involved in the process. I looked into a few different options and decided on Trello which we already used on several of our teams to manage projects. Trello has great notification and communication features which are key for tracking progress between multiple team members.</p><p>With Trello, we can move each step to a <em>Done</em> list when it’s been completed. Eventually all items will be moved and archived other than our <em>General Info</em> list. The <em>General Info</em> list is where we put frequently used contacts (like Slack groups and email lists), links to employee blog posts, and general office information. The new team member can also add any information they’re given during their first few days here to keep on hand for later. When you join a new company you’re often bombarded with details about the office and company, policies, etc. Trying to remember everything can be a hassle, so this way our new team member has access to all the information without feeling like they’ll forget or lose it.</p><h3>Setting up Trello</h3><p>So now it was time to set up my Trello board. I decided to track the process over a month with six lists (Offer, Before First Day, First Day, Week 1, Week 2, First Month).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*a680jDUVr6iRfd_1.png" /></figure><p>Standard HR and Operations tasks are spread between the Offer all the way to the First day. The First Day is arguably the most important. Here we give the new employee time to set up their computer and new accounts, meet with them for a quick office tour, and go over building access, certain policies, and how to get set up on the perks we offer. We also schedule a chat to discuss equipment policies and security.</p><p>Weeks 1 and 2 are more relaxed and focused on team events and helping everyone get to know each other. We schedule a team lunch and coffee meetings with a few team members from different departments. The goal here is to start building relationships across the company and offering more resources as the new employee is still ramping up. It helps break down barriers so everyone knows they can speak to everyone and ask questions. An inclusive and open working environment is a really big part of who we are and so making sure we help people feel this right from the start is integral to their onboarding process.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*G2wByPdeS8OlC8ps.png" /></figure><p>By the end of the first month things should be running smoothly. Here we schedule a lunch or coffee with our CEO, James, which then puts the new employee into the rotation for their quarterly 1on1.</p><h3>Why we track onboarding over a month</h3><p>I want to make sure we’re aware of how people are adjusting for a longer period than just the first day or week. So we’ve decided to track onboarding over a month. As time goes on, there are fewer administrative tasks, but the most important things, like integrating into the company and getting to know the team, continue. This also includes HR/Operations and the Founders of the company checking in from time to time with each new employee.</p><p>In a month’s time at Bugsnag there is an opportunity to experience all aspects of our culture and work environment. We’ll have a monthly All Hands meeting for the entire company, including our UK team. We’ll have done at least one team event, like going out to the Exploratorium, Trivia night, or just playing games at the office.</p><p>Our aim is that by the end of the first month, our new team member has all the tools they need to be productive, have met and bonded with other teammates, and feel comfortable in their new role.</p><p>People are the most valuable part of any company and it’s important to us at Bugsnag that everyone is happy and successful. This new system has allowed us to stay on top of the process and address any issues before they become a problem. We’ve made a <a href="https://trello.com/b/EeORacnF/bugsnag-onboarding-public">public version of this board</a> as an example to help you gain inspiration for your organization.</p><p>So far we have used this Trello board to onboard several new employees and the benefits have definitely been noticed by our Operations department and our new team members. We think we’re on to something here and can’t wait to use it as we continue to grow.</p><p><a href="https://bugsnag.com/">Bugsnag</a> is an automatic error monitoring platform that helps developers build better software. With Bugsnag, you can capture and fix every error, in all your applications.</p><p>We’re currently <a href="https://jobs.lever.co/bugsnag">hiring</a> for roles in Design, Engineering, and Sales in San Francisco.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9c611bf4a84c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Moving Bugsnag’s front-end to React]]></title>
            <link>https://medium.com/@Bugsnag/moving-bugsnag-s-front-end-to-react-fb3e4f681043?source=rss-815e417c7cc8------2</link>
            <guid isPermaLink="false">https://medium.com/p/fb3e4f681043</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[software-development]]></category>
            <dc:creator><![CDATA[Bugsnag]]></dc:creator>
            <pubDate>Mon, 07 Dec 2015 23:57:42 GMT</pubDate>
            <atom:updated>2015-12-07T23:57:42.756Z</atom:updated>
            <content:encoded><![CDATA[<h4>What we learned through the largest rewrite of our application</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5om1amRqgP2AkAzH3mAT_w.png" /></figure><p>About a year ago, our team decided to undertake a massive rewrite of much of our application. We knew we wanted to add a ton of new features and functionality to help our users fix bugs as painlessly as possible, but part of this meant rethinking the way our Dashboard’s front-end was built.</p><p>Recently, we released a new Bugsnag Dashboard to the world, which has been incredibly exciting. You can read more about it <a href="https://bugsnag.com/blog/all-new-bugsnag-launch">here</a> in case you didn’t hear about it. Throughout the process, we learned a lot, and we thought sharing our experiences might help other product teams who are thinking of undertaking similar projects.</p><p>The new Dashboard has a completely revamped look and tons of additional features. Handling all these changes was made possible with an entire rewrite of our front-end. We ended up changing our <a href="http://rubyonrails.org/">Ruby on Rails</a> front-end to <a href="https://facebook.github.io/react/">React</a>, a JavaScript library for creating user interfaces, and to power our new front-end, we created a robust Ruby on Rails API.</p><h3>Why does React work for Bugsnag?</h3><h4>What is React?</h4><p>React is a JavaScript library built by Facebook. The creators of React built the library to solve one problem: building large applications with data that changes over time. They consider it to be the View layer in the <a href="https://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93controller">Model–view–controller</a> (or MVC) pattern, allowing developers to show and mutate a representation of our data. It is not considered a full MVC framework like some of the other comparable JavaScript libraries out there. React is unique in that, as the view layer, it combines the HTML markup with JavaScript code in the same file. React also works with <a href="https://facebook.github.io/flux/">Flux</a>, which is an architecture that defines how data, events, and actions should flow through client side code.</p><h4>Why React?</h4><p>In React, you build individual components, and each component encapsulates a part of the view and its logic. This means the HTML view markup and the JavaScript for that view are in the same file, where they can all be edited together. I was initially pretty horrified to see the markup inside of our JavaScript files — what about separation of concerns? However, after using it for a little while, I realized that I actually <em>like</em> them being combined. Hear me out here: although React does remove the physical “separation” between HTML &amp; JavaScript, that separation wasn’t necessarily helpful in a rich client-side application. Over time, I realized that the separation was a separation of technologies, rather than concerns. Removing this separation led to code that was both more maintainable and easier to reuse.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Cej0wvizYjCAEN5wE_ps4g.png" /></figure><p>When the markup and the JavaScript that manipulates that markup are in the same file, it’s much easier to understand exactly how the JavaScript affects the markup. One of the popular alternatives to this is writing js-* classes and data-*attributes into the markup, and then attaching to those in JavaScript. People working in the markup generally know not to touch those parts of the view, but they aren’t necessarily sure why. The code then becomes brittle, hard to read, and hard to maintain.</p><p>One of the main reasons we wanted to use React was so we could build components that would be reusable in multiple areas of our application. As it turns out, building components is one of the main use cases for React. Since components keep their code so encapsulated, they make reusing code, testing, and separation of concerns easy.</p><p>Even though removing the physical separation between HTML markup and JavaScript code is a great idea by itself, there are more reasons why it’s ideal for React to have markup living alongside JavaScript. Each React component has arender function, which is where you create your HTML template and return it. This function creates a virtual DOM, and the real DOM is only updated when there are data changes. Some rich client-side applications handle data changes by replacing existing content with new HTML returned by an AJAX request. In a React application, data changes cause a conceptual press of the “refresh” button, and React knows to only update the changed parts. Since DOM changes are slow, React’s approach can be a really huge performance improvement for the front-end.</p><h3>The move</h3><p>Converting our entire front-end to React was a big move, but well worth it. After planning out how to divide our Dashboard into easily digestible chunks to move over, we started implementing them piece by piece. We found the similarities and differences between the old Dashboard and the new Dashboard design — we looked through the sections of our Rails application to figure out which pieces of Ruby code could be “reused” and rewritten into JavaScript. From there, we were able to make reusable components to drop into our views.</p><p>React components also function as <a href="http://facebook.github.io/react/docs/interactivity-and-dynamic-uis.html#components-are-just-state-machines">state machines</a> which means we don’t have to manually track state, and React will trigger rerenders in affected DOM areas. This helped us rip out our complicated JavaScript files and Rails decorators, encapsulating the existing logic in with the component.</p><p>We chose a few technologies that would help us integrate React:</p><h4>JSX &amp; CJSX</h4><p>You can use plain JavaScript with React, but we used <a href="https://facebook.github.io/react/docs/jsx-in-depth.html">JSX</a>. JSX is a JavaScript syntax extension that looks similar to XML, and is what allows us to write the aforementioned HTML inside our JavaScript files. We use JSX because it provides a concise and familiar syntax for defining tree structures with attributes. On top of that, since we already use <a href="http://coffeescript.org/">CoffeeScript</a> at Bugsnag, we used <a href="https://github.com/jsdf/coffee-react">Coffee-React</a> to enable functionality with CoffeeScript and JSX.</p><h4>Reflux</h4><p>We also decided to use <a href="https://github.com/reflux/refluxjs">Reflux</a> instead of traditional Flux. Reflux is a <a href="https://github.com/reflux/refluxjs#differences-with-flux">refactored</a>version of Flux that makes everything more dynamic and adheres more closely to the principles of <a href="https://en.wikipedia.org/wiki/Functional_reactive_programming">functional reactive programming</a>.</p><h4>Gulp</h4><p>For numerous reasons, including the fact that the <a href="http://guides.rubyonrails.org/asset_pipeline.html">Rails asset pipeline</a> does not allow us to harness <a href="http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/">sourcemaps</a>, we decided to <a href="https://bugsnag.com/blog/replacing-the-rails-asset-pipeline-with-gulp">remove the asset pipeline</a> and use<a href="http://gulpjs.com/">Gulp</a> for our asset compilation needs. Gulp is a Node.js streaming build system, strictly providing streams and a basic task system. We use Gulp to compile all of our assets, including everything we need to run React and related technology.</p><h3>What we learned</h3><p>React was a great library for us to work with, and although the rewrite was a huge project, we definitely learned a lot. The library is unique and allowed us to do a lot of really cool things, but we had to learn how to structure and use it properly over time. Along the way we made some mistakes, but ultimately learned how to use it and get us to the Dashboard we have today.</p><h4>Mixins</h4><p>One of the early mistakes we made was not using <a href="https://facebook.github.io/react/docs/reusable-components.html#mixins">mixins</a> correctly. At first, when we had a pretty reusable piece of code, we would decide that it would make a great mixin. After making quite a few mixins and developing on top of them, we realized they ended up being either <em>extremely</em> brittle or <em>extremely</em> generalized. This made our code harder to maintain, which defeated the whole purpose of code reuse. In the end, we pulled out these mixins into components. We learned not to use mixins for view code, but instead for small and very specific logic. For example, we have a mixin for managing our API requests, and another mixin for creating and managing application hotkeys. Every mixin we have now is very small and very specific.</p><h4>Requesting Data</h4><p>A helpful thing we added to React was the ability to request data from Reflux stores while a component is on screen. It allows you to “mount” a store, which automatically connects to that store, and while on screen can ask the store for certain data. When that data is fetched, it will automatically update the state. Onunmount, it automatically removes that hook. We developed this workflow before Facebook released <a href="https://facebook.github.io/relay/">Relay</a>, which handles approximately the same use case. In the future, we will probably switch over to using Relay so we don’t have to maintain our own system.</p><h4>PureRenderMixin</h4><p>Another thing we found handy was to use the <a href="https://facebook.github.io/react/docs/pure-render-mixin.html">PureRenderMixin</a> in pretty much every component. If your React component’s render function is “pure” (in other words, it renders the same result given the same props and state), you can sometimes get a performance boost by using this mixin. We did run into a pitfall though: this mixin works by comparing your component’s data to avoid unnecessary re-renders during changes, but it only shallowly compares the data objects. That means if a component contains complex data structures, it may produce false-negatives for deeper differences.</p><h4>Immutable-js</h4><p>One future improvement we are considering is using <a href="https://github.com/facebook/immutable-js">Immutable-js</a>, which would allow us to use the PureRenderMixin in more components. Immutable-js makes it so that we can create immutable data, which cannot be changed once created. This means much simpler application development, no defensive copying, and enabling advanced memoization and change detection techniques with simple logic. Because we wouldn’t be modifying original objects, Immutable-js will allow us to use the PureRenderMixin on components with complex data structures without producing false-negatives.</p><h3>The future</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AmN9uw1xRhROZ1g6xrLh7Q.png" /></figure><p>At Bugsnag, we are really excited about the architectural changes we’ve made to the product for the new Dashboard. These changes allowed us to make more meaningful representations of error data, helping make debugging easier. From an engineering perspective, these changes allow easier maintenance of the code, and the component-based system enables us to create new features faster. We’re hopeful that in the future we can open source our components and contribute to the React ecosystem.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fb3e4f681043" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>