— All Play



007 — Context is King


Listen on

Show Notes

Reflecting on Laravel vs. React debate that went down a few weeks back, got me thinking about Context. Context switching. The context that influences the decisions we make. Really, just about context in general.

My focus has been to try to minimize the amount of context switching that I am doing, which is already difficult while managing multiple clients and trying to focus on my personal stuff. I get into some of those trade offs, along with a few other things that have been popping up that have been requiring additional context switching, resulting in ultimate flow wreckage.

Some references from the show:

To follow along, you can find me at ryanhefner.com, follow me on Twitter @ryanhefner, and keep up with the show on allplay.fm and @allplayfm.

Help yourself, while supporting the show, by trying some of the services that I use, and highly recommend:
Transistor FM
Fathom Analytics


00:00 - 00:27

Hey. How's it going? This is Ryan Hefner, and this is the All Play Podcast. So this week, I've been thinking about context a lot, and it's definitely been influenced through the whole debates that were going on on Twitter last week or last weekend regarding, you know, Laravel versus, React or React or React Remix or whatever. I mean, I guess I kind of fall on both sides of that debate for sure.

00:28 - 01:12

I can definitely appreciate and acknowledge all the niceties that come with working within Laravel. But, you know, on the opposite side, I feel like it is a bit of a slippery slope as soon as you start introducing React as far as, like, if that is how is if that's what you want to use or need to use to build the app that you're working on. The pairing of those 2, at least within, like, the same project I mean, I know that Inertia exists, and there are demos of pairing, Laravel with, like, a Next app. It still feels kinda clunky. I don't know what's going on with it.

01:12 - 01:41

And maybe it's just with the way that I like to set up my Laravel projects. For me, I typically like, some of the first things I do when I get into a Laravel project is I update the routing of the API. I'd like to I typically like to have that sit at a subdomain versus that slash API. I just think that gives you a lot more flexibility. And for me, I don't know.

01:41 - 02:25

It's just cleaner. It also means that if for the for whatever reason, if you want to start playing around with a different stack, you can, you know, just start swapping out whatever, you know, whatever, service or, app you have running at API, you know, dot your domain. And I don't know. It just seems it seems cleaner to me than having everything under the same domain and then having a bunch of subdirectories. But, you know, that also typically with the Laravel projects I've worked on in the past is, if I was working on I actually have done it both ways.

02:25 - 03:17

I've had it to where, you know, I've had some sort of tenancy setup that is using subdomains so, like, the app kinda lives at the tendency level and each, each account can have have their own, you know, unique subdomain. I've also just done the slash app thing. But when you start doing that, like so for instance, in the slash app scenario, that would typically be the React app would live there. And then I would also a lot then I would, like, use React router to handle, you know, deep linking within that app subdirectory. And then just I don't know.

03:18 - 04:38

Having to then especially if you wanted to have good, fast, you know, no spinners on that when that React app spins up, doing all of the predictive preloading of the JSON data that would use to hydrate that app with depending on the state of the route that it's in within Laravel to seem kind of annoying, which, you know, the story there in the next world is you would either I mean, it also depends on, which routing technique you're using. But, like, in the pages routing world, I mean, mostly I most of the apps, I've actually my personal ones, I've just been using the static routing, which is rad because everything just generates on build and is super, super fast when you're navigating it. But, for the client stuff, I use the get server side props for all the dynamic stuff. And, actually, I use my library that I wrote called next proper, so next dash proper. And that allows you to basically compose, a series of handlers that can then go and request whatever data you need for the page and then throws throws that into to the props.

04:39 - 05:16

And I don't know. It makes it really composable. Downsize there or the downside for that approach is at least within the next world, there's a lot of just copy and pasting pretty much like the same get server side props across whatever pages you're using. It's not horrible. You could also do some, you know, wild card deep wild card optional, slug stuff if you wanted to kinda minimize that and then just handle some view stuff there.

05:16 - 06:06

