<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Michael Friedman</title>
    <description>The latest articles on Forem by Michael Friedman (@michaelfriedman).</description>
    <link>https://forem.com/michaelfriedman</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F179111%2F65716c6a-253f-49d7-8dad-21ac6fb779a1.jpeg</url>
      <title>Forem: Michael Friedman</title>
      <link>https://forem.com/michaelfriedman</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/michaelfriedman"/>
    <language>en</language>
    <item>
      <title>NextJS vs GatsbyJS - What's the diff?</title>
      <dc:creator>Michael Friedman</dc:creator>
      <pubDate>Fri, 16 Aug 2019 18:54:16 +0000</pubDate>
      <link>https://forem.com/michaelfriedman/nextjs-vs-gatsbyjs-what-s-the-diff-47i2</link>
      <guid>https://forem.com/michaelfriedman/nextjs-vs-gatsbyjs-what-s-the-diff-47i2</guid>
      <description>&lt;p&gt;First off, thanks for taking the time! If you're interested in Next.js and the JAMStack in general, I've got a weekly newsletter, where I share the best bits of what I've been learning recently on the topic. I even dive into some other stuff like what I'm reading and things on the horizon. It's totally free for those signing up now, so if you're interested you can sign up at &lt;a href="https://michaels.blog"&gt;michaels.blog&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;During my &lt;a href="https://michaels.blog/posts/whats-got-my-attention-in-2019"&gt;last post&lt;/a&gt;, I touched on some of these frameworks' critical features. Today I'd like to make a complete assessment and discuss some of the essential differences and nuances between the two. Let me start by saying that this is not an opinion piece on which React framework is the best. While both of these frameworks could sometimes be used to hit the same target, they excel at very different things and have different costs associated with their implementation. My experience working with NextJS also runs more in-depth, so I'm able to offer a little more insight. I intend to provide some context to make a more informed decision when you are architecting your next stack. I believe that between the two of these frameworks, you can fulfill just about any user story.&lt;/p&gt;

&lt;h2&gt;
  
  
  NextJS
&lt;/h2&gt;

&lt;h3&gt;
  
  
  What is it?
&lt;/h3&gt;

&lt;p&gt;Next.js is a React framework that requires very little boilerplate to configure. Its most significant selling point is the serverside rendering (SSR) that it provides right out of the box. NextJS is developed by Zeit, which is an entire serverless ecosystem built on top of AWS Lambda. NextJS takes advantage of serverless technology to serve your application pages in a swift, reliable, and affordable manner.&lt;/p&gt;

&lt;h3&gt;
  
  
  Serverside Rendering
&lt;/h3&gt;

&lt;p&gt;Serverside rendering is a topic on its own, but I will say that it's essential for almost any project where being found on the internet is of vital importance. Startups and tech giants alike are often opting for SSR when given a choice. This is because there is a tremendous difference in search engine indexing results for a single page (SPA) vs. SSR apps.&lt;/p&gt;

&lt;p&gt;Have you ever used Create React App (CRA)? If you are a React developer, I'm guessing the answer is yes. Have you ever inspected the page source only to see the single div element that your application is rooted too? That's when you usually bust out the React Dev Tools extension to explore your application markup. Unfortunately, Google doesn't know how to crawl your application with React Dev Tools (although hopefully one day).&lt;/p&gt;

&lt;p&gt;That only leaves the metadata for the search engines to discern what sort of content is delivered. While convenient, this SPA approach is not nearly as effective for search engine optimization (SEO). A site that loads the page already filled with a mass of relevant content and markup has a significant advantage.&lt;/p&gt;

&lt;h3&gt;
  
  
  Dynamic Clientside Routing
&lt;/h3&gt;

&lt;p&gt;With Next.js, we render the markup with a Node service and return it to the client. There are many benefits to doing this, the big one we have discussed thus far is SEO, but there are also tremendous performance benefits to properly implemented SSR applications. Allowing a server (or function) to render your project, takes the most cumbersome work off the client, which almost always makes things a lot snappier. Next.js abstracts the process of code splitting, eeking out even more performance wherever possible in your bundle. That's all handled under the hood with some very sensible defaults that allow for easy customization.&lt;/p&gt;

&lt;h3&gt;
  
  
  Dynamic API Routing
&lt;/h3&gt;

&lt;p&gt;One of the things that I love most about Next.js is how it handles dynamic client-side routing based on your application file structure. Even to those unfamiliar, it's incredibly intuitive. Rolling a proxy for routing an application like this is not an easy task, and Next does a genius job of handling all of this work for us.&lt;/p&gt;

