{"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
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\nBut 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\nSo! 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\nSo, 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\nNormally, 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\nSo I'll be rewritting this website as purely functional components with react hooks as needed
\r\nFirst 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\nFirst 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
Posts were easy, they really don't have anything in them that's interesting
\r\nNext 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
.
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...).
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\nMy 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\nFast 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\nPlus, the keyboards are dope.
\r\nThat 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\nSo, 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\nOne 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\nThese 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\nThe issues I was having with the layout were three-fold:
\r\nSo, because it's so easy to experiment, I went for it! Here's the new layout.
\r\nA handful of major changes:
\r\nThe 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\nAs always, feel free to hit me up if you have any questions!
\r\nYou 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