{"version":3,"sources":["pages/notFound/NotFound.tsx","pages/blog/posts/FirstPost.tsx","pages/blog/posts/FunctionalComponentRefactor.tsx","pages/blog/posts/CorneLayout.tsx","pages/blog/posts.tsx","components/navbar/Navbar.tsx","pages/blog/Blog.tsx","pages/contact/Contact.tsx","App.tsx","reportWebVitals.js","index.js"],"names":["NotFound","className","FirstPost","href","functionalComponentRefactor","CorneLayout","src","alt","Posts","Array","index","element","pageTitle","navTitle","blogNavLink","tags","NotFoundPost","filter","post","findIndex","tag","Navbar","useState","blogMenuOpen","setBlogMenuOpen","blogMenuRef","useRef","history","useHistory","navigateTo","key","push","AppBar","position","elevation","Toolbar","Button","variant","color","disableElevation","onClick","Typography","aria-controls","aria-haspopup","ref","Menu","id","anchorEl","current","keepMounted","open","onClose","map","MenuItem","reverse","Blog","props","currentPost","setCurrentPost","changePage","dir","nextPost","find","useEffect","title","length","document","reduce","acc","curr","i","Contact","App","exact","path","to","render","match","params","reportWebVitals","onPerfEntry","Function","then","getCLS","getFID","getFCP","getLCP","getTTFB","ReactDOM","StrictMode","getElementById"],"mappings":"gSAAe,SAASA,IACpB,OACI,8BACI,oBAAIC,UAAU,QAAd,8BCHG,SAASC,IACpB,OACI,gCACI,oBAAID,UAAU,QAAd,sBACA,sBAAKA,UAAU,UAAf,UACI,oKACA,+BACI,iFACA,iFACA,kEACA,uCAEJ,mOAGA,4QACkF,mBAAGE,KAAK,8CAAR,oBADlF,4BAEc,mBAAGA,KAAK,6BAAR,qBAFd,2BAEsF,mBAAGA,KAAK,WAAR,qBAFtF,gBCfD,SAASC,IACpB,OACI,gCACI,oBAAIH,UAAU,QAAd,kCACA,oBAAIA,UAAU,QAAd,0CACA,sBAAKA,UAAU,UAAf,UACI,iWAGA,6HAA+F,mBAAGE,KAAK,+CAAR,mBAA/F,0RAGA,iIAEJ,oBAAIF,UAAU,QAAd,kCACA,sBAAKA,UAAU,UAAf,UACI,maAGA,+IAAiH,4CAAjH,+CACuB,6CADvB,0IAE+B,mBA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5E,EAAD,eC9B9B,IAYe+E,EAZS,SAAAC,GAClBA,GAAeA,aAAuBC,UACxC,6BAAqBC,MAAK,YAAkD,IAA/CC,EAA8C,EAA9CA,OAAQC,EAAsC,EAAtCA,OAAQC,EAA8B,EAA9BA,OAAQC,EAAsB,EAAtBA,OAAQC,EAAc,EAAdA,QAC3DJ,EAAOH,GACPI,EAAOJ,GACPK,EAAOL,GACPM,EAAON,GACPO,EAAQP,OCDdQ,IAASZ,OACP,cAAC,IAAMa,WAAP,UACE,cAAC,EAAD,MAEFvB,SAASwB,eAAe,SAM1BX,M","file":"static/js/main.d55e2ce2.chunk.js","sourcesContent":["export default function NotFound() {\r\n return (\r\n
\r\n

Page not found

\r\n
\r\n );\r\n}","export default function FirstPost() {\r\n return (\r\n
\r\n

Welcome!

\r\n
\r\n

Hey all, welcome! This here is my first post (mostly for testing). I'm planning to use this as a platform for recording things like

\r\n \r\n

But mostly I just want to maintain my thoughts on the platform while getting to work this site into something bigger. I would like this to be a place where I \r\n can store most of my work and ideas.\r\n

\r\n

So! Enjoy, have a look around, do whatever. As you can see this is (currently) a completely static site. I don't really expect that to change any time soon, \r\n either. So as a matter of transparency, the code for the site can be found on github. Feel free to \r\n check out my work on github as well, and contact me.\r\n

\r\n
\r\n
\r\n );\r\n}","export default function functionalComponentRefactor() {\r\n return (\r\n
\r\n

Refactoring the site

\r\n

Why I'm refactoring the site

\r\n
\r\n

So, I have worked with react.js for about a year now (since May 2020) at my current position. A lot of the work I do in it is class-based. I'm not sure \r\n if that was an intentional decision by my team before I joined or not. I suspect it was just legacy use of the SPA they use as a template for spinning up \r\n new projects.

\r\n

Normally, this wouldn't be a huge deal, except as of React 16.8, we have been introduced to hooks.\r\n Not only that, but a lot of development in react OSS projects is using hooks and functional components primarily. Personally it feels like a pretty big \r\n paradigm shift, but I think it's worth keeping up on it as I can to ensure that I can write effective react going forward.

\r\n

So I'll be rewritting this website as purely functional components with react hooks as needed

\r\n
\r\n

Journey, hiccups, &c

\r\n
\r\n

First things first, we need a list of all the components that need refactoring. I've already started this post as a functional component (peak behind the \r\n scenes, this blog is written in react cause I'm too lazy to learn a blogging platform). Next there's components, pages, and the top level app. Luckily this\r\n site is still really small, so we don't have to work too hard at the moment.

\r\n

First bump is with the navbar - we have some state and we have some routing. State seems easy enough with the useState hook. I assume there is\r\n some corresponding useRoutes hook or something like that for react router. There's also a ref for aligning the blog menu to it's label. \r\n Luckily I found this handy blog post \r\n describing how to use ref hooks! The navigation was easy as well, there's a hook for \r\n useHistory as well. Seems like there's a hook for everything! So far , the transition has been easy. Admittedly, I don't have a super complex\r\n use case, but in my experience, starting with something this simple is always a good way to dig into something new. It's also worth noting that this has \r\n seemed to reduce boiler plate

\r\n

Posts were easy, they really don't have anything in them that's interesting

\r\n

Next is the blog page itself which basically just finds the correct blog and renders it. We do use a prop here, so that's unfamiliar territory, but it looks\r\n to be as easy as using function(props)... And it appears you can strongly type it too (which is always good in my opinion). I ended up \r\n refactoring the way I do page title setting to use document.title = \"title\" instead of Helmet, a 3rd party OSS react package that sets the \r\n document title with a dom element. This refactor was interesting because I used useState and useEffect in conjunction in a cool\r\n way! An interesting effect is that we have to pass the state as a dependency in useEffect.

\r\n

Everything else was easy as well. The only thing worth noting is setting the page title in App.tsx with useEffect hook (which is literally the \r\n example the give in the hooks overview, so...).

\r\n
\r\n
\r\n

Welp, that was easy! I'm glad I did it and will definitely be looking forward to working with functional components and hooks in the future. Even just this \r\n short exercise was useful in demistifying the whole concept. Check out the \r\n code here, or feel free to hit me up.

\r\n
\r\n
\r\n );\r\n}","export default function CorneLayout() {\r\n return (\r\n
\r\n

Experimenting with my Corne Layout

\r\n
\r\n

So for those who don't know (which might be everyone), I am a big fan of custom keyboards. I got into the\r\n hobby at the beginning of the pandemic. I had just started a new job and was stuck inside in my studio apartment with my partner and my loud ass keyboard \r\n (an old coolermaster with Cherry MX Blues, if you're wondering). The board itself was fine, but it was clear that it wasn't going to work. I was simply making \r\n too much noise. \r\n

\r\n

My brother had been talking to me about his keyboards and showing me his cool ortholinear boards (all the keys are in rows and columns like a \r\n grid), and telling me about the switches... at the time I kind of just tuned it out. He was clearly much deeper down the rabbit hole than I, and I couldn't\r\n keep up. Remembering this, I reached out to him for some advice, and we starting talking about form factors and hot swap and switch types and QMK and.... \r\n Before I knew it, I had bought a $110 keyboard (more than I ever thought I would spend) and was buying new keycap sets and switches to experiment\r\n with the sound... I was hooked. Thanks for that, David.\r\n

\r\n

Fast forward a year and change and I'm pretty deep in it at this point. I have several boards, several more that I have bought, built, and sold. I am a member\r\n of several keyboard focused discords and consider some of those folks in those spheres my friends. I even got my partner into it (she's a big fan of the case \r\n design and keycap aspects). It has been, in my opinion, really important for my mental health during the pandemic. I was stuck inside, but I was exploring a \r\n new hobby and making new friends the whole time. I am really grateful to the community because of that.\r\n

