<?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 Rob Russo on Medium]]></title>
        <description><![CDATA[Stories by Rob Russo on Medium]]></description>
        <link>https://medium.com/@robrusso?source=rss-6b541fb9f60c------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*rUhQK-ytkhBzXA3g.jpeg</url>
            <title>Stories by Rob Russo on Medium</title>
            <link>https://medium.com/@robrusso?source=rss-6b541fb9f60c------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 19 Nov 2026 06:26:47 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@robrusso/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[Making the Portfolio: Part 1]]></title>
            <link>https://medium.com/@robrusso/making-the-portfolio-part-1-80aa215470de?source=rss-6b541fb9f60c------2</link>
            <guid isPermaLink="false">https://medium.com/p/80aa215470de</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[tutorial]]></category>
            <category><![CDATA[react]]></category>
            <dc:creator><![CDATA[Rob Russo]]></dc:creator>
            <pubDate>Wed, 25 Nov 2015 06:29:13 GMT</pubDate>
            <atom:updated>2015-11-25T06:29:13.076Z</atom:updated>
            <content:encoded><![CDATA[<p>What good is a developer without a portfolio, right? I felt my time had come to leave my shell and create something representative of my skills. Of course, like most good developers, I’m only as good as the resources I find on StackOverflow. To this point, I thought I’d do my part and share my experiences in making my portfolio for this who’d like to follow in my footsteps. <em>This will be regularly updated up until the completion of my portfolio.</em></p><h4>Tech Stack</h4><p>As of this writing, I’m going to be using <a href="https://facebook.github.io/react/">React</a> for a dynamic and component based user interface. I’ll be going with some custom CSS and HTML, and I’ll be using <a href="https://nodejs.org/en/">Node.js</a> to manage libraries and dependencies. This site will not have any sort of backend because I’m a student and have to pay for hosting, and GitHub is free.</p><h4>Building with Node</h4><p>Node is pretty ubiquitous in 2015 so forgive me, but I’m going to gloss over this. Make sure you have Node installed and you’re good to go. To kick things off, let’s do a quick init. Take note, I’m using index.js as my starting point. For the lazy, just keep hitting enter after typing the following command inside the main folder of the project.</p><pre>npm init</pre><h4>Getting Started with React</h4><p>So, what is React? If you haven’t heard, it’s a hot new JavaScript library for UI work. It’s comparable to something like Angular or JQuery in many respects. Why am I using it? Well, it’s a portfolio. I want to show off how “hip” I am and right now React is pretty damn hip.</p><p>To build React with Node you’re going to first need to install <a href="http://browserify.org/">Browserify</a>. Browserify is actually a pretty neat package. It takes all of your installed modules and builds them appropriately so you only need to include one script in your JavaScript projects. For React, this makes your work infinitely easier, as you can focus on writing.</p><p>So first, install browserify to dev-dependencies only, because only people developing your site will need this.</p><pre>npm install — save-dev browserify</pre><p>Once build, open up package.json. Things are about to get weird. Under scripts, add the following:</p><pre>“build”: “browserify -t [ babelify — presets [ react ] ] index.js -o bundle.js”</pre><p>What this does is create a command called “build”. When called in npm (yes npm, not Node), this will create this neat-o include all file (named build.js if you couldn’t tell) that I alluded to earlier, and it will be all set for React development. You’ll also need React so do this to get your packages.</p><pre>npm install — save react react-dom babelify babel-preset-react</pre><p>Okay, now we’re cooking with fire! Time to actually write some juicy JSX code. I won’t go into this in depth yet. To be frank, I’m still learning myself. Facebook has some <a href="https://facebook.github.io/react/docs/tutorial.html">great example code</a> on their site if you want to check it out. For now, and just to make sure things are working, let’s copy and paste from Facebook into that file specified earlier as your main file. For me, that’ll be index.js.</p><pre>var React = require(‘react’);<br>var ReactDOM = require(‘react-dom’);</pre><pre>ReactDOM.render(<br> &lt;h1&gt;Hello, world!&lt;/h1&gt;,<br> document.getElementById(‘example’)<br>);</pre><p>While definitely weird at first, I can’t help but marvel at the elegance and simplicity in React. You’ll also need an output file so create a quick index.html. You can have mine if you’d like.</p><pre>&lt;!DOCTYPE html&gt;<br>&lt;html lang=”en”&gt;<br>&lt;head&gt;<br> &lt;meta charset=”UTF-8&quot;&gt;<br> &lt;title&gt;Portfolio&lt;/title&gt;<br>&lt;/head&gt;<br>&lt;body&gt;<br> &lt;!-— Specified in React --&gt;<br> &lt;div id=”example”&gt;<br> &lt;/div&gt;</pre><pre> &lt;!-— Browserify Magic Script --&gt;<br> &lt;script src=”bundle.js”&gt;&lt;/script&gt;<br>&lt;/body&gt;<br>&lt;/html&gt;</pre><p>Notice how the id for the div is example, and React selects this element. Guess what? That’s where Hello World where come out. To use this code, call the build script, specified below.</p><pre>npm run build </pre><p>Now open your index.html in any browser and you’ll see something like this, meaning success.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/418/1*5Zx5Loen7wWkGJzOYtn-5A.png" /><figcaption>You did it! If you don’t see this, check the JS console.</figcaption></figure><h4>Reflecting</h4><p>So, why is React cool? You’ll notice you don’t have to open that index.js file on a server. That’s something that Angular cannot say. By “compiling” the JavaScript beforehand, you can have significant performance gains. React does this relatively simply, and now you have a pipeline for doing so.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=80aa215470de" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>