<?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 Tomas Zaicevas on Medium]]></title>
        <description><![CDATA[Stories by Tomas Zaicevas on Medium]]></description>
        <link>https://medium.com/@zaicevas?source=rss-79be94688064------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*L-8p7a4voXbQ0phSBJyCKQ.jpeg</url>
            <title>Stories by Tomas Zaicevas on Medium</title>
            <link>https://medium.com/@zaicevas?source=rss-79be94688064------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 06 Apr 2026 04:31:15 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@zaicevas/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[The Most Important Assertions in Jest, React Testing Library Tests]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://blog.bitsrc.io/the-most-important-assertions-in-jest-react-testing-library-tests-276fd745db38?source=rss-79be94688064------2"><img src="https://cdn-images-1.medium.com/max/2600/0*CaGnSV27lYyF2Rkj" width="4288"></a></p><p class="medium-feed-snippet">Prioritize these assertions when writing component tests</p><p class="medium-feed-link"><a href="https://blog.bitsrc.io/the-most-important-assertions-in-jest-react-testing-library-tests-276fd745db38?source=rss-79be94688064------2">Continue reading on Bits and Pieces »</a></p></div>]]></description>
            <link>https://blog.bitsrc.io/the-most-important-assertions-in-jest-react-testing-library-tests-276fd745db38?source=rss-79be94688064------2</link>
            <guid isPermaLink="false">https://medium.com/p/276fd745db38</guid>
            <category><![CDATA[react]]></category>
            <category><![CDATA[tdd]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Tomas Zaicevas]]></dc:creator>
            <pubDate>Mon, 21 Mar 2022 10:57:21 GMT</pubDate>
            <atom:updated>2022-03-23T08:51:53.920Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[How ESLint Resolves Plugins And Shareable Configs]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://levelup.gitconnected.com/how-eslint-resolves-plugins-and-shareable-configs-87194bca7b02?source=rss-79be94688064------2"><img src="https://cdn-images-1.medium.com/max/2600/0*cNhwnX7t-NexmJWb" width="5472"></a></p><p class="medium-feed-snippet">And what does it have to do with package managers and peer dependencies?</p><p class="medium-feed-link"><a href="https://levelup.gitconnected.com/how-eslint-resolves-plugins-and-shareable-configs-87194bca7b02?source=rss-79be94688064------2">Continue reading on Level Up Coding »</a></p></div>]]></description>
            <link>https://levelup.gitconnected.com/how-eslint-resolves-plugins-and-shareable-configs-87194bca7b02?source=rss-79be94688064------2</link>
            <guid isPermaLink="false">https://medium.com/p/87194bca7b02</guid>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[node-package-manager]]></category>
            <category><![CDATA[front-end-development]]></category>
            <category><![CDATA[eslint]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Tomas Zaicevas]]></dc:creator>
            <pubDate>Tue, 08 Mar 2022 14:07:34 GMT</pubDate>
            <atom:updated>2022-03-08T14:26:57.496Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[What NOT to Assert in React Component Tests]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://blog.bitsrc.io/what-not-to-assert-in-react-component-tests-66ab9ee79176?source=rss-79be94688064------2"><img src="https://cdn-images-1.medium.com/max/2600/0*63g-o81EK4nWsvUS" width="5627"></a></p><p class="medium-feed-snippet">Avoid these test assertions in Jest, React Testing Library tests.</p><p class="medium-feed-link"><a href="https://blog.bitsrc.io/what-not-to-assert-in-react-component-tests-66ab9ee79176?source=rss-79be94688064------2">Continue reading on Bits and Pieces »</a></p></div>]]></description>
            <link>https://blog.bitsrc.io/what-not-to-assert-in-react-component-tests-66ab9ee79176?source=rss-79be94688064------2</link>
            <guid isPermaLink="false">https://medium.com/p/66ab9ee79176</guid>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[tdd]]></category>
            <dc:creator><![CDATA[Tomas Zaicevas]]></dc:creator>
            <pubDate>Thu, 10 Feb 2022 11:17:04 GMT</pubDate>
            <atom:updated>2022-03-13T13:00:51.791Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[How Performing Classical Music Helped Me Code]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://levelup.gitconnected.com/how-performing-classical-music-helped-me-code-945a45c12fe7?source=rss-79be94688064------2"><img src="https://cdn-images-1.medium.com/max/2600/0*_QRD__38dOQhDEHV" width="4896"></a></p><p class="medium-feed-snippet">From winning tens of international accordion competitions to becoming a frontend developer.</p><p class="medium-feed-link"><a href="https://levelup.gitconnected.com/how-performing-classical-music-helped-me-code-945a45c12fe7?source=rss-79be94688064------2">Continue reading on Level Up Coding »</a></p></div>]]></description>
            <link>https://levelup.gitconnected.com/how-performing-classical-music-helped-me-code-945a45c12fe7?source=rss-79be94688064------2</link>
            <guid isPermaLink="false">https://medium.com/p/945a45c12fe7</guid>
            <category><![CDATA[piano]]></category>
            <category><![CDATA[classical-music]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[self-improvement]]></category>
            <dc:creator><![CDATA[Tomas Zaicevas]]></dc:creator>
            <pubDate>Thu, 02 Dec 2021 18:33:52 GMT</pubDate>
            <atom:updated>2021-12-02T18:33:52.528Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[5 Tips To Ace Your Software Development Internship]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://levelup.gitconnected.com/5-tips-to-ace-your-software-development-internship-7ee2e097af28?source=rss-79be94688064------2"><img src="https://cdn-images-1.medium.com/max/2600/0*FKtw-e6AX5V3ScP3" width="3600"></a></p><p class="medium-feed-snippet">From a 3x intern and a mentor</p><p class="medium-feed-link"><a href="https://levelup.gitconnected.com/5-tips-to-ace-your-software-development-internship-7ee2e097af28?source=rss-79be94688064------2">Continue reading on Level Up Coding »</a></p></div>]]></description>
            <link>https://levelup.gitconnected.com/5-tips-to-ace-your-software-development-internship-7ee2e097af28?source=rss-79be94688064------2</link>
            <guid isPermaLink="false">https://medium.com/p/7ee2e097af28</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[internships]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[software-internship]]></category>
            <dc:creator><![CDATA[Tomas Zaicevas]]></dc:creator>
            <pubDate>Tue, 09 Nov 2021 02:34:03 GMT</pubDate>
            <atom:updated>2021-11-09T02:34:03.494Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[You Probably Don’t Need act() in Your React Tests]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://javascript.plainenglish.io/you-probably-dont-need-act-in-your-react-tests-2a0bcd2ad65c?source=rss-79be94688064------2"><img src="https://cdn-images-1.medium.com/max/1920/1*WjgMW8a4mDuoAvpbU5se0w.jpeg" width="1920"></a></p><p class="medium-feed-snippet">What you should do instead.</p><p class="medium-feed-link"><a href="https://javascript.plainenglish.io/you-probably-dont-need-act-in-your-react-tests-2a0bcd2ad65c?source=rss-79be94688064------2">Continue reading on JavaScript in Plain English »</a></p></div>]]></description>
            <link>https://javascript.plainenglish.io/you-probably-dont-need-act-in-your-react-tests-2a0bcd2ad65c?source=rss-79be94688064------2</link>
            <guid isPermaLink="false">https://medium.com/p/2a0bcd2ad65c</guid>
            <category><![CDATA[testing]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[front-end-development]]></category>
            <dc:creator><![CDATA[Tomas Zaicevas]]></dc:creator>
            <pubDate>Mon, 05 Apr 2021 09:04:20 GMT</pubDate>
            <atom:updated>2021-04-05T09:04:20.586Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Chat app from scratch with React Native and Java (Part 2 — backend)]]></title>
            <link>https://zaicevas.medium.com/chat-app-from-scratch-with-react-native-and-java-part-2-backend-deef6fb38bad?source=rss-79be94688064------2</link>
            <guid isPermaLink="false">https://medium.com/p/deef6fb38bad</guid>
            <category><![CDATA[websocket]]></category>
            <category><![CDATA[react-native]]></category>
            <category><![CDATA[chat]]></category>
            <category><![CDATA[java]]></category>
            <category><![CDATA[mobile-app-development]]></category>
            <dc:creator><![CDATA[Tomas Zaicevas]]></dc:creator>
            <pubDate>Sun, 02 Aug 2020 10:54:23 GMT</pubDate>
            <atom:updated>2021-03-20T12:13:01.514Z</atom:updated>
            <content:encoded><![CDATA[<h3>Chat app from scratch with React Native and Java (Part 2 — backend)</h3><p><em>In </em><a href="https://medium.com/@tozaicevas/chat-app-from-scratch-with-react-native-and-java-part-1-27ec8beae271"><em>part 1</em></a><em> we developed a front-end part of our little chat app. In this part, we will write the </em><strong><em>backend</em></strong><em>. Full source code: </em><a href="https://github.com/tozaicevas/chat-demo"><em>https://github.com/zaicevas/chat-demo</em></a></p><p>Let’s start by finishing the frontend, so that it’s ready to receive messages from the backend. We will do it in two phases:</p><ul><li>Writing a WebSocket wrapper</li><li>Using the wrapper in our <strong>App</strong> component</li></ul><h3>Writing a WebSocket wrapper</h3><p>The reason we’re doing it, is to have the logic, concerned with how to send and receive messages to a server, be outside of the UI component.</p><p>Create a <strong>WebSocketClient.js:</strong></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/419156c6feb42d2bc9d3dd3edea48d48/href">https://medium.com/media/419156c6feb42d2bc9d3dd3edea48d48/href</a></iframe><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/26d7775776a2c5c12c074edc72fe1cd7/href">https://medium.com/media/26d7775776a2c5c12c074edc72fe1cd7/href</a></iframe><p><em>Note, that in </em><strong><em>30th</em></strong><em> line, you need to pass your local IP. Sadly, </em><strong><em>localhost</em></strong><em> won’t work, because of iOS restrictions.</em></p><h3>Using the wrapper in our <strong>App</strong> component</h3><p>Let’s update our App.js so that it uses our <strong>WebSocketClient </strong>to retrieve and send messages:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/38e33136fb61ad414379788a84b05269/href">https://medium.com/media/38e33136fb61ad414379788a84b05269/href</a></iframe><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/6e6ed892f38ddcd6ae674329102b0548/href">https://medium.com/media/6e6ed892f38ddcd6ae674329102b0548/href</a></iframe><p>The tricky part here is the second <strong>useEffect. </strong>This useEffect runs every time <strong>messages</strong> change. It’s not enough call that useEffect once, because in that case, <strong>messages</strong> would not refer to the latest state. That problem could also be solved with other techniques (for instance, useRef) but this solution seems simpler and sufficient.</p><p>After these changes, we are ready to send and receive new messages from our backend server.</p><h3>Building the backend</h3><p>Let’s go straight to <a href="https://start.spring.io/">spring initialzr</a> and choose following options:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BAh4UVCP5X1p643AKSRiwA.jpeg" /><figcaption>Note: this screenshot was taken a while back, the page might look differently by now, including versions.</figcaption></figure><p>When the project is generated, hop into your favourite IDE and let’s add a couple of dependencies into our pom.xml. At the end, it should look like this:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/19dca3c2d5a8482e5d01f56694843719/href">https://medium.com/media/19dca3c2d5a8482e5d01f56694843719/href</a></iframe><p>Let’s then create a class which will handle WebSocket messages</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/acfd81eaeadc6096b1b94bdb189b75dd/href">https://medium.com/media/acfd81eaeadc6096b1b94bdb189b75dd/href</a></iframe><p>We need another class, which maps our WebSocket API path and the handler.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/6899bd37e46946e80654c8d08724a03f/href">https://medium.com/media/6899bd37e46946e80654c8d08724a03f/href</a></iframe><p>Congratulations for making it that far, because we have only one thing left — implement our WebSocketHandler:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/e91f4fa1cd8a89e19e1e647bd67ff02a/href">https://medium.com/media/e91f4fa1cd8a89e19e1e647bd67ff02a/href</a></iframe><p>In a nutshell, we’re taking every message that we receive and send it to all of the clients. Simple, isn’t it?</p><p>Now you should be able to connect to the app with two or more phones and chat!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/375/1*_Ke3he2eIrYoVI9ZevVQtQ.jpeg" /><figcaption>Chat</figcaption></figure><p>This app, of course, has gazillion number of problems, some of which are:</p><ol><li>What about users with the same name?</li><li>No persistence</li><li>No auth</li></ol><p>However, I am going to let you solve them on your own! Thank you for following these tutorials. You can find the source code here: <a href="https://github.com/tozaicevas/chat-demo">https://github.com/zaicevas/chat-demo</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=deef6fb38bad" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Chat app from scratch with React Native and Java (Part 1)]]></title>
            <link>https://zaicevas.medium.com/chat-app-from-scratch-with-react-native-and-java-part-1-27ec8beae271?source=rss-79be94688064------2</link>
            <guid isPermaLink="false">https://medium.com/p/27ec8beae271</guid>
            <category><![CDATA[chat]]></category>
            <category><![CDATA[react-native]]></category>
            <category><![CDATA[websocket]]></category>
            <category><![CDATA[expo]]></category>
            <category><![CDATA[spring-boot]]></category>
            <dc:creator><![CDATA[Tomas Zaicevas]]></dc:creator>
            <pubDate>Thu, 23 Jan 2020 12:22:42 GMT</pubDate>
            <atom:updated>2021-03-20T12:12:58.582Z</atom:updated>
            <content:encoded><![CDATA[<h3>Chat app from scratch with React Native and Java (Part 1 — frontend)</h3><h4>Let’s build a chat app from scratch with React Native, Java and WebSockets!</h4><p><strong><em>Part 2:</em></strong><em> </em><a href="https://medium.com/@tozaicevas/chat-app-from-scratch-with-react-native-and-java-part-2-backend-deef6fb38bad">https://medium.com/@tozaicevas/chat-app-from-scratch-with-react-native-and-java-part-2-backend-deef6fb38bad</a><em>. </em><strong><em>Source code:</em></strong><em> </em><a href="https://github.com/tozaicevas/chat-demo"><em>https://github.com/zaicevas/chat-demo</em></a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/375/1*H3Y51tOtqbQ9feeUcekppw.jpeg" /></figure><p>Ladies and gentlemen, I recently spent some time working with WebSockets by writing a <a href="https://github.com/tozaicevas/chat">simple chat app</a> and was amazed by how easy it is, so let me enlighten you as well!</p><p><strong>We’ll use</strong></p><ul><li><a href="https://expo.io/">Expo</a></li><li>Spring Boot</li><li>WebSockets</li><li><a href="https://github.com/FaridSafi/react-native-gifted-chat">React Native Gifted Chat</a></li></ul><p><em>P.S. Newest versions as of 2020–01</em></p><p>Mobile UI in part 1 and Java backend in part 2 of this tutorial.</p><p>The only things that we need for this tutorial are <em>expo</em> and a <em>phone</em> (you can use android/iOS emulators if you want)</p><h4>Setting up expo</h4><ul><li>Runnpm install expo-cli --global This will install the expo so that we can run all the features expo provides us (creating an initial project, running it on our phone)</li></ul><p><em>Note: if you don’t have </em><em>npmyou can get it by executing </em><em>pacman -S npm nodejsor </em><em>apt-get install npm nodejson Linux machines and </em><a href="https://nodejs.org/en/download/"><em>https://nodejs.org/en/download/</em></a><em> for Windows.</em></p><ul><li>Run expo initand choose <strong>blank (managed workflow). </strong>This will create an empty project.</li><li>Move to the directory of the created project and run expo start</li><li>You should see a new tab opened in your browser, if you don’t — open <a href="http://localhost:19002/">http://localhost:19002/</a></li><li>Download expo mobile app for <a href="https://play.google.com/store/apps/details?id=host.exp.exponent&amp;hl=en">Android</a>/<a href="https://apps.apple.com/us/app/expo-client/id982107779">iOS</a></li><li>Scan the QR code</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/375/1*SsPFSgQ191biIfOntphMqg.jpeg" /><figcaption><em>Note: If the app doesn’t load, try switching to </em><strong><em>Tunnel</em></strong><em> instead of LAN in the browser tab.</em></figcaption></figure><h4>Getting name from the user</h4><p>First of all, we need to get a name from the user. Open App.js and let’s start with this code snippet, which I will explain soon:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/c7b754c6fc4e5ebb84618c8f2eeeacfe/href">https://medium.com/media/c7b754c6fc4e5ebb84618c8f2eeeacfe/href</a></iframe><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/131ed3aeb65b3f0a390833f706244ff9/href">https://medium.com/media/131ed3aeb65b3f0a390833f706244ff9/href</a></iframe><p>We should now see this layout:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/375/1*DyccD2_TRHUbaqwVWM25uA.jpeg" /><figcaption><em>Note: it will look a little differently in android</em></figcaption></figure><p>With this code, we are able to read the name from the user, but we are not doing anything with it just yet. As soon as user presses Enter, the screen becomes empty. That’s okay, it’s expected behavior for now.</p><p>As you can see, we made a couple of changes in the code:</p><ol><li>Added TextInput, Button</li><li>Added name, isEnter <a href="https://reactjs.org/docs/hooks-intro.html">React hooks</a></li><li>Added conditional rendering based on whether user has pressed Enter</li><li>Changed function App() to a lambda</li></ol><p>For those unfamiliar with React or React hooks — shortly speaking, we create 2 variables name and isEnter which are managed by React. Whenever we change them, React handles the changes in the UI. However, one should only change them by calling respective functions setName and setIsEnter</p><p>Therefore, when onChangeText={text =&gt; setName(text)}gets called in our TextInput, React figures out that namehas been changed and it rerenders our App component with new value of name. That’s why when we are typing our name, we can see it in our app.</p><p>Now, that we have read user’s name, we can start coding the main part of our application — chat.</p><h4>Coding chat</h4><p>Firstly, we need the <a href="https://github.com/FaridSafi/react-native-gifted-chat">React Native Gifted Chat</a> component. Run npm install react-native-gifted-chat --save</p><p>Now, let’s modify our App.js by rendering a chat, instead of an empty screen, when the user has pressed Enter:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/b3d50e6c8ba126c311ce91100f5e8a8c/href">https://medium.com/media/b3d50e6c8ba126c311ce91100f5e8a8c/href</a></iframe><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/b351d62540d77dba0200cfaaeabe3f5b/href">https://medium.com/media/b351d62540d77dba0200cfaaeabe3f5b/href</a></iframe><p>At this point, you can chat with yourself:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/375/1*H3Y51tOtqbQ9feeUcekppw.jpeg" /></figure><p>Let’s look closer into what we’ve changed:</p><ol><li>Created another hook messages</li><li>Passed a mock message as a default state for messages hook just to see how it is rendered</li><li>Used react-native-gifted-chat to render chat component when the user has pressed Enter</li><li>Whenever we send a message, we updated the chat component.</li></ol><p>So far, everything is going well, however our app is still local, which means we cannot see if someone else has sent a message. For this reason, we need to setup a WebSocket client and build a backend server.</p><p>Building a backend server will be an objective of the 2nd part of this tutorial, so stay tuned!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=27ec8beae271" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>