\r\n

Plus, the keyboards are dope.

\r\n \"polycarbonate \r\n \"small\r\n \"all \r\n \"split \r\n

That final photo is called a CRKBD or Corne. Specifically, a black aluminum IMK Corne (a custom case for the typical\r\n fr4 sandwich corne, which is what most cornes are), with lubed (205g0) and spring swapped (100g progressive \r\n sprits) NK Creams, \r\n and MT3 Susuwatari. It's a lovely little \r\n keyboard, and as you can see has some interesting features:\r\n

\r\n \r\n

So, how do you type on these you might ask? Layers! The two keys next to the big boys where the thumbs go are called layer keys. They act a lot like a \"fn\" key\r\n you see on some laptop keyboards which change the functionality of other keys when held. So basically I have memorized a secondary layout that's mapped to the \r\n same keys as the alphas. Just have to hold the \"LWR\" (lower) and/or \"RSE\" (raise) key to access them. With that I have all the functionality I need. Numbers, \r\n symbols, navigation, and F row!\r\n

\r\n

One of the many appeals of the hobby is the personalization and customization of things like keymap layout. It's a lot of fun to try to optimize your\r\n keystrokes and make sure you're typing efficiently. The reason I wanted to write this post was to document a change from an old layout to a new one. Here's the \r\n old layout.\r\n

