Skip to content

Commit

Permalink
updatess
Browse files Browse the repository at this point in the history
Signed-off-by: Shauna Gordon <[email protected]>
  • Loading branch information
ShaunaGordon committed Sep 23, 2024
1 parent 0cdf4c8 commit 9f2b7f4
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 38 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ cache
public

*.work*
node_modules
3 changes: 3 additions & 0 deletions content/posts/2017-08-23-shopify-hmac-verification.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ aliases:
- "/blog/2017/08/24/shopify-hmac-verification"
---

> [!IMPORTANT]
> If the date doesn't make it evident, this is an old post. In the intervening years, Shopify has made a lot of changes, including a recent heavy overhaul. I'm leaving this up for posterity, but I don't know or guarantee that it still works in light of those changes.
I get the pleasure of writing integration after integration to Shopify at my day job. As a result, I have become quite familiar with their documentation and its gaps. The HMAC verification piece of the OAuth/embedded app installation process is a particularly glaring gap. So let's close it.

# What's Wrong With The Docs?
Expand Down
35 changes: 0 additions & 35 deletions content/posts/2024-07-27-appalachia.md.md

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
---
title: "Adventures in Modernizing React"
description: "Something, something, new paradigms"
date: 2023-12-08
date: 2024-09-08
categories: [tech]
tags: [react, legacy code]
draft: true
---

I spent the better part of my first year at Custom Ink upgrading an Electron and React application. That was an adventure unto itself, let me tell you. It also resulted in a list of "things I need to do when my priority isn't just get this thing working again to unblock the other team." Among that list was updating the code to modern standards -- something I got to make a bunch of headway on in the second half of my second year.

I got really good at converting class-based React components to functional ones. And now, I want to document how I did it.
I got really good at converting class-based React components to functional ones. And now, I want to document how I did it, because there are always legacy apps to update.

## Convert The Class To A Function

Expand All @@ -29,6 +29,24 @@ const Foo = () => {
This, of course, will promptly throw a bunch of IDE error syntax errors. That's okay, we'll fix those in the following steps. Just make sure the function is wrapping properly.
## Return the Template
## Convert The Inner Functions
Now that we've done the easy part, the next step is to convert all the functions to either hooks or constants. This is where it gets a bit time consuming, because it requires more understanding of the code the than simply a syntax conversion.
Now that we've done the easy part, the next step is to convert all the functions to either hooks or constants. This is where it gets a bit time consuming, because it requires more understanding of the code the than simply a syntax conversion.
### Functions To Constants
Converting functions to constants is primarily for functions that aren't used for reactivity.
### Functions to Hooks
## Convert or Remove Variables
Class-based components often use a lot of `this` and `this.props` type references when referencing class variables. These are no longer needed, because of how function based components work. The context usually communicated with `this` is inferred using standard Javascript context blocking, and using arrow functions for function declarations retains the component's context and bindings.
## Split Out Other Components
## Delete Any Now-Defunct Things

0 comments on commit 9f2b7f4

Please sign in to comment.