<?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[Blazing Edge - Medium]]></title>
        <description><![CDATA[Software Agency specializing in the web platform, JavaScript-based tech. Based in Split, Croatia. - Medium]]></description>
        <link>https://medium.com/blazing-edge?source=rss----12898d1534f5---4</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>Blazing Edge - Medium</title>
            <link>https://medium.com/blazing-edge?source=rss----12898d1534f5---4</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 01 Dec 2026 13:33:51 GMT</lastBuildDate>
        <atom:link href="https://medium.com/feed/blazing-edge" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Essential React Native Setup]]></title>
            <link>https://medium.com/blazing-edge/essential-react-native-setup-5565662d0e56?source=rss----12898d1534f5---4</link>
            <guid isPermaLink="false">https://medium.com/p/5565662d0e56</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[react-native]]></category>
            <dc:creator><![CDATA[Mateo Karadza]]></dc:creator>
            <pubDate>Mon, 16 Oct 2017 14:19:10 GMT</pubDate>
            <atom:updated>2017-10-16T14:19:08.908Z</atom:updated>
            <content:encoded><![CDATA[<p><em>This is the first article in a series in which I will be writing about React Native, how we use it to create applications here at </em><a href="https://blazingedge.io/"><em>Blazing Edge</em></a><em>, and what it can do for you.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*K19PhfZ1CMgHVglC30uOcA.png" /></figure><p>React Native, when used correctly, can be a powerful tool to craft native mobile experiences. At <a href="https://blazingedge.io/">Blazing Edge</a>, we are a bunch of JavaScript nerds through and through, so of course we love React Native. In this first blog post of many, I’ll be focusing on preparing a good development environment and configuration for deployment to real devices.</p><h4>Agenda for this article</h4><ul><li>Introduction</li><li>New to React Native</li><li>Project directory structure</li><li>Running application on real devices</li><li>Development tools</li><li>Handling different environments</li><li>Tips</li><li>Summary</li></ul><h3>Introduction</h3><p>Listen, there are probably 1000’s of posts about why you should use React or React Native for your next application. This is not one of those posts. If you are reading this article, you are most likely already hooked on React Native, so there’s no need to persuade you, but just in case, here are main reasons why we use React Native.</p><ol><li>React Native is open source and there is a massive community around it. This means there are a lot of contributions to it, lot of custom modules to enhance app functionalities and a lot of different channels you can use to get help (Facebook, Discord — check tips section for links).</li><li>While there are many small contributors, React Native has garnered the attention of some major companies. Big household names like Facebook, Microsoft, Airbnb, Wix, Walmart, and Uber have been known to use and contribute to React Native.</li><li>People tend to think about React Native as a hybrid technology, such as Cordova, PhoneGap or Ionic. It is not! React Native allows us to write Javascript code which executes native functions on mobile devices to perform actions and render components. This allows us to have fully native applications, as if they were written in Java or Objective-C.</li><li>React Native applications run at 60 FPS. This is crucial for delivering good user experience which is really hard to achieve if you are using a hybrid technology which runs your app in a Web view.</li><li>Best of all, you write your code once and it runs on both iOS and Android without the need to customize anything. People usually talk about 80/20 rule where 80% of your code is shared between platforms, and then 20% of your code is platform specific. On our last project we had less than 5% of the code specific to the platform.</li></ol><h3>New to React Native?</h3><p>This article will cover many aspects of React Native and the development process behind every app.</p><p>If you are just starting with React Native, I highly recommend you check <a href="https://expo.io/">Expo.io</a>. Expo is a set of tools that allows anyone to build React Native apps without worrying about the tools, IDEs, packages, native modules, etc.</p><p>Recently, I participated in a Reddit thread where a user asked if he can use Windows machine to learn and make apps in React Native.</p><p>You can make Android apps using React Native, but you won’t be able to test your application on iOS devices, since in order to deploy an app to an iPhone you need to have a macOS machine with Xcode installed. More about this whole process in the iOS section of this article.</p><p>However, if you are on a Windows (or Linux) machine, there is a way to test your application on an iOS device, and that is by using Expo which I linked above, which takes care of the bundling process (doesn’t require any tools or IDEs installed locally, such as Android Studio, Xcode, Android SDK).</p><p>While Expo is great for beginners, it does have its own limitations, like a limited offer of packages that can be used within an Expo project (maintained by Expo). So if you need to write native code or use some package/functionality that is not within Expo SDK, you’ll have to eject Expo from your application or use some advanced methods.</p><p>Read more about the limitations <a href="https://docs.expo.io/versions/latest/introduction/why-not-expo.html">here</a>.</p><h3>Project directory structure</h3><p>Here is a basic directory structure that you’ll most likely find in any React Native project, and if you had experience with React for the web, you’ll find src/ directory very familiar.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/578/1*H2Y9ntPQxxXdyWZtyk68rA.png" /></figure><pre>index.js</pre><p>Entry point for every Android and iOS application. If you were using React Native before version 0.49 you’ll find this new. Before there were two files, each for each platform. Since they were always the same, it was logical for React Native maintainers to use a single entry point for both platforms.</p><pre>android/, ios/</pre><p>p<em>latform related directories</em></p><p>Most of the time you won’t even need to touch files within these directories because react-native link command does everything for you when you install new packages.</p><pre>src/index.js</pre><p>The JS part of the app entry file usually glues together small pieces that require access to the root component of the app, such as <strong>redux integration</strong>, <strong>over the air updates</strong> (more about this in the next sections), <strong>navigation library</strong>, <strong>deep linking</strong>, <strong>handling push notifications</strong>, etc.</p><pre>src/components/</pre><p>A directory with all reusable components used in the application, same as components in React</p><pre>src/screens/</pre><p>We keep all screens within this directory since all screens have access to the Redux store, there was no need to have a containers/ directory.</p><p>In this directory, we keep all screens which are registered by Navigation library on the application start so they can be accessed within the application.</p><pre>.env, .env.example</pre><p>More about these files in the Environment section of the post.</p><pre>.vscode/</pre><p>This is an editor specific directory used by <a href="https://code.visualstudio.com/">Visual Studio Code</a> to store all configuration for the project and editor plugins.</p><h3>Running application on real devices</h3><h4>Android</h4><p>Running the application on Android devices is easy to do, all you need is a <em>keystore</em> file and that’s it. Just be sure to always have this file backed up and passwords stored safely. Once you upload your signed app to the Google Store, you won’t be able to submit new versions of the app if you decide to swap an existing <em>keystore</em> file with a new one.</p><p>In case you do want to submit the app with a new <em>keystore</em> file, then you’ll have to change the package name of the app which leads you back to 0 reviews 🙁.</p><p>Here is an example of our signingConfigs in build.gradle file.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/9583ddce02ebfa3f77b11c578e257bcc/href">https://medium.com/media/9583ddce02ebfa3f77b11c578e257bcc/href</a></iframe><p>In order to install the app on a device, you need to generate a signed APK<em> </em>by running the following command from root directory</p><pre>cd android &amp;&amp; ./gradlew assembleRelease</pre><p>Once you have the signed APK, you can send it to your friends and they’ll be able to install and use the app.</p><p>And by the way, the application will be in production mode, so if you are using the app in production mode for the first time, you’ll notice performance improvements vs development mode.</p><p>You will need Google Developers account which you can get for $25 (one time purchase fee) for submitting the app to the Google Play store.</p><p>Read more about that process <a href="https://facebook.github.io/react-native/docs/signed-apk-android.html">here</a>.</p><h4>iOS</h4><p>Unlike Android, there are several steps that you need to do in order to run your app on a real device.</p><p>The first, and most important step, is to get an Apple Developers account which is needed for creating applications on their development portal and creating necessary certificates and provisioning profiles. An account costs $99 per year .</p><p>Now that you have your Apple Developers account (it may take them some time to confirm your account, specially if you are registering on behalf of a company), you should be able to create a new application using <a href="https://developer.apple.com/account/ios/identifier/bundle">this link</a>.</p><p>Once you have chosen your App ID in the creation process, don’t change it afterwards because you’ll have to reissue all certificates, provisioning profiles, and store entry (say bye bye to the name!). That would definitely be a waste of time, and this App ID is usually hidden from users, so you should give it a unique codename or later on you will have to change it.</p><p>Now that you got your App ID registered, you can create Certificates which are usually used by third party services, such as Push notifications. What interests us in this section is the creation of Provisioning profiles.</p><p><em>A provisioning profile is a collection of digital entities that uniquely ties developers and devices to an authorized iPhone Development Team and enables a device to be used for testing.</em></p><p>In short, the only way for you to test the application on a real device is either by publishing your app through the store or bundling it with a correct provisioning profile during the archive process.</p><p>When creating a provisioning profile, you need to choose an <em>Ad Hoc</em> type profile under <em>Distribution</em> so you can install the app on test devices.</p><p>Then you’ll need to choose which test devices will be added to the Provisioning Profile, after that you can download and use the profile.</p><p>There is a limitation of 100 devices that can be added as testing devices. In order to add one, all you need is an UDID (Unique Device Identifier) of the device and a name for the device.</p><p><a href="http://whatsmyudid.com/">This site</a> explains how to get an UDID from a device.</p><p>My advice is to ask your testers to copy and paste the UDID they get with the method mentioned above. There is a good chance they’ll provide a screenshot, so you’ll have to go through the pain of manually typing the UDID which is a nightmare.</p><h3>Development tools</h3><p><em>Shoutout to you dear reader, if you know some good tools that can help in development, please leave a comment.</em></p><p>So far I only ran into one type of development tool, and that’s the inspector for React Native, what allows you to have the same development experience as you’d have on the web.</p><h4>React Native Debugger</h4><p><a href="https://github.com/jhen0409/react-native-debugger">React Native Debugger</a> is a standalone app that you run on your machine in order to debug your application.</p><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/0*eOfydL0Z61ow-GGY." /></figure><p>One of the functionalities that this tool offers, that I cannot live without, is the option to inspect network.</p><p>Not sure if you tried to do this on the device or simulator, but it’s such a pain since the interface is so tiny and your network requests get spammed by the debugger requests. When you open the React Native Debugger, just right click on it and press <em>Enable Network Inspector</em>.</p><p>Be aware of one thing, you cannot upload files while Network Inspector is enabled, I’ve lost a full day on this issue. ^.^ Read about the issue <a href="https://github.com/jhen0409/react-native-debugger/issues/38#issuecomment-312419961">here</a>.</p><p>Other good functionality, which you can see from the screenshot shown above is the option to inspect your React Native elements, and adjust stylesheet properties. We know that React Native is fast at applying updates, but why stop there, having the same experience on the web when it comes to inspecting and adjusting style on the element is the way to go!</p><p>Last but not least, Redux inspector!</p><h4>Configuration</h4><p>In order to have Redux inspector to work, here is how your store file should look like.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/68931e55bdb148503e3b3bc7a9570055/href">https://medium.com/media/68931e55bdb148503e3b3bc7a9570055/href</a></iframe><h3>Handling different environments</h3><p>React Native on it’s own doesn’t provide support for Environment variables which is a crucial functionality in professional development. Depending on the Environment (Development, Staging/Testing, Production) you’ll be using different API keys, databases, analytics keys and such.</p><p>There are several modules on npm that allow you to use environment variables, but not all of them allow you to use variables in JavaScript, Java and Objective-C code.</p><p>Usually, all your code will be in the JavaScript part of your application, but if you use functionalities such as Push Notifications, Over the Air updates, crash services, etc. you’ll need to make adjustments in Native code.</p><p>So far we’ve been using <a href="https://github.com/luggit/react-native-config">React Native Config</a> and we love it.</p><p>All you have to do is to install the package, and add .env file to the root of your directory. Next time you install the application, it’ll run a script that reads values from .env file, or you can specify .env file location in <em>ENVFILE</em>variable. I tested this module on several Continuous Integration services and it works like a charm!</p><p>My advice for you is to add .env file to your .gitignore file and provide an .env.example file which should inform developer of environment values that are used within a project — Environment values/files can be shared between developers, or you can have a separate environment for each developer.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/7bfdca5b56854e70293d12221bc3a76a/href">https://medium.com/media/7bfdca5b56854e70293d12221bc3a76a/href</a></iframe><p>When it comes to deploying applications, Continuous Integration and Deployment services should have their own environment values, so that the developer doesn’t have to worry if he is using correct environment values when releasing an app.</p><h3>Tips</h3><p><em>In case you have some tips, drop them in the comments and I’ll update the article. ;)</em></p><h4><a href="https://github.com/tleunen/babel-plugin-module-resolver">Babel Module Resolver</a></h4><p>A <a href="http://babeljs.io/">Babel</a> plugin to add a new resolver for your modules when compiling your code using Babel. This plugin allows you to add new “root” directories that contain your modules. It also allows you to setup a custom alias for directories, specific files, or even other npm modules.</p><p>Check the code snippet below</p><pre>// Use this:</pre><pre>import MyUtilFn from ‘utils/MyUtilFn’;</pre><pre>// Instead of that:</pre><pre>import MyUtilFn from ‘../../../../utils/MyUtilFn’;</pre><p>SOLD! Right?</p><p>Module resolver allows us to write absolute paths using aliases, instead of writing relative paths which can be a pain at some points because you need to be aware of your component/file depth and location of the file you’d like to import.</p><p>With absolute path imports, all you need to know is the location of the file you want to import, and you can even simplify that by providing an alias.</p><p>Check our babel configuration below!</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/c2f935ef31d6239661f730a0a499fe3f/href">https://medium.com/media/c2f935ef31d6239661f730a0a499fe3f/href</a></iframe><p>I ran into one issue, I had to start react native packager with — reset-cache, otherwise it throws an error. A simple npm/yarn script fixes it:</p><pre>npm run start — — reset-cache</pre><p>However, it seems like they have fixed this issue in the latest v3.0 beta releases, been using it for the last few days and it seems to work without any issue!</p><h4>React Native communities</h4><p>Here are few links to React Native communities with thousands of people where you can participate in discussions, read related news and articles, ask for help and such things:</p><ul><li><a href="https://www.reactiflux.com/">Reactiflux on Discord</a></li><li><a href="https://www.facebook.com/groups/react.native.community/">React Native Community group on Facebook</a></li></ul><p>Next articles will cover topics such as:</p><ul><li>Navigation</li><li>Continuous integration and deployment</li><li>Dealing with images in application</li><li>Handling keyboard and views with forms</li><li>Over the Air updates</li><li>etc.</li></ul><p><em>We’re constantly trying new tech to improve our development skills and experience. If you are interested in innovating and growing your product, let’s do it together. </em><a href="/service/mailto:info@blazingedge.io"><em>Reach out to us today.</em></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5565662d0e56" width="1" height="1" alt=""><hr><p><a href="https://medium.com/blazing-edge/essential-react-native-setup-5565662d0e56">Essential React Native Setup</a> was originally published in <a href="https://medium.com/blazing-edge">Blazing Edge</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 Love WebdriverIO]]></title>
            <link>https://medium.com/blazing-edge/why-we-love-webdriverio-and-you-should-too-57738a393c48?source=rss----12898d1534f5---4</link>
            <guid isPermaLink="false">https://medium.com/p/57738a393c48</guid>
            <category><![CDATA[quality-assurance]]></category>
            <category><![CDATA[webdriverio]]></category>
            <category><![CDATA[testing]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Ana]]></dc:creator>
            <pubDate>Fri, 13 Oct 2017 12:59:19 GMT</pubDate>
            <atom:updated>2017-10-15T14:02:35.551Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Originally posted on our partner blog at East Coast Product, November 17, 2016</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YEL-JyS1dHgRo5wBBaEbiw.jpeg" /></figure><p>I’ve been using <a href="http://webdriver.io/">the WebdriverIO testing framework</a> for the last eight months and have had an incredibly positive experience, so I want to share the love. If you are looking for a new testing framework, here are a few reasons to consider WebdriverIO.</p><h3><strong>It’s developer friendly</strong></h3><p>WebdriverIO is written entirely in JavaScript. This is awesome because it lets me write checks in a familiar language and allows me to use the same libraries I have used previously for Unit Testing (Mocha &amp; Chai).</p><p>Also, WebdriverIO makes it super simple to find elements. Outside of searching for elements by only the text they contain (e.g. ‘button=Save’), WebdriverIO allows the use of advanced CSS selectors (e.g. ‘#editSomething&gt;span #someElementID’, or ‘#elementId&gt;h3:nth-of-type(1)’). This means there’s no need to rely on the pesky xPath and accidentally selecting duplicate elements is no longer an issue!</p><p>Combined with <a href="https://addons.mozilla.org/en-US/firefox/addon/firefinder-for-firebug/">Firefinder</a> for <a href="https://addons.mozilla.org/en-US/firefox/addon/firebug/">Firebug</a> (for Firefox), WebdriverIO makes writing checks incredibly easy. The framework comes with a nice configuration utility that helped me create a config file in a matter of seconds. I did it by typing:</p><p>wdio config</p><p>in the command line of the project’s folder and then a command line wizard launched. After answering some questions about my project, the config file was done:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/400/0*z4Vcz6T2NO8jv6te." /></figure><p>Another good aspect of WebdriverIO is it comes with its own test runner. I wanted to learn more about automated workflows, so I used gulp-webdriver, a <a href="http://gulpjs.com/">Gulp</a> plugin that runs selenium tests with the WebdriverIO runner. Setup is as easy as:</p><p>npm install -g gulp</p><p>npm install --save-dev gulp</p><p>and the gulp task for running checks looks something like this:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/ce2493be2efc5178953c34452a5075c2/href">https://medium.com/media/ce2493be2efc5178953c34452a5075c2/href</a></iframe><p>WebdriverIO supports other testing frameworks like Jasmine, Cucumber, and Mocha. I used Mocha because the configuration helper kindly offered it to me, and I’ve used it before.</p><p>Additionally, you can add custom options into the <em>wdio.conf.js</em> config file, e.g. for Mocha:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/bcd35710aab8f90333c2f5ff1c195914/href">https://medium.com/media/bcd35710aab8f90333c2f5ff1c195914/href</a></iframe><p>Not only that, you can set global variables, arrange scripts into suites, and set the number of browser instances. I’ll dive deeper into these options in a later blog post.</p><p>If you’re still doubting the framework’s friendliness, check out this awesome <a href="https://gitter.im/webdriverio/webdriverio">Gitter channel</a> where WebdriverIO devs and users hang out, share knowledge, and help one another.</p><h3>You get Selenium under the hood</h3><p>The best thing about WebdriverIO and Selenium working together is that checks run in a broad range of browsers (the sorts that have drivers, that is), like Firefox, Chrome, Safari, and even IE. This makes cross-browser checking SO much easier.</p><h3>It’s intuitive</h3><p>The commands used in WebdriverIO checks are short, succinct, and pretty intuitive.</p><p>For example, logging into an app is as easy as:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/b6c07dbf0fe5c70272678df60ea87c54/href">https://medium.com/media/b6c07dbf0fe5c70272678df60ea87c54/href</a></iframe><h3>Commands are customizable</h3><p>Out of hundreds of available commands, sometimes we need that special one that’s not available. Thus, we make our own. WebdriverIO supports custom commands, so we can just call the “<em>addCommand</em>” function and pass in our custom steps like this:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/3d39efd1792a87b58aad09f6506e5f14/href">https://medium.com/media/3d39efd1792a87b58aad09f6506e5f14/href</a></iframe><p>I haven’t needed custom commands yet, but it’s good to know that they’re available if necessary.</p><h3>Easy Page Object &amp; Helper Functions</h3><p>WebdriverIO supports the <a href="http://webdriver.io/guide/testrunner/pageobjects.html">Page Objects</a> design pattern. Using Page Objects is a way of separating page information from the checks. This helps reduce repeating the same selectors connected to a common action over and over, like <em>Login</em>, that cause you to end up with scripts that are difficult to maintain. If anything changes on the page, you’ll have to refactor your code to account for the change in multiple places, and you might miss a file or two. To work around this, a Page Object can be used to reference that action. Then, it’s easy just to refactor the Page Object with the update propagating to wherever you use it in the checking suites. Here’s an example of how to use of a Page Object:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/714753ced9f7426ab5624be775b04883/href">https://medium.com/media/714753ced9f7426ab5624be775b04883/href</a></iframe><p>Personally, I use helper functions for this purpose. Here’s an example of a helper function, <em>account.js:</em></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/1ef27c74e5fb4c6e4b63775727efbdc1/href">https://medium.com/media/1ef27c74e5fb4c6e4b63775727efbdc1/href</a></iframe><p>This function is then referenced in the <em>testAccount.js</em> suite like this:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/be1f7ea052c073606c99da19b7c98531/href">https://medium.com/media/be1f7ea052c073606c99da19b7c98531/href</a></iframe><p>That way, if anything changes in the Account/Login page code, I can refactor my <em>account.js </em>helper function, and I’m done.</p><p>When I was starting out, I didn’t really understand the Page Object Model but have since decided to give it another chance. Since it seems like helper functions do pretty much the same thing — reference an action and keep it separated from the checks — I’m not sure if I should switch to Page Object Model. If anyone has some good arguments for why the Page Object Model is a better choice, I’d be very interested in hearing them.</p><h3>Final thoughts</h3><p>I hope you find WebdriverIO as valuable as I have. If you want to play with it some more, check out this <a href="https://github.com/EastCoastProduct/webdriverio-blog-example">GitHub repo</a> to see the examples from this post and a few extras that will be the topic of my next post (repo in progress). Happy Testing!</p><p><em>We’re constantly trying new tech to improve our development skills and experience. If you are interested in innovating and growing your product, let’s do it together. </em><a href="/service/mailto:info@blazingedge.io"><em>Reach out to us today.</em></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=57738a393c48" width="1" height="1" alt=""><hr><p><a href="https://medium.com/blazing-edge/why-we-love-webdriverio-and-you-should-too-57738a393c48">Why We Love WebdriverIO</a> was originally published in <a href="https://medium.com/blazing-edge">Blazing Edge</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Why I’m Excited About Yarn and You Should Be Too]]></title>
            <link>https://medium.com/blazing-edge/why-im-excited-about-yarn-and-you-should-be-too-8e2e3e7f2624?source=rss----12898d1534f5---4</link>
            <guid isPermaLink="false">https://medium.com/p/8e2e3e7f2624</guid>
            <category><![CDATA[yarn]]></category>
            <category><![CDATA[npm]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Ivan Blazevic]]></dc:creator>
            <pubDate>Fri, 13 Oct 2017 12:36:24 GMT</pubDate>
            <atom:updated>2017-10-13T12:38:53.940Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Originally posted on our partner blog at East Coast Product, October 20, 2016</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4l79NyJswOdZuFz1Iwg5hw.png" /></figure><p>Remember the dark age of packages in web development? Searching all over the web to try and find a version of a package from some global CDN just to cut your load times by a small margin?</p><p>Well, since then, we’ve come a long way. Most libraries and packages you use for development are open sourced and hosted on Github today. Awesome tools, like Bower, have paved the way for npm, which is now the de facto standard for JS package management.</p><p>Creating an application without the massive package repository that npm has to offer is hard and simply terrifying to even imagine. It’s super easy, just type npm install mypackage and it&#39;s installed and ready to use, add --save and it&#39;s added to the package.json. What&#39;s not to like?</p><p>Don’t get me wrong, npm is not without its imperfections. Npm is very complex and with this ever-increasing complexity, some imperfections became more apparent. Enter: Yarn.</p><p>Last week, Google, Tilde, Facebook, and Exponent collaboratively launched Yarn, a new package manager to address some of the glaring issues with npm. In this post I will take a closer look at Yarn and discuss the most important improvements that it’s claiming to make.</p><h3>Work Offline</h3><p>Simply put, to install packages using npm, you need to be connected to the internet in order to fetch the desired packages.</p><p>Alternatively, Yarn gives you the power to work in offline mode. Yarn essentially caches all packages globally that you install. If you are installing a package that you have installed previously, you don’t need an internet connection at all. Offline mode also speeds up all subsequent installations of the same package since there is no need to go and fetch if from the internet.</p><h3>Lockfile</h3><p>I can’t tell you how many times different package versions installed across the team had been the culprit for a bug. Checking dependency versions tends to be an annoying starting point for every developer when trying to figure out some strange bug that only affected certain people or certain environments.</p><p>To address this, npm introduced shrinkwrap, which lets you to lock package versions for production. If you run npm shrinkwrap it will generate a <em>npm-shrinkwrap.json</em> file with listed locked dependencies. However, shrinkwrap requires you to actually run it manually. If you add a new package and forget to run shrinkwrap, that package is left out.</p><p>To solve this problem, Yarn took a proven concept from other package managers — <strong>lock file</strong>. During the installation, yarn.lock file is generated automatically. It&#39;s similar to Gemfile.lock file that Ruby on Rails developers should be very familiar with. This file locks all the versions installed, and each time Yarn installs, it will use these locked versions. If you keep this file in the repository (which you should), it guarantees that all developers, and even deploy builds, are running the same dependency versions.</p><h3>Determinism</h3><p>The npm client uses a non-deterministic approach when installing packages. This means that the <em>node_modules/</em> directory structure can vary between different systems and different developers. A common problem with this structure variance between different systems and developers is it’s a potential source for those <em>‘It works on my machine’</em> bugs.</p><p>Yarn lockfile guarantees that no matter how many times you run it on the same repository, you will always get the same results — this works across different machines and production builds. No more need for pushing <em>node_modules</em> to the repository or keeping it zipped somewhere so that different machines can unpack and have the exact same version of <em>node_modules</em>.</p><p>Determinism is an incredibly important feature for a package manager and is really long overdue with npm.</p><h3>Speed</h3><p>Yarn claims to be giving a big increase in dependency installation speed. I ran a few experiments to test this claim.</p><p>Using the same hardware, I picked three different repositories to compare:</p><ul><li>A React repository</li><li>An internal front-end React application</li><li>An API written in Node.js.</li></ul><p>For each repository, I did three sets of measurements:</p><ul><li>one with npm3</li><li>one with Yarn without cache</li><li>one with Yarn when packages are already cached.</li></ul><p>I ran multiple experiments for each and used the average. There was no significant difference when running npm3 with or without cache, so the time wasn’t noted.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/0834de0fc6649d25db3f40eb8feabe09/href">https://medium.com/media/0834de0fc6649d25db3f40eb8feabe09/href</a></iframe><p>As you can see, Yarn is about twice as fast as npm3 on the initial installation. On the second run, when packages are cached, and don’t need to be fetched over the network, Yarn is an impressive five times faster than npm3 installations. Needless to say, the increase is pretty apparent.</p><p>For the past week or so I have been playing with Yarn, and it definitely seems more reliable than the current version of npm. I’m excited to see how npm, as the current king of JS package managers, will react to this. Yarn clearly improves on a few aspects and I expect to see npm introducing at least some of these improvements.</p><p>In the meantime, Blazing Edge will probably make a switch from npm to Yarn because the benefits seem to be so evident and clear.</p><p><em>We’re constantly trying new tech to improve our development skills and experience. If you are interested in innovating and growing your product, let’s do it together. </em><a href="/service/mailto:info@blazingedge.io"><em>Reach out to us today.</em></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8e2e3e7f2624" width="1" height="1" alt=""><hr><p><a href="https://medium.com/blazing-edge/why-im-excited-about-yarn-and-you-should-be-too-8e2e3e7f2624">Why I’m Excited About Yarn and You Should Be Too</a> was originally published in <a href="https://medium.com/blazing-edge">Blazing Edge</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>