\r\n \"keymap \r\n \"keymap\r\n \"keymap \r\n \"keymap \r\n

These screenshots are from a program called Via. It's a semi-open source project that uses QMK, a common custom keyboard firmware \r\n to map keys on the fly without having to reflash the hardware. The upside triangles mean \"no key here\". M1 and M0 are macros (which automatically type multiple \r\n keys at once) and ADV keys are special commands in QMK. MO(1) and MO(2) are the special layer keys I spoke about above. \r\n

\r\n

The issues I was having with the layout were three-fold:

\r\n
    \r\n
  1. Because I have to hit the lower key so frequently - MO(1) in layer 0 - I often accidentally hit the windows key, which is super disrupting.
  2. \r\n
  3. The arrow cluster on layer 2 is unintuitive. I never really grokked where to put my fingers. I use arrows a lot navigating around code, so I thought\r\n this would start to come naturally, but as you can see I have several board and for the most part they all have the arrows in different locations. It can \r\n be hard to build muscle memory for it when switching boards regularly (which I do).\r\n
  4. \r\n
  5. This is a minor issue, but I use delete key fairly regularly, and in this layout it's paired with the right shift. You can't see it in the layout, because \r\n it's using something called \"Mod Tap\" which is a functionality in the keyboard which allows you to press one key (a modifier, specifically) when held, and \r\n another key when tapped. In this case, it's the ADV key on the bottom right where right shift would be normally, and that has right shift on hold, delete on \r\n tap. \r\n
  6. \r\n
\r\n

So, because it's so easy to experiment, I went for it! Here's the new layout.

\r\n \"keymap \r\n \"keymap\r\n \"keymap \r\n \"keymap \r\n

A handful of major changes:

\r\n \r\n

The biggest issue with changes like this is just getting used to it. And, assuming I do get used to it (which is extremely likely to happen, just takes \r\n time) then porting it over to my other 40% boards!\r\n

\r\n

As always, feel free to hit me up if you have any questions!