There's a lot of different options depending on how you wanna structure your app, but that does make it a lot cleaner, at least in my mind as far as dealing with the React side of things. I mean, really for Next, I I use it mostly just for the routing. Obviously, there's the get server side props. The fact that it has the server side rendering all out of the box, That's that's my go to there. But, yeah, it's you know, it when I guess that it just just goes back to these debates that people have, whether they're kicking off a project or working on an internal one and trying to figure out what the next move is or what the the best thing is.

06:07 - 07:13

All these different questions and trade offs you have to do. And at the end of the day, it's just really trying to figure out what works best for you. And for me right now, I'm trying to figure out context and trying to remain as productive as possible and not have to contact switch as much. The fact that both of the clients that I'm working for right now that, you know, the majority of the work is actually in Next Apps means that any of my personal projects that I'm working on, if I can continue to just work within the the scope or context of Next and React, then that's gonna be a whole lot easier for me to try to remain somewhat sane as I'm juggling these things. And even though I'm context switching between projects, I don't have to necessarily context switch between languages or, you know, the friction of trying to get multiple projects to work together.

07:15 - 07:56

That's also and then, you know, regarding my personal projects, thinking about local first, thinking about progressive web apps, all that stuff, the the story of a traditional app with a traditional request life cycle as you're navigating pages, it just starts to break down. So I'm not even sure. I know that there is a, I think, I believe, a a Laravel PWA, package. I'm not sure how well it supported. I think I looked last time I looked at it, looked like it had a lot of dust on it.

07:56 - 08:18

Might just it might have been back at the Laravel let me see here. Let me see if I could find it. Maybe, like, Laravel 5 days. 583. So, yeah, the demo is running Laravel 583.

08:18 - 08:32

I think Laravel's at 11 now. Who knows? They might be releasing 12 today. I mean, that that they've definitely been picking up the pace, over there. And so, yeah, it's just interesting.

08:34 - 09:24

And, actually, regarding the whole Laravel versus React thing, I think I was listening to, How About Tomorrow podcast with Taylor Otwell, and I think they really got down to the the basics of what's going on there. I mean, you can't really compare Laravel and, like, React Remix. That'd be like comparing you could only really if you wanna do a comparison, you'd be basically taking the Laravel router and blade and then comparing that with, like, React or Remix. I mean, maybe a few other little pieces, but it's just not really it's not really comparison. I mean, most React apps are typically being written against an existing API.

09:28 - 10:27

So yeah. I mean, there's that. There's also actually, it's it's there's an issue that's plaguing one of my apps right now, and I'm actually gonna be changing the, w w w to just be a a Next app and isolating the actual Laravel app under a app to subdomain because it's being basically, like, kinda like DDoS right now, and it has been since February. And it's one of those wild ones where it's more it's like an application layer attack. So essentially, I have this thing running on a $5 DigitalOcean box, but it dynamically you know, it's a it's a, disconnected service that basically allows me to dynamically generate Open Graph images from the from the like, for my projects that I work on.

10:28 - 11:08

But because it's being DDoS, the, it's just not behaving as consistent as it used to be. So I also do think that from a stability or resources standpoint, sometimes having these things a little bit fragmented can save you in that regard. So I'm gonna throw up a static site for the marketing, which will just be the next app. I'm gonna throw the actual Laravel app under an app subdomain, and hopefully, that will free it up so that it runs a little bit better. But, yeah, I've gone long on this one.

11:08 - 11:33

I thought it was gonna be a short one just regarding context and context switching and just even the concept of the context that's when someone is introduced to an idea or is having a conversation. I mean, all that context matters. So context really is king, and, we'll leave it there. So I'm Ryan Heffner. This is the All Play Podcast.

11:36 - 11:47

Please like and subscribe. No. This isn't YouTube. Subscribe, leave a review, or rating. Hopefully, it's an okay one.

11:47 - 12:03

You can follow me on Twitter @ryanhefner . You can follow the show @allplayfm. You can check out the site, allplay.fm, and my personal site, ryanhefner.com. Alright. Have a great one.

12:03 - 12:03


More Episodes

Subscribe to the newletter

Get updates when new episodes are posted, and other fun stuff that I am into.

Help yourself, while supporting the show

Here are a few services that I use, and highly recommend.

© 2024 — All Play FM + Ryan Hefner

With OSS
All Play on MediumAll Play on Substack