<?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 Neocoast on Medium]]></title>
        <description><![CDATA[Stories by Neocoast on Medium]]></description>
        <link>https://medium.com/@neocoaster?source=rss-59abeab85f70------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*SbN_WDzkXCr_qSqseYOJTA.png</url>
            <title>Stories by Neocoast on Medium</title>
            <link>https://medium.com/@neocoaster?source=rss-59abeab85f70------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 27 Nov 2026 21:01:01 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@neocoaster/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[Remix JS: a new fullstack framework]]></title>
            <link>https://neocoaster.medium.com/remix-js-a-new-fullstack-framework-6d94dacb495e?source=rss-59abeab85f70------2</link>
            <guid isPermaLink="false">https://medium.com/p/6d94dacb495e</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[remixjs]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[website-development]]></category>
            <category><![CDATA[framework]]></category>
            <dc:creator><![CDATA[Neocoast]]></dc:creator>
            <pubDate>Mon, 27 Feb 2023 17:52:22 GMT</pubDate>
            <atom:updated>2023-02-27T17:52:22.618Z</atom:updated>
            <content:encoded><![CDATA[<p>By Julieta Dubra</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*kUGU-afRQzpv09JP.png" /></figure><h3>Introduction</h3><p>Javascript has been the main tool used by developers to power websites for the past 25 years. As the language was popularized, many frameworks and libraries were created in order to make development faster, for both frontend and backend. Nowadays, there are a lot of widely used javascript frameworks. One of the most popular ones is React, which can be used to build sleek fronted components. In this article, we will talk about a new, React inspired framework, called Remix. Remix is a full stack web framework, based on React, that was released in November 2021. It is focused mainly on UI and UX, and its main objective is to create fast websites and eliminate as many loading states as possible. In order to achieve this, Remix uses server side rendering to prefetch data including public data, user data, modules or CSS. It also uses built-in data updates, through the use of HTML forms: by just creating a form and an action associated with it on the server, Remix is capable of handling these actions server-side, revalidate data, and handle race conditions from resubmissions. Remix applications use either Javascript or Typescript, and can be run on any browser that supports javascript ES modules. However, the idea behind it allows for most basic pages to run without having javascript enabled. This way, it’s possible to have a basic interface that is fully functional, but can be enhanced through javascript.</p><h3>Folder structure</h3><p>Remix projects can be easily created by running the following command:</p><blockquote>npx create-remix@latest</blockquote><p>It runs a setup script that can create an app configured to fit the needs of the user generating a project with the following folder structure:</p><pre>remix-jokes<br>├── README.md<br>├── app<br>│   ├── entry.client.jsx<br>│   ├── entry.server.jsx<br>│   ├── root.jsx<br>│   └── routes<br>│       └── index.jsx<br>├── package-lock.json<br>├── package.json<br>├── public<br>│   └── favicon.ico<br>├── remix.config.js<br>├── remix.env.d.js<br>└── tsconfig.json</pre><p>Let’s see what some of these files and folders are used for:</p><ul><li><strong>app/entry.client.jsx: </strong>Contains the first Javascript code that runs when the browser loads.</li><li><strong>app/entry.server.jsx: </strong>Contains the first Javascript code that runs when a request to the server is made. Remix then handles all necessary data and the only thing left to do is to create a response.</li><li><strong>app/root.jsx: </strong>Contains the root element of the application. Here is where the &lt;html&gt; tag is placed.</li><li><strong>app/routes/: </strong>This folder contains the different “route modules”. The files in this folder define the different URLs for the app, based on the names of the files.</li><li><strong>public/: </strong>Contains all static assets, such as images, fonts, css, etc.</li><li><strong>remix.config.js: </strong>This file allows the user to change some of the default configurations provided by Remix.</li></ul><h3>Data Loading</h3><p>So how does Remix work? In order to properly understand this framework, a key concept has to be understood: Remix routes. Routes are frontend components that are also their own APIs routes, and can handle communication with the server from the browser on their own. They work in a similar fashion as Rails views, only using React as a format and without the need to use JQuery to improve user interaction. A remix route has therefore two main parts: a component and a loader. Loaders are the backend “API” for their component, and run exclusively on the server. They can interact directly with the database, and can use any database or data persistence services available, or can make calls to external APIs. So, in order to get data for a component through navigation, a user would need to write code such as this one:</p><pre>export async function loader() {<br><br> return json(await getData());<br><br>}<br><br>export default function Component() {<br><br> return &lt;DataView data={useLoaderData()} /&gt;;<br><br>}</pre><p>If we take a close look into this code, we can see how the loader function gets the data through some unspecified means, and then the component consumes it using the useLoaderData hook.</p><p>It is also possible to get data outside of navigation, in cases where the loader function is needed for something in a route but additional queries still need to be made. For example, one might need to access another route’s data to fill the options in a combobox that suggests information to the user. For this sort of situation, a hook called useFetcher can be used, in a similar manner to how one would use the useLoaderData hook. One might then have a route called “cities-search.tsx”, and then the following on a combobox component:</p><pre>function CitySearchCombobox() {<br>  const cities = useFetcher();<br><br>  return (<br>    &lt;cities.Form method=&quot;get&quot; action=&quot;/city-search&quot;&gt;<br>      &lt;Combobox&gt;<br>        &lt;div&gt;<br>          &lt;ComboboxInput<br>            name=&quot;q&quot;<br>            onChange={(event) =&gt;<br>              cities.submit(event.target.form)<br>            }<br>          /&gt;<br>       &lt;/div&gt;<br><br>        {cities.data ? <br>           &lt;div&gt;...&lt;/div&gt;<br>        }<br>     &lt;/Combobox&gt;<br>}</pre><h3>Routing</h3><p>As was mentioned briefly in the description of the project’s structure, Remix routes also define the URL structure of the website. For example, if a file called ‘home.jsx’ was created on the routes folder, a route ‘/home’ would be automatically created and associated with the file. However, this only scratches the surface of the available routing functions of Remix. One of the core features of Remix are nested routes which match segments of the URL to component hierarchy in the UI. The idea behind this is that URL segments usually determine one of these three options: The layouts to render on the page The code split JavaScript bundles to load The data dependencies of those layouts Remix provides a way to render all of these options, maintaining the hierarchy between them. In order for this to work, each component that receives a child route must have an &lt;Outlet /&gt; component that shows where to render the matching child route. So let’s imagine we have the following structure:</p><pre>routes/sales/invoices/$invoiceId.jsx</pre><p>When the user visits this page, assuming all the parent layout routes have an &lt;Outlet /&gt; component, Remix will render the components in this hierarchy that matches the hierarchy defined by the folder structure:</p><pre>&lt;Root&gt;<br>  &lt;Sales&gt;<br>    &lt;Invoices&gt;<br>      &lt;InvoiceId /&gt;<br>    &lt;/Invoices&gt;<br>  &lt;/Sales&gt;<br>&lt;/Root&gt;</pre><p>Which would in turn render an application such as this one:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/0*bkzK4_Nx1Xq3sXGu.gif" /></figure><p>Note how, in order to define a dynamic route, the file name must have the syntax $&lt;VARIABLE&gt;.jsx, like the file invoiceId.jsx. It could go a step further, in cases when the developer wants to add an unspecified amount of variables to the URL. In those cases, the developer could use a file called $.jsx also known as a splat. In these cases Remix will match any value in the URL for the rest of the URL to the end. Unlike dynamic segments, a splat won&#39;t stop matching at the next /, it will capture everything.</p><p>These structures can have as many levels as needed. The user might even want to set a default value for this structure and can do so by defining an index route:</p><pre>routes/sales/invoices/index.jsx</pre><p>So the content of this file is what would show up if a URL without an invoice Id was called.</p><p>Remix offers some flexibility with their nested routing. For example, it is possible to have a nested route without an accompanying nested layout. To do this, one would define the same hierarchy that would be used in the folder structure to define the desired URL, but within the name of one file. So, if we follow the same example as before we would have:</p><pre>routes/sales.invoices.index.jsx</pre><p>The inverse case is also possible: we could want a nested layout on a simple URL. To achieve this, we can remove part of the nested URL from the folder structure by adding two underscores before the name. So, if we wanted to remove the sales part from the example shown before:</p><pre>routes/__sales/invoices/$invoiceId.jsx</pre><p>Now all that’s left to understand is how one would access the information passed to the pages through dynamic routes. In the component, the user can call the Remix hook useParams to access this information and in server side functions such as the loader the params can be received as a function argument.</p><pre>import { useParams } from &quot;@remix-run/react&quot;;<br><br>export function loader({ params }) {...}<br><br>export default function Invoice() {<br>  const params = useParams();<br>  return (&lt;Component/&gt;);<br>}</pre><p>And that ‘s it! The user can then use these params as he would on any other React or Node application.</p><h3>Resource Routes</h3><p>There are cases where a user might want to create a route that is not directly linked to an API or a component. These could be, for example:</p><ul><li>API endpoints.</li><li>Dynamically generating PDFs or images.</li><li>Webhooks for other services like Stripe or GitHub.</li></ul><p>To implement these cases, the user would define a resource route, which is a route that doesn’t export a component. Resource routes only export a loader, whose response is automatically given when the user calls the URL with the GET method. Other methods can be added if they are needed.</p><p>A small, yet important detail that arises when using resource routes is linking: it has to be done with either a &lt;Link reloadDocument&gt; or a plain &lt;a href&gt;. If the link is created as a normal &lt;Link to=&quot;pdf&quot;&gt;, the route will be treated as a UI route.</p><h3>Error handling</h3><p>One of the last interesting features of Remix that we will talk about is error handling. Remix can automatically catch most code errors, whether they occur on the server or on the browser. These errors are then rendered on the closest component of the kind &lt;ErrorBoundary&gt;, a React component that renders each time an error occurs on any part of the route it is a part of. If a template is used, an &lt;ErrorBoundary&gt; will most likely be automatically present in the root of the project. This greatly simplifies error handling: the user does not have to worry about showing specific error messages on each case, as everything is handled automatically.</p><h3>Styling</h3><p>Adding CSS to a Remix project is relatively easy, although not as simple as it may be on React, or on other frameworks such as Next Js. First, the user has to create a .css file anywhere inside the app folder, then import it into the route where he wants to use it. Then, in the component, the user adds a Link with the desired CSS like this:</p><pre>import stylesUrl from &quot;~/styles/index.css&quot;;<br><br>export const links: LinksFunction = () =&gt; {<br><br> return [{ rel: &quot;stylesheet&quot;, href: stylesUrl }];<br><br>};</pre><p>In order for this to work, the user has to additionally include the Link component provided by Remix somewhere within the root component, normally within the &lt;head&gt; tag. This is necessary because Remix associates links to routes, so that the CSS imported on a route will only be available on that specific route in order to avoid conflicts with CSS classes.</p><p>Additional CSS preprocessors, such as SASS or LESS, can be included but aren’t naturally supported: the user must separately run a compile script for these files that will generate their corresponding CSS. This CSS is the one that will effectively be used by the page. This is worth noting as it can be a bit bothersome for some users.</p><h3>In Conclusion</h3><p>Remix provides an interesting and dynamic way to create user interfaces that load extremely fast and handle errors automatically. It offers multiple ways to load and offer data, in a much simpler and condensed way than traditional fullstack applications where there is usually a backend that offers APIs and a frontend that consumes them. Remix offers an array of interesting features, meant to offer pages with almost no loading, but also to generally improve the user experience. This article only scratches the tip of the iceberg on what’s offered and more information along with examples and tutorials can be found on their official <a href="https://remix.run/docs/en/v1">documentation</a>. This new framework is off to a very promising start, but any users interested in trying it out should be warned: it is a very recent project, and bugs may still arise!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6d94dacb495e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Animations: CSS vs JavaScript]]></title>
            <link>https://medium.com/neocoast/animations-css-vs-javascript-226903d6976a?source=rss-59abeab85f70------2</link>
            <guid isPermaLink="false">https://medium.com/p/226903d6976a</guid>
            <category><![CDATA[css-animation]]></category>
            <category><![CDATA[css]]></category>
            <category><![CDATA[frontend]]></category>
            <category><![CDATA[animation]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Neocoast]]></dc:creator>
            <pubDate>Fri, 29 Jul 2022 20:09:41 GMT</pubDate>
            <atom:updated>2022-07-29T20:11:33.460Z</atom:updated>
            <content:encoded><![CDATA[<p>Why should you choose one or the other? Take a look.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*bMMUC-I9qjBkhuyR.png" /></figure><h3>Goal</h3><p>The main goal of this article is to make a comparison between CSS and JavaScript in order to create animations, providing pro and cons and when it’s convenient to opt for one approach or the other. Besides, we will be looking into a few examples of simple transitions and animations with CSS and JavaScript.</p><p>Let’s begin by displaying a few examples of basic transitions with both approaches:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/0*fq-pF_D2pRGklNtD.gif" /></figure><h3>Code</h3><h4>Using CSS.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/922/0*1b4Y7Tz0Ah-5UzBN.png" /></figure><h4>Using JavaScript.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1022/0*3sZeKjFSK8NYl8vV.png" /></figure><p>On the second block of code, in order to pull off a similar output using JavaScript, we need to add event listeners (onmouseover, onmouseout) to the buttons, and define scripts so as to update the element styles on such event listeners.</p><p>So far, it doesn’t seem much of a difference in terms of complexity, later on we will be looking into a more complex animation.</p><h3>Pros and Cons</h3><p><em>JavaScript</em>:</p><ul><li>JavaScript-based animation delivers far more flexibility, power and better workflow for complex animations and rich interactivity, as JavaScript is imperative — you are able to programmatically define the animation — .</li><li>Creating animations with JavaScript is, by comparison, more complex than writing CSS transitions or animations</li></ul><p><em>CSS</em>:</p><ul><li>They’re easy to use for simple animations; you can start creating without the need of having to know about JavaScript.The animations run well, even under moderate system load. Simple animations can often perform poorly in JavaScript. The rendering engine can use frame-skipping and other techniques to keep the performance as smooth as possible.</li><li>Letting the browser take the control of the animation sequence lets the browser optimize performance and efficiency by, for example, reducing the update frequency of animations running in tabs that aren’t currently visible.</li></ul><blockquote>If you can do an animation with CSS over JavaScript, don’t think it twice<em>.</em></blockquote><h3>More examples</h3><p>In this example, we will be producing an animation using JavaScript to move an element from left to right infinitely:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/0*kz8MeGu3WjWlUImV.gif" /></figure><p>Example: Animation with JavaScript (modifies the position of the ball over time).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Qked6X-cmupVLvJi.png" /></figure><p>However, we can also use CSS in order to achieve a similar result, by defining @keyframes to take control of the animation sequence.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/954/0*RjY4UDCv-BTh0dcL.png" /></figure><p>In this code block, we’ve described the animation declaratively: its start position, end position, duration, etc. This tells the browser ahead of time the behavior of the animation, indicating which CSS properties will be modified.</p><h3>Animating SVG with CSS.</h3><p>We can also animate SVG assets using CSS, here’s an example:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/184/0*PcxS0DRgjVOQzEia.gif" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/954/0*dJsJA-0jv0QPNJOS.png" /></figure><p>Animating SVG line with CSS.</p><h3>Conclusions</h3><ul><li>We can use either CSS or JavaScript to create animations. What we opt to use will depend on the complexity of the animation and rich interactivity we may need.</li><li>We should always try to create our animations using CSS where possible. If the animations we are to create are really complex, we may have to rely on JavaScript-based animations (or JavaScript libraries) instead.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=226903d6976a" width="1" height="1" alt=""><hr><p><a href="https://medium.com/neocoast/animations-css-vs-javascript-226903d6976a">Animations: CSS vs JavaScript</a> was originally published in <a href="https://medium.com/neocoast">Neocoast</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[E2E Tests in React Native in a GraphQL App]]></title>
            <link>https://neocoaster.medium.com/e2e-tests-in-react-native-in-a-graphql-app-1d2ed87db51a?source=rss-59abeab85f70------2</link>
            <guid isPermaLink="false">https://medium.com/p/1d2ed87db51a</guid>
            <category><![CDATA[testing]]></category>
            <category><![CDATA[cavies]]></category>
            <category><![CDATA[react-native]]></category>
            <category><![CDATA[graphql]]></category>
            <dc:creator><![CDATA[Neocoast]]></dc:creator>
            <pubDate>Fri, 25 Jun 2021 16:33:15 GMT</pubDate>
            <atom:updated>2021-06-25T16:33:15.122Z</atom:updated>
            <content:encoded><![CDATA[<p>By Lucía del Arco</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*1V8wB-oevXPMP_I2.png" /></figure><h3>Motivation</h3><p>The goal of this article is to learn how to write end-to-end tests in a React Native application using the test framework <a href="https://cavy.app/">Cavy</a>. For this, we are going to give a brief introduction to Cavy and Cavy-CLI, how to adapt our code with the hooks Cavy provides, and how to mock our GraphQL backend using a mocked provider from Apollo.</p><p>First of all, what’s an end-to-end test and why are they so important for our app? An end-to-end test is the way we have to test the whole application from start to end, this simulates a real scenario and how a user would use the app. Doing this, we can prevent potential bugs and ensure that our application works correctly as a whole, including backend, UI and third-party libraries.</p><h3>Cavy and Cavy-CLI</h3><blockquote>“Cavy is an open-source end-to-end test framework for React Native, developed for use with both iOS and Android applications.”<em> — Pixie Labs</em></blockquote><p>The way we use Cavy is with React’s <a href="https://reactjs.org/docs/refs-and-the-dom.html">ref</a> prop. You must pass the generateTestHook function that Cavy provides with an identifier of the component, which is going to be used to reference it in the specs. Ok, but how does Cavy run the tests? By swapping our main index.js entry point, with an index.test.js which will be used by cavy to boot the app and run the tests. (<a href="https://cavy.app/docs/getting-started/setting-cavy-up">Setting up our cavy tester</a>).</p><p>Then there’s Cavy-CLI, a command-line interface that, among other things, lets us setup Cavy creating an e2e folder and the already mentioned index.test.js file, and run the tests of each platform (iOS and Android) using several props. For example, to create the e2e folder and index.test.js you run cavy init e2e, to run the iOS test you simply do: cavy run-ios, or cavy run-ios --skipbuild if your app is already running in a simulator. You can see the full list <a href="https://cavy.app/docs/api/commands">here</a>.</p><h3>How do we adapt our code to use Cavy?</h3><p>As we said before, we need to use the generateTestHook function to register our components. There are two ways to access this function:</p><ol><li>With react hooks and using useCavy() to obtain the function.</li><li>Using the hook function and receiving generateTestHook as a prop in the component.</li></ol><p>Since not all components can be assigned with a ref (e.g. third-party libraries), Cavy provides the wrap function to make those ones testable too. To do that the component has to be wrapped like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/671/1*hGxvKbrNlJeE2hOGSnDlZA.png" /></figure><p><em>Note:</em> The following React Native components have to be wrapped like this if you want to test them: Text, TextInput, Pressable, TouchableOpacity and TouchableHighlight. To avoid doing this every time you want to use one of these components, it’d be better to create a reusable component that returns the component already wrapped: for example TestableTextInput or TestableTouchableOpacity.</p><p>When writing the specs, Cavy provides a set of helpers, for example:</p><ul><li>.findComponent(identifier): returns a component using its test hook identifier.</li><li>.fillIn(identifier, string): fill in a component with a given string. Really helpful to fill TextInputs ;)</li><li>.press(identifier): press the component with the given test hook identifier</li></ul><p>You can take a look at the rest of the helpers <a href="https://cavy.app/docs/api/test-helpers">here</a>.</p><h3>Mocking our Apollo Client<a href="https://blog.neocoast.com/e2e-tests-in-react-native-in-a-graphql-app#mocking-our-apollo-client">#</a></h3><p>In case you need to test a flow that calls your API, you have two choices: mock the responses or use the real API. In this section we are going to see how to implement the first choice in a GraphQL environment, you can <a href="https://blog.neocoast.com/e2e-tests-in-react-native-in-a-graphql-app#comparison-with-detox">skip</a> this section if you want to go with the second choice.</p><p>To test components that make API calls using Apollo, we are going to need to mock that service using MockedProvider, a version of ApolloProvider that doesn’t send real network requests to our API. We specify the response payload we want for a given GraphQL operation and this is used by the mocked provider.</p><p>Once we have our main index.test.js file, we need to configure our provider, in this case: MockedProvider. Let’s take a look at this file:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/722/1*rhNl87QJGcLwLYXzwQZrIg.png" /></figure><p>Here we have the Tester component wrapping the whole app, this instantiates a new TestHookStore, which will store references to the testable components registered, and render our app inside Cavy&#39;s Tester component so that the tests run on boot.</p><p>Then we can see the MockedProvider component, this is where the magic happens when mocking API calls. This component needs the mocks prop, which are all the mocked mutations and queries we are going to use in our tests (it is important that all requests you use in the flow be passed in this prop, otherwise the test will fail because the provider won’t find it). It’s a good practice to have a __mocks__ folder for that, to make our project easier to maintain. You can read more information about mocking requests <a href="https://www.apollographql.com/docs/react/development-testing/testing/">here</a>.</p><p><em>Important:</em> when mocking a mutation that uses some component’s data, make sure to fill the same data in the components and in the mocked request, this is pretty important, otherwise the mutation will fail.</p><p>Last, we put our main <a href="https://reactnavigation.org/docs/getting-started/">navigator</a> inside the MockedProvider, this allows us to also test the navigation flow in our app.</p><h3>Comparison with Detox</h3><p>Let’s do a brief comparison between Cavy and <a href="https://github.com/wix/Detox">Detox</a>, one of the most used test frameworks for React Native.</p><p><strong><em>Installation</em></strong><em>:</em> Cavy is really easy to install and configure, there is no need to do a different configuration to iOS or Android, we just run the cavy init e2e command and we are ready to go. It’s a different story with Detox, the installation and setup is different on each platform and it takes a lot of configuration, you need to install another third-party library as a test runner (e.g. jest), and also add special configuration in the package.json file to specify which devices you want to test (simulators or real devices).</p><p><strong><em>Adapting our code to test:</em></strong> As we said before, Cavy uses the ref prop to reference the components we want to test, but if you are using this for another purpose, you can still pass it as a second argument to the generateTestHook function. For Detox, this is almost the same, it uses the testID prop, but as not all React components accept this prop, you must propagate it through to the correct native component. So, in terms of adapting the code, it is almost the same in both cases.</p><p><strong><em>Capabilities:</em></strong> Cavy is only javascript, so we don’t have the chance to test anything that needs access to native code, for example: opening the camera, access to the gallery, location of the device, tap a specific point, etc. Detox does support this, so it offers more testing functionalities.</p><h3>Conclusion</h3><p>To sum up, if you need a fast solution to test basic flows with only javascript code, go ahead with Cavy, it will save you a lot of time for its nature of fast installation and setup in both iOS and Android platforms (this is pretty important to React Native developers, it’s really annoying to spend more time doing different configurations for each one), and the tests are clean and really simple to write.</p><p>However, if you are building a big project that needs more specific and native testing, you should go with another testing framework, e.g. <a href="https://www.npmjs.com/package/detox">Detox</a>, but take into account the time you will need to spend in installation and setup with non cross-platform frameworks.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1d2ed87db51a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Communicating in a Software Development Company]]></title>
            <link>https://medium.com/neocoast/communicating-in-a-software-development-company-c32330b5a264?source=rss-59abeab85f70------2</link>
            <guid isPermaLink="false">https://medium.com/p/c32330b5a264</guid>
            <category><![CDATA[communication]]></category>
            <category><![CDATA[external-communication]]></category>
            <category><![CDATA[internal-communications]]></category>
            <category><![CDATA[communication-skills]]></category>
            <category><![CDATA[software-development]]></category>
            <dc:creator><![CDATA[Neocoast]]></dc:creator>
            <pubDate>Tue, 27 Apr 2021 12:44:54 GMT</pubDate>
            <atom:updated>2021-04-27T12:44:54.207Z</atom:updated>
            <content:encoded><![CDATA[<h3>Introduction</h3><p>We can all agree that communicating isn’t always easy. Now, how about making it a little harder by managing a group of people who speak different languages, work separately in different projects and when they mean writing they mean writing in code?</p><p>Bear with me as we get into the ongoing challenge of directing a Communications Department in a Software Development Company.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ov_JgYmF6m3AOOk7.png" /></figure><h3>Internal Communication: Hello Chaos</h3><p>First things first, what does internal communication even mean? Well, to put it simply, it’s about making everything move smoothly, in flow, coordinately and coherently behind doors. Sounds easy, right? Well, it’s way harder than it looks.</p><p>I have to say that working with engineers has really changed the perspective I had of them. Yes, I am talking about the stereotypical look of the nerdy guy with glasses and with a computer in hand at all times. Though the latter is actually true, the person behind it is a lot different. Actually, I consider them now as the “cool guys”.</p><p>At least from my experience, they are people who love having fun, enjoy every little thing they do and there’s something about not understanding a word they say when they speak to each other about a project that’s exciting. But, when you have to coordinate all teams handling different technologies and not having a clue about communication, that’s when everything changes.</p><p>Internal communication was chaotic if we compare it to the books. Meaning their main channel of communication was Slack and WhatsApp and there was no protocol to be seen. Don’t get me wrong, Slack and WhatsApp are good, but if you are a communications student, you might have seen more of Social Media, Boards, Newsletters, and, at least, e-mails. Well, not here.</p><p>From the very beginning my job was a challenge and still is. We are just starting with the process and it is nice to work with such proactive people. They are now realizing the importance of having a spokesperson, a communications plan, a head of Marketing, Social Media accounts, and a lot more.</p><p>Our messages now have a purpose, a way of organizing them and prioritizing them, and everyone knows how and why a message is sent. It may seem a little too restrictive at times for them, but the more they use it and understand it, the more they get involved with new and creative ideas to communicate.</p><p>However, not everything ends with handling the way we do things on the inside, which brings me to another point.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*FWse2SpqOIEXx_MC.png" /></figure><p><a href="https://icplan.com/blog/internal-communications/how-to-differentiate-messaging-between-internal-and-external-communication/">ref: ICPLAN</a></p><h3>External Communication: Welcome clients</h3><p>Conversations with clients have always been taken care of. Recognizing the importance of them is not necessarily a problem in any company. It’s simple, without them, there’s no service to offer. Yet, it is important to sink deeper into the whys and hows of the communication with clients and the public in general.</p><p>NeoCoast has been reinforcing the relationships with all its publics, and turning them into long-lasting and strong partnerships. Here’s the importance of differentiating Communications and Marketing. You can always understand a product or service and sell it best to the client you have already studied, yet making the relationship last is all about communication and handling the media and public affairs too.</p><p>Working tight with Sales and Marketing here is crucial. Getting to know what you sell and how we sell it is going to be essential when talking with our stakeholders, but I’m not talking about the characteristics of your product or service or even the channel you use to sell it, but understanding why your offer is better than and different from the competitions.</p><p>Initiating that process meant a lot of studying and introspection. Asking the right questions to our clients, getting to know them, our relationship and analyzing our own sales process to find key points and improve them is a challenge.</p><p>You may not have heard about the Value Proposition Canvas or the Model Business Canvas, but those are an incredibly great way of getting to know your own company by asking all the right questions; that should give you the shove you need to start. After that, it’s all about keeping the conversations going using all the information you already know about your own company. And never lie.</p><p>Remember, it’s not only about finding a client, but selecting the one who is right for you because it fits with your brand, culture, and purpose. That’s what we are working on right now and, even though it may take some time, it is all worth it.</p><h3>Conclusion</h3><p>All in all, there’s a lot to take into account when managing the Communications area of a super complex company. Getting all the information you need is not always as easy as you would think and understanding it is another thing. Nonetheless, if the people you work with help you out, that may be a huge factor. Learning about your company, experiencing the culture and aligning objectives will take time but you shouldn’t feel discouraged. At the end of the day, if the team finds a way to fit in, everything else will follow.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c32330b5a264" width="1" height="1" alt=""><hr><p><a href="https://medium.com/neocoast/communicating-in-a-software-development-company-c32330b5a264">Communicating in a Software Development Company</a> was originally published in <a href="https://medium.com/neocoast">Neocoast</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Search using geolocations with Elasticsearch]]></title>
            <link>https://medium.com/neocoast/search-using-geolocations-with-elasticsearch-ba9590792322?source=rss-59abeab85f70------2</link>
            <guid isPermaLink="false">https://medium.com/p/ba9590792322</guid>
            <category><![CDATA[backend]]></category>
            <category><![CDATA[elasticsearch]]></category>
            <category><![CDATA[geolocation]]></category>
            <dc:creator><![CDATA[Neocoast]]></dc:creator>
            <pubDate>Thu, 26 Nov 2020 17:04:04 GMT</pubDate>
            <atom:updated>2020-11-26T17:10:07.226Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*YocjQ5AJC1tuDwtq.png" /></figure><p>In my last project, we needed to create an engine to search available products within a huge set of products. Those products are available in a certain geographic region with many conditions that must match to be returned as a search result. Typical search features also need to be satisfied like the use of filters and pagination.</p><p>One of the most important requirements was to solve this with a fast query using coordinates for the customer and the product location. Products availability may be represented in two different ways:</p><ul><li>a pair of coordinates and a fixed maximum distance of deliverability</li><li>a polygon that represents the area where it can be fulfilled.</li></ul><p>To develop search queries we decided to use ElasticSearch. As the API is developed in Ruby on Rails, we created an active record model and indexed it into an ElasticSearch index, and using elasticsearch-rails gem we get methods to easily make elasticsearch queries (search, create and delete an index, and to index, update and delete documents).</p><p>This search engine, provided us with the possibility of making fast queries, using complex structures with nested attributes, and build filters using its aggregates, and what’s best: it supports two types of geo data fields without any plugin:</p><ul><li>geo_point: fields which support lat/lon pairs,</li><li>geo_shape: fields that support points, lines, circles, polygons, multi-polygons, etc.</li></ul><p>For these data fields it provides four types of queries:</p><ul><li>geo_bounding_box: finds documents with geo-points that fall into the specified rectangle.</li><li>geo_distance: finds documents with geo-points inside a circle centered in a specified geo-point with a specified radius of distance.</li><li>geo_polygon: finds documents with geo-points within a specified polygon.</li><li>geo_shape: Finds documents with:</li><li>geo-shapes which either intersect, are contained by, or do not intersect with the specified geo-shape</li><li>geo-points which intersect the specified geo-shape</li></ul><p>Despite all these benefits, we are aware of some well-known disadvantages of document oriented systems. Elasticsearch doesn’t allow joins between indexes, so we must have nested attributes and duplicated data, and keeping the data up to date was something that we had to take care of.</p><p>As our work could be adapted to those issues, we decided to use it, because of all the benefits.</p><p>For the queries in which we need to find products near the customer, geo_distance query is the best alternative, and for the products available in a delimited area, geo_shape queries are useful because we can search documents that customer coordinates point is inside the area.</p><h3>geo_distance queries<a href="https://blog.neocoast.com/search-using-geo-locations-with-elasticsearch#geo_distance-queries">#</a></h3><p>Gets all documents that it geo_point field of type geo_point is in a radius of 20 km from the point 40.743479, -73.992377</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/649/1*i1-7sEhBLVHnZJAbKx7XRQ.png" /></figure><p>geo_shape queries<a href="https://blog.neocoast.com/search-using-geo-locations-with-elasticsearch#geo_shape-queries">#</a></p><p>Documents have an area field of type geo_shape. We use this query to see if the customer location is contained in the area where the product is available. Coordinates structure here is an alternative from the other one, it has the next structure: [lon, lat]</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/681/1*g5VM-i-nlalSgbt93-B5LQ.png" /></figure><p>Ordering by distance<a href="https://blog.neocoast.com/search-using-geo-locations-with-elasticsearch#ordering-by-distance">#</a></p><p>Geo point fields also allow us to sort documents by distance.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/665/1*aYMhDOpP2hvK2k33q5M71w.png" /></figure><p>Here we order them first by price, and then order same price products by the distance between its location and 40.743479, -73.992377</p><p>Finally using should and minimum should match we can search elements that match the distance or the area in the same query if it’s needed.</p><h3>Conclusions:</h3><p>Thanks to Elasticsearch we could resolve our problem, allowing us to make the search fast including geographic queries in an easy way. With it we could satisfy our functional and non-functional requirements, generating a traditional search improved with customer and products location, so we highly recommend it.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ba9590792322" width="1" height="1" alt=""><hr><p><a href="https://medium.com/neocoast/search-using-geolocations-with-elasticsearch-ba9590792322">Search using geolocations with Elasticsearch</a> was originally published in <a href="https://medium.com/neocoast">Neocoast</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>