\r\n
\r\n
\r\n );\r\n\r\n}\r\n","import { ReactElement } from \"react\";\r\n\r\nimport NotFound from \"../notFound/NotFound\";\r\nimport FirstPost from \"./posts/FirstPost\";\r\nimport FunctionalComponentRefactor from \"./posts/FunctionalComponentRefactor\";\r\nimport CorneLayout from \"./posts/CorneLayout\";\r\n\r\ntype Tag = \"misc\" | \"dev\" | \"keebs\" | \"dnd\";\r\n\r\nexport type Post = {\r\n index: number,\r\n element: ReactElement,\r\n pageTitle: string, \r\n navTitle?: string,\r\n blogNavLink?: string,\r\n tags?: Tag[],\r\n}\r\n\r\nexport const Posts = new Array(\r\n {index: 0, element: , pageTitle: \"Welcome!\", navTitle: \"Welcome!\", blogNavLink: \"first-post\", tags: [\"misc\"]},\r\n {index: 1, element: , pageTitle: \"Refactoring the site\", navTitle: \"Refactor\", blogNavLink: \"refactoring-the-site\", tags: [\"dev\"]},\r\n {index: 2, element: , pageTitle: \"Corne Layout Experiments\", navTitle: \"Corne Layout\", blogNavLink: \"corne-layout-experiments\", tags: [\"keebs\"]}\r\n);\r\nexport const NotFoundPost: Post = {index: -1, element: , pageTitle: \"Not Found\"};\r\nexport const PostsByTag = new Array>(\r\n Posts.filter(post => post.tags && post.tags.findIndex(tag => tag === \"misc\") !== -1),\r\n Posts.filter(post => post.tags && post.tags.findIndex(tag => tag === \"dev\") !== -1),\r\n Posts.filter(post => post.tags && post.tags.findIndex(tag => tag === \"keebs\") !== -1),\r\n Posts.filter(post => post.tags && post.tags.findIndex(tag => tag === \"dnd\") !== -1),\r\n)","import { useRef, useState } from 'react';\r\nimport { useHistory } from 'react-router-dom';\r\n\r\nimport { Posts } from '../../pages/blog/posts';\r\n\r\nimport Button from '@material-ui/core/Button'\r\nimport AppBar from '@material-ui/core/AppBar';\r\nimport Toolbar from '@material-ui/core/Toolbar';\r\nimport Typography from '@material-ui/core/Typography';\r\nimport Menu from '@material-ui/core/Menu';\r\nimport MenuItem from '@material-ui/core/MenuItem';\r\nimport './Navbar.css';\r\n\r\nexport default function Navbar() {\r\n const [blogMenuOpen, setBlogMenuOpen] = useState(false);\r\n const blogMenuRef = useRef(null);\r\n const history = useHistory();\r\n\r\n function navigateTo(key: string): void {\r\n setBlogMenuOpen(false);\r\n history.push(key);\r\n }\r\n\r\n return (\r\n \r\n \r\n \r\n
\r\n {/* */}\r\n \r\n \r\n setBlogMenuOpen(false)}\r\n >\r\n {Posts.map(post => \r\n navigateTo(`/blog/${post.blogNavLink}`)} key={post.pageTitle}>\r\n {post.navTitle}\r\n ).reverse()\r\n }\r\n \r\n
\r\n
\r\n
\r\n );\r\n}","import { useEffect, useState } from 'react';\r\nimport { useHistory } from 'react-router-dom';\r\n\r\nimport { Posts, NotFoundPost, Post } from './posts';\r\n\r\nimport Button from '@material-ui/core/Button';\r\nimport './Blog.css';\r\n\r\ntype Direction = \"prev\" | \"next\";\r\n\r\ninterface IBlogProps {\r\n title: string;\r\n}\r\n\r\nexport default function Blog(props: IBlogProps) {\r\n const [currentPost, setCurrentPost] = useState(NotFoundPost);\r\n const history = useHistory();\r\n\r\n useEffect(() => {\r\n setCurrentPost(props.title === \"last\" ? Posts[Posts.length - 1] : Posts.find(post => post.blogNavLink === props.title) || NotFoundPost);\r\n }, [currentPost.pageTitle, props.title]);\r\n\r\n useEffect(() => {\r\n document.title = currentPost.pageTitle;\r\n })\r\n\r\n function changePage(dir: Direction) {\r\n const nextPost = Posts.find(post => post.index === currentPost.index + (dir === \"next\" ? 1 : -1)) || NotFoundPost;\r\n history.push(`/blog/${nextPost.blogNavLink}`);\r\n }\r\n\r\n return (\r\n
\r\n
\r\n
\r\n { currentPost.index > 0 &&\r\n }\r\n
\r\n
\r\n { currentPost.index < (Posts.length - 1) && \r\n }\r\n
\r\n
\r\n
\r\n {currentPost.element}\r\n
\r\n { currentPost.tags && \r\n
\r\n {currentPost.tags.reduce((acc, curr, i) => acc + (i === 0 ? \"\": \" \") + curr, \"\")}\r\n
}\r\n
\r\n );\r\n}","export default function Contact() {\r\n\r\n return (\r\n
\r\n

You can find my work on github. \r\n You can contact me on discord at gwillad#0001. \r\n If you really really want to, you can also email me.\r\n

\r\n\r\n
\r\n );\r\n}","import { useEffect } from 'react';\r\nimport { \r\n Route, \r\n Redirect, \r\n Switch,\r\n BrowserRouter as Router\r\n} from 'react-router-dom';\r\nimport Navbar from './components/navbar/Navbar';\r\nimport Blog from './pages/blog/Blog';\r\nimport Contact from './pages/contact/Contact';\r\nimport NotFound from './pages/notFound/NotFound';\r\n\r\nimport './App.css';\r\n\r\nexport default function App() {\r\n useEffect(() => { \r\n document.title = \"Adam Gwilliam\"; \r\n });\r\n\r\n return (\r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n {/* } /> */}\r\n } />\r\n } />\r\n } />\r\n \r\n \r\n
\r\n );\r\n}\r\n","const reportWebVitals = onPerfEntry => {\r\n if (onPerfEntry && onPerfEntry instanceof Function) {\r\n import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => {\r\n getCLS(onPerfEntry);\r\n getFID(onPerfEntry);\r\n getFCP(onPerfEntry);\r\n getLCP(onPerfEntry);\r\n getTTFB(onPerfEntry);\r\n });\r\n }\r\n};\r\n\r\nexport default reportWebVitals;\r\n","import React from 'react';\r\nimport ReactDOM from 'react-dom';\r\nimport './index.css';\r\nimport App from './App';\r\nimport reportWebVitals from './reportWebVitals';\r\n\r\nReactDOM.render(\r\n \r\n \r\n ,\r\n document.getElementById('root')\r\n);\r\n\r\n// If you want to start measuring performance in your app, pass a function\r\n// to log results (for example: reportWebVitals(console.log))\r\n// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals\r\nreportWebVitals();\r\n"],"sourceRoot":""}