<?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 Negar Jamalifard on Medium]]></title>
        <description><![CDATA[Stories by Negar Jamalifard on Medium]]></description>
        <link>https://medium.com/@negarjf?source=rss-8401ac33d046------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*KARUe8hP075JfcnwzuFHOw.jpeg</url>
            <title>Stories by Negar Jamalifard on Medium</title>
            <link>https://medium.com/@negarjf?source=rss-8401ac33d046------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 19 Jun 2026 13:50:07 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@negarjf/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[Progress Isn’t Always Measurable]]></title>
            <link>https://medium.com/@negarjf/progress-isnt-always-measurable-4b9fe997484a?source=rss-8401ac33d046------2</link>
            <guid isPermaLink="false">https://medium.com/p/4b9fe997484a</guid>
            <category><![CDATA[growth]]></category>
            <category><![CDATA[new-years-resolutions]]></category>
            <category><![CDATA[self-care]]></category>
            <category><![CDATA[self-improvement]]></category>
            <category><![CDATA[tech]]></category>
            <dc:creator><![CDATA[Negar Jamalifard]]></dc:creator>
            <pubDate>Sat, 28 Dec 2024 00:12:33 GMT</pubDate>
            <atom:updated>2024-12-28T00:12:33.968Z</atom:updated>
            <content:encoded><![CDATA[<h4>A Personal Reflection on Growth, Goals, and Life Beyond the Numbers</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*_pAhwUMwKeI8YZZ1" /><figcaption>Photo by <a href="https://unsplash.com/@timmossholder?utm_source=medium&amp;utm_medium=referral">Tim Mossholder</a> on <a href="https://unsplash.com?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>With the new year approaching, it feels like everyone is sharing their achievements and setting ambitious resolutions. Social media is filled with milestones, career moves, and personal victories, and it’s hard not to compare. My goal-oriented brain, of course, jumped right into overdrive, making me feel like I’ve done nothing with my life this past year.</p><p>I’m still working at the same company, in the same position, as part of the same team, and on the same product. I make relatively the same amount of money, have the same circle of friends, and the most exciting thing in my life is an upcoming trip — which is stressing me out more because of the cost than anything else.</p><p>Looking back at the lifelong goals I’ve envisioned for myself, I worry that if I’m not actively moving toward them, I might never achieve them. I shared these fears with my therapist during our last session, and she eventually stopped me to list all the things she believed <em>I had</em> <em>accomplished</em> — like always prioritizing my mental health.</p><p>Don’t get me wrong; I didn’t disagree with her. I could see the things she mentioned, but the difference was that I didn’t view them as “achievements.” To me, they felt more like simply “living” my life. That conversation got me questioning my entire approach to thinking about goals and accomplishments.</p><p>When we start listing goals and setting timelines, we often reduce those goals to quantifiable, measurable outcomes. This mindset can be incredibly useful in professional settings. But the truth is, this kind of reduction — or what I like to call <em>compression</em> — misses out on many qualities that play a much more crucial role in our happiness and life satisfaction than just the numbers.</p><p>It’s like compressing a RAW image into JPEG format. Sure, it’s easier to share and faster to load, but it loses so much valuable detail that created the original image in the first place.</p><p>Let’s take my professional life as an example. I’ve been a Senior Software Developer at my company for a little over two years. On LinkedIn, it might look like nothing has changed during that time. I’ve held the same title, carried the same responsibilities, and — on paper — there’s no sign of growth. To a goal-oriented mindset, this might seem like stagnation, especially for someone with great ambition. To that person, I might look like I haven’t been working hard enough, because I’m not hitting new milestones every year.</p><p>But the problem with measuring growth purely by promotions is that it overlooks so much more important information.</p><p>In the past two years, I’ve become a better-known person within my company. I hosted an internal event that connected me with dozens of colleagues worldwide, creating meaningful professional relationships that are invaluable — and portable — even if I change jobs.</p><p>Within my team, I’ve gained the trust of my teammates. They now reach out to me first — even before consulting some of the “bigger brains” in the company. I’ve also built a strong, respectful relationship with my manager, which has not only created a more secure workplace for me but also allows me to take bigger risks, knowing my manager has my back.</p><p>All of this growth has happened while I’ve held the same title, earned relatively the same salary, and worked within the same team. So, is it fair to say I haven’t grown? Absolutely not. I know I’m a better professional today than I was when I first got promoted.</p><p>What about financial growth? Well, financial growth doesn’t just happen when you get a raise or sign a new contract. People often assume that landing a higher-paying job automatically makes you wealthier, but that’s not always true. A higher salary may give you more room for spending, but spending doesn’t make you rich — saving does.</p><p>I’ve seen people earning significantly more than me who live paycheck to paycheck, with no financial safety net to fall back on if they lose their jobs. They may live in fancier apartments or travel more often, but they’re either heavily in debt or one missed paycheck away from financial stress.</p><p>I didn’t grow up with money, so it took me a while to have enough to even begin learning how to manage it. But now that I know, I understand that building sustainable, healthy financial habits takes time and effort. I’m not saying that financial growth shouldn’t be a goal for anyone — it definitely is an important factor for a better life — but instead of focusing on growing your income, the focus and goal should be on your general wealth or net worth. The goal should be ensuring that your overall financial health grows steadily over the years.</p><p>By now, I think my point is clear. Sometimes, on paper, life seems to stay the same, but building quality — whether in your career, relationships, or finances — takes time. With every step of measurable progress, it’s essential to pause and ensure you’ve gained the strength and foundation you need for the next step. And it’s perfectly okay not to have visible, annual reports of progress to show the world every single year.</p><p>This year, I’ve decided to set broader, more meaningful goals for myself, paired with a few actionable steps. Instead of obsessing over the details, I’m focusing on the big picture — and more importantly, on how I carry myself throughout the year. My progress might not always be flashy or visible, but as long as I’m building a life that aligns with my values and priorities, I know I’ll be moving in the right direction.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4b9fe997484a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A React.js Roadmap for Vue.js Developers]]></title>
            <link>https://itnext.io/reactjs-roadmap-for-vuejs-developers-4edacff6bafb?source=rss-8401ac33d046------2</link>
            <guid isPermaLink="false">https://medium.com/p/4edacff6bafb</guid>
            <category><![CDATA[front-end-development]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[vue]]></category>
            <category><![CDATA[vuejs]]></category>
            <category><![CDATA[reactjs]]></category>
            <dc:creator><![CDATA[Negar Jamalifard]]></dc:creator>
            <pubDate>Sat, 09 May 2020 16:17:13 GMT</pubDate>
            <atom:updated>2020-05-13T13:29:15.789Z</atom:updated>
            <content:encoded><![CDATA[<h3>A React Roadmap for Vue Developers</h3><p>My Experience of learning React.js in less than two months</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/1*WRzDZndJCduHwqgOpWmbhQ.png" /><figcaption><a href="https://medium.com/javascript-in-plain-english/i-created-the-exact-same-app-in-react-and-vue-here-are-the-differences-e9a1ae8077fd">Image Credit</a></figcaption></figure><p>I have been working as a Vue.js developer for two years straight. And I can not lie about how much fun I had with Vue.js, developing all kinds of websites. But in my new job, I have been asked to learn React.js. As a frontend developer you should always know that frameworks come and go but what always remains is HTML, CSS, and Javascript. So I need to learn React.js for this new job and I had to do this fast and start my work as soon as possible.</p><p>For learning new concepts I usually start with a video tutorial and learn the basics and then make some playing-around-simple-projects to feel more comfortable with the new API. Later, for a deeper understanding of each concept, I search online and read more in-depth articles.</p><p>But with the React.js, I was already familiar with lots of the basic concepts like components, V DOM, reactivity, etc. Also, I had enough experience in developing web applications like SPA and SSR apps that makes a React.js crash course too boring for me. Besides this time I didn’t have time to take a 30 hours course. So I came up with a new approach that unexpectedly gave me the knowledge to start my work as a React Developer in a short time.</p><p>In this article, I am going to share my RoadMap and link to some of the resources that helped me throughout the past couple of months to learn React and start my new job confidently.</p><h3>Step #1: Overview</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*tmsBenpVWoaYjaAM" /><figcaption>Photo by <a href="https://unsplash.com/@esteejanssens?utm_source=medium&amp;utm_medium=referral">Estée Janssens</a> on <a href="https://unsplash.com?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>In my mind for learning any new frameworks or languages, there are two phases of learning and I gave them these two names: <strong>Learning the Concepts</strong> and <strong>Learning the Syntax</strong>.</p><p>For example, learning the definition of components in Vue.js is a concept but learning how to write a component in Vue.js is in a syntax category. I usually learn both of these sides synchronously. But this time, as some of the concepts were pretty similar in both frameworks, I’ve decided to learn the concept before the syntax.</p><p>First, I did general research about the highlights of React.js as a library and learn the most famous terminologies.</p><p>So your first step is to pick a pen an a notebook and jot down the answers to these questions (Keep the answers short and right to the point):</p><ul><li>How React works?</li><li>What is JSX?</li><li>What is ReactDOM?</li><li>Class Components vs. Function Components?</li><li>State vs. Props?</li><li>What are the lifecycle methods?</li><li>What is a Higher Order Component (HOC)?</li><li>What is Redux?</li><li>What is setState? Why is it an async function?</li><li>What is render() method? What does it return?</li><li>What is Create React App?</li></ul><p>You can find the answers to most of these questions on the React documents and/or on other articles or videos on the web.</p><p>Here’s one of the articles that provide a good short answer for the questions above:</p><p><a href="https://medium.com/@vigowebs/frequently-asked-react-js-interview-questions-and-answers-36f3dd99f486"><em>Frequently asked: React JS Interview Questions and Answers</em></a></p><p>Keep in mind that this step shouldn’t take more than a day. The main goal here is to understand the general concepts.</p><h3>Step #2: Map your knowledge</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*mviylZ1r7ZBkQiCr" /><figcaption>Photo by <a href="https://unsplash.com/@nordwood?utm_source=medium&amp;utm_medium=referral">NordWood Themes</a> on <a href="https://unsplash.com?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Now that we know React more than a title let’s take a moment and compare React and Vue in our mind and map what we know from Vue.js to what React has in common:</p><ol><li>Hopefully, they both have components. Although there are some fundamental differences between components in React and Vue, they both use components as building blocks of a frontend application.</li><li>Components in React and Vue receive data from parents using props.</li><li>Similar to Vue, props can have a default value and validations in React components.</li><li>States in React components are pretty similar to data in Vue components. But states shouldn’t be mutated in React and instead, they should be updated by setState.</li><li>React doesn’t have directives and modifiers.</li><li>They both have lifecycle methods.</li><li>…</li></ol><p>As you have noticed so far there are a lot of similarities between React and Vue in concept.</p><h3>Step #2: Let’s write some React</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*FYUmNQU-Ky1CJpHa" /><figcaption>Photo by <a href="https://unsplash.com/@kaitlynbaker?utm_source=medium&amp;utm_medium=referral">Kaitlyn Baker</a> on <a href="https://unsplash.com?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Now that we know React more than what we thought, let’s jump into the code and get our hands dirty with some real React code. At this point, your best friend is going to be the React documents and Stack overflow. As a warm-up exercise, you can follow these steps:</p><ul><li>Create a new project with Create React App and build your very first <a href="https://reactjs.org/docs/components-and-props.html#function-and-class-components"><strong>function component</strong></a>, that says “Hello World!”.</li><li>Now pass a name to your component from <strong>props</strong>, so that your component can say “Hello” to any provided name. Set “World” as a <strong>default value</strong> for your name.</li><li>Now pass a list of color codes to your component from outside and make sure you always receive a list for colors and make it required. (Hint: <strong>Props Validation</strong>)</li><li>Read about React hooks and useState.</li><li>With the knowledge, you have from the previous step, add a button to your component that changes the text color randomly to one of the colors you are receiving from the props.</li><li>Read about useEffect and dependencies.</li><li>With the knowledge, you received from the previous step, change your component so that it prints “Welcome to this Component” only the first time it renders.</li></ul><p>Great job! Now you know React components even better than before.</p><h3>Step #3: More Studying</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Zg7E30izNDbanlAN" /><figcaption>Photo by <a href="https://unsplash.com/@hudsoncrafted?utm_source=medium&amp;utm_medium=referral">Debby Hudson</a> on <a href="https://unsplash.com?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Before you start underestimating React complexity, let me give a long list of concepts that you need to master, before starting a real project.</p><ul><li>Read about <a href="https://reactjs.org/docs/conditional-rendering.html"><strong>conditional Rendering</strong></a> and <a href="https://reactjs.org/docs/lists-and-keys.html"><strong>loops</strong></a> in JSX</li><li>Learn <a href="https://reactjs.org/docs/hooks-intro.html"><strong>hooks</strong></a> more deeply</li><li>Learn about <a href="https://reactjs.org/docs/context.html"><strong>Context</strong></a> and it’s use-cases. Learn how to use <a href="https://reactjs.org/docs/hooks-reference.html#usecontext"><strong>Context with Hooks</strong></a>.</li><li>Learn <a href="https://www.freecodecamp.org/news/understanding-redux-the-worlds-easiest-guide-to-beginning-redux-c695f45546f6/"><strong>Redux</strong></a> and more importantly the Redux terminology and structure.</li><li>Learn about <a href="https://reacttraining.com/react-router/"><strong>routing in React applications</strong></a>.</li><li>Review the whole concept of <a href="https://github.com/getify/You-Dont-Know-JS/blob/1st-ed/this%20%26%20object%20prototypes/ch2.md">this in JavaScript</a> before you create your first Class Component.</li><li>Read about <a href="https://reactjs.org/docs/optimizing-performance.html"><strong>React performance</strong></a> and what is an enemy for that.</li><li>Install and discover the React Devtool.</li></ul><p>For learning these concepts you can either read the official documents or any other sources that suit you. At the end of this article, I will list some of my recommended resources.</p><h3>Step #4: Now you know better</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*-WpFGFhgOaVXnlGs" /><figcaption>Photo by <a href="https://unsplash.com/@karsten_wuerth?utm_source=medium&amp;utm_medium=referral">Karsten Würth</a> on <a href="https://unsplash.com?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>This point is not the end but the starting point of learning React.js. Comparing headlines of this article with React documents shows how little we have covered so far, but from now on you know enough of basics to decide what you need to learn next. Besides, you can start any simple project at this point and keep on learning while you are developing a React application.</p><p>I hope my roadmap of learning React enables more Vue.js developers to add this new skill to their toolbox.</p><h3>My Recommended Resources</h3><ul><li><a href="https://btholt.github.io/complete-intro-to-react-v5/">Complete Intro to React by Brian Holt </a>(free)</li><li><a href="https://egghead.io/courses/getting-started-with-redux">Getting Started with Redux By Dan Abramov</a> (free)</li><li><a href="https://kentcdodds.com/">Kent C.Dodds Blog</a> (free)</li><li><a href="https://frontendmasters.com/learn/react/">Frontend Masters: React Learning Path</a> (paid)</li><li><a href="https://frontendmasters.com/courses/redux-mobx/">Frontend Masters: State Management with Redux &amp; MobX</a> (paid)</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4edacff6bafb" width="1" height="1" alt=""><hr><p><a href="https://itnext.io/reactjs-roadmap-for-vuejs-developers-4edacff6bafb">A React.js Roadmap for Vue.js Developers</a> was originally published in <a href="https://itnext.io">ITNEXT</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Use Git More Efficiently: A Simple Git Workflow]]></title>
            <link>https://medium.com/@negarjf/use-git-more-efficiently-a-simple-git-workflow-c4e650289ec8?source=rss-8401ac33d046------2</link>
            <guid isPermaLink="false">https://medium.com/p/c4e650289ec8</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[git]]></category>
            <category><![CDATA[github]]></category>
            <category><![CDATA[version-control]]></category>
            <category><![CDATA[workflow]]></category>
            <dc:creator><![CDATA[Negar Jamalifard]]></dc:creator>
            <pubDate>Thu, 06 Jun 2019 18:38:05 GMT</pubDate>
            <atom:updated>2019-06-08T10:24:00.218Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EL75egCdMV78vKHa1E4TkQ.jpeg" /></figure><p>Git without a doubt is one of the essential tools for every developer. As helpful as Git is, not following best practices will make it completely useless. That’s why there are different standard workflows to make most out of Git and its awesome features.</p><p>For a long time, my inception of Git and GitHub was a tool that back-ups the codes and let us access them online; Which was not completely wrong, but there are so much more about them that I didn’t know until I start my work as a developer in <a href="https://www.linkedin.com/company/yasnateam/">YasnaTeam</a>.</p><p>In our team, about 10 developers are actively working on the same repository. Having the same habit and so-called culture is necessary to avoid conflicts and chaos. With over 100 commits per day, things could get out of hand very soon. To avoid such problems we implement a modified version of <a href="https://datasift.github.io/gitflow/IntroducingGitFlow.html">Gitflow</a>.</p><h3>How it works</h3><p>Instead of having one single master branch, we have another extra branch nameddev. These both branches are locked and no one can push directly into them.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/998/1*R_tFLk-UWZxN8L1MIJUeQw.png" /><figcaption><a href="https://www.atlassian.com/git/tutorials/comparing-workflows/gitflow-workflow">Image Source</a></figcaption></figure><p>master is reserved for production only. ‌After testing new features, the repository owner updates master before each release.</p><p>dev is the default branch that all of the developers create a branch from and merge back into. dev is always ahead of master and it’s the only branch that will be merged into master, frequently.</p><h3>Naming Branches</h3><p>We have a pattern for naming our branches.</p><pre>[Module Name]-[Type]-[Detail]</pre><pre>// Example<br>users-fix-attach-roles-issue#765</pre><h4>Module Name</h4><p>Since we have a modular structure in our code base, changes related to each module should be committed on a separated branch with the module name. This part could be removed if you don’t have such structure, in your project.</p><h4>Type</h4><p>According to the type of task, developers should choose between one of these types:</p><ul><li>feature</li><li>enhance</li><li>cleanup</li><li>refactor</li><li>fix</li><li>hotfix</li></ul><p>Type hotfix is for urgent fixes on the master branch and won’t be used that often.</p><h4>Detail</h4><p>The detail is a short description of what is going to be delivered by the branch.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/923/1*BgjBdnC82OR5sh73nvxtxQ.png" /><figcaption><a href="https://www.atlassian.com/git/tutorials/comparing-workflows/gitflow-workflow">Image Source</a></figcaption></figure><p>This branching rules force us to separate each task to meaningful chunks and merge frequently into dev and always have fresh branches. One great side-effect of this approach is to minimize conflicts.</p><h3>Commit Messages</h3><p>In order to have clean and descriptive commit list, we also have a naming rule for commit messages (I love rules!).</p><pre>[[Module Name]] [Commit Message]</pre><pre>// Example<br>[users] add fetch users endpoint</pre><p>Having the module name in each commit message might seem redundant since we have the name in our branch, but the truth is after merging all branches into dev (or master), looking at the commits history you cannot say which branch each of the commits was belonged to. Because right now they are all belonged to the dev (or master) branch. In order to filter through all commits easily, we need to have the module name somewhere inside the commit message.</p><p>The commit message itself should complete the sentence “<em>This commit will…</em>” grammatically.</p><h3>Pull Requests</h3><h4>Title</h4><p>Title of the pull request is automatically filled with the branch name. In case the branch name is too generic, more details are expected to be added.</p><h4>Body</h4><p>The body should contain details about the pull request. In our workflow pull requests are usually related to an existing issue. We create an issue for each bug or feature. So we link to the related issue inside the pull request body. We also mention highlights of the changes that are made inside the pull using bullet points. We have created a <a href="https://help.github.com/en/articles/creating-a-pull-request-template-for-your-repository">template for our pull requests</a>, to facilitate the process.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/771/1*NNCy6pdWjFXfzQthrl5l0Q.png" /></figure><h4>Review</h4><p>Code review is one of the most important parts of our daily job. Once a pull request is created, the creator should choose two of peers to review the code based on some prespecified criteria.</p><p>Once the pull is approved by reviewers, the creator can merge into dev and delete the branch.</p><p>We have been using this workflow for more that one year and update frequently based on our needs. Do you use some other git workflows on your team? Let me know how they are.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c4e650289ec8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to deal with CORS error on Vue CLI 3?]]></title>
            <link>https://medium.com/js-dojo/how-to-deal-with-cors-error-on-vue-cli-3-d78c024ce8d3?source=rss-8401ac33d046------2</link>
            <guid isPermaLink="false">https://medium.com/p/d78c024ce8d3</guid>
            <category><![CDATA[vue-cli]]></category>
            <category><![CDATA[vue-cli-3]]></category>
            <category><![CDATA[vuejs]]></category>
            <category><![CDATA[cors]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Negar Jamalifard]]></dc:creator>
            <pubDate>Sat, 23 Mar 2019 08:06:50 GMT</pubDate>
            <atom:updated>2019-03-26T02:21:44.370Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-8AAdexfOAK9R-AIha_PBQ.png" /></figure><blockquote>Access to XMLHttpRequest at ‘http://backend.test/api/data&#39; from origin ‘http://localhost:8080/&#39; has been blocked by CORS policy.</blockquote><blockquote><em>You can watch this article’s video on </em><a href="https://youtu.be/WsYrDu7xkEw"><em>YouTube</em></a><em>.</em></blockquote><p>This error has been my nightmare during the past two months. I tried different solutions available online, from Installing extensions on my browser to <a href="https://gist.github.com/negarjf/95f2c2c6b27d9ad3591bb5f1f36059dc">altering </a><a href="https://gist.github.com/negarjf/95f2c2c6b27d9ad3591bb5f1f36059dc">.htaccess file of the backend project locally</a>, but none of them was ideal. Last night when I was messing around with my Apache configurations I found out that this error could be handled simply by Vue config file provided by Vue CLI 3. If you are struggling with the same problem, you are reading the right article.</p><p>To understand the problem and the solution better let&#39;s talk a little bit about the error.</p><h3>Why do we get CORS error?</h3><p>Browsers protect web applications to interact only with apps that are from the same origin. This is a policy called <em>same-origin</em>. But sometimes it is required to send requests to another server. CORS or <a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS"><strong>Cross-Origin Resource Sharing</strong></a><strong> </strong>is a standard that makes cross-origin requests possible by setting specific headers for requests.</p><p>In my case, I was serving my Vue application using Vue CLI serve command on localhost:8080 and my backend project was running by apache on a virtual host; Completely against <em>same-origin </em>policy. If somehow it was possible to send Ajax request to the same origin, the problem was solved. There are different ways that we can achieve this behavior by touching server configurations. Since we are frontend developers and server configuration might be different in production, we need some solution that is applied only during development and could be handled in the frontend.</p><h3>So, how to have the same origin?</h3><p>Hopefully, Vue CLI provides some properties to achieve this behavior. First, we need to set our Ajax request domain same as our frontend application; In my case: http://localhost:8080/ .</p><p>To configure the Vue CLI server, we need to create a vue.config.js file in the root of the frontend project right beside package.json, containing:</p><pre>// vue.config.js<br>module.exports = {<br>  // options...<br>}</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/383/1*hkPP2Mce-mjP7l1X0GI7CA.png" /><figcaption>vue.config.js file location inside a Vue project</figcaption></figure><p>Inside the module.export you can add configurations for your development server using devServer object. Now we want to configure our development server to proxy API request to the backend domain.</p><pre>devServer: {<br>        proxy: &#39;http://backend.test/&#39;,<br>    }</pre><p>The proxy property is a string of the backend host.</p><blockquote>This will tell the dev server to proxy any unknown requests (requests that did not match a static file) to http://backend.test/ __ <a href="https://cli.vuejs.org/config/#devserver-proxy">Vue CLI Configuration</a></blockquote><p>Now you need to serve the app again so that the new configuration applies to the server. And TADA! Your requests don’t need CORS headers anymore.</p><p><strong>RECOMMENDATION</strong>: I highly recommend using variables inside .env file for storing backend and Ajax base URLs, since the value will be different during production.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d78c024ce8d3" width="1" height="1" alt=""><hr><p><a href="https://medium.com/js-dojo/how-to-deal-with-cors-error-on-vue-cli-3-d78c024ce8d3">How to deal with CORS error on Vue CLI 3?</a> was originally published in <a href="https://medium.com/js-dojo">Vue.js Developers</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to access a static JSON file in Vue CLI 3?]]></title>
            <link>https://medium.com/@negarjf/how-to-access-a-static-json-file-in-vue-cli-3-8943dc343f95?source=rss-8401ac33d046------2</link>
            <guid isPermaLink="false">https://medium.com/p/8943dc343f95</guid>
            <category><![CDATA[json]]></category>
            <category><![CDATA[vuejs]]></category>
            <category><![CDATA[vue]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[vue-cli-3]]></category>
            <dc:creator><![CDATA[Negar Jamalifard]]></dc:creator>
            <pubDate>Mon, 31 Dec 2018 19:50:26 GMT</pubDate>
            <atom:updated>2018-12-31T21:47:44.004Z</atom:updated>
            <content:encoded><![CDATA[<h4>Using data from a static JSON file without bundling it with your main app.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HAZ8ueHePp3FeKns92-rJg.png" /></figure><p>One might need to use some external static data written in a JSON file, in their application. One simple solution is to place the JSON file inside your src directory and then import it into your js file; Using this method you can not access your JSON file and change it in the production mode; Because the JSON will be included into the bundled JS by Webpack.<br>But sometimes what you need is a JSON file separated from your app.js, so that you can change the content anytime in future, without rebuilding the whole application.</p><p>In <a href="https://cli.vuejs.org/guide/html-and-static-assets.html#the-public-folder">Vue CLI 3 document</a>, it has been offered to place such static files in public directory, hence the file won’t be processed by Webpack and will just be copied after building the application. But importing a JSON file from the public directory is a little bit more tricky.</p><h4>1. Install Axios</h4><p>Accessing the data of a JSON out of your application is basically similar to reaching out to an API and getting a response. The only difference is, you are requesting a file placed right inside your own public directory. So the first thing we need here is an Ajax handling tool. I will use <a href="https://github.com/axios/axios">axios </a>in this article but feel free to use any other alternatives.</p><pre>npm install axios</pre><h4>2. Create an env file</h4><p>Create a .env file in the root of your project and add your own base URL to the file:</p><pre>VUE_APP_BASE_URL=http://localhost:8080/</pre><h4>3. Get base URL in your component</h4><p>Inside your component, create a data property to read base URL from .env :</p><pre>data() {<br>    <strong>return </strong>{<br>        baseUrl: process.env.VUE_APP_BASE_URL,<br>    }<br>}</pre><h4>4. Fetching data</h4><p>Import Axios into your component.</p><pre><strong>import </strong>axios <strong>from </strong>&#39;axios&#39;<br><br><br><strong>export default </strong>{<br>...</pre><p>Now You can create a method for fetching your JSON data:</p><pre>methods: {<br>  fetchData(){<br>     axios.get(<strong>this</strong>.baseUrl + &#39;test.json&#39;).then(response =&gt; {<br>        console.log(response);<br>     })<br>  }<br>}</pre><p>You can escape <strong>step 2 </strong>and replace the this.baseUrl with a simple ‘/’, but it is recommended to use the .env file.</p><p>The last step is to call this method wherever you need, Like when the component is created:</p><pre>created(){<br>    // Fetch Data<br>    <strong>this</strong>.fetchData();<br>},</pre><p>The response of the Ajax call contains your JSON content.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8943dc343f95" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Do not Cling to the Decisions Once Were the Best]]></title>
            <link>https://medium.com/@negarjf/dont-be-afraid-to-change-2f89d3d6d35e?source=rss-8401ac33d046------2</link>
            <guid isPermaLink="false">https://medium.com/p/2f89d3d6d35e</guid>
            <category><![CDATA[personal-development]]></category>
            <category><![CDATA[personal-growth]]></category>
            <category><![CDATA[self-improvement]]></category>
            <category><![CDATA[dream-job]]></category>
            <category><![CDATA[change-your-life]]></category>
            <dc:creator><![CDATA[Negar Jamalifard]]></dc:creator>
            <pubDate>Fri, 05 Oct 2018 12:52:18 GMT</pubDate>
            <atom:updated>2018-10-05T12:59:27.655Z</atom:updated>
            <content:encoded><![CDATA[<h4>The takeaways of my journey to change my professional life.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EaIw1cKm9SywAjgMliMB-g.jpeg" /></figure><p>I am a front-end web developer. I had started learning the basics of the web about more than two years ago when I knew absolutely nothing about programming. The day I started learning HTML I even had no idea what the difference between UI design and development is. Being a programmer never was on my wish list. I always wanted to be an astrophysicist. That’s why I choose physics at university. In this article, I’m going to talk about my challenges during this path of changing my life and profession.</p><p>I always was good at math and physics. But at university when I started studying physics academically, I realized that I don’t want to spend my whole day reading physics books. I enjoyed the classes, and I never missed any. But at home, I didn’t want to study more, and that didn’t seem right.</p><p>In fact, I had a misunderstanding about my interests and purposes. I enjoyed learning physics, but in action, I didn’t like to be a physicist. I got bored so fast. There was some part of me looking for a job to solve problems with creativity and then be able to show off the result like a piece of art, but in physics, I couldn’t think of that type of job. With that, I shouldn’t keep studying physics any further. Studying would eventually end, and I need to look for a job that I could do 9 hours a day and don’t hate my life every Monday.</p><h3>Be Honest and Realistic</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3rloe1T3dvYuxYxdPnNjKA.jpeg" /></figure><p>Facing this fact wasn’t easy for me because after years of planning, now I had no plan for my future. I didn’t want to believe that physics is not for me, but I didn’t have more time to waste. I need to find my best job before it’s too late. So I came up to a formula for myself:</p><p><strong>1. I made a list of my interests and abilities realistically.</strong><br><em>I was good at solving problems, and I had a taste for art and design. I always kept myself close to technology and had an undiscovered enthusiasm for working with my computer.</em></p><p><strong>2. I start looking for attractive jobs and then consider their prerequisites. If the job is not interesting, it’s out of the list.</strong><br><em>I am interested in photography, but as a job, it was rejected, because I didn’t like to discuss prices with customers, about my beloved photos.</em></p><p><strong>3. I imagined myself doing the job for a constant 9 hours a day. Boring? Not my job.</strong><br><em>I crossed out astrophysics because it consists of days of data analyzing for finding something valuable, although the astronomy itself was always attractive to me.</em></p><p>The process of filtering jobs took me almost one year until I finally came to the answer of web development. As a programmer, I need to solve problems every day and to work in client-side gives me the chance to be involved with the design and creative ideas. The job was interesting, and learning materials were mostly available online. And last but not least I never get tired of working with computers. That seemed to be a good choice.</p><h3>Next Step, family, and friends</h3><p>Making a big decision that would influence your life and future, will probably involve more people than just you. Family and close friends would definitely react to your new decisions, so convincing them is unavoidable. To be honest, I believe it’s even good for yourself. Convincing my mom for giving me a one-year timeout to study at home and not applying for a master degree, actually helped myself realizing how decisive I really am about this change.</p><p>But don’t forget you don’t need to talk about your new plan to everyone. Some people will judge your decision anyway, but they will be convinced once you achieve your purpose and succeed. During that one year that I was studying at home, I was always getting messages of worried relatives who wanted to find me a job and get mad when I refuse to apply.</p><h3>Giving up is part of the show</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cOennnVrSmyftZM9S8IsWw.jpeg" /></figure><p>I cannot count how many times I gave up and end up crying. I was entering a field that I had no experience. Every concepts and techniques were new to me. Each article I was starting to read has led to a bunch of other googling for finding the meaning of an unknown term. But at the end of the day, I knew I was one step closer to the best job I could have.</p><p>Sometimes giving a couple-days break to yourself will help to recover the energy and eagerness. I tried to keep atmosphere fun with playing music while practicing and even dance-coding which is my invented method of coding _Whatever keeps you away from the stress. I deactivated my Instagram account to prevent comparing myself with others who were having their routine life with no turning point; Instead, I started a new twitter account and followed new people to create a new environment of people around myself.</p><p>Making a big decision for changing your job is hard by itself, it’s even harder when you are in the middle of doing something else. But having a job you love can change your entire life and moral. You will spend the most efficient time of your days, most of the year, at work. If you don’t enjoy what you are doing, you can’t enjoy your life. If you feel like that you need to change something, change it now. Don’t live your life for weekends, live every day of your life.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2f89d3d6d35e" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>