&lt;p&gt;The effectiveness of this API benefits significantly from the release of React Hooks. Now NextJS offers us a &lt;code&gt;useRouter&lt;/code&gt; hook, which keeps our clientside routing even cleaner by not forcing us to nest our components in a higher-order routing component every time we want to make a clientside route change.&lt;/p&gt;

&lt;p&gt;As of this latest major version (Next 9.0), we can use the same approach we do for clientside routing in NextJS on our backend. Just &lt;code&gt;mkdir api&lt;/code&gt; in the &lt;code&gt;pages&lt;/code&gt; directory of your project, and Next will build your API routes to match the folder and file structure, just like it does on the client. That makes pretty URLs and dynamic page generation easier than it ever has been.&lt;/p&gt;

&lt;h3&gt;
  
  
  TypeScript Support
&lt;/h3&gt;

&lt;p&gt;NextJS will automatically support TypeScript files in your project. Also, equally important, the framework was just completely rewritten in TypeScript, which is a huge asset to the community. You can now infer a significant amount of safety just by naming your files with a &lt;code&gt;.ts&lt;/code&gt; or &lt;code&gt;.tsx&lt;/code&gt; extension.&lt;/p&gt;

&lt;h3&gt;
  
  
  Under the Hood
&lt;/h3&gt;

&lt;p&gt;Already, one of the fastest-growing frameworks in the JavaScript ecosystem, recently, NextJS began receiving boosts of support from very talented members of the Google Chrome team, who are now working actively with Zeit and the NextJS core team to improve performance further. I think this is, in part, a testament to the firm belief that Google has in the future of NextJS, which certainly lends confidence to me when I'm building a project and considering using this framework.&lt;/p&gt;

&lt;h3&gt;
  
  
  Static vs. Dynamic
&lt;/h3&gt;

&lt;p&gt;Next.js does not dichotomize the choice of dynamic serverside rending or static site generation. Generally, it can be applied to many more use cases than Gatsby.&lt;/p&gt;

&lt;h3&gt;
  
  
  Clientside Routing
&lt;/h3&gt;

&lt;p&gt;Next.js uses a &lt;code&gt;&amp;lt;Link&amp;gt;&lt;/code&gt; higher-order component to wrap anchor elements with additional functionality like the &lt;code&gt;prefetch&lt;/code&gt; prop that uses an Intersection Observer to asynchronously fetch your data for linked pages before the client actually requests them. Still, it does so with these requests in a lower priority queue than effects that are executing on the current page, so there is no competition for network resources.&lt;/p&gt;

&lt;h3&gt;
  
  
  Data
&lt;/h3&gt;

&lt;p&gt;Next.js also pairs very eloquently with AWS Amplify. Amplify will handle authentication for you using AWS Cognito Identity Pools and automatically generate a GraphQL API for your backend and provision it using AWS Lambda, API Gateway, Dynamo DB, and CloudFormation. If all of those things are foreign to you, rest assured, that's the beauty of Amplify; it handles all the infrastructure so that you can focus on your API. That is what serverless and modern development is all about.&lt;/p&gt;

&lt;h2&gt;
  
  
  Gatsby
&lt;/h2&gt;

&lt;p&gt;It would be unfair to categorize Gatsby as a static site generator and leave it at that. It behaves much more similar to a fully-featured dynamic React app than anything else.&lt;/p&gt;

&lt;p&gt;Without additional configuration, Gatsby isn't set up for applications that handle dynamic data. It prebuilds all the HTML for your pages and links a JavaScript file to it, which is your React app. Any dynamic updates would require rebuilding your application. Gatsby's ideal use case is for projects without any changing data. It is perfect for landing pages, marketing pages, and documentation. I'll add simple e-commerce (small e-comm) sites that can effectively run from a cache.&lt;/p&gt;

&lt;p&gt;While you can realistically build just about anything with Gatsby, it does not mean that you should. It's all about picking the right tool for the job, and it's my firm belief that you should use Gatsby for what it's best at which is static websites like the blog I'm publishing this post on, or documentation for OSS and other use cases that can primarily rely on cached content. Don't try to turn it into something it's not; static sites were never intended to deliver dynamic content.&lt;/p&gt;

&lt;p&gt;One of the greatest things Gatsby has going is the community of talented developers that have built a copious amount of ingenious plugins, themes, and starters to aid in rapid iteration. However, the Gatsby docs do some comparing and contrasting of these two frameworks, and I think their chart is misleading and more marketing-driven rather than fact-based- so hopefully, this helps shed some light on the subject.&lt;/p&gt;

</description>
      <category>react</category>
      <category>nextjs</category>
      <category>gatsby</category>
      <category>javascript</category>
    </item>
    <item>
      <title>What has my attention in 2019?</title>
      <dc:creator>Michael Friedman</dc:creator>
      <pubDate>Mon, 05 Aug 2019 15:46:25 +0000</pubDate>
      <link>https://forem.com/michaelfriedman/what-tech-has-my-attention-in-2019-4bj4</link>
      <guid>https://forem.com/michaelfriedman/what-tech-has-my-attention-in-2019-4bj4</guid>
      <description>&lt;p&gt;First off, thanks for taking the time! If you're interested in Next.js and the JAMStack in general, I've got a weekly newsletter, where I share the best bits of what I've been learning recently on the topic. I even dive into some other stuff like what I'm reading and things on the horizon. It's totally free for those signing up now, so if you're interested you can sign up at &lt;a href="https://michaels.blog"&gt;michaels.blog&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I mentor a few React developers and often get asked where people should focus their attention while studying to gain the most relevance in today's job market.&lt;/p&gt;

&lt;p&gt;This blog post is a rundown where I'm focusing my programming attention, a little explanation as to why, and some useful resources for you to get started with these technologies. If you're not familiar with the modern JavaScript ecosystem and want to get on the fast track now, pay close attention to the following.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;React JS (NextJS, Gatsby)&lt;/li&gt;
&lt;li&gt;GraphQL / Apollo&lt;/li&gt;
&lt;li&gt;Amazon Web Services (Lambda)&lt;/li&gt;
&lt;li&gt;TDD&lt;/li&gt;
&lt;li&gt;Redux&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  React
&lt;/h2&gt;

&lt;p&gt;A deep understanding of React is an essential building block for nearly all modern web developers. I won't spend much time here, I'm just going to assume that if you're a web developer or want to become one, you already understand that you need to know React like the back of your hand.&lt;/p&gt;

&lt;p&gt;When I was starting, this wasn't a given. The boot camp curriculums often struggle to keep up with the industry trends. I was taught both Angular and React when I was attending Galvanize. For me, the writing was already on the wall when it came to the Angular (that was 2016-2017). Today, I'm comfortable recommending React as the only frontend library/framework you will need in your toolbelt to be relevant in the current market. You're better off knowing React intimately than you would be splitting your time between learning multiple frontend frameworks.&lt;/p&gt;

&lt;p&gt;&lt;a href="mailto:React@16.8"&gt;React@16.8&lt;/a&gt; brought us some powerful new API's, that should change the way you create React applications. Gone are the days of classes and lifecycles. Now, we can design genuinely composable interfaces using functional components that allow us to derive our UI directly from the state of the application in a much more flexible and extendible way than ever before.&lt;/p&gt;

&lt;h3&gt;
  
  
  Next JS
&lt;/h3&gt;

&lt;p&gt;Next is a React framework that gives you serverside rendering for free. Serverside rendering allows the DOM to be fully hydrated on page load, meaning that the code is much more crawlable and SEO friendly than your typical Create-React-App (CRA) application. SSR applications are ranked substantially higher in the search engine indexes because it is much easier for the search engines to glean the type and quality of information that the site is disseminating.&lt;/p&gt;

&lt;p&gt;NextJS abstracts a substantial amount of the complexity involved in configuring a serverside rendered application. As if this wasn't reason enough, NextJS has added lots of performant features that prove incredibly useful when developing React apps. The latest version of NextJS now supports TypeScript out of the box, without any additional configuration. Just name your files with a &lt;code&gt;.ts&lt;/code&gt; or &lt;code&gt;.tsx&lt;/code&gt; and you're off and running with TypeScript.&lt;/p&gt;

&lt;h3&gt;
  
  
  Gatsby
&lt;/h3&gt;

&lt;p&gt;Gatsby is another React Framework, but Gatsby's specialty is static websites. The JavaScript / React community has rallied around Gatsby and the JAM Stack to grow its plugin library to over 1200 packages. Properly developed Gatsby sites are speedy and remain highly available when network connectivity is interrupted. Gatsby relies on GraphQL to query its API, which has been so quickly and widely adopted.&lt;/p&gt;

&lt;h3&gt;
  
  
  React Resources
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://reactjs.org/docs/hooks-overview.html"&gt;React Hooks&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://nextjs.org/learn/basics/getting-started"&gt;Learn NextJS&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/zeit/next.js/tree/canary/examples"&gt;NextJS Examples&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.gatsbyjs.org/tutorial/"&gt;Gatsby Tutorial&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://frontendmasters.com/courses/gatsby/"&gt;Gatsby Intro&lt;/a&gt; (Must be a FEM Member)&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  GraphQL
&lt;/h2&gt;

&lt;p&gt;GraphQL is the most exciting advancement in backend development that I've seen innovated during my career as a software developer. It rewrote the book on how modern backends should be architected. It allows our clients to eloquently describe the data that they require to operate, which is a problem that has never been really solved until now. Being able to get all our data from a single endpoint, totally changes how we can think about organizing our data. It also allows for incremental adoption, so it's not an all or nothing buy-in, again contributing to its rapid adoption.&lt;/p&gt;

&lt;h3&gt;
  
  
  GraphQL Resources
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.howtographql.com/"&gt;Learn GraphQL&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://onegraph.io"&gt;OneGraph&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://developer.github.com/v4/"&gt;Github API v4&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Lambda
&lt;/h2&gt;

&lt;p&gt;We're now in the era of serverless computing. Serving millions of customers for a fraction of what it used to cost means businesses that have not already moved to this model definitely will over the next five to ten years. That includes industries like banking that haven't had an infrastructure overhaul in 20+ years. Monolithic backends are becoming incrementally antiquated. The financial benefits of running a serverless architecture are causing technology giants to rewrite their entire APIs in what seems like rapid succession. AWS Lambda and API Gateway are the core of modern serverless computing technology.&lt;/p&gt;

&lt;p&gt;The AWS Cloud Practitioner Certification is an excellent place to start with AWS. I only mention AWS because of its market share. If you have a reason to be on another provider, by all means, learn Google or Azure instead.&lt;/p&gt;

&lt;p&gt;One approach is to rely on our colleagues to build fantastic developer tooling so that you never have to see the inside of the AWS Admin Panel. Perhaps a better one is understanding that you should have at least a good familiarity with the cloud.&lt;/p&gt;

&lt;h3&gt;
  
  
  AWS Lambda Resources
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://aws.amazon.com/api-gateway/resources/"&gt;API Gateway Resources&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.aws.training/LearningLibrary?&amp;amp;search=lambda&amp;amp;tab=view_all"&gt;AWS Training&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://serverless-stack.com/#table-of-contents"&gt;Serverless Framework&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  TDD
&lt;/h2&gt;

&lt;p&gt;If you are practicing agile development in the React ecosystem, that probably means you'll likely be using Jest, React Testing Library, and/or React Storybook. Most React shops will expect juniors to have extensive experience with at least one or two of them. Unit testing is something you should have a deep understanding of, this is often overlooked by boot camps.&lt;/p&gt;

&lt;h3&gt;
  
  
  TDD Resources
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://jestjs.io/docs/en/getting-started"&gt;Jest&lt;/a&gt;&lt;br&gt;
&lt;a href="https://storybook.js.org"&gt;Storybook&lt;/a&gt;&lt;br&gt;
&lt;a href="https://github.com/testing-library/react-testing-library"&gt;React Testing Library&lt;/a&gt;&lt;br&gt;
&lt;a href="https://medium.com/javascript-scene/what-every-unit-test-needs-f6cd34d9836d"&gt;5 Questions Every Unit Test Must Answer&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Redux
&lt;/h2&gt;

&lt;p&gt;Wait, but I thought Hooks meant we didn't need Redux Anymore? Not quite. Local state management has indeed improved by leaps and bounds with the release of Hooks in React v16.8. There are far fewer use cases that require Redux; however, many complex applications at scale still need the reliability of a deterministic UI. Familiarity with these technologies will be a pivotal asset to potential employers. It will be one of the things that set you apart as more mid-level or senior in your proficiency.&lt;/p&gt;

&lt;h3&gt;
  
  
  Redux Resources
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://egghead.io/courses/getting-started-with-redux"&gt;Dan Abramov's Egghead Course&lt;/a&gt;&lt;/p&gt;

</description>
      <category>react</category>
      <category>graphql</category>
      <category>aws</category>
      <category>redux</category>
    </item>
  </channel>
</rss>
