1
00:00:08,880 --> 00:00:13,160
Welcome back perfect peeps to 
code with coding cats. 

2
00:00:13,600 --> 00:00:15,560
That felt weird, didn't it? 
It did. 

3
00:00:16,120 --> 00:00:21,000
It's usually perfect, that dev. 
It throws me off every week, as 

4
00:00:21,000 --> 00:00:23,240
you can probably tell. 
We have Kenzie Dodds with us. 

5
00:00:23,240 --> 00:00:26,720
Hey, Ken. 
With the awesome neon remix sign

6
00:00:26,720 --> 00:00:28,880
in the background. 
Yeah, so when he told me I need 

7
00:00:28,880 --> 00:00:31,760
to put it up here, but. 
Oh yeah, that would be cool. 

8
00:00:32,360 --> 00:00:35,520
It's harder to it's literally 
just hanging on the hooks that I

9
00:00:35,520 --> 00:00:38,560
had already for my lanyards. 
And so I just like threw it up 

10
00:00:38,560 --> 00:00:38,840
there. 
Oh. 

11
00:00:39,280 --> 00:00:41,440
You're a lanyard keeper. 
I always wanted to be. 

12
00:00:41,600 --> 00:00:43,760
They always get shuffled away in
my moves though. 

13
00:00:43,760 --> 00:00:46,600
They're like. 
Yeah, I, I'm glad that I did. 

14
00:00:46,800 --> 00:00:50,440
I have every lanyard I've ever 
for every conference I've ever 

15
00:00:50,440 --> 00:00:52,200
been to. 
And so now it's kind of a fun 

16
00:00:52,440 --> 00:00:53,960
reflection. 
Yeah. 

17
00:00:54,840 --> 00:00:57,720
That's awesome. 
My son was collecting mine for a

18
00:00:57,720 --> 00:00:59,400
long time. 
I was like, yeah, you can have. 

19
00:01:00,240 --> 00:01:03,640
This. 
So we are going to go somewhat 

20
00:01:03,640 --> 00:01:06,520
fast today because we're kind of
try to build something pretty 

21
00:01:06,520 --> 00:01:10,280
crazy in 90 minutes. 
And you know, with that said, 

22
00:01:11,200 --> 00:01:14,200
how how's everybody Friday? 
First of all, let's say at least

23
00:01:14,200 --> 00:01:16,720
do a little intro. 
We always try to do this. 

24
00:01:16,720 --> 00:01:18,680
Brittany how was how was Netlify
this week? 

25
00:01:19,600 --> 00:01:23,280
It is good. 
I'm trying to get my last July 

26
00:01:23,280 --> 00:01:27,280
blog post out today so hopefully
that's going to go well. 

27
00:01:27,520 --> 00:01:29,680
It's going great though. 
How was Apprite? 

28
00:01:30,360 --> 00:01:33,760
Apprite was good. 
I'm learning a lot, but also 

29
00:01:33,760 --> 00:01:38,120
having to put my like PHP brain 
back on, which has been, you 

30
00:01:38,120 --> 00:01:40,400
know, 1215 years. 
So I'm having a little bit of 

31
00:01:40,400 --> 00:01:43,840
like imposter syndrome, like, Oh
my gosh, I don't belong here. 

32
00:01:44,000 --> 00:01:46,920
There's like some incredibly 
smart people working on the back

33
00:01:46,920 --> 00:01:50,600
end for all this stuff, so it's 
pretty cool, but working on some

34
00:01:50,600 --> 00:01:54,240
fun apps for tutorials and 
things like that, which has been

35
00:01:54,240 --> 00:01:55,760
super fun. 
Digging it. 

36
00:01:56,480 --> 00:01:57,280
That's very cool. 
How are you Ken? 

37
00:01:57,280 --> 00:02:01,960
Anything fun this week? 
Yeah, this week I'm going to 

38
00:02:02,760 --> 00:02:07,640
Front End Masters next week and 
teaching two workshops on remix.

39
00:02:07,920 --> 00:02:10,360
And so this week I was working 
on the tooling around the 

40
00:02:10,360 --> 00:02:13,880
workshops to make that 
experience seamless, and that's 

41
00:02:14,120 --> 00:02:17,520
always fun. 
Yeah, those front end Masters 

42
00:02:17,520 --> 00:02:19,600
workshops are a bear, aren't 
they? 

43
00:02:20,600 --> 00:02:26,160
Yeah, yeah, scheduling a front 
and master workshop or or an 

44
00:02:26,160 --> 00:02:29,320
egghead course is always a good 
forcing function for producing 

45
00:02:29,320 --> 00:02:31,840
content for me so. 
Absolutely. 

46
00:02:33,080 --> 00:02:36,880
Cool. 
Well, without any more ado is 

47
00:02:36,920 --> 00:02:38,760
obviously. 
I don't know, it'd be all 

48
00:02:38,760 --> 00:02:42,800
proper. 
So probably in another 10 

49
00:02:42,800 --> 00:02:45,560
minutes once we have some more 
people on, we will do the 

50
00:02:45,560 --> 00:02:49,600
drawing for the five giveaway 
for level up tutorials. 

51
00:02:50,080 --> 00:02:52,280
So just supporting our creator 
community out there. 

52
00:02:53,040 --> 00:02:56,040
We'll jump out in a bit. 
But other than that, I think are

53
00:02:56,040 --> 00:02:58,720
you guys ready to code? 
I, I know Brittany's kind of 

54
00:02:58,720 --> 00:03:00,960
running the show today on the 
coding side. 

55
00:03:00,960 --> 00:03:04,200
And Kent, you're, you're helping
instruct creating a remix app, 

56
00:03:04,200 --> 00:03:06,000
right? 
Yes, yeah. 

57
00:03:06,280 --> 00:03:08,360
Hopefully it goes well. 
Awesome. 

58
00:03:08,760 --> 00:03:10,840
We'll hear live coding. 
Here we go. 

59
00:03:12,600 --> 00:03:16,000
I forgot to ask you, are you on 
a a recent version of node? 

60
00:03:17,080 --> 00:03:18,640
Let's see what version I'm 
running. 

61
00:03:18,640 --> 00:03:23,000
I think I'm on 1616 point 14.2. 
That'll work fine. 

62
00:03:23,480 --> 00:03:26,440
If you were on like 12 then we 
might have to do an upgrade but 

63
00:03:26,800 --> 00:03:28,520
sixteen will work. 
OK. 

64
00:03:29,320 --> 00:03:32,400
Cool. 
So do do we want to talk about 

65
00:03:32,400 --> 00:03:34,680
what Remix is or do you want to 
just get right into coding? 

66
00:03:34,880 --> 00:03:37,720
You can go ahead and give like a
brief overview that might get us

67
00:03:37,720 --> 00:03:40,600
to that mark that Alex was 
mentioning earlier. 

68
00:03:40,600 --> 00:03:41,600
So. 
Sure. 

69
00:03:41,600 --> 00:03:44,920
Yeah. 
So Remix is a web framework for 

70
00:03:44,920 --> 00:03:49,280
building excellent user 
experiences for the web, a very 

71
00:03:49,280 --> 00:03:55,440
strong focus on the web platform
and using JavaScript to enhance 

72
00:03:55,440 --> 00:03:57,560
that experience. 
So progressive enhancement is a 

73
00:03:57,560 --> 00:04:00,840
big piece of what we're doing at
Remix. 

74
00:04:02,200 --> 00:04:05,760
And yeah, it's built on top of 
React Router. 

75
00:04:06,480 --> 00:04:09,520
So it's, it's basically an 
evolution of React Router. 

76
00:04:10,600 --> 00:04:13,240
It brings a whole lot of extra 
features that React Router 

77
00:04:13,240 --> 00:04:17,360
hasn't had so far. 
And in the next week or so, I, I

78
00:04:17,360 --> 00:04:20,040
feel like I've been saying that 
for a while, but really this 

79
00:04:20,040 --> 00:04:25,800
time probably next week we'll 
have released React Router 

80
00:04:26,320 --> 00:04:30,120
version 6.4, I think, or maybe 
it's 6.5, I can't remember. 

81
00:04:30,120 --> 00:04:34,680
The next minor bump of React 
Router that brings in a lot of 

82
00:04:34,680 --> 00:04:40,000
the features of Remix. 
So loaders, error boundaries, 

83
00:04:40,320 --> 00:04:43,840
actions, forms, fetchers, bunch 
of stuff. 

84
00:04:45,280 --> 00:04:49,640
And this is really exciting 
because it, it means that it's 

85
00:04:49,960 --> 00:04:55,800
actually very straightforward to
migrate an existing React app to

86
00:04:55,800 --> 00:05:00,280
Remix if you're using React 
Router, If you're not using 

87
00:05:00,280 --> 00:05:03,680
React Router, you're probably 
using Next and maybe Gatsby. 

88
00:05:04,200 --> 00:05:06,600
And those have different 
migration stories. 

89
00:05:06,600 --> 00:05:10,360
But, but for React Router apps, 
which is most React apps in the 

90
00:05:10,360 --> 00:05:13,720
world, migrating to Remix is 
actually pretty straightforward,

91
00:05:13,720 --> 00:05:16,040
thanks to the fact that it's 
just built on top of React 

92
00:05:16,040 --> 00:05:18,280
Router and, and we're bringing 
lots of the React Router or 

93
00:05:18,280 --> 00:05:20,880
Remix features to React Router. 
So I can ask. 

94
00:05:21,080 --> 00:05:23,360
You a quick question on the 
router side too. 

95
00:05:23,440 --> 00:05:28,280
I've heard whispers that Remix 
Routers is starting to branch 

96
00:05:28,280 --> 00:05:31,720
out too, and there's a Remix 
Routers felt in the works. 

97
00:05:32,280 --> 00:05:34,240
Yeah, yeah. 
So we're not working on the 

98
00:05:34,240 --> 00:05:37,440
spelt router ourselves, but. 
Austin Krim, right? 

99
00:05:37,560 --> 00:05:40,560
Yes, Austin is playing around 
with that. 

100
00:05:40,560 --> 00:05:44,400
So in the process of bringing 
Remix features into React 

101
00:05:44,400 --> 00:05:47,480
Router, what we're actually 
doing is we're taking React out 

102
00:05:47,480 --> 00:05:51,320
of the the router and we're 
making a new router called Remix

103
00:05:51,320 --> 00:05:54,200
Router that has all these new 
features. 

104
00:05:55,040 --> 00:05:56,800
It is. 
And then we're going to turn 

105
00:05:56,800 --> 00:05:58,960
React Router into an adapter for
Remix Router. 

106
00:06:00,040 --> 00:06:03,280
And so like no breaking changes 
or anything, it's just new 

107
00:06:03,280 --> 00:06:07,160
features. 
But yeah, by doing that we do 

108
00:06:07,160 --> 00:06:12,840
open the floodgates for any 
JavaScript framework to use the 

109
00:06:12,840 --> 00:06:15,920
router. 
And there's a lot to do with the

110
00:06:15,920 --> 00:06:20,280
router for your application. 
So especially with the the 

111
00:06:20,280 --> 00:06:22,520
features that the Remix Router 
will have. 

112
00:06:22,520 --> 00:06:28,600
So yeah, we have published a pre
release of this, which is why we

113
00:06:28,920 --> 00:06:30,680
talk about it. 
We try not to talk about stuff 

114
00:06:30,680 --> 00:06:33,120
that hasn't shipped yet, but 
this is technically shipped 

115
00:06:33,440 --> 00:06:35,400
because we do have a pre 
release. 

116
00:06:35,880 --> 00:06:38,560
And so people have taken the pre
release and we've got an 

117
00:06:38,920 --> 00:06:41,800
somebody who's worked on an 
angular router with remix router

118
00:06:42,920 --> 00:06:47,160
and somebody who's worked on 
Svelte Austin and and Vue and 

119
00:06:47,160 --> 00:06:52,560
pre act. 
So yeah, the lots of exciting 

120
00:06:53,640 --> 00:06:56,880
developments in the future, it's
not like we're necessarily 

121
00:06:56,880 --> 00:06:59,880
hedging our bets because like 
let's face it, React is still 

122
00:06:59,880 --> 00:07:02,520
like three times as widely used 
as the rest of them combined. 

123
00:07:02,520 --> 00:07:07,480
But but it's still, it is not 
everybody wants to use React. 

124
00:07:07,480 --> 00:07:10,280
And so this gives them a a 
chance to get these really cool 

125
00:07:10,280 --> 00:07:12,080
features without having to use 
React. 

126
00:07:12,560 --> 00:07:15,400
Yes, thank you. 
Thanks for talking about that 

127
00:07:15,400 --> 00:07:18,320
for a minute. 
Yeah. 

128
00:07:19,120 --> 00:07:25,040
Another question that I had on 
Remix is, so from my 

129
00:07:25,040 --> 00:07:27,400
understanding of it, just 
briefly like reading through the

130
00:07:27,400 --> 00:07:30,040
docs and learning a little bit 
about it, is that it's kind of 

131
00:07:30,040 --> 00:07:32,760
this middleware between the 
server. 

132
00:07:33,080 --> 00:07:36,080
So it handles the request from 
the server back to the client. 

133
00:07:36,360 --> 00:07:38,240
Is that right? 
And can you explain that a 

134
00:07:38,240 --> 00:07:39,800
little bit? 
Yeah, yeah. 

135
00:07:40,240 --> 00:07:45,840
So we like to call Remix center 
stack because it manages the 

136
00:07:45,840 --> 00:07:51,920
network tab for you. 
So by that I mean all of the 

137
00:07:51,920 --> 00:07:55,840
data loading, you write the 
server code for loading the 

138
00:07:55,840 --> 00:07:58,000
data. 
And so everything, the code that

139
00:07:58,000 --> 00:08:01,720
you write for getting data is 
all written on the server. 

140
00:08:01,720 --> 00:08:04,240
So you can talk directly to a 
database or you can make a fetch

141
00:08:04,240 --> 00:08:08,600
request or whatever. 
And you just, you know, you can 

142
00:08:08,600 --> 00:08:11,760
do your await and whatever 
normal JavaScript stuff you're 

143
00:08:11,760 --> 00:08:15,440
going to do in there. 
And then you return a response, 

144
00:08:15,720 --> 00:08:18,240
a web fetch response. 
So you say new response, 

145
00:08:18,240 --> 00:08:21,360
whatever, or we have some 
helpers because most of the time

146
00:08:21,360 --> 00:08:22,640
you're going to be returning 
Jason. 

147
00:08:23,720 --> 00:08:28,280
And then on the client side in 
your in your components, which 

148
00:08:28,280 --> 00:08:31,320
may or may not be a client side 
because you can be doing server 

149
00:08:31,320 --> 00:08:35,120
rendering too. 
But in your component, you use a

150
00:08:35,200 --> 00:08:40,720
hook called use loader data. 
And so Remix is managing getting

151
00:08:40,720 --> 00:08:43,559
that data from that server code 
that you're writing into your 

152
00:08:43,559 --> 00:08:45,800
component. 
And so that's why we say we're 

153
00:08:45,800 --> 00:08:51,080
managing the the network tab and
and even more than that, we also

154
00:08:51,080 --> 00:08:53,760
manage mutations for you. 
So you need to make a change to 

155
00:08:53,760 --> 00:08:56,280
the data. 
We've got a form component that 

156
00:08:56,280 --> 00:08:58,760
you can use. 
And when the user submits a 

157
00:08:58,760 --> 00:09:02,400
form, we'll take care of 
serializing that up the same way

158
00:09:02,400 --> 00:09:06,520
the browser would and send it to
the back end where your action 

159
00:09:06,520 --> 00:09:09,040
code is waiting to handle that 
action. 

160
00:09:09,040 --> 00:09:10,440
And again, it's just on the back
end. 

161
00:09:10,440 --> 00:09:12,840
So you can use private keys and 
you can talk to a database or 

162
00:09:12,840 --> 00:09:16,120
whatever you need to do. 
You're, it's not like A use 

163
00:09:16,120 --> 00:09:19,160
effect soup thing. 
You're just writing regular 

164
00:09:19,160 --> 00:09:23,840
JavaScript code. 
And yeah, and, and Remix manages

165
00:09:24,120 --> 00:09:27,520
that entire network 
communication piece for you. 

166
00:09:27,760 --> 00:09:32,160
And what's cool is Remix 
emulates what the browser does. 

167
00:09:32,160 --> 00:09:36,280
And so your code remains the 
same whether or not you want to 

168
00:09:36,280 --> 00:09:38,480
actually have JavaScript in the 
the client. 

169
00:09:39,520 --> 00:09:43,680
And so it actually works if the 
JavaScript fails to load or the 

170
00:09:43,680 --> 00:09:46,680
user disables their JavaScript 
or whatever, which of course 

171
00:09:46,800 --> 00:09:50,920
most people don't do. 
But, and, and there are reasons 

172
00:09:50,920 --> 00:09:56,080
that we, sorry, there are 
reasons that we want JavaScript 

173
00:09:56,240 --> 00:09:59,280
in the clients. 
And so we, this is where the 

174
00:09:59,280 --> 00:10:02,320
progressive enhancement piece 
comes in and, and, and Remix, 

175
00:10:02,320 --> 00:10:05,480
when JavaScript does show up in 
the client, remix will emulate 

176
00:10:05,480 --> 00:10:08,560
the browser. 
And so what's really great about

177
00:10:08,560 --> 00:10:12,160
that, though, is not that like, 
oh, well, we're resilient if 

178
00:10:12,160 --> 00:10:13,800
JavaScript doesn't load, like 
that's great. 

179
00:10:14,040 --> 00:10:17,560
But what's what's really good is
the fact that it works without 

180
00:10:17,560 --> 00:10:20,240
JavaScript is evidence that you 
don't have to manage state in 

181
00:10:20,240 --> 00:10:23,680
the client. 
Because if the app works without

182
00:10:23,680 --> 00:10:26,280
any JavaScript, then obviously 
you don't need state in the 

183
00:10:26,280 --> 00:10:30,880
client. 
And so no, no Redux, no Apollo, 

184
00:10:30,880 --> 00:10:37,360
no Mob X, no React query, none 
of no context, none of that 

185
00:10:37,360 --> 00:10:40,600
stuff is is necessary for 
application state management 

186
00:10:41,520 --> 00:10:44,080
now. 
Context can be useful for other 

187
00:10:44,080 --> 00:10:46,160
things, just not application 
state management. 

188
00:10:46,240 --> 00:10:50,720
Now of course Remix and React 
Router are using context for 

189
00:10:50,720 --> 00:10:54,320
what they're doing, but the fact
is that you don't have to use 

190
00:10:54,720 --> 00:10:58,760
context, you don't have to 
manage any state, and you also 

191
00:10:59,120 --> 00:11:03,680
only use use effect for like 
focus management and stuff. 

192
00:11:03,680 --> 00:11:09,520
So Remix makes the hard parts of
React a lot easier, which I 

193
00:11:09,520 --> 00:11:13,080
really appreciate. 
Yeah, that is really nice too. 

194
00:11:13,240 --> 00:11:16,440
I I feel like there's been a lot
of talk since David Capiano's 

195
00:11:16,440 --> 00:11:21,280
talk at Was it Reactathon? 
Where he said use effect is 

196
00:11:21,680 --> 00:11:26,480
going away. 
Yeah, he's not super thrilled 

197
00:11:26,480 --> 00:11:31,360
with use effects. 
I I mostly share his, his 

198
00:11:31,360 --> 00:11:38,320
feelings, I guess. 
Yeah, I the the use event hook 

199
00:11:38,320 --> 00:11:41,120
that was introduced soon after 
that talk. 

200
00:11:42,200 --> 00:11:46,480
That, that one's interesting. 
I think that I I'm a little 

201
00:11:46,480 --> 00:11:50,160
concerned that people are going 
to start over using that hook. 

202
00:11:50,960 --> 00:11:57,880
The fact is that useeffect, it 
helps you uncover problems in 

203
00:11:57,880 --> 00:12:01,480
your code that you never would 
have back in the class component

204
00:12:01,480 --> 00:12:04,680
days. 
So like the sorts of problems 

205
00:12:04,680 --> 00:12:07,160
that you discover in production,
not during development. 

206
00:12:07,840 --> 00:12:10,240
Useeffect is so frustrating 
because it reveals all those 

207
00:12:10,240 --> 00:12:15,320
problems to you during 
development and yeah, when they 

208
00:12:15,320 --> 00:12:17,640
happen in production, you just 
don't realize that there was 

209
00:12:17,640 --> 00:12:20,800
something you could have used in
development that that would have

210
00:12:20,800 --> 00:12:23,400
helped you avoid those problems.
I've got a blog post about this 

211
00:12:23,400 --> 00:12:25,600
on Epic react dot dev slash 
articles. 

212
00:12:26,320 --> 00:12:31,560
It's about, shoot, what, what is
it called? 

213
00:12:31,840 --> 00:12:35,400
I'll have to grab a link to it 
'cause I I've got a couple on 

214
00:12:35,400 --> 00:12:37,400
there about. 
Epic epic dot. 

215
00:12:38,200 --> 00:12:39,880
Dev. 
It's epic react dot dev. 

216
00:12:40,360 --> 00:12:44,320
Epic React. 
Yeah, and there are two, two 

217
00:12:44,320 --> 00:12:48,440
blog posts and you said I could 
put them just right here and 

218
00:12:48,440 --> 00:12:51,720
people will see them maybe or 
actually I'll put them in the in

219
00:12:51,720 --> 00:12:53,680
the Twitch chat every day. 
Perfect. 

220
00:12:54,680 --> 00:12:58,520
That's where we want to be. 
So the first one is how reactive

221
00:12:58,520 --> 00:13:04,440
disclosures to avoid bugs. 
And by using use event, you are 

222
00:13:05,080 --> 00:13:08,880
switching from the new default 
to the old default and and this 

223
00:13:08,880 --> 00:13:12,200
blog post will demonstrate what 
the old default was and and how 

224
00:13:12,200 --> 00:13:15,040
it caused bugs. 
And then the second blog post I 

225
00:13:15,040 --> 00:13:17,480
shared is the latest ref 
pattern, which is basically the 

226
00:13:17,480 --> 00:13:21,880
use event hook. 
And so yeah, you can actually 

227
00:13:21,880 --> 00:13:25,520
implement the use event hook 
yourself today, but I just think

228
00:13:25,520 --> 00:13:29,080
it's so important to understand 
how React uses closures to avoid

229
00:13:29,080 --> 00:13:32,080
bugs before you start using it. 
And so I'm a little concerned 

230
00:13:32,080 --> 00:13:35,880
that people are going to start 
over using that use event hook, 

231
00:13:36,960 --> 00:13:41,080
but we'll see. 
People definitely have good 

232
00:13:41,080 --> 00:13:43,800
reason to be frustrated by use 
effect. 

233
00:13:44,200 --> 00:13:47,200
And I've got good news for you. 
You basically don't need to use 

234
00:13:47,200 --> 00:13:49,320
it very much when you're using 
remakes. 

235
00:13:49,320 --> 00:13:52,080
And and when you do, it's for 
focus management and stuff, 

236
00:13:52,080 --> 00:13:54,240
which is really easy. 
Like they're it's not 

237
00:13:54,240 --> 00:13:57,680
complicated. 
So I mean relatively should 

238
00:13:57,680 --> 00:14:02,640
never use the word easy when 
describing it for them, but but 

239
00:14:02,640 --> 00:14:06,560
yes. 
I had one clarification 

240
00:14:06,560 --> 00:14:09,400
throughout all that. 
I know it was a minute ago but I

241
00:14:09,400 --> 00:14:11,200
I know like Brittany had to be 
running node. 

242
00:14:11,200 --> 00:14:14,080
Is there any other back ends 
that remix can handle or is it 

243
00:14:14,080 --> 00:14:15,760
all node based? 
Yeah, great question. 

244
00:14:15,760 --> 00:14:20,320
So Remix, we take pride in the 
fact that it runs anywhere you 

245
00:14:20,320 --> 00:14:23,760
can run JavaScript. 
I don't think anybody's tried it

246
00:14:23,760 --> 00:14:25,560
yet, but I'm pretty sure you 
could get it running in a 

247
00:14:25,560 --> 00:14:31,000
service worker even. 
And so, yeah, we, we deploy to 

248
00:14:31,000 --> 00:14:36,440
Cloudflare workers, we deploy to
Dino, we deploy to actually Bun.

249
00:14:37,040 --> 00:14:39,000
You can use Bun with Remix 
already. 

250
00:14:40,080 --> 00:14:45,280
Yeah, deploy wherever JavaScript
is sold, you know, like Akamai 

251
00:14:45,280 --> 00:14:48,320
edge workers. 
So a lot of people say, yeah, 

252
00:14:48,320 --> 00:14:50,840
I'd love to use Remix, but 
there's no way my company is 

253
00:14:50,840 --> 00:14:52,880
ever going to let me deploy node
in production. 

254
00:14:54,000 --> 00:14:57,120
Maybe not a lot of people, but I
I've heard that quite a bit. 

255
00:14:58,280 --> 00:15:06,040
And I think that while that is 
there are arguments to be had, I

256
00:15:06,040 --> 00:15:08,200
worked at PayPal. 
So like the place that made node

257
00:15:08,200 --> 00:15:10,800
in production at A at scale like
popular. 

258
00:15:11,160 --> 00:15:15,040
And so I'm, I'm super into that 
node in in production. 

259
00:15:15,040 --> 00:15:17,440
But for those people who are 
like, no, we're not shipping 

260
00:15:17,440 --> 00:15:20,200
node. 
You're probably using Akamai and

261
00:15:20,200 --> 00:15:23,000
you can, you can use remix in 
production with Akamai. 

262
00:15:23,000 --> 00:15:26,400
So, and even even in those 
situations, if you really just 

263
00:15:26,400 --> 00:15:31,000
like, Nope, we're not doing any 
runtime of JavaScript on a 

264
00:15:31,000 --> 00:15:34,240
server, fine. 
That's why Remix router is going

265
00:15:34,240 --> 00:15:38,840
to be a thing. 
So you can get most of the OR a 

266
00:15:38,840 --> 00:15:43,320
lot of the UX and DX experience 
or improvements. 

267
00:15:44,200 --> 00:15:49,760
But there, there's a point where
like you cannot do better than 

268
00:15:49,760 --> 00:15:53,920
actually running it on a server 
from a UX and DX perspective. 

269
00:15:53,920 --> 00:15:56,360
But we're going to try and make 
it as good as possible for 

270
00:15:56,360 --> 00:15:59,040
people who just want to, who 
just want to stick files on 

271
00:15:59,120 --> 00:16:02,520
ACDN, so. 
Awesome. 

272
00:16:03,560 --> 00:16:07,840
If if that's it before the code,
I'll do our little drawing. 

273
00:16:07,840 --> 00:16:11,000
I was going to ask if that gave 
enough time for a special 

274
00:16:11,000 --> 00:16:14,760
surprise. 
OK so we are doing a giveaway 

275
00:16:14,800 --> 00:16:19,680
for Level up tutorials. 
We're an affiliate over there 

276
00:16:19,680 --> 00:16:24,320
and we thought it would be fun 
to give away 5, five, I think 

277
00:16:24,320 --> 00:16:26,920
year long memberships. 
Yeah, that sounds right. 

278
00:16:28,200 --> 00:16:31,800
So we had everybody kind of hit,
hit our tweets and if you want 

279
00:16:31,800 --> 00:16:34,080
to put your name in in the next 
two seconds. 

280
00:16:34,080 --> 00:16:36,400
No, just kidding. 
We we have everybody. 

281
00:16:36,920 --> 00:16:39,880
I'm going to, I'm going to spin 
this crazy wheel and hopefully 

282
00:16:40,000 --> 00:16:43,320
it works correctly and I'll do 
five names and I'll probably do 

283
00:16:43,320 --> 00:16:45,640
a few extra in case the five 
don't respond. 

284
00:16:45,640 --> 00:16:46,520
But here we go. 
Awesome. 

285
00:16:51,560 --> 00:16:53,400
Man, that, that was quite the 
spin it. 

286
00:16:53,680 --> 00:16:54,680
Was that was. 
Crazy. 

287
00:16:55,880 --> 00:16:58,400
It's a Google color. 
It's a Google developer group 

288
00:16:58,400 --> 00:17:00,040
and there. 
Was like a. 1000 names. 

289
00:17:00,120 --> 00:17:02,960
It was crazy. 
So Matthew Wiggly. 

290
00:17:03,080 --> 00:17:04,000
Wiggly. 
I don't know. 

291
00:17:04,160 --> 00:17:05,839
Matthew Wiggly. 
There we go. 

292
00:17:06,720 --> 00:17:09,400
I I read that completely 
different. 

293
00:17:09,720 --> 00:17:12,920
I read it Matt the Wiggly. 
That's probably what it is. 

294
00:17:15,160 --> 00:17:17,839
OK, I think I remove and then we
can do more. 

295
00:17:17,839 --> 00:17:19,200
OK? 
Yep, so. 

296
00:17:19,240 --> 00:17:23,200
Here's our second one. 
Yeah, I'm, I'm thinking Matthew 

297
00:17:23,200 --> 00:17:25,839
Higley. 
Sorry, Matthew. 

298
00:17:25,839 --> 00:17:29,000
If if we're wrong, yes. 
I'm I'm totally going to bought 

299
00:17:29,400 --> 00:17:33,920
this one. 
So Clara Minova, I'm not going 

300
00:17:33,920 --> 00:17:35,640
to attempt that one, but you've 
won as well. 

301
00:17:36,640 --> 00:17:38,200
Are you are you saving me 
somewhere or? 

302
00:17:38,240 --> 00:17:39,960
Is it? 
Yeah, they go in our results, 

303
00:17:40,040 --> 00:17:43,240
so. 
OK, not going to type anymore 

304
00:17:43,280 --> 00:17:48,560
then. 
I'm see bomb C 52 looks like. 

305
00:17:48,560 --> 00:17:51,360
Yep, I did this in an event 
there. 

306
00:17:51,360 --> 00:17:53,480
Was like so many. 
Names you didn't even know who 

307
00:17:53,480 --> 00:17:55,000
won. 
It was like such a sliver. 

308
00:17:56,840 --> 00:17:59,320
Yeah, we're just not going to 
remember. 

309
00:17:59,800 --> 00:18:02,600
I can't talk today. 
Remember them, Anthony? 

310
00:18:02,600 --> 00:18:04,600
We're just going to have to 
rewatch the video back. 

311
00:18:04,600 --> 00:18:06,240
Yeah, we'll watch the video. 
It'll be fine. 

312
00:18:07,720 --> 00:18:11,240
Jeff, looks like you won. 
One more. 

313
00:18:11,360 --> 00:18:15,400
One last one. 
Oh. 

314
00:18:19,960 --> 00:18:23,560
Oh my gosh, that's tight. 10 EZ 
3 cent. 

315
00:18:25,360 --> 00:18:28,920
That is a great name. 
Maybe it's E cent, I don't know.

316
00:18:28,920 --> 00:18:30,720
OK, I I think we're good with 
that. 

317
00:18:30,720 --> 00:18:33,520
We have our five winners. 
I'll do a couple extra in case 

318
00:18:33,520 --> 00:18:37,040
like I don't get a response from
them, but that's that's the 

319
00:18:37,040 --> 00:18:41,600
winners for level up tutorials. 
I'll be reaching out via DM and 

320
00:18:42,440 --> 00:18:44,680
via your new username. 
So thanks. 

321
00:18:44,920 --> 00:18:46,920
Thanks for signing up everybody.
Thanks for watching. 

322
00:18:48,600 --> 00:18:53,680
OK, so the goal today is that we
are going to be building a fake 

323
00:18:53,680 --> 00:18:57,560
books application written in 
Remix. 

324
00:18:57,920 --> 00:19:01,080
Are we good with that? 
Who's excited about accounting? 

325
00:19:03,040 --> 00:19:05,680
Dashboards are something that 
are important though, right? 

326
00:19:05,800 --> 00:19:08,160
I'd be. 
Interested if someone did my 

327
00:19:08,160 --> 00:19:09,560
accounting for coding cat for 
me. 

328
00:19:12,920 --> 00:19:14,440
Cool. 
So Brittany's going to be 

329
00:19:14,440 --> 00:19:18,680
driving today and showing us how
to code remix and I'm. 

330
00:19:18,680 --> 00:19:21,440
Not worried at all about that. 
The right screen let's. 

331
00:19:23,000 --> 00:19:25,480
See if. 
My guess is it's going to be a 

332
00:19:25,480 --> 00:19:27,960
little tight because we have 
like a window within a window. 

333
00:19:27,960 --> 00:19:31,640
So I'm probably going to switch 
this out to this mode and then 

334
00:19:31,640 --> 00:19:34,400
often probably just take us away
here and there. 

335
00:19:34,400 --> 00:19:37,200
So hopefully that'll work. 
Yeah, that sounds fine. 

336
00:19:37,720 --> 00:19:39,000
Cool. 
All right. 

337
00:19:39,680 --> 00:19:47,880
OK, yeah, if you stay on that 
developer blog, we can copy a 

338
00:19:47,880 --> 00:19:49,280
little bit of that to get 
started. 

339
00:19:50,440 --> 00:19:53,440
And so if you go down a little 
further, there's a snippet of 

340
00:19:53,440 --> 00:19:54,880
code. 
You went too far. 

341
00:19:56,400 --> 00:20:00,400
It's NPX create remix template. 
Oh, we're gonna do a template, 

342
00:20:00,560 --> 00:20:02,240
OK. 
Yeah, so I'm gonna. 

343
00:20:02,240 --> 00:20:03,480
Try to follow along with you 
guys. 

344
00:20:03,520 --> 00:20:05,880
We'll see. 
And and actually just you know 

345
00:20:05,880 --> 00:20:07,920
what, skip skip the template 
nonsense. 

346
00:20:07,960 --> 00:20:12,640
Just type in NPX, create remix 
and then it will prompt you for 

347
00:20:12,640 --> 00:20:16,360
the rest. 
Yes, this will start our CLI. 

348
00:20:16,360 --> 00:20:19,360
We want to go ahead and install 
the following packages. 

349
00:20:19,360 --> 00:20:24,400
Yes, I'll go. 
Ahead and. 

350
00:20:24,640 --> 00:20:25,760
Make this bigger for now. 
Yeah. 

351
00:20:25,760 --> 00:20:30,120
So NPX is temporarily installing
create Remix into your onto your

352
00:20:30,120 --> 00:20:33,560
machine and then it will execute
it. 

353
00:20:34,040 --> 00:20:37,680
And when that happens, it will 
ask you a couple of questions 

354
00:20:37,680 --> 00:20:41,080
and I will tell you the answers 
to provide for what we're doing.

355
00:20:41,760 --> 00:20:43,360
OK. 
OK. 

356
00:20:43,360 --> 00:20:44,760
Where would you? 
Like to create it. 

357
00:20:45,160 --> 00:20:47,000
Put it wherever you just call it
whatever you want. 

358
00:20:47,000 --> 00:20:48,760
You can call it Fake Books, 
Remix or. 

359
00:20:49,240 --> 00:20:52,200
Fake books remix 'cause that's 
what we're creating. 

360
00:20:52,640 --> 00:20:56,680
Yeah, we can't see it Alex. 
Yeah, there we go. 

361
00:20:57,040 --> 00:20:59,240
So do a pre configured stack for
production. 

362
00:21:00,760 --> 00:21:02,600
OK. 
And indie. 

363
00:21:03,040 --> 00:21:07,160
So these are all named after 
music subgenres. 

364
00:21:07,200 --> 00:21:10,760
Go ahead and select Indie. 
I'll I can talk about it and 

365
00:21:10,760 --> 00:21:13,120
let's stick with TypeScript 
because I can't even imagine. 

366
00:21:13,880 --> 00:21:16,800
And then yes, let's install. 
OK. 

367
00:21:17,520 --> 00:21:23,280
OK, so the the music sub genres,
originally we were making these 

368
00:21:23,560 --> 00:21:26,280
stacks and we would call them 
after where we were deploying 

369
00:21:26,280 --> 00:21:30,560
them to, but then realized that 
didn't make any sense because 

370
00:21:31,000 --> 00:21:33,920
you could use. 
We actually had two that were 

371
00:21:34,040 --> 00:21:37,400
both deploying to fly and what 
became the indie stack and the 

372
00:21:37,400 --> 00:21:40,720
Bluestack. 
And so we're like, well, so this

373
00:21:40,720 --> 00:21:43,200
is the one that uses sequel Lite
and this is the one that uses 

374
00:21:44,240 --> 00:21:47,360
Postgres. 
And it also is like deployed in 

375
00:21:47,360 --> 00:21:49,400
multiple regions. 
So it's like cluster. 

376
00:21:49,400 --> 00:21:50,800
And so like, what are we gonna 
call this? 

377
00:21:50,800 --> 00:21:52,880
It would just be like a 
ridiculously long name that had 

378
00:21:52,880 --> 00:21:54,680
all the the features that it 
implements. 

379
00:21:55,160 --> 00:21:58,800
And so we decided to go with 
something that does not describe

380
00:21:58,800 --> 00:22:03,680
what it is to force people to go
to remix dot run slash stacks to

381
00:22:03,680 --> 00:22:05,880
learn about them because 
there's, you know, there's a lot

382
00:22:05,880 --> 00:22:09,680
that goes into the decision. 
The other cool thing about this 

383
00:22:09,680 --> 00:22:12,440
is that you can actually use 
that template flag and point to 

384
00:22:12,440 --> 00:22:17,840
any repo on GitHub or any just 
like a tar ball on your internal

385
00:22:17,840 --> 00:22:22,640
network or whatever, even at 
like a local directory, and it 

386
00:22:22,640 --> 00:22:24,560
will generate the project for 
you as well. 

387
00:22:25,160 --> 00:22:28,640
So yeah. 
I think the templates team at 

388
00:22:28,640 --> 00:22:32,040
Netlifi created the K pop stack.
Yeah, that's right. 

389
00:22:32,040 --> 00:22:36,000
I love the K pop stack. 
Well, that's awesome. 

390
00:22:36,360 --> 00:22:39,320
Yeah. 
So this one deploys to fly or 

391
00:22:39,320 --> 00:22:40,720
it's, it's configured to deploy 
to fly. 

392
00:22:40,720 --> 00:22:42,120
You could deploy it somewhere 
else if you wanted. 

393
00:22:42,880 --> 00:22:49,440
And it uses Sequel Lite and 
Prisma and yeah, we're ready to 

394
00:22:49,440 --> 00:22:52,960
rock'n'roll. 
So if you run NPM run dev or or 

395
00:22:52,960 --> 00:22:55,640
CD into the. 
Yeah, I'll have to go in and I'm

396
00:22:55,640 --> 00:22:57,760
going to go ahead and open up a 
new Windows. 

397
00:22:57,760 --> 00:22:59,720
Yeah, there we go. 
I have a question. 

398
00:22:59,720 --> 00:23:02,520
You said that it would you would
be able to change the deployment

399
00:23:02,520 --> 00:23:04,440
target. 
Is there an easy way to do that 

400
00:23:04,440 --> 00:23:08,160
or do you have to create a new 
deployment target 'cause I 

401
00:23:08,160 --> 00:23:11,000
noticed in the CLI when we chose
a template it didn't ask us 

402
00:23:11,080 --> 00:23:12,680
about that. 
Yeah, yeah. 

403
00:23:12,680 --> 00:23:16,920
So if you go with just the 
basics, then it will ask you or 

404
00:23:16,920 --> 00:23:20,120
it'll present a couple of 
deployment targets and generate 

405
00:23:20,120 --> 00:23:24,600
a project for you like that. 
So yeah, like if you were 

406
00:23:24,600 --> 00:23:28,080
planning on deploying to Netlify
for example, then I I would 

407
00:23:28,080 --> 00:23:30,680
probably just use the K pop 
stack, even though we do have a 

408
00:23:30,680 --> 00:23:35,920
basic template the like. 
Unless you're not planning on 

409
00:23:35,920 --> 00:23:38,960
having a database, which I 
suppose not every everybody 

410
00:23:38,960 --> 00:23:41,920
cares about having a database, 
but the K pop stack is is 

411
00:23:41,920 --> 00:23:45,160
preconfigured for I I believe 
planetscale or something. 

412
00:23:45,160 --> 00:23:48,400
I think it superbase. 
And. 

413
00:23:49,280 --> 00:23:51,720
K pop remix stack, let's see if 
I can get. 

414
00:23:52,720 --> 00:23:55,640
It up Yeah K Pop Remix is not 
going to get you what you are 

415
00:23:55,640 --> 00:24:00,760
looking for. 
So yeah, it uses Superbase, 

416
00:24:00,760 --> 00:24:04,840
Tailwind, Cypress, Prettier, ES 
Lint, TypeScript and deployed to

417
00:24:04,840 --> 00:24:08,040
Netlify on Edge by default. 
Yeah, Yep. 

418
00:24:08,520 --> 00:24:12,840
So a lot of the same things that
we're we've got in in the Indy 

419
00:24:12,840 --> 00:24:18,320
stack, except the Indy stack 
deploys to fly and uses Sequel 

420
00:24:18,320 --> 00:24:21,600
Lite. 
OK, Fly and Sequel Lite. 

421
00:24:21,600 --> 00:24:23,760
And does it use Cypress for end 
to end testing too? 

422
00:24:23,920 --> 00:24:25,400
Yep. 
Interesting. 

423
00:24:25,400 --> 00:24:27,280
So we're going to do a lot of 
the same stuff today. 

424
00:24:27,280 --> 00:24:30,360
OK, Yeah. 
So and then yeah, if you do want

425
00:24:30,360 --> 00:24:32,960
to change your deployment target
later, then you have two 

426
00:24:32,960 --> 00:24:36,880
options. 
You can either just look up the 

427
00:24:37,080 --> 00:24:40,360
configuration files and stuff 
that you need to to deploy to 

428
00:24:40,360 --> 00:24:45,160
your new deployment target, or 
you can spin up a new app and 

429
00:24:45,160 --> 00:24:49,240
then just copy the app directory
over and then make maybe a 

430
00:24:49,240 --> 00:24:51,320
couple changes. 
But one of the cool things about

431
00:24:51,320 --> 00:24:54,760
Remix is that it normalizes 
platforms for you. 

432
00:24:54,800 --> 00:24:56,880
And so most of your app code 
will be the same. 

433
00:24:57,160 --> 00:25:00,600
The the main differences will be
how you're accessing data and 

434
00:25:00,600 --> 00:25:04,120
stuff. 
Because yeah, in a serverless 

435
00:25:04,120 --> 00:25:06,880
environment is, is quite 
different from a long running 

436
00:25:06,880 --> 00:25:09,960
server environment. 
And so sometimes like you're 

437
00:25:09,960 --> 00:25:14,440
making a, a database connection 
for a long time versus just like

438
00:25:14,680 --> 00:25:17,280
temporarily during the life of 
the serverless function. 

439
00:25:17,360 --> 00:25:19,600
So. 
So they use that as like 

440
00:25:19,600 --> 00:25:23,360
adapters, right? 
Yeah, yeah, I, I think, yeah, 

441
00:25:23,360 --> 00:25:26,200
each, each one will have 
different adapter like so we've 

442
00:25:26,200 --> 00:25:28,600
got a Remix run Netlify adapter,
for example. 

443
00:25:29,240 --> 00:25:32,520
So cool, let's go ahead and and 
just run what we have. 

444
00:25:32,520 --> 00:25:37,040
So if you go NPM run dev. 
It already installed everything 

445
00:25:37,040 --> 00:25:41,200
for us during the setup, right? 
Yep, and so now you can go to 

446
00:25:41,200 --> 00:25:45,960
localhost 3000. 
Where did my browser go? 

447
00:25:46,600 --> 00:25:48,320
Fun. 
There we go. 

448
00:25:48,560 --> 00:25:53,200
So you've got the indie Stack 
and it has a sign up and login 

449
00:25:53,200 --> 00:25:56,120
that actually does work. 
I don't think we're gonna have 

450
00:25:56,120 --> 00:25:58,960
time to to do much with that 
today. 

451
00:25:59,520 --> 00:26:03,800
We'll just build this as a auth 
free accounting app. 

452
00:26:05,200 --> 00:26:07,800
Probably is breaking some laws 
somewhere, but these are. 

453
00:26:07,800 --> 00:26:11,480
The safest apps. 
Yeah, but we can always. 

454
00:26:12,640 --> 00:26:17,560
We'll, we'll keep the the auth 
around, but we, you could always

455
00:26:17,560 --> 00:26:21,160
add that later to your app late 
so. 

456
00:26:21,200 --> 00:26:27,360
OK, see what was in the file, 
file and folder structure here 

457
00:26:27,360 --> 00:26:31,040
to kind of see what's going on. 
So we've got the app file and 

458
00:26:31,040 --> 00:26:32,480
routes. 
I'm assuming is where all of our

459
00:26:32,480 --> 00:26:35,440
routes are living. 
Yeah, the app directory is where

460
00:26:35,440 --> 00:26:37,920
most of your code will will be 
written. 

461
00:26:38,600 --> 00:26:44,320
There's also the Prisma file 
that has, you know, database 

462
00:26:44,320 --> 00:26:47,640
related stuff. 
And I will, since we're not 

463
00:26:47,640 --> 00:26:51,200
learning about Prisma today, 
I'll give you something to copy 

464
00:26:51,200 --> 00:26:55,880
into that for our data models 
and stuff here a bit. 

465
00:26:57,120 --> 00:26:58,640
So actually why don't we do that
right now? 

466
00:26:59,800 --> 00:27:03,040
It is the best way to to send 
you these code snippets through 

467
00:27:03,040 --> 00:27:06,400
the the chat in stream yard. 
I didn't think about that. 

468
00:27:07,800 --> 00:27:09,840
You could do that or discord us,
either one. 

469
00:27:10,040 --> 00:27:15,640
Yeah, either way I don't know if
I am in your discord server. 

470
00:27:17,280 --> 00:27:18,960
Let's see what happens if I send
it. 

471
00:27:19,520 --> 00:27:20,160
Nope. 
Oh, yeah. 

472
00:27:20,600 --> 00:27:26,400
Oh, it cuts it off, Yeah. 
OK, so Brittany, what is your 

473
00:27:26,400 --> 00:27:30,200
discord? 
Oh, that's a good question. 

474
00:27:31,880 --> 00:27:33,080
Let's see. 
Have you on here? 

475
00:27:33,960 --> 00:27:37,720
That's my I'm in yours as well. 
It should be at Codercat Dove. 

476
00:27:38,480 --> 00:27:40,680
OK, let me it's just, it's just 
my name. 

477
00:27:40,680 --> 00:27:43,120
So if if you typed in my name, 
it should pop up. 

478
00:27:47,000 --> 00:27:50,480
You also I need the the four 
digit number at the. 

479
00:27:50,480 --> 00:27:55,400
End mine's 1988 hey, which is 
not the year I was born. 

480
00:27:55,920 --> 00:27:57,680
Year I was born. 
That's the year you were. 

481
00:27:58,080 --> 00:28:00,480
Born people. 
Think it's the year I was born 

482
00:28:00,480 --> 00:28:02,280
but it's not. 
I was born in 82. 

483
00:28:03,400 --> 00:28:05,480
Huh. 
Well, that's fun. 

484
00:28:05,840 --> 00:28:09,600
OK, so I guess I need to have 
the correct capitalization. 

485
00:28:09,600 --> 00:28:13,480
So is it capital B and it looks.
Like capital B and there's a 

486
00:28:13,480 --> 00:28:17,480
space and capital P for the in 
the username, which is. 

487
00:28:17,480 --> 00:28:21,320
There we go, I sent you a friend
request so we can be friends. 

488
00:28:21,560 --> 00:28:24,440
Yay. 
Remember when it used to be 

489
00:28:24,440 --> 00:28:27,600
Facebook official? 
Yeah, we're Facebook. 

490
00:28:28,040 --> 00:28:31,560
Friends and now on discord like 
no one does that and I think I 

491
00:28:31,560 --> 00:28:33,560
had to switch it because I was 
getting a lot of random 

492
00:28:33,560 --> 00:28:35,960
messages. 
Yeah, yeah. 

493
00:28:37,400 --> 00:28:40,680
I I do not allow people to 
unmute for as friends unless 

494
00:28:40,680 --> 00:28:42,960
we're in the same server and 
then I I don't accept 

495
00:28:42,960 --> 00:28:46,480
invitations unless I know them. 
Yes, exactly. 

496
00:28:47,360 --> 00:28:49,760
So where is this going to go 
into the? 

497
00:28:49,760 --> 00:28:51,320
Prisma it's schema dot prisma 
schema. 

498
00:28:52,120 --> 00:28:54,880
OK oh, is this already in here 
or is this? 

499
00:28:54,920 --> 00:28:57,280
Yeah, yeah. 
We've, we've got stuff for that 

500
00:28:57,280 --> 00:28:59,760
was bootstrapped for you. 
But yeah, if you just copy paste

501
00:28:59,760 --> 00:29:04,280
over that, then it's going to 
add deposits, line items, 

502
00:29:04,280 --> 00:29:09,280
customers, invoice. 
Like I don't have an extension 

503
00:29:09,280 --> 00:29:11,520
that is showing the 
intellisense. 

504
00:29:12,160 --> 00:29:17,680
Yeah, you're not getting any 
highlighting, but yeah, that's 

505
00:29:17,680 --> 00:29:18,880
OK. 
We're not going to spend any 

506
00:29:18,880 --> 00:29:20,400
time in here. 
We're not talking about Prisma. 

507
00:29:20,440 --> 00:29:20,960
We're. 
We're. 

508
00:29:21,880 --> 00:29:23,360
OK, we're here to talk about 
Remix. 

509
00:29:23,360 --> 00:29:26,720
So the the next thing that you 
do need to do though is run a 

510
00:29:26,720 --> 00:29:33,200
script to to up or yeah to 
update your database. 

511
00:29:33,480 --> 00:29:36,840
So we're going to make a 
migration so you can either open

512
00:29:36,840 --> 00:29:42,080
a new tab or or close the remix 
server and then run NPX Prisma 

513
00:29:42,240 --> 00:29:46,480
Migrate dev. 
Is it a dash or? 

514
00:29:46,880 --> 00:29:49,280
A space. 
Space migrate. 

515
00:29:49,280 --> 00:29:55,240
Migrate and then space dev and 
it will ask you for the name or 

516
00:29:55,240 --> 00:30:00,160
yeah say yes yeah we are 
dropping the new people. 

517
00:30:02,800 --> 00:30:04,400
And just. 
Say yes, yeah. 

518
00:30:04,960 --> 00:30:09,240
And then the name, you can call 
it fake books or whatever, it 

519
00:30:09,240 --> 00:30:17,400
doesn't really matter. 
And now it has updated actually,

520
00:30:18,120 --> 00:30:19,720
yeah, your database is now In 
Sync with your schema. 

521
00:30:19,720 --> 00:30:22,520
I yeah, the client was generated
perfect. 

522
00:30:22,920 --> 00:30:27,160
So now if you try to run NPM run
dev, it's not going to work 

523
00:30:27,600 --> 00:30:31,880
because we dropped the the notes
database. 

524
00:30:31,880 --> 00:30:35,680
So it might open up. 
But if you were to like log in 

525
00:30:35,680 --> 00:30:39,120
and try to use the notes part of
the app then which was like 

526
00:30:39,120 --> 00:30:40,320
generated for you, that wouldn't
work. 

527
00:30:40,720 --> 00:30:44,000
So let's go ahead. 
And if you go to the app 

528
00:30:44,000 --> 00:30:50,400
directory now, go ahead and 
delete the notes directory 

529
00:30:50,400 --> 00:30:52,920
inside of routes 'cause we're 
we're not gonna have that 

530
00:30:52,920 --> 00:30:56,560
anymore. 
And the notes dot TSX file, 

531
00:30:56,560 --> 00:30:59,000
that's the parent route for that
section of the app. 

532
00:31:00,000 --> 00:31:03,280
It's in the routes directory. 
Notes. 

533
00:31:03,360 --> 00:31:05,880
There it is. 
So we'll delete that and then 

534
00:31:05,880 --> 00:31:10,360
the models directory has a note 
dot server where we'll delete 

535
00:31:10,360 --> 00:31:13,800
that. 
What was generated for you was a

536
00:31:13,800 --> 00:31:15,120
notes app. 
So we're just getting rid of 

537
00:31:15,120 --> 00:31:16,240
this stuff that we don't need 
anymore. 

538
00:31:17,640 --> 00:31:22,800
OK, cool. 
So now we're gonna do one other 

539
00:31:22,800 --> 00:31:29,080
thing that that you don't need 
just so we can speed up to the 

540
00:31:29,440 --> 00:31:32,520
the remix piece of this. 
And that is, I'm gonna give you 

541
00:31:32,520 --> 00:31:37,000
all of the Prisma stuff for the 
app that we're going to build. 

542
00:31:37,520 --> 00:31:45,240
So let me see if I can just move
or drag and drop these files. 

543
00:31:45,720 --> 00:31:48,240
All of these files. 
I'm not sure whether the user 

544
00:31:48,680 --> 00:31:51,920
file was changed from the 
original, so I'm just giving you

545
00:31:51,920 --> 00:31:57,640
all of them and just copy paste 
all of those over to the models 

546
00:31:57,640 --> 00:32:07,560
directory. 
I feel like I should play music 

547
00:32:07,560 --> 00:32:10,600
during this. 
We can make music during this 

548
00:32:10,760 --> 00:32:12,440
do. 
You and I'm sorry, which 

549
00:32:12,440 --> 00:32:13,960
directory did you say to put 
them in? 

550
00:32:14,360 --> 00:32:18,720
The models directory, so these 
are files that are responsible 

551
00:32:18,720 --> 00:32:23,320
for managing the communication 
between your app and Prisma. 

552
00:32:24,120 --> 00:32:26,240
Do I do have night driving 
loaded? 

553
00:32:26,280 --> 00:32:29,560
Let's see. 
Yeah, I was actually going to 

554
00:32:29,560 --> 00:32:32,440
start singing Christmas songs. 
So Jingle Bells would be right. 

555
00:32:33,600 --> 00:32:36,160
My son has been listening to 
Christmas music like for the 

556
00:32:36,160 --> 00:32:39,760
last two weeks. 
I had a guy I used to work with 

557
00:32:39,760 --> 00:32:41,600
to cheer him up. 
He would listen to Christmas 

558
00:32:41,600 --> 00:32:43,720
music. 
Any, any month it does cheer you

559
00:32:43,720 --> 00:32:46,040
up, right? 
Like, I mean, I, I can't blame 

560
00:32:46,040 --> 00:32:49,480
him, but there's a reason I made
a, a separate Spotify account 

561
00:32:49,480 --> 00:32:50,600
for my children. 
So. 

562
00:32:52,240 --> 00:32:54,480
That's a great idea. 
That is a great idea. 

563
00:32:54,640 --> 00:32:56,320
Cool. 
OK, so they. 

564
00:32:56,720 --> 00:33:00,400
Have kidz bop on mine. 
Nice, cool. 

565
00:33:01,160 --> 00:33:03,600
OK, so now we've got a data 
model. 

566
00:33:03,600 --> 00:33:05,440
We have ways for accessing the 
data. 

567
00:33:05,440 --> 00:33:09,680
Now the last thing that we need 
for the data piece of this and 

568
00:33:10,400 --> 00:33:13,560
yeah, there I I'm glad that we 
didn't actually just like have 

569
00:33:13,560 --> 00:33:16,280
you clone something directly so 
you can see these are the 

570
00:33:16,280 --> 00:33:20,000
things, you know, concerns that 
are common for building an app. 

571
00:33:20,560 --> 00:33:23,600
You need to have data model, you
need to have ways of accessing 

572
00:33:23,600 --> 00:33:25,640
the data. 
The other one is that's really 

573
00:33:25,640 --> 00:33:28,560
common for local development is 
a way to seed the data. 

574
00:33:28,560 --> 00:33:33,440
So I'm going to give you my seed
script, which is a seed dot TS 

575
00:33:33,440 --> 00:33:40,720
file inside the Whoops, No, hold
on, let's just delete that. 

576
00:33:40,720 --> 00:33:44,440
Never mind inside the Prisma 
directory. 

577
00:33:44,440 --> 00:33:47,680
So let me reveal in Finder and 
drag and drop that for you. 

578
00:33:51,240 --> 00:33:55,160
This should be the last giant 
piece of code that you're gonna.

579
00:33:55,160 --> 00:33:56,720
Copy and where does that one go 
to? 

580
00:33:57,080 --> 00:33:58,600
That will go in the Prisma 
directory. 

581
00:33:59,240 --> 00:34:02,040
And the Prisma. 
So right there, right? 

582
00:34:02,040 --> 00:34:05,760
Just at the group. 
Yep, and it and then you can 

583
00:34:05,760 --> 00:34:11,520
delete the seed dot JS file 
'cause we're not using JS. 

584
00:34:11,520 --> 00:34:14,000
And actually there is one other 
thing you're gonna need to do. 

585
00:34:14,000 --> 00:34:19,679
I forgot about that. 
In the package Jason, there is a

586
00:34:19,679 --> 00:34:28,880
Prisma property at the very 
bottom and it is referencing the

587
00:34:28,880 --> 00:34:31,360
JS file. 
I totally forgot we changed 

588
00:34:31,360 --> 00:34:33,360
that. 
We need it to reference the TS 

589
00:34:33,360 --> 00:34:38,480
file. 
So we're gonna use TS node for 

590
00:34:38,480 --> 00:34:43,360
that. 
And the other thing is we, we'll

591
00:34:43,360 --> 00:34:46,239
probably, Oh no, we've got TS 
node installed already, so we're

592
00:34:46,239 --> 00:34:49,480
good there. 
So this is the right command. 

593
00:34:49,480 --> 00:34:52,880
I I just sent you Oh. 
You sent me a new one? 

594
00:34:53,199 --> 00:34:54,639
Yeah. 
Oh, OK. 

595
00:34:54,639 --> 00:34:56,120
I see. 
It's basically the same thing, 

596
00:34:56,440 --> 00:34:59,720
but it just allows us to to run.
It has TS node instead. 

597
00:34:59,840 --> 00:35:01,000
Yep. 
There we go. 

598
00:35:01,680 --> 00:35:03,400
Cool. 
Yeah, I guess that was the only 

599
00:35:03,400 --> 00:35:04,720
thing. 
Just add ATS dash. 

600
00:35:05,840 --> 00:35:07,520
So cool. 
Great. 

601
00:35:07,520 --> 00:35:15,240
So now you can open up your 
terminal and run NPX Prisma DB 

602
00:35:15,240 --> 00:35:17,160
seed. 
All of those have spaces between

603
00:35:17,160 --> 00:35:23,320
them and that will get some 
seeded data into your database. 

604
00:35:24,960 --> 00:35:28,440
OK, the seed command has been 
executed. 

605
00:35:28,840 --> 00:35:34,760
Booyah, so fun fact, it has that
little emoji with the plant 

606
00:35:34,760 --> 00:35:37,640
growing. 
So they did not used to do that.

607
00:35:37,680 --> 00:35:42,120
And so that's why I added 
database has been seeded that 

608
00:35:42,120 --> 00:35:44,280
that log was for me with the 
emoji. 

609
00:35:44,560 --> 00:35:48,160
And I think I don't know any 
whether this is true, but I 

610
00:35:48,160 --> 00:35:50,320
think that they saw that I did 
that and they're like, oh, what 

611
00:35:50,320 --> 00:35:51,800
a good idea. 
And they stole my idea. 

612
00:35:51,800 --> 00:35:57,400
So now you have two of those, 
but like I said, I don't know 

613
00:35:57,400 --> 00:36:02,960
for sure. 
Anyway, now we've got data in 

614
00:36:02,960 --> 00:36:04,800
the database, we've got a way to
access it. 

615
00:36:05,040 --> 00:36:10,080
Let's finally get to the remix 
piece of this and make a route 

616
00:36:10,240 --> 00:36:13,760
that just displays our our 
customers. 

617
00:36:14,280 --> 00:36:18,600
So if you go to let me just 
think of the way that I want to 

618
00:36:19,000 --> 00:36:22,440
structure this. 
Yeah. 

619
00:36:22,440 --> 00:36:30,560
So let's do yeah, let's see, 
see, I don't wanna like give you

620
00:36:30,560 --> 00:36:34,560
too much 'cause we do wanna 
create some of this stuff, but 

621
00:36:35,280 --> 00:36:40,360
let's just make it a go to your 
index dot TSX route there. 

622
00:36:42,080 --> 00:36:43,880
Actually, you know what? 
Let's let's make a brand new 

623
00:36:43,880 --> 00:36:45,840
route. 
We, I was gonna modify this one,

624
00:36:45,840 --> 00:36:49,360
but we'll make a brand new one. 
Just call it customers dot TSX. 

625
00:36:49,360 --> 00:36:52,640
We'll probably delete this 
later, but I want to just 

626
00:36:52,640 --> 00:36:54,120
demonstrate a couple of things 
here. 

627
00:36:54,160 --> 00:36:59,400
So now we are going to create 
what is called a loader. 

628
00:36:59,680 --> 00:37:05,040
So you're going to export a 
function called loader. 

629
00:37:06,680 --> 00:37:10,720
Is it construction loader? 
Yeah, you we actually I used to 

630
00:37:10,720 --> 00:37:13,520
do construction loader, but now 
we we changed the way our our 

631
00:37:13,520 --> 00:37:18,720
typings work and it works a lot.
I I just prefer function 

632
00:37:18,720 --> 00:37:21,200
declaration. 
Reader and like. 

633
00:37:21,720 --> 00:37:23,320
Yep, just like that. 
It's and it. 

634
00:37:23,320 --> 00:37:25,680
Oh, it's also gonna be an async 
function 'cause we're gonna be 

635
00:37:25,680 --> 00:37:29,440
talking to the database in here.
Oh, it goes. 

636
00:37:30,360 --> 00:37:33,160
No, you, you got it right. 
OK, it was a repeat your. 

637
00:37:33,480 --> 00:37:35,640
Constant declarations ruined 
everything. 

638
00:37:38,760 --> 00:37:41,280
Function declarations are where 
it's at anyway. 

639
00:37:42,600 --> 00:37:48,640
So now consider we're going in 
here, we're going to grab the 

640
00:37:48,640 --> 00:37:50,520
customers, the list of 
customers. 

641
00:37:50,920 --> 00:37:53,680
So hold on a second, where did 
my? 

642
00:37:54,800 --> 00:37:59,280
So we're going to get a, use a 
function in our customer server 

643
00:37:59,600 --> 00:38:01,640
file called get customer list 
items. 

644
00:38:01,680 --> 00:38:05,240
And we've got a special way to 
import those things that's built

645
00:38:05,240 --> 00:38:09,720
into Remix, and that is to use 
this little tilde. 

646
00:38:09,720 --> 00:38:12,400
So I just sent that along to you
is. 

647
00:38:12,400 --> 00:38:18,640
This an alias. 
Yeah, so it it aliases to the 

648
00:38:18,640 --> 00:38:20,880
app directory. 
So when you do that tilde, 

649
00:38:21,480 --> 00:38:23,040
that's gonna be the app 
directory. 

650
00:38:23,160 --> 00:38:26,440
That means no more back dot dot 
dot dot dot dot nonsense. 

651
00:38:26,440 --> 00:38:30,440
So does this come by default 
with remix and can you customize

652
00:38:30,440 --> 00:38:31,680
that? 
No. 

653
00:38:32,040 --> 00:38:34,440
No, OK, it's not in. 
Not customizable. 

654
00:38:34,920 --> 00:38:37,960
This is something that I do with
felt kit is the alias with the 

655
00:38:37,960 --> 00:38:40,960
vconfig is we can do. 
It comes with a dollar sign and 

656
00:38:40,960 --> 00:38:43,560
I don't like the dollar sign so 
I use an AT symbol but. 

657
00:38:44,040 --> 00:38:45,760
OK. 
Yeah, we do at slash for 

658
00:38:45,760 --> 00:38:46,920
everything. 
Yeah. 

659
00:38:47,040 --> 00:38:50,440
So there's something to be said 
for customizability. 

660
00:38:50,960 --> 00:38:53,640
There's also something to be 
said for copy ability. 

661
00:38:54,840 --> 00:38:57,920
And so making it so that it's 
the same for everybody just 

662
00:38:57,920 --> 00:39:00,480
makes it easier. 
Convention over configuration, 

663
00:39:00,480 --> 00:39:03,360
right? 
So, yeah, get customer list 

664
00:39:03,360 --> 00:39:04,880
items. 
So this is for listing our 

665
00:39:04,880 --> 00:39:09,280
customers out. 
So if you go to line four and 

666
00:39:10,240 --> 00:39:14,920
have a customer's variable 
that's assigned to get customer 

667
00:39:14,920 --> 00:39:17,560
list items, yeah, just like what
Copilot is saying. 

668
00:39:18,280 --> 00:39:21,040
Yes, I love copilot. 
So instead of just returning 

669
00:39:21,040 --> 00:39:26,720
customers, though, we're going 
to return a response and we have

670
00:39:26,800 --> 00:39:29,560
a helper to create a response. 
But you could literally just do 

671
00:39:29,560 --> 00:39:33,160
return new response and then 
Jason stringify and all of that,

672
00:39:33,200 --> 00:39:35,720
that stuff if you wanted to. 
But we're going to use the 

673
00:39:35,720 --> 00:39:38,880
helper. 
It's called Jason and it comes 

674
00:39:38,880 --> 00:39:43,360
from Remix run Node. 
OK, So what? 

675
00:39:44,440 --> 00:39:47,760
If you type out Jason, it should
actually auto complete. 

676
00:39:48,080 --> 00:39:52,120
No, all lower case. 
It's a function and you're gonna

677
00:39:52,120 --> 00:39:56,960
go, Nope, not that one. 
Yeah, there's other. 

678
00:39:57,200 --> 00:39:59,560
There's Jason. 
Things it did import something 

679
00:39:59,560 --> 00:40:01,600
from stream consumers. 
Yeah, that's not us. 

680
00:40:01,640 --> 00:40:04,640
That's not right. 
Yeah, I think that's a control C

681
00:40:04,680 --> 00:40:06,200
thing. 
Maybe Intellisense? 

682
00:40:06,200 --> 00:40:10,480
Is not doing its job right here.
Yeah, well, it was it was in 

683
00:40:10,480 --> 00:40:12,520
that list. 
There are like three ways you 

684
00:40:12,520 --> 00:40:15,480
can get that, but I'll just give
it to you in Discord so. 

685
00:40:15,840 --> 00:40:18,640
If you type Jason again, can we 
just pick the list? 

686
00:40:18,640 --> 00:40:20,000
From Jason. 
Yeah. 

687
00:40:20,000 --> 00:40:22,280
So it's, oh, actually it's not 
even in that list. 

688
00:40:22,360 --> 00:40:25,080
Yeah, it's sort of that one. 
So you can you can tab that one 

689
00:40:25,080 --> 00:40:28,560
and then change change server 
runtime to node. 

690
00:40:30,000 --> 00:40:32,000
To node runtime or just node? 
Node. 

691
00:40:32,000 --> 00:40:35,600
Whoops. 
Not that node. 

692
00:40:36,440 --> 00:40:38,360
There we go. 
OK, so now you're going to call 

693
00:40:38,360 --> 00:40:41,320
Jason and just pass it the 
customers? 

694
00:40:41,880 --> 00:40:43,760
OK. 
And then you'll want to return 

695
00:40:43,760 --> 00:40:48,560
that. 
OK, OK, sweet. 

696
00:40:48,560 --> 00:40:52,400
So now you can actually save 
this and go to your browser and 

697
00:40:52,400 --> 00:40:55,240
go to Locos 3000 slash 
customers. 

698
00:41:00,510 --> 00:41:03,550
And what you've made is a 
resource route. 

699
00:41:04,230 --> 00:41:07,670
So since we don't have any UI 
that's exported from this route,

700
00:41:08,320 --> 00:41:12,080
remixes saying oh you just want 
this to be like an API? 

701
00:41:12,120 --> 00:41:16,960
It's an API endpoint, yeah. 
Yeah, so no API directory or 

702
00:41:16,960 --> 00:41:20,840
whatever you'd put these 
wherever you like on on my site 

703
00:41:21,000 --> 00:41:25,520
you I have the ability for users
to download their data and so I 

704
00:41:25,520 --> 00:41:29,520
just made a resource route at me
slash download dot Jason and. 

705
00:41:29,960 --> 00:41:34,120
So how do you differentiate an 
API endpoint route from an 

706
00:41:34,120 --> 00:41:37,440
actual route that you would want
to create with that data? 

707
00:41:37,480 --> 00:41:42,520
Yeah, great question. 
So on line 8, create, add a 

708
00:41:42,520 --> 00:41:45,680
export default function and 
we're going to make a component 

709
00:41:48,680 --> 00:41:51,240
and you can call this component 
customer route. 

710
00:41:54,640 --> 00:41:58,200
You're, I would give it a name. 
You don't have to, but I would 

711
00:41:58,200 --> 00:42:00,800
just call it customer route and 
it yeah. 

712
00:42:01,000 --> 00:42:04,360
Is the convention to capitalize?
It's a component, so yeah. 

713
00:42:06,400 --> 00:42:10,440
And then in here, sure, go ahead
and like. 

714
00:42:10,920 --> 00:42:13,320
Copilot. 
Oh my goodness, I might have to 

715
00:42:13,320 --> 00:42:15,800
actually pay for Copilot. 
Co pilot's amazing. 

716
00:42:16,280 --> 00:42:19,880
So then on line 10, just above 
that line, we we need to get the

717
00:42:19,880 --> 00:42:23,040
customers from somewhere. 
You're gonna say constant 

718
00:42:23,040 --> 00:42:25,000
customers equals use loader 
data. 

719
00:42:25,480 --> 00:42:30,360
Constant customers, not that use
loader data, yeah. 

720
00:42:31,600 --> 00:42:33,240
And that's coming from Remix. 
Run React. 

721
00:42:33,240 --> 00:42:34,480
There we go. 
That one worked. 

722
00:42:35,360 --> 00:42:38,240
That one did work. 
OK, so TypeScript is going to 

723
00:42:38,240 --> 00:42:39,880
complain. 
Let's just stick with this for 

724
00:42:39,880 --> 00:42:42,320
right now and I'll show you how 
to make TypeScript happy. 

725
00:42:42,320 --> 00:42:45,440
So save that and then go over to
your browser and refresh. 

726
00:42:46,200 --> 00:42:50,240
We can't do automatic refresh on
a resource route, but yeah, so 

727
00:42:50,240 --> 00:42:51,040
there you go. 
There your. 

728
00:42:51,040 --> 00:42:52,520
Customer. 
So just in the same file you 

729
00:42:52,520 --> 00:42:57,600
have your loader Nice. 
It's it's very similar to Next 

730
00:42:57,600 --> 00:43:01,160
JS where you use like get static
props or get server side props 

731
00:43:01,160 --> 00:43:03,800
and just return it in. 
But it's not coming in as props,

732
00:43:03,800 --> 00:43:06,040
you're just using the loader 
data hook. 

733
00:43:06,640 --> 00:43:10,040
Yeah. 
And then on top of this, we I'm 

734
00:43:10,120 --> 00:43:13,040
guessing we're not going to have
time for this date, but maybe if

735
00:43:13,040 --> 00:43:19,280
we add a mutation and we added a
customer to that list, then 

736
00:43:19,480 --> 00:43:22,960
Remix would automatically update
our data for us. 

737
00:43:23,920 --> 00:43:28,640
So yeah, people, people always 
say, oh, loaders just get static

738
00:43:28,640 --> 00:43:30,320
props. 
No, no, no, it's nothing like 

739
00:43:30,320 --> 00:43:33,840
that. 
It or, or get server side props.

740
00:43:33,920 --> 00:43:38,560
No, no, Remix does a lot more 
for you from that And and we'll 

741
00:43:38,560 --> 00:43:41,040
probably get to that I. 
Think I do have to say that I 

742
00:43:41,040 --> 00:43:45,160
like that this is TypeScript and
I haven't written any TypeScript

743
00:43:45,160 --> 00:43:47,640
and it's only complaining about 
one thing in this file. 

744
00:43:47,800 --> 00:43:51,480
Yeah, and check this out. 
So you're gonna love this. 

745
00:43:51,880 --> 00:43:54,720
This is so bad. 
So you're gonna update your used

746
00:43:54,720 --> 00:44:01,320
loader data to use a generic 
that looks like what I just sent

747
00:44:01,320 --> 00:44:05,880
you. 
So, so we may get here, but I, I

748
00:44:05,880 --> 00:44:08,080
think the thing that Brittany 
and I were talking about before 

749
00:44:08,080 --> 00:44:11,480
this is trying to understand 
and, and you answered a lot of 

750
00:44:11,480 --> 00:44:12,880
these questions before it came 
for me. 

751
00:44:12,880 --> 00:44:18,960
But how this will end up being 
faster than a statically so get 

752
00:44:18,960 --> 00:44:23,960
static props in next JS like and
I know we're like apples and 

753
00:44:23,960 --> 00:44:27,040
oranges type of scenario here 
but do we want to talk about 

754
00:44:27,040 --> 00:44:28,320
that now or should we just get 
through? 

755
00:44:28,320 --> 00:44:31,760
This we can talk about this. 
So if you did this statically, 

756
00:44:31,760 --> 00:44:34,880
then your list of customer oh, 
and by the way, Brittany, you 

757
00:44:34,880 --> 00:44:37,520
just did it type uploader. 
Boom, now everything is typed 

758
00:44:37,680 --> 00:44:40,520
across. 
The wire, everything just works.

759
00:44:40,720 --> 00:44:43,000
That is it's magic. 
It's amazing. 

760
00:44:43,240 --> 00:44:45,280
I love it. 
Yeah. 

761
00:44:45,280 --> 00:44:48,320
So like, it's it's nuts. 
It's so cool. 

762
00:44:49,400 --> 00:44:53,000
So, yeah, if you were to do this
statically, then that list of 

763
00:44:53,000 --> 00:44:57,640
customers would be and would 
forever be what they were at the

764
00:44:57,640 --> 00:45:01,720
time you built your site, right.
And so that's probably not going

765
00:45:01,720 --> 00:45:04,240
to work when you start thinking 
about, oh, I just added a new 

766
00:45:04,240 --> 00:45:06,160
customer. 
Do I need to rebuild my whole 

767
00:45:06,160 --> 00:45:07,760
site again? 
No, I don't want to do that. 

768
00:45:07,760 --> 00:45:10,280
So what do you do? 
You say, well, I'm going to load

769
00:45:10,280 --> 00:45:13,360
this in the client at, at 
runtime because the client is 

770
00:45:13,360 --> 00:45:15,200
all I've got. 
When I do a static site, I, I 

771
00:45:15,200 --> 00:45:18,400
don't have a server, I have a 
build server. 

772
00:45:18,400 --> 00:45:21,280
And if I want to rebuild every 
time there's a mutation, I can 

773
00:45:21,280 --> 00:45:23,240
do that. 
And now I'm inventing ISR. 

774
00:45:24,240 --> 00:45:26,720
I'm reinventing what the 
platform does. 

775
00:45:27,960 --> 00:45:31,600
So like I, I could go on on a 
big thing about ISR and how it's

776
00:45:31,600 --> 00:45:34,000
just like trying to reinvent 
what the platform already does. 

777
00:45:34,000 --> 00:45:38,120
But so, so then you're loading 
in the client. 

778
00:45:38,120 --> 00:45:41,520
And so that, what that means is 
that the browser has to go to 

779
00:45:41,520 --> 00:45:44,600
the CDN to go get your 
JavaScript and, and all that, 

780
00:45:44,720 --> 00:45:47,800
you know, HTML, whatever. 
And then it has to make a 

781
00:45:47,800 --> 00:45:51,600
request to go get the data. 
And your data, it's gonna 

782
00:45:52,000 --> 00:45:56,560
request is gonna hit some 
endpoint that is indirect, some 

783
00:45:56,560 --> 00:45:58,640
indirection there. 
Like what I've got to find what 

784
00:45:58,640 --> 00:46:00,760
the URL is. 
I've got to make an API route 

785
00:46:00,760 --> 00:46:05,200
and all of this. 
And now, so like the developer 

786
00:46:05,200 --> 00:46:07,120
experience is worse, it's not in
the same file there. 

787
00:46:07,880 --> 00:46:12,040
And so when that response comes 
back, now we have all of our 

788
00:46:12,040 --> 00:46:14,080
customers. 
So this is going to be faster. 

789
00:46:14,960 --> 00:46:21,240
And in our, our demos and, and 
comparisons, we found that even 

790
00:46:21,240 --> 00:46:26,520
the initial page load of like 
time to 1st bite, of course it's

791
00:46:26,520 --> 00:46:32,160
going to be faster on ACDN, but 
it actually is not even that 

792
00:46:32,160 --> 00:46:34,680
much faster. 
Especially if, if this matters 

793
00:46:34,680 --> 00:46:36,920
so much to you, then you'll 
probably want to deploy to the 

794
00:46:36,920 --> 00:46:41,680
edge and you're looking at like 
100 milliseconds, maybe 200 

795
00:46:41,680 --> 00:46:43,440
milliseconds. 
That's fast enough. 

796
00:46:44,080 --> 00:46:47,800
And, and no loading spinners or 
anything like isn't, isn't it 

797
00:46:47,800 --> 00:46:50,680
neat how we've just written all 
of this stuff and we haven't 

798
00:46:50,680 --> 00:46:52,320
talked about a pending UI at 
all? 

799
00:46:53,760 --> 00:46:56,840
Like it's, it's literally just 
like I've got my customers on 

800
00:46:56,840 --> 00:46:59,000
the page. 
There's no need for a pending 

801
00:46:59,000 --> 00:47:01,720
UII think that's pretty cool. 
Now of course, I think the. 

802
00:47:01,760 --> 00:47:04,440
Biggest thing is it's been like 
that time to 1st bite and 

803
00:47:04,440 --> 00:47:08,120
lighthouse scores and like how 
how that starts to look. 

804
00:47:08,120 --> 00:47:11,440
I guess is is always my biggest 
question because for all of our 

805
00:47:11,440 --> 00:47:14,080
stuff, like when we're updating 
blog posts and releasing like 

806
00:47:14,080 --> 00:47:16,280
yours just came up. 
So like you were on our 

807
00:47:16,280 --> 00:47:18,800
schedule, our schedule needs to 
update 'cause you'll fall off of

808
00:47:18,800 --> 00:47:22,600
it when we pull you off. 
We actually have to have a web 

809
00:47:22,600 --> 00:47:26,000
hook triggered to do the 
rebuild, not rebuild. 

810
00:47:26,000 --> 00:47:31,600
But what's the word revalidate 
on on Versal and have that come 

811
00:47:31,600 --> 00:47:33,640
up. 
So to me, like I love the idea 

812
00:47:33,640 --> 00:47:37,080
of not having to do all of that 
but still get speed out of it. 

813
00:47:37,080 --> 00:47:41,760
So if that's kind of the win 
here, like me conceptually, like

814
00:47:41,760 --> 00:47:44,160
at the very high level of this, 
I'm all in. 

815
00:47:44,160 --> 00:47:47,920
Like that's great. 
Yes, that is what it is. 

816
00:47:49,120 --> 00:47:54,240
Go in here and it is phenomenal 
this is when I rewrote my site 

817
00:47:54,240 --> 00:48:00,720
in remix I didn't totally get 
that that aspect of it before I 

818
00:48:00,720 --> 00:48:03,560
started and after I was done I 
was like oh shoot like all I 

819
00:48:03,560 --> 00:48:08,120
want to do is talk about remix 
now and so that's what I do so 

820
00:48:08,400 --> 00:48:13,360
cool cool OK so yeah I don't 
want to gloss over the the 

821
00:48:13,360 --> 00:48:18,680
typing awesomeness here like 
this is phenomenal getting like 

822
00:48:18,680 --> 00:48:23,480
with just that little bit you 
get type safety over the. 

823
00:48:23,480 --> 00:48:25,760
Wire a really great developer 
experience. 

824
00:48:25,960 --> 00:48:28,440
Honestly. 
And there's no fancy. 

825
00:48:28,560 --> 00:48:32,560
Like and this is parsable too, 
which is one of my big gripes 

826
00:48:32,560 --> 00:48:35,600
about TypeScript is that it 
makes the code just completely 

827
00:48:35,600 --> 00:48:38,200
unreadable. 
Yes, absolutely. 

828
00:48:38,520 --> 00:48:41,840
There's one thing of TypeScript 
in here and that is the type of 

829
00:48:41,840 --> 00:48:44,320
loader data. 
And I think just about anybody 

830
00:48:44,320 --> 00:48:48,120
can, you know, even if you don't
understand what it's doing, like

831
00:48:49,040 --> 00:48:53,360
you can gloss over that like 
just like, well, I do this and 

832
00:48:53,360 --> 00:48:55,800
now the TypeScript red 
squigglies go away and I got 

833
00:48:55,800 --> 00:48:59,680
autocomplete so. 
That type of loader that is 

834
00:48:59,680 --> 00:49:01,880
coming from remix, not prismic, 
correct? 

835
00:49:02,120 --> 00:49:05,000
Yes, yeah. 
So that use loader data hook is 

836
00:49:05,000 --> 00:49:08,640
a generic and that's coming from
Remix and the generic has been 

837
00:49:08,920 --> 00:49:12,600
codified to be able to to deal 
with the loader function like 

838
00:49:12,600 --> 00:49:14,920
that. 
Is this what it is coming out 

839
00:49:14,920 --> 00:49:16,640
as? 
What's popping up here? 

840
00:49:16,880 --> 00:49:18,600
Yeah, yeah. 
So actually if you hover over 

841
00:49:18,600 --> 00:49:22,560
the customers then you'll get a 
better view of what that is. 

842
00:49:22,560 --> 00:49:25,720
Yeah, there we go. 
Yeah, cool. 

843
00:49:26,080 --> 00:49:29,920
OK, so let's let's make this 
look a little bit nicer. 

844
00:49:29,920 --> 00:49:33,760
I'm going to grab. 
Let me see, just make sure. 

845
00:49:34,160 --> 00:49:38,040
Yeah, see, my finished version 
has a bunch of nice fancy things

846
00:49:38,040 --> 00:49:40,960
that I probably should have 
spent a little time getting rid 

847
00:49:41,040 --> 00:49:46,480
of for our our stuff today. 
So let me get rid of this here 

848
00:49:46,480 --> 00:49:50,560
really quick. 
Choosing tailwind, right? 

849
00:49:50,560 --> 00:49:52,960
So we've got some tailwind 
styles in there, I'm assuming? 

850
00:49:53,400 --> 00:49:56,760
Yeah, Yep. 
So let me grab all of this. 

851
00:49:57,840 --> 00:50:01,680
I think I'm just deleting stuff 
to so that you don't have to. 

852
00:50:02,560 --> 00:50:09,720
Like this is stuff that you'd 
want to have later when when 

853
00:50:09,720 --> 00:50:12,080
we're done, but I don't want to 
add it right from the get go 

854
00:50:12,080 --> 00:50:15,240
because I think that would 
confuse people. 

855
00:50:15,240 --> 00:50:20,840
So here we go. 
Thanks. 

856
00:50:20,840 --> 00:50:23,160
So that hopefully that all 
works. 

857
00:50:24,360 --> 00:50:25,680
OK. 
And where does that does that 

858
00:50:25,680 --> 00:50:26,400
go? 
Right under? 

859
00:50:26,480 --> 00:50:30,880
Here, just take it in in place 
of the customer component that 

860
00:50:30,880 --> 00:50:32,200
you've got already. 
OK. 

861
00:50:33,120 --> 00:50:36,040
OK, so now it's complaining. 
Oh, shoot, yeah. 

862
00:50:36,040 --> 00:50:37,960
To import all. 
The and stuff. 

863
00:50:37,960 --> 00:50:42,840
Dang it, components. 
OK, so and it's oh, complaining 

864
00:50:42,840 --> 00:50:46,120
about the customers is. 
Actually a question I have. 

865
00:50:46,120 --> 00:50:48,760
So these are components. 
Where's what's the convention? 

866
00:50:48,760 --> 00:50:51,080
Just making a components folder 
in App? 

867
00:50:51,280 --> 00:50:54,120
Yeah it kind of depends. 
Like so you can put a a 

868
00:50:54,560 --> 00:50:58,240
components thing in the route 
directory and then you can 

869
00:50:58,240 --> 00:51:00,880
configure remix to just ignore 
it and not treat it like a 

870
00:51:00,880 --> 00:51:02,840
route. 
So you can Co locate components 

871
00:51:02,840 --> 00:51:06,520
if you want to. 
But thanks to the tilde alias 

872
00:51:06,520 --> 00:51:09,280
thing, it's actually not too 
terrible to just make a 

873
00:51:09,280 --> 00:51:12,560
components directory, especially
for smaller apps. 

874
00:51:12,560 --> 00:51:15,160
If you've got like a big app 
that's got like tons of sections

875
00:51:15,160 --> 00:51:17,920
and routes now I would probably 
Co locate those things. 

876
00:51:18,960 --> 00:51:22,920
But yeah, for something more 
simple, I I think I just put it 

877
00:51:22,920 --> 00:51:26,480
all in a components directory. 
So let's, let's fix all these 

878
00:51:26,480 --> 00:51:28,640
errors as we go. 
Line 7, you're going to want to 

879
00:51:28,640 --> 00:51:31,480
turn that into an object. 
Instead of just returning to 

880
00:51:31,480 --> 00:51:34,400
customers, you return an object 
that has a customer's property. 

881
00:51:34,920 --> 00:51:36,600
Now TypeScript is happy about 
that. 

882
00:51:37,120 --> 00:51:41,840
And then the NAV link that comes
from React Router or or Remix 

883
00:51:41,840 --> 00:51:44,120
run React. 
So on line 2 you can just add 

884
00:51:44,120 --> 00:51:51,720
NAV link. 
Sorry, it it it added to the use

885
00:51:51,720 --> 00:51:54,360
loader data import. 
Oh, I see. 

886
00:51:59,120 --> 00:52:01,960
Great, awesome. 
And then there I think it's just

887
00:52:01,960 --> 00:52:06,000
the one component that's left 
and you can just delete that or 

888
00:52:06,280 --> 00:52:08,080
yeah, just delete the file plus 
icon. 

889
00:52:08,080 --> 00:52:10,920
No, leave everything else. 
We want to create the new 

890
00:52:10,920 --> 00:52:15,040
customer eventually, but just 
so. 

891
00:52:15,280 --> 00:52:18,040
Oh, you mean yeah? 
Delete the icon component that 

892
00:52:18,040 --> 00:52:20,760
you don't have. 
I could give that to you, but I 

893
00:52:20,760 --> 00:52:23,240
don't think we need that for. 
What we're doing, it's just we 

894
00:52:23,240 --> 00:52:25,120
could throw an emoji in there or
something. 

895
00:52:26,160 --> 00:52:28,280
OK, so since there was an 
application error, you're not 

896
00:52:28,280 --> 00:52:31,840
going to get a refresh, so 
you'll hit reload and there you 

897
00:52:31,840 --> 00:52:34,840
go. 
So now you can click on each one

898
00:52:34,840 --> 00:52:39,160
of those and you'll see like it 
says, hey, not found. 

899
00:52:39,360 --> 00:52:41,680
This is because we don't have 
that route yet and we'll create 

900
00:52:41,680 --> 00:52:47,280
that here in a second. 
But yeah, each one of these is 

901
00:52:47,320 --> 00:52:48,960
coming from your Prisma 
database. 

902
00:52:48,960 --> 00:52:51,680
If you go create new customer, 
that route will go to customer 

903
00:52:51,680 --> 00:52:56,320
slash new. 
And let's go ahead and I I think

904
00:52:56,320 --> 00:53:00,880
we should create that that route
so we can see this nested 

905
00:53:00,880 --> 00:53:05,040
routing magic. 
So let's make under the routes 

906
00:53:05,040 --> 00:53:07,920
directory, you're gonna make a 
new directory with the same name

907
00:53:08,040 --> 00:53:14,000
as the the parent directory. 
So it's customers is the the 

908
00:53:14,000 --> 00:53:15,920
route, the parent route for the 
routes we want. 

909
00:53:16,080 --> 00:53:20,400
So customers is gonna be the 
name of the directory and then 

910
00:53:20,440 --> 00:53:21,760
just. 
Get thrown into. 

911
00:53:22,080 --> 00:53:25,120
There no, it will stay where 
it's at because it's the parent 

912
00:53:25,440 --> 00:53:29,000
layout route and then in the 
customers directory we're going 

913
00:53:29,000 --> 00:53:35,760
to make an index dot TSX and 
then here you're going to make 

914
00:53:36,040 --> 00:53:40,680
Oh yeah ignore that for now here
you're going to make a component

915
00:53:41,480 --> 00:53:45,400
so you'll export default 
function customers index if you 

916
00:53:45,400 --> 00:53:47,200
want to call it that actually, 
you know what maybe I should 

917
00:53:47,200 --> 00:53:51,720
just give this to you so we're 
not wasting our time there's not

918
00:53:51,720 --> 00:53:57,800
much to this one Oh yeah here, 
yeah we'll we'll I'll just give 

919
00:53:57,800 --> 00:54:00,000
all this to you and then we can 
talk about it 'cause it's kind 

920
00:54:00,000 --> 00:54:06,640
of cool so copy paste this into 
your the. 

921
00:54:07,720 --> 00:54:10,480
Just the second one. 
Actually you know what, hold on 

922
00:54:10,480 --> 00:54:13,520
a second, let me change that 
cause I've got user 

923
00:54:13,520 --> 00:54:16,120
authentication stuff in here and
we're we're skipping that user 

924
00:54:16,120 --> 00:54:18,600
off stuff. 
So let me fix this. 

925
00:54:22,360 --> 00:54:24,640
Oh, that first one was still the
other file. 

926
00:54:24,640 --> 00:54:27,400
Nevermind. 
OK, fixing this. 

927
00:54:30,440 --> 00:54:33,360
OK, so you want the one that has
you don't have any customers 

928
00:54:34,440 --> 00:54:38,200
with a thawing emoji. 
There we go. 

929
00:54:38,200 --> 00:54:40,320
All right, sweet. 
Save that and then go ahead and 

930
00:54:40,320 --> 00:54:43,920
reload again the error. 
Oh, right. 

931
00:54:44,560 --> 00:54:51,520
So go to flash customers. 
Oh yes, well, I'll explain why 

932
00:54:51,520 --> 00:54:52,960
this is happening here in just a
second. 

933
00:54:52,960 --> 00:54:58,360
Let me give you one other thing.
And I'm trying to just make sure

934
00:54:58,360 --> 00:55:01,040
I'm not giving you more stuff 
than we've talked about already.

935
00:55:01,680 --> 00:55:03,160
So we're. 
Going are we confusing the 

936
00:55:03,160 --> 00:55:07,720
router because we have a route 
of customers and an index route 

937
00:55:07,760 --> 00:55:09,520
of customers? 
No, no. 

938
00:55:09,520 --> 00:55:11,160
I'll explain it here in just a 
second. 

939
00:55:11,720 --> 00:55:18,080
OK, so this should work. 
I'm gotta like remove all of the

940
00:55:18,080 --> 00:55:19,720
features that we haven't talked 
about yet. 

941
00:55:21,600 --> 00:55:26,360
OK, I think we'll get rid of 
that also. 

942
00:55:28,360 --> 00:55:31,280
OK, cool. 
So I'll copy that and give this 

943
00:55:31,280 --> 00:55:40,890
to you. 
OK so copy this into a new file 

944
00:55:41,050 --> 00:55:47,730
under customers called dollar 
sign customer ID camel case dot 

945
00:55:47,730 --> 00:55:52,640
TSX. 
Customer ID like that PSX. 

946
00:55:53,440 --> 00:55:55,160
Yep. 
OK. 

947
00:55:55,560 --> 00:55:59,760
And then paste that in there. 
What the devil? 

948
00:55:59,760 --> 00:56:02,680
Why is it complaining? 
Oh, it just it just needed a 

949
00:56:02,680 --> 00:56:05,080
second to it's complaining about
this though. 

950
00:56:05,080 --> 00:56:06,400
Oh. 
Currency formatter. 

951
00:56:07,360 --> 00:56:08,720
Good grief. 
What is that used for? 

952
00:56:11,360 --> 00:56:14,880
Yeah, OK, go down to line or to 
where that's being used. 

953
00:56:14,880 --> 00:56:16,760
We're going to just delete it. 
We don't need the currency 

954
00:56:16,760 --> 00:56:17,800
formatted. 
Oh, OK. 

955
00:56:19,040 --> 00:56:22,080
Or you know what, may as well 
may as well let's I'll just give

956
00:56:22,080 --> 00:56:24,920
you the currency formatter 
because you've got the utils 

957
00:56:24,920 --> 00:56:30,040
file already. 
So here is the currency 

958
00:56:30,040 --> 00:56:36,200
formatter and that you just put 
in the utils dot TS file. 

959
00:56:36,720 --> 00:56:43,600
Just stick it at the bottom. 
OK, well, and these are just. 

960
00:56:43,680 --> 00:56:44,840
Not being used? 
Yep. 

961
00:56:46,480 --> 00:56:50,000
So save that and then refresh 
and we should see. 

962
00:56:50,000 --> 00:56:52,160
Now see something? 
No. 

963
00:56:52,560 --> 00:56:58,920
What the devil? 
Oh, it's. 

964
00:57:00,400 --> 00:57:03,080
I see like it's doing something 
here with the route. 

965
00:57:03,600 --> 00:57:05,520
I'll I'll explain what's 
happening then we can debug it 

966
00:57:05,520 --> 00:57:09,360
together. 
So if you go to the index TSX 

967
00:57:09,360 --> 00:57:14,040
file in the customers, you'll 
see the loader there. 

968
00:57:14,520 --> 00:57:17,840
It's the first thing it does is 
it does get first customer. 

969
00:57:18,080 --> 00:57:20,640
If there's not a first customer,
then we'll just return Jason 

970
00:57:21,920 --> 00:57:25,080
empty and then you'll render you
don't have any customers Sabi 

971
00:57:25,080 --> 00:57:26,720
face. 
But if there is the first 

972
00:57:26,720 --> 00:57:29,640
customer like I, I'm guessing 
you're probably going to want to

973
00:57:29,640 --> 00:57:32,280
select a customer. 
You don't need to see like a 

974
00:57:32,280 --> 00:57:33,880
message that says select your 
customer. 

975
00:57:35,360 --> 00:57:36,680
Actually, I think I might know 
what's going on. 

976
00:57:37,160 --> 00:57:39,480
So if there is a first customer,
then we're going to redirect to 

977
00:57:39,480 --> 00:57:41,480
that first customer. 
So that's why you can't get to 

978
00:57:41,480 --> 00:57:43,880
slash customers. 
It's because we're just gonna 

979
00:57:43,920 --> 00:57:46,520
like, we're gonna assume you're 
gonna wanna select a customer. 

980
00:57:46,520 --> 00:57:48,200
So we may as well just like the 
first one for you. 

981
00:57:49,640 --> 00:57:51,680
And this this will make more 
sense when it actually starts 

982
00:57:51,680 --> 00:57:53,000
working too. 
OK. 

983
00:57:53,720 --> 00:57:56,840
So if. 
I see what's causing the 

984
00:57:56,840 --> 00:57:59,040
redirect though. 
Is this line here? 

985
00:57:59,280 --> 00:58:01,880
Yeah. 
OK, and that that again is just 

986
00:58:01,880 --> 00:58:05,640
a a helper function from remix 
that creates a new response. 

987
00:58:06,480 --> 00:58:10,680
So you could literally just say 
return new response null and 

988
00:58:10,680 --> 00:58:14,440
then give the header's location 
and it is whatever that is. 

989
00:58:14,440 --> 00:58:17,480
So there's not like a bunch of 
magic weirdness going on here. 

990
00:58:17,480 --> 00:58:21,160
This is all just platform stuff,
which is some helper APIs. 

991
00:58:22,920 --> 00:58:28,280
OK, so the I I'm a little 
baffled by why we're getting a 

992
00:58:28,280 --> 00:58:35,000
404 not found if you go to 
customer ID that route. 

993
00:58:35,000 --> 00:58:36,680
Oh, shoot, yeah. 
And I forgot to. 

994
00:58:36,800 --> 00:58:40,960
You can Dang it. 
Yeah, See my my code is a little

995
00:58:40,960 --> 00:58:43,680
older and it still has like 
older TypeScript stuff that we 

996
00:58:43,680 --> 00:58:45,200
used to have to do. 
And now you don't have to do 

997
00:58:45,200 --> 00:58:48,600
that anymore. 
So stuff on line seven through 

998
00:58:48,600 --> 00:58:50,080
10, you can just delete all of 
that. 

999
00:58:50,680 --> 00:58:52,400
This. 
Whole thing, yeah, just that 

1000
00:58:52,400 --> 00:58:56,640
whole block. 
And then you'll go to line 16 

1001
00:58:56,640 --> 00:59:00,360
and delete that loader data 
thing, everything between 

1002
00:59:00,360 --> 00:59:05,480
carrots inclusive. 
And then on line 24, you can add

1003
00:59:05,480 --> 00:59:11,720
the type of loader data or type 
of loader that we had before and

1004
00:59:11,720 --> 00:59:15,840
then delete the add loader data.
This is way better than it used 

1005
00:59:15,840 --> 00:59:19,880
to be. 
OK, so my guess is, so we are 

1006
00:59:19,880 --> 00:59:24,640
getting, if you save this here, 
you know what, it's very 

1007
00:59:24,640 --> 00:59:28,320
possible that this 404 is coming
from our loader. 

1008
00:59:28,760 --> 00:59:31,360
And So what we're gonna do is 
I'm gonna teach you a new thing 

1009
00:59:32,600 --> 00:59:36,040
for error handling so we get 
more useful error. 

1010
00:59:36,320 --> 00:59:37,960
So this is called a catch 
boundary. 

1011
00:59:38,720 --> 00:59:41,520
And you'll stick this at the 
bottom of that customer ID 

1012
00:59:41,520 --> 00:59:45,600
route. 
And it's just a function that 

1013
00:59:45,600 --> 00:59:48,360
you export called catch 
boundary. 

1014
00:59:48,360 --> 00:59:51,640
And if you save that and then go
and refresh, let's see what 

1015
00:59:51,640 --> 00:59:53,960
happens. 
Yeah, it's still. 

1016
00:59:54,040 --> 00:59:56,200
It's what that is saying is that
there's no. 

1017
00:59:56,600 --> 01:00:00,240
Mentioning an outlet. 
Yeah, we are missing an outlet, 

1018
01:00:00,240 --> 01:00:02,280
but that still shouldn't. 
But maybe it is. 

1019
01:00:03,160 --> 01:00:05,560
Go to, go to the customers file 
and we'll just add that really 

1020
01:00:05,560 --> 01:00:08,560
quick. 
OK, the customers dot TSX. 

1021
01:00:09,000 --> 01:00:16,720
And then Scroll down to where we
have the dot to do with a 

1022
01:00:16,720 --> 01:00:20,000
component called outlet that 
comes from Remix run React. 

1023
01:00:22,920 --> 01:00:25,000
Is it self closing? 
That's the one. 

1024
01:00:25,080 --> 01:00:31,680
Yep, and save that. 
It's not importing it. 

1025
01:00:32,400 --> 01:00:34,440
It's coming from Remix. 
Run React, you said. 

1026
01:00:34,800 --> 01:00:39,360
Just add it to the import online
too, OK? 

1027
01:00:40,640 --> 01:00:42,640
Yeah, so it's still not. 
That is so weird. 

1028
01:00:42,640 --> 01:00:46,040
I don't maybe restart the server
that that would be very unusual.

1029
01:00:46,240 --> 01:00:48,160
You should not have to restart 
the server for this. 

1030
01:00:54,440 --> 01:00:57,040
Yeah, still. 
OK, so this is what we're going 

1031
01:00:57,040 --> 01:01:00,360
to do now. 
We're going to debug the oh, oh,

1032
01:01:00,600 --> 01:01:03,120
I know what it is. 
We're redirecting to slash 

1033
01:01:03,120 --> 01:01:05,240
sales. 
Sales and customers, yeah. 

1034
01:01:05,680 --> 01:01:08,520
In in the finished app, the 
customers is actually a subroute

1035
01:01:08,520 --> 01:01:12,080
of sales. 
So in this file we need to take 

1036
01:01:12,080 --> 01:01:14,520
this out. 
Yes, thank you. 

1037
01:01:14,520 --> 01:01:17,640
And then get the sales out of 
there. 

1038
01:01:19,200 --> 01:01:21,920
Oh come on, not Twitter. 
Let's go to Twitter. 

1039
01:01:21,920 --> 01:01:24,120
Yeah. 
Let's just take a break and go 

1040
01:01:24,280 --> 01:01:26,080
to Twitter. 
There we go. 

1041
01:01:26,080 --> 01:01:29,280
OK, Oh my gosh. 
What a pain that was. 

1042
01:01:29,480 --> 01:01:32,440
OK, so now you can you can 
select between these different 

1043
01:01:33,280 --> 01:01:37,080
different customers and see how 
that get all gets updated. 

1044
01:01:38,520 --> 01:01:41,240
So I want to call out a couple 
of things here. 

1045
01:01:41,360 --> 01:01:43,600
First, I want to I want to talk 
about that catch boundary that 

1046
01:01:43,600 --> 01:01:45,920
we added because we added it, I 
want to get it out of the way. 

1047
01:01:45,920 --> 01:01:50,600
So if you update the URL in just
in the URL bar, just change it 

1048
01:01:50,600 --> 01:01:52,600
to some some nonsense for the 
ID. 

1049
01:01:54,080 --> 01:01:56,640
Now you're going to see no 
customer found with the ID of 

1050
01:01:56,880 --> 01:02:00,480
whatever. 
So now if you go to customer ID 

1051
01:02:00,480 --> 01:02:02,360
and let's look at that catch 
boundary for a SEC. 

1052
01:02:04,200 --> 01:02:08,080
So this is just saying or 
actually before we look at the 

1053
01:02:08,080 --> 01:02:09,920
catch boundary, go to the loader
above. 

1054
01:02:12,080 --> 01:02:15,240
This is responsible for loading 
the data based on that customer.

1055
01:02:15,240 --> 01:02:18,360
So you'll see on line 7 it's 
accepting params. 

1056
01:02:19,080 --> 01:02:25,800
This is because we are using a 
dynamic route param route name 

1057
01:02:25,840 --> 01:02:29,960
with the dollar sign. 
It's saying OK, so anything that

1058
01:02:31,080 --> 01:02:34,000
that would be along in this 
segment of the URL, I'm going to

1059
01:02:34,000 --> 01:02:37,360
call customer ID and I will pass
that to your loader. 

1060
01:02:37,960 --> 01:02:40,160
And it's also accessible in your
components through the use 

1061
01:02:40,160 --> 01:02:44,520
params hook. 
And so then you can do whatever 

1062
01:02:44,520 --> 01:02:46,640
dynamic thing you need to do for
this. 

1063
01:02:46,640 --> 01:02:50,480
And so we're getting the 
customer ID out of params. 

1064
01:02:50,720 --> 01:02:53,160
And yes, this should be 
unpossible. 

1065
01:02:53,440 --> 01:02:57,240
That is intentional. 
You gotta chuckle a little bit. 

1066
01:02:57,960 --> 01:03:01,480
I'm talking about line 10. 
But yeah, so then we say, hey, 

1067
01:03:01,480 --> 01:03:05,960
get me the customer details for 
this customer ID on line 12. 

1068
01:03:06,120 --> 01:03:09,200
And if there are no customer 
details, then we are throwing a 

1069
01:03:09,200 --> 01:03:13,120
new response. 
So that this action of throwing 

1070
01:03:13,120 --> 01:03:16,280
a response is saying, hey, I 
don't want the rest of this to 

1071
01:03:16,280 --> 01:03:18,800
execute because like, it's 
nonsense. 

1072
01:03:18,800 --> 01:03:22,120
We're in a, an error state. 
Something is not right. 

1073
01:03:22,920 --> 01:03:26,080
So we're gonna stop execution. 
So we're gonna throw and Remix 

1074
01:03:26,080 --> 01:03:28,520
is gonna catch that and it's 
gonna say, are you a response? 

1075
01:03:28,520 --> 01:03:31,280
Oh, yes, you are. 
So I will actually render your 

1076
01:03:31,280 --> 01:03:34,680
catch boundary instead. 
And so it won't even get into 

1077
01:03:34,680 --> 01:03:37,040
your default export. 
It will just go straight to the 

1078
01:03:37,040 --> 01:03:39,720
catch boundary where you can 
say, OK, So what was the thing 

1079
01:03:39,720 --> 01:03:42,120
that was thrown? 
What's the response? 

1080
01:03:42,120 --> 01:03:44,080
What's that status? 
Oh, it's a four O 4. 

1081
01:03:44,240 --> 01:03:45,360
I know what to do with the four 
O 4. 

1082
01:03:45,360 --> 01:03:47,120
I'm going to say they didn't 
have a customer found. 

1083
01:03:47,920 --> 01:03:52,080
So you mentioned that those 
params are being used over here,

1084
01:03:52,080 --> 01:03:55,280
which is why we're able to get 
these nested dynamic routes in 

1085
01:03:55,320 --> 01:03:57,520
the same route. 
Yes. 

1086
01:03:57,520 --> 01:04:02,120
So that outlet component that 
you added is saying hey I am a 

1087
01:04:02,120 --> 01:04:06,080
parent route, I'm a I'm a layout
route and if I have any children

1088
01:04:06,120 --> 01:04:09,680
this is where they go. 
OK, so that's like a slot in 

1089
01:04:09,680 --> 01:04:13,720
spell I'm trying to make my. 
Slot in spell or or in the it's 

1090
01:04:13,720 --> 01:04:18,960
transclusion in angular JS it's 
the the children prop in in 

1091
01:04:18,960 --> 01:04:22,880
React. 
So just just for everybody else,

1092
01:04:22,880 --> 01:04:26,080
when they when you catch that 
and do a 404, that's almost like

1093
01:04:26,080 --> 01:04:30,160
no JS having a response of 
status 404. 

1094
01:04:30,800 --> 01:04:32,360
Yeah. 
So if you look back at the 

1095
01:04:32,360 --> 01:04:35,840
customer ID and look in the 
loader at the throne response, 

1096
01:04:37,080 --> 01:04:38,760
I'm the one who creates that 
response. 

1097
01:04:38,760 --> 01:04:41,760
So I set the status to 404. 
I could set it to whatever I 

1098
01:04:41,760 --> 01:04:45,560
want and then my catch boundary 
can handle that however I like. 

1099
01:04:45,840 --> 01:04:48,360
We also have all happening 
server side. 

1100
01:04:48,720 --> 01:04:50,040
What? 
Happened to be very like a 

1101
01:04:50,040 --> 01:04:51,760
different. 
Yeah, it just breaks if you 

1102
01:04:51,800 --> 01:04:52,880
throw. 
Yeah. 

1103
01:04:53,080 --> 01:04:54,480
Cool. 
Well, so and you could handle 

1104
01:04:54,480 --> 01:04:58,720
that as well if you wanted to. 
So, yeah, you just have it be 

1105
01:04:58,720 --> 01:05:00,320
whatever you want. 
The most sensible thing is a 

1106
01:05:00,320 --> 01:05:03,040
four O 4. 
This will be an actual four O 4.

1107
01:05:03,040 --> 01:05:05,880
So like a user lands on this 
page, they're getting a four O 4

1108
01:05:05,880 --> 01:05:08,440
status code. 
Their browser will be like, hey,

1109
01:05:08,440 --> 01:05:09,720
this, you know, couldn't find 
it. 

1110
01:05:09,720 --> 01:05:12,560
Do you want me to use a cache 
version or Google will do the 

1111
01:05:12,560 --> 01:05:16,040
same? 
And so like status codes 

1112
01:05:16,040 --> 01:05:18,520
actually matter. 
I, I don't know, like we kind of

1113
01:05:18,520 --> 01:05:20,760
got into this thing where 
everything's a 200. 

1114
01:05:21,200 --> 01:05:25,080
It's not. 
So yeah, so that's what's. 

1115
01:05:25,720 --> 01:05:31,400
Going on. 
It's not OK yeah exactly. 

1116
01:05:31,560 --> 01:05:34,600
So yeah throwing a response, you
could throw a 200 if you want to

1117
01:05:35,200 --> 01:05:39,080
throwing basically just says I 
want this to go into my into my 

1118
01:05:39,080 --> 01:05:41,360
catch boundary. 
So that didn't work because our 

1119
01:05:41,360 --> 01:05:43,840
catch boundary is only handling 
4 O fours. 

1120
01:05:43,840 --> 01:05:46,560
If you go down to the catch 
boundary, we just have an F that

1121
01:05:46,560 --> 01:05:51,120
says if it's not a four O 4 then
just throw an error because I I 

1122
01:05:51,120 --> 01:05:52,840
was not programmed to handle 
this case. 

1123
01:05:53,440 --> 01:05:56,440
But yeah. 
So if if you go to a nonsensical

1124
01:05:56,640 --> 01:06:01,040
ID now, it still works. 
It's the same thing, yeah, but. 

1125
01:06:01,080 --> 01:06:04,400
The browser is going to behave 
differently in caching and all 

1126
01:06:04,400 --> 01:06:05,880
that too. 
So yes. 

1127
01:06:06,560 --> 01:06:09,440
So yeah, there you go. 
We got a little exploration and 

1128
01:06:09,560 --> 01:06:12,880
error handling and making sure 
our routes are correctly 

1129
01:06:13,160 --> 01:06:19,240
configured. 
So let's see yeah. 

1130
01:06:19,240 --> 01:06:23,000
The other thing is I I wish that
we had more time today because 

1131
01:06:23,960 --> 01:06:27,360
it would be pretty cool to talk 
about like how awesome this 

1132
01:06:27,360 --> 01:06:33,520
nested routing is. 
Because in a, a larger 

1133
01:06:33,520 --> 01:06:36,680
application where you've got 
like dozens of people working on

1134
01:06:36,680 --> 01:06:40,360
your app, you will have like the
shell of the app, the header, 

1135
01:06:40,360 --> 01:06:44,560
the footer, maybe a left NAV. 
And you've got like big 

1136
01:06:44,560 --> 01:06:46,400
companies I've worked at. 
There are teams that are 

1137
01:06:46,400 --> 01:06:49,520
responsible for that entire 
experience, like the, the 

1138
01:06:49,520 --> 01:06:52,880
header, footer and left NAV or a
team responsible for the header,

1139
01:06:52,880 --> 01:06:54,960
A-Team for the footer and a team
for the left net. 

1140
01:06:54,960 --> 01:06:58,800
Like just really big, you know, 
many teams working on all of 

1141
01:06:58,800 --> 01:07:01,560
this. 
And without nested routing, 

1142
01:07:02,560 --> 01:07:05,200
that's a really difficult thing 
to coordinate. 

1143
01:07:05,240 --> 01:07:07,360
And now you're starting to talk 
about micro front ends. 

1144
01:07:07,360 --> 01:07:09,840
And that's what I was just going
to say. 

1145
01:07:10,440 --> 01:07:15,840
So with Remix, if you actually 
if you want to share the screen 

1146
01:07:15,840 --> 01:07:18,960
again, we'll go to the customers
dot TSX. 

1147
01:07:19,680 --> 01:07:22,600
And I will, I will say we have, 
I mean, if you want to go for 

1148
01:07:22,600 --> 01:07:24,120
another hour, it's up to you. 
Yeah. 

1149
01:07:24,280 --> 01:07:26,560
Yeah. 
Time, but I want to spend time 

1150
01:07:26,560 --> 01:07:29,960
in in mutations. 
So this is this will account for

1151
01:07:29,960 --> 01:07:34,000
purposes, I think well, the 
customers here, this is 

1152
01:07:34,000 --> 01:07:36,600
responsible for everything you 
see on the left of the screen, 

1153
01:07:36,600 --> 01:07:39,040
create new customer, the list of
customers, all of that. 

1154
01:07:39,480 --> 01:07:42,400
And there's nothing in here that
cares anything about the 

1155
01:07:42,400 --> 01:07:46,440
children other than where they 
go, which I think is is 

1156
01:07:46,880 --> 01:07:49,840
sufficient level of power for 
this parent, right? 

1157
01:07:50,200 --> 01:07:53,160
Says if I have children, this is
where they're going to go. 

1158
01:07:53,400 --> 01:07:59,600
And then the customer ID, if you
go to the customer ID route and 

1159
01:07:59,600 --> 01:08:03,160
the in this component, there is 
nothing in here that says 

1160
01:08:03,160 --> 01:08:05,880
anything about its parent. 
It doesn't know anything about 

1161
01:08:05,880 --> 01:08:07,320
the parent. 
It doesn't care about the 

1162
01:08:07,320 --> 01:08:08,600
parent. 
It's not passing prompts, it's 

1163
01:08:08,600 --> 01:08:12,120
not loading data, it's not doing
any of that stuff for the 

1164
01:08:12,120 --> 01:08:13,400
parent. 
This is really. 

1165
01:08:14,080 --> 01:08:15,960
Yeah, it's just. 
It's just because the folder 

1166
01:08:15,960 --> 01:08:21,080
structure is called customers. 
So that the association is 

1167
01:08:21,080 --> 01:08:24,040
created because of that. 
So like Remix, the remix 

1168
01:08:24,040 --> 01:08:28,040
convention creates the routes 
based on that folder structure, 

1169
01:08:28,479 --> 01:08:33,800
but but the key here and, and so
this would apply the same with 

1170
01:08:34,040 --> 01:08:38,160
with Remix router without like 
Remix server and, and this 

1171
01:08:38,319 --> 01:08:42,840
folder convention, the the fact 
the the key is that it's nested 

1172
01:08:42,840 --> 01:08:44,880
routing. 
And so what's really great about

1173
01:08:44,880 --> 01:08:49,040
this is the customer ID route 
doesn't know anything about its 

1174
01:08:49,040 --> 01:08:51,720
parent and the parent doesn't 
know anything about the child. 

1175
01:08:51,920 --> 01:08:56,479
And so you have two teams who 
are responsible for like one 

1176
01:08:56,479 --> 01:08:59,279
team's responsible for the shell
and another team's responsible 

1177
01:08:59,279 --> 01:09:02,600
for a piece of the app and. 
I'm sorry, I'm laughing at the 

1178
01:09:02,600 --> 01:09:04,880
people in the chat. 
There's sounds like a rebellious

1179
01:09:04,880 --> 01:09:08,479
team not caring about. 
The That's right, we don't care.

1180
01:09:08,479 --> 01:09:09,600
We. 
Don't care. 

1181
01:09:10,120 --> 01:09:13,680
Now, yeah, so and the parent 
doesn't care about the child 

1182
01:09:13,680 --> 01:09:14,960
either. 
They they're negligent. 

1183
01:09:16,760 --> 01:09:20,479
But this, this, this makes like 
this is significant because. 

1184
01:09:20,479 --> 01:09:22,080
It really. 
Is that's you don't need 

1185
01:09:22,080 --> 01:09:24,520
coordination. 
So who needs a micro front end? 

1186
01:09:25,800 --> 01:09:29,560
The the only reason left to do a
microfront end when you're using

1187
01:09:29,560 --> 01:09:33,120
Remix is if you want to have 
independent deployability, you 

1188
01:09:33,120 --> 01:09:35,120
want to deploy separately from 
each other. 

1189
01:09:35,120 --> 01:09:40,040
OK, I still don't quite 
understand why, but if that's 

1190
01:09:40,040 --> 01:09:44,000
what you want, then yeah, still.
Microfront really see the value 

1191
01:09:44,000 --> 01:09:47,040
in this because you're like you 
said, you're not passing data 

1192
01:09:47,040 --> 01:09:49,640
from the parent to the child the
child isn't giving. 

1193
01:09:50,000 --> 01:09:53,160
I mean it is giving data to the 
parent but it the parent doesn't

1194
01:09:53,160 --> 01:09:55,040
know about it. 
Yeah, like. 

1195
01:09:55,040 --> 01:09:57,200
It all lives in this other file.
Yeah. 

1196
01:09:57,840 --> 01:10:01,400
Are you are you passing way less
props like for all of this? 

1197
01:10:01,760 --> 01:10:02,840
Like you don't. 
Have to do props. 

1198
01:10:03,280 --> 01:10:06,600
Yeah, it's, it's kind of crazy. 
So you don't need provider, you 

1199
01:10:06,600 --> 01:10:08,720
don't need like I'm trying to 
rehash all that. 

1200
01:10:08,800 --> 01:10:09,880
Yeah, I. 
Think you're basically. 

1201
01:10:10,120 --> 01:10:14,200
Don't use context except for 
like if you have a component 

1202
01:10:14,200 --> 01:10:16,400
library that's like a a menu 
thing, you're probably going to 

1203
01:10:16,400 --> 01:10:18,560
have context for those compound 
components and stuff. 

1204
01:10:18,840 --> 01:10:21,960
But that like that's easy. 
Like, yeah, yeah, simple stuff. 

1205
01:10:22,200 --> 01:10:24,080
Or we're talking about 
application state management, 

1206
01:10:24,440 --> 01:10:27,120
There's there's nothing we 
haven't used use state yet. 

1207
01:10:27,560 --> 01:10:30,160
I know I I'm like blown away so 
far. 

1208
01:10:30,920 --> 01:10:32,480
Yeah. 
And we haven't even gotten into 

1209
01:10:32,480 --> 01:10:35,200
the really cool part, which is 
mutations, which I think we'll 

1210
01:10:35,200 --> 01:10:38,360
get into next. 
So if you go to create new 

1211
01:10:38,360 --> 01:10:40,680
customer, click on that, I think
we'll actually get our catch 

1212
01:10:40,680 --> 01:10:42,600
boundary because we don't have 
our new TSX. 

1213
01:10:42,600 --> 01:10:45,240
Yet I'm sorry, create new. 
Customer in in the app, if you 

1214
01:10:45,240 --> 01:10:48,120
click on create new customer at.
The top Oh, I gotcha, OK. 

1215
01:10:48,200 --> 01:10:51,440
So no customer at the idea of 
new, there is never going to be 

1216
01:10:51,440 --> 01:10:54,200
a customer with the idea of new.
We want customer slash new to 

1217
01:10:54,200 --> 01:10:59,320
show us a customer form. 
So let me again go through this 

1218
01:10:59,320 --> 01:11:04,120
and delete stuff that we are not
going to be using for what we're

1219
01:11:04,120 --> 01:11:07,560
doing here actually and I won't 
give you the action yet either. 

1220
01:11:09,880 --> 01:11:16,400
So let me just whoops that. 
I actually really like how 

1221
01:11:16,440 --> 01:11:19,640
Kent's like, piece mealing this,
like we don't get lost in all of

1222
01:11:19,640 --> 01:11:22,240
it. 
Yeah, I I'm hoping that this is 

1223
01:11:22,240 --> 01:11:24,800
this is helpful. 
I think this is great. 

1224
01:11:25,800 --> 01:11:29,360
I think this is really breaking 
it down actually, without having

1225
01:11:29,360 --> 01:11:31,520
to code all of this. 
And it looks nice because you've

1226
01:11:31,520 --> 01:11:33,160
got the Tailwind stuff in there.
I I. 

1227
01:11:33,160 --> 01:11:35,720
Have to be like fully honest 
with you can't like I've I've 

1228
01:11:35,720 --> 01:11:37,560
gone through all the remix and 
like checked it out. 

1229
01:11:37,560 --> 01:11:39,360
I'm like why is this any better 
than next? 

1230
01:11:39,360 --> 01:11:41,080
But now things are starting to 
finally. 

1231
01:11:41,080 --> 01:11:44,000
Like you've got to use it. 
I'm like, oh, I see. 

1232
01:11:44,000 --> 01:11:45,280
Oh, I see. 
Yeah. 

1233
01:11:45,760 --> 01:11:46,360
So this. 
File. 

1234
01:11:46,400 --> 01:11:49,640
I shouldn't say better or worse.
This just this file that I I 

1235
01:11:49,640 --> 01:11:56,560
sent you put it in just in the 
the app directory just like next

1236
01:11:56,600 --> 01:12:00,680
to DB dot server. 
OK, Yeah, sweet. 

1237
01:12:00,760 --> 01:12:02,160
OK. 
So you're going to need that for

1238
01:12:02,160 --> 01:12:07,000
a couple of the just just. 
Updating there, I think 

1239
01:12:07,000 --> 01:12:11,040
everything's good. 
Here we go. 

1240
01:12:11,120 --> 01:12:14,280
And so this is our the new 
customer route. 

1241
01:12:14,280 --> 01:12:18,160
So you'll put this in customers 
slash new dot TSX. 

1242
01:12:23,800 --> 01:12:29,760
So in the customers directory a 
new file and you said. 

1243
01:12:30,280 --> 01:12:38,400
Customers. 
New dot TSX Yep, get mad at me. 

1244
01:12:40,720 --> 01:12:43,000
OK, now we have the form. 
Sweet. 

1245
01:12:43,240 --> 01:12:44,760
And it looks nice. 
Thanks, Tailwind. 

1246
01:12:44,800 --> 01:12:46,520
Yes. 
Tailwind. 

1247
01:12:46,640 --> 01:12:51,800
Love it. 
OK, so now if you were to to 

1248
01:12:51,800 --> 01:12:54,840
fill this out and everything hit
create customer, it's going to 

1249
01:12:54,840 --> 01:12:57,520
make a a fetch request and it's 
yeah, it's going to say four or 

1250
01:12:57,520 --> 01:12:58,960
five. 
I'm not allowed because we're 

1251
01:12:58,960 --> 01:13:05,480
not actually handling the any 
POST requests to this particular

1252
01:13:05,480 --> 01:13:09,800
URL. 
So, so if you go to look at the 

1253
01:13:09,800 --> 01:13:11,360
code here, we'll look at that 
form. 

1254
01:13:13,000 --> 01:13:17,640
The form has a method of post. 
This is very reminiscent of the 

1255
01:13:17,640 --> 01:13:20,640
good old days of the web. 
You could actually, you know 

1256
01:13:20,640 --> 01:13:22,800
what, just for fun, let's 
lowercase that form. 

1257
01:13:23,040 --> 01:13:26,680
So don't use the component, use 
a lowercase F So just a regular 

1258
01:13:26,680 --> 01:13:28,640
form. 
Not from form. 

1259
01:13:28,880 --> 01:13:31,280
I do that all the time and did 
it. 

1260
01:13:31,280 --> 01:13:34,520
It didn't update this one OK. 
Great comment from Mark here. 

1261
01:13:34,720 --> 01:13:37,680
OK, so this is just an HTML form
now. 

1262
01:13:39,400 --> 01:13:42,040
Yes, just a regular HTLHTML 
form. 

1263
01:13:42,040 --> 01:13:45,680
You're still going to get a 405 
because we aren't handling this.

1264
01:13:45,960 --> 01:13:48,000
So we've talked about loading 
data. 

1265
01:13:49,200 --> 01:13:53,160
Now we want to talk about making
changes to data. 

1266
01:13:53,560 --> 01:13:56,520
OK, so we're going to make a 
action function. 

1267
01:13:56,920 --> 01:14:00,240
So you'll notice on the form 
there's that prompt called or 

1268
01:14:00,520 --> 01:14:03,400
there is a prop you can provide 
to a form called action. 

1269
01:14:03,720 --> 01:14:10,040
That action prop specifies where
you want the POST request to go.

1270
01:14:10,040 --> 01:14:13,520
So you want it to go to the root
direct route right now, or you 

1271
01:14:13,520 --> 01:14:15,760
want it to go to slash, API 
slash, whatever. 

1272
01:14:16,160 --> 01:14:19,400
For us, we want it to go to the 
current URL, right? 

1273
01:14:19,400 --> 01:14:22,840
And that's the default. 
So when you make a form and you 

1274
01:14:22,840 --> 01:14:26,280
don't provide an action, then 
it's going to make a request to 

1275
01:14:26,280 --> 01:14:28,120
the current route. 
If you don't provide a method, 

1276
01:14:28,120 --> 01:14:31,160
that request will be a GET and 
it will serialize the form 

1277
01:14:31,480 --> 01:14:35,320
values in the URL. 
Here we're saying we want this 

1278
01:14:35,320 --> 01:14:36,920
to be serialized in the POST 
body. 

1279
01:14:36,920 --> 01:14:40,600
So let's do method POST. 
With a regular form, you only 

1280
01:14:40,600 --> 01:14:42,400
have two options. 
It's either GET or POST. 

1281
01:14:42,560 --> 01:14:45,120
You can't do DELETE, you can't 
do PUT, You can't do any of that

1282
01:14:45,720 --> 01:14:48,440
with a regular form. 
With the uppercase form, you 

1283
01:14:48,440 --> 01:14:56,120
can, but I recommend just do 
just do the regular post because

1284
01:14:56,120 --> 01:15:00,040
that is progressive enhancement 
magic, which is is nice. 

1285
01:15:00,040 --> 01:15:02,880
So it'll work whether or not 
JavaScript is on the page. 

1286
01:15:04,840 --> 01:15:06,760
So and we can demonstrate that 
later. 

1287
01:15:06,760 --> 01:15:10,280
So if you go into line three, 
we're going to add a function to

1288
01:15:10,280 --> 01:15:13,960
this and it is called action and
it's very similar to a loader. 

1289
01:15:13,960 --> 01:15:15,360
So you have to export. 
It. 

1290
01:15:15,880 --> 01:15:23,880
Yep, export async function 
action and then this one we 

1291
01:15:23,880 --> 01:15:27,000
actually need to get something. 
Yeah, No thanks. 

1292
01:15:27,160 --> 01:15:33,760
Not that. 
We want to get a something from 

1293
01:15:33,760 --> 01:15:37,920
the request right 'cause now the
request has our form stuff. 

1294
01:15:37,920 --> 01:15:41,800
In fact here. 
Comment that out for now or or 

1295
01:15:41,800 --> 01:15:44,080
don't save the file. 
Go back to the browser and open 

1296
01:15:44,080 --> 01:15:51,640
the dev tools Yeah on new Yep, 
there we go and then if you type

1297
01:15:51,640 --> 01:15:57,600
in fill in or or go to the 
network tab start, we want to 

1298
01:15:58,440 --> 01:16:01,920
record what's going on in here. 
Don't in Firefox you gotta. 

1299
01:16:02,360 --> 01:16:07,000
Yeah, there we go, this. 1. 
Is that how? 

1300
01:16:07,160 --> 01:16:08,760
How does Firefox do? 
How do you do? 

1301
01:16:08,760 --> 01:16:10,560
That I I can I can open it in 
Chrome. 

1302
01:16:10,560 --> 01:16:12,680
I had it in. 
Chrome earlier and I think it'll

1303
01:16:12,680 --> 01:16:13,680
work. 
If you just click create 

1304
01:16:13,680 --> 01:16:15,680
customer, I think we will see 
the request. 

1305
01:16:15,760 --> 01:16:19,080
OK, no. 
No, no dice. 

1306
01:16:19,160 --> 01:16:20,880
Came into there. 
Huh. 

1307
01:16:20,880 --> 01:16:23,280
That's weird. 
Yeah. 

1308
01:16:23,280 --> 01:16:26,080
How do you do? 
OK, you can open up up in 

1309
01:16:26,080 --> 01:16:27,920
Chrome. 
I don't know how to use Firefox.

1310
01:16:27,920 --> 01:16:32,120
I don't. 
I like the same as tools. 

1311
01:16:32,280 --> 01:16:34,120
No I'm not. 
There are lots of people that 

1312
01:16:34,120 --> 01:16:35,840
use Firefox. 
Thank you very much. 

1313
01:16:36,960 --> 01:16:39,400
What were we at Slash? 
Customers slash new. 

1314
01:16:40,760 --> 01:16:42,880
New. 
Oh wow, what did I do? 

1315
01:16:43,560 --> 01:16:47,520
I'm zoomed in. 
OK, so now if we go here, this 

1316
01:16:48,240 --> 01:16:54,480
can be bumped down to the bottom
and network and record. 

1317
01:16:54,480 --> 01:16:56,280
Yeah, that is much. 
Oh, you just turned it off. 

1318
01:16:56,280 --> 01:17:00,280
Yeah, you don't. 
Yeah, Chrome is recording 

1319
01:17:00,280 --> 01:17:02,520
always. 
I don't know why Firefox isn't 

1320
01:17:02,520 --> 01:17:05,440
just always recording. 
Yeah, OK, great. 

1321
01:17:05,440 --> 01:17:09,240
So now let's look at the request
that was made and you'll look at

1322
01:17:09,360 --> 01:17:13,000
the the payload. 
So this is what was in the 

1323
01:17:13,000 --> 01:17:17,960
request and the the browser 
actually knows how to take what 

1324
01:17:17,960 --> 01:17:20,200
you have input and stick it in 
the payload. 

1325
01:17:20,200 --> 01:17:25,160
This happens automatically 
whether or and and what Remix is

1326
01:17:25,160 --> 01:17:26,520
doing. 
Since you're using the uppercase

1327
01:17:26,520 --> 01:17:30,000
form and we've got JavaScript 
going, Remix just does the same 

1328
01:17:30,000 --> 01:17:32,280
thing the browser does. 
So if you change that to a 

1329
01:17:32,280 --> 01:17:34,400
lowercase form, you're going to 
see this request and it will 

1330
01:17:34,400 --> 01:17:37,760
look exactly the same, like 
mostly the same. 

1331
01:17:39,120 --> 01:17:42,600
There's some implementation 
details here, but. 

1332
01:17:42,840 --> 01:17:45,400
But yeah, you're going to get 
the same experience. 

1333
01:17:46,200 --> 01:17:49,640
Yeah, you need to go back and, 
and you'll want to refresh or. 

1334
01:17:50,160 --> 01:17:53,440
Yeah, actually I think, I think 
that works in any case, like the

1335
01:17:53,440 --> 01:18:00,040
the point is that the browser 
knows what to do about requests 

1336
01:18:00,040 --> 01:18:01,920
like this. 
It'll say, oh, you're submitting

1337
01:18:01,920 --> 01:18:04,280
a form. 
Let me take all of the inputs of

1338
01:18:04,280 --> 01:18:07,000
that form, one of which was 
actually a hidden input, by the 

1339
01:18:07,000 --> 01:18:08,640
way. 
That's where that intent create 

1340
01:18:08,640 --> 01:18:12,560
came from. 
And yeah, if you look, if you go

1341
01:18:12,560 --> 01:18:16,720
up to the top, you'll have or 
maybe it's at the Oh no, no, no,

1342
01:18:16,720 --> 01:18:18,000
it's the button that you 
clicked. 

1343
01:18:18,240 --> 01:18:21,760
So the submit button has a name 
intent and a value create. 

1344
01:18:21,760 --> 01:18:25,200
So because that's a button or 
submitted, then that's the one 

1345
01:18:25,200 --> 01:18:30,520
that that's the value. 
So yeah, so the browser is going

1346
01:18:30,520 --> 01:18:32,600
to take that, put it in the 
request and send that to the 

1347
01:18:32,600 --> 01:18:36,000
server. 
And so our action is going to 

1348
01:18:36,040 --> 01:18:38,520
take that request and get the 
form data out of that. 

1349
01:18:38,720 --> 01:18:42,480
OK, That's what we're that's 
what the last five minutes was. 

1350
01:18:44,600 --> 01:18:48,120
That's what we're going to do. 
So your action function is going

1351
01:18:48,120 --> 01:18:52,760
to accept an argument, and that 
argument is going to be an 

1352
01:18:52,760 --> 01:18:57,520
object that has a request 
property on it, and to make so 

1353
01:18:57,520 --> 01:19:00,080
it's a full full request. 
You have to. 

1354
01:19:00,640 --> 01:19:04,440
Yeah. 
And then that the type for that 

1355
01:19:04,440 --> 01:19:07,880
request is gonna be action ARC. 
So here I'll just give you that 

1356
01:19:07,880 --> 01:19:14,120
whole line so we don't have to 
worry about talking past each 

1357
01:19:14,120 --> 01:19:17,040
other or anything. 
Oh yeah. 

1358
01:19:21,880 --> 01:19:25,360
So and then the action arcs 
comes from, let me get that 

1359
01:19:25,360 --> 01:19:29,120
import for you too. 
Oh, that's not where it comes 

1360
01:19:29,120 --> 01:19:29,840
from. 
Never mind. 

1361
01:19:29,840 --> 01:19:32,080
Hold on. 
Here we go. 

1362
01:19:35,480 --> 01:19:43,720
Over node. 
OK, OK, I'll change this back to

1363
01:19:43,720 --> 01:19:46,840
form before I forget to do that.
It'll work either way. 

1364
01:19:46,840 --> 01:19:53,920
That's, but let's leave it with 
the lowercase form for now. 

1365
01:19:54,720 --> 01:19:58,360
OK, cool. 
So now to get the request that 

1366
01:19:58,360 --> 01:20:02,160
here's the cool thing. 
If you look at the type 

1367
01:20:02,160 --> 01:20:07,880
definitions for that request 
object, so hover over request, 

1368
01:20:08,480 --> 01:20:12,840
you'll see it's a request. 
If you click into it and then 

1369
01:20:12,840 --> 01:20:16,160
click on the, click into request
the uppercase request there. 

1370
01:20:16,600 --> 01:20:21,200
That takes you right into the 
the TypeScript definitions for 

1371
01:20:21,200 --> 01:20:24,480
fetch. 
So this is not a fancy Remix 

1372
01:20:24,480 --> 01:20:26,880
thing. 
This is just a regular request 

1373
01:20:26,880 --> 01:20:28,960
object that Remix is giving to 
you. 

1374
01:20:29,240 --> 01:20:32,880
Whether you're running on 
Netlify or Versal or Express or 

1375
01:20:32,880 --> 01:20:36,360
whatever else. 
It always normalizes all of 

1376
01:20:36,360 --> 01:20:39,360
these requests and response 
objects to fetch API the. 

1377
01:20:40,000 --> 01:20:42,080
Regular fetch API that is 
awesome. 

1378
01:20:42,400 --> 01:20:46,360
Yes, it is because as as you get
better at using Remix, you're 

1379
01:20:46,360 --> 01:20:49,000
just getting better at the web 
platform, which I think is is 

1380
01:20:49,000 --> 01:20:50,880
pretty rad. 
That is. 

1381
01:20:51,360 --> 01:20:53,520
So. 
The more we can standardize to 

1382
01:20:53,960 --> 01:20:57,560
the web platform standards is 
better. 

1383
01:20:57,960 --> 01:21:00,920
There's just there's so many 
different ways to do things and 

1384
01:21:01,280 --> 01:21:02,840
standards. 
Yes. 

1385
01:21:03,640 --> 01:21:07,920
So Speaking of standards, there 
is a standard way to get things 

1386
01:21:07,920 --> 01:21:10,640
out of a request. 
People probably familiar with 

1387
01:21:10,640 --> 01:21:18,680
request dot Jason, but there's 
well or response dot JSON, but 

1388
01:21:19,040 --> 01:21:21,720
we also have a request dot form 
data. 

1389
01:21:22,880 --> 01:21:25,680
And so if you say request dot 
form data, and that's a function

1390
01:21:25,680 --> 01:21:29,160
that you're going to call, it's 
an async function and that's 

1391
01:21:29,160 --> 01:21:30,720
going to give you a form data 
object. 

1392
01:21:30,720 --> 01:21:33,760
So assign that and it's a 
promise. 

1393
01:21:33,760 --> 01:21:36,400
So you'll want to. 
OK, so. 

1394
01:21:36,640 --> 01:21:39,160
I just call it form data or you 
could call form. 

1395
01:21:40,120 --> 01:21:43,640
And assign it and it's async. 
So you all wait. 

1396
01:21:44,120 --> 01:21:45,200
Oh wait. 
Oh my gosh. 

1397
01:21:47,440 --> 01:21:48,520
Yeah. 
So it's. 

1398
01:21:49,040 --> 01:21:53,920
Friday. 
Yeah, so the form data object, 

1399
01:21:54,240 --> 01:21:58,880
that also is just web platform 
stuff because again, this is all

1400
01:22:00,240 --> 01:22:03,920
just like the built in objects. 
So form data. 

1401
01:22:03,920 --> 01:22:07,200
You can go to MDN to learn about
how the form data API works. 

1402
01:22:08,520 --> 01:22:10,720
But yeah, it's, it's an 
iterable. 

1403
01:22:11,280 --> 01:22:13,360
So you could iterate over all of
the entries. 

1404
01:22:13,880 --> 01:22:16,600
You can say dot entries to get 
everything and turn it into an 

1405
01:22:16,600 --> 01:22:19,560
object, object from entries. 
But we're not going to do any of

1406
01:22:19,560 --> 01:22:23,080
that. 
You'll we're going to say form 

1407
01:22:23,080 --> 01:22:25,720
data dot get and we're going to 
get the pieces of data that we 

1408
01:22:25,720 --> 01:22:28,080
want. 
So one piece of data. 

1409
01:22:28,520 --> 01:22:30,920
Yep. 
So you're going to say GET and 

1410
01:22:30,920 --> 01:22:34,320
then we want to get the name and
the e-mail. 

1411
01:22:35,640 --> 01:22:38,280
You could also get the intent to
make sure that the request is 

1412
01:22:38,280 --> 01:22:43,200
being made properly. 
But no, this isn't how the API 

1413
01:22:43,200 --> 01:22:45,640
works actually. 
So you when you call GET, you 

1414
01:22:45,640 --> 01:22:49,360
pass it a string of the property
that you want to get the name of

1415
01:22:49,360 --> 01:22:52,960
the property from the form data.
And so for us, we're going to 

1416
01:22:52,960 --> 01:22:57,120
get the name A. 
String and then you said get the

1417
01:22:57,120 --> 01:22:58,000
name. 
Yep. 

1418
01:22:58,640 --> 01:23:01,080
And then that's gonna return the
name. 

1419
01:23:01,440 --> 01:23:04,240
So no, no extra prams. 
No, no, no, sorry. 

1420
01:23:04,520 --> 01:23:06,000
Maybe it'll be easier if I do 
this? 

1421
01:23:06,400 --> 01:23:10,840
Name e-mail like this. 
I'm not looking now 'cause I'm 

1422
01:23:11,400 --> 01:23:17,840
sending it to you, yeah. 
Oh, OK, so OK, let me start. 

1423
01:23:17,840 --> 01:23:19,560
A code of cards. 
Sometimes name equal. 

1424
01:23:19,760 --> 01:23:24,600
Oh I know form data dot git and 
this is a new API for me, so I'm

1425
01:23:24,600 --> 01:23:25,760
not. 
Yeah, Yeah. 

1426
01:23:25,760 --> 01:23:29,120
Well, it's new for most people, 
like it's been so long since we 

1427
01:23:29,120 --> 01:23:32,600
used the platform. 
I see. 

1428
01:23:32,600 --> 01:23:34,960
Yeah, I have never used it like 
this. 

1429
01:23:34,960 --> 01:23:38,080
I would normally, like you said,
do the response dot Jason and. 

1430
01:23:38,680 --> 01:23:41,440
Yeah, yeah. 
But for us, this is encoded as 

1431
01:23:41,440 --> 01:23:46,440
as URL encoded form data, which 
is the way that the form is 

1432
01:23:46,440 --> 01:23:49,080
going to be submitted by the 
browser by default. 

1433
01:23:49,400 --> 01:23:53,680
And so you can change it to you,
you can submit Jason if you 

1434
01:23:53,680 --> 01:23:56,240
wanted to. 
Like if you're want to 

1435
01:23:56,240 --> 01:23:59,440
communicate straight from the 
client to some third party 

1436
01:23:59,440 --> 01:24:03,120
endpoint that only takes Jason, 
then yeah, you totally can do 

1437
01:24:03,120 --> 01:24:06,440
that with Remix. 
But the default for Remix is a 

1438
01:24:06,440 --> 01:24:08,600
focus on progressive enhancement
and the platform. 

1439
01:24:08,920 --> 01:24:10,320
And this is the way the platform
does it. 

1440
01:24:10,600 --> 01:24:13,360
Now, if you don't like this form
data dot get and that's like, oh

1441
01:24:13,360 --> 01:24:15,240
man, what if we've got like 300 
things? 

1442
01:24:15,240 --> 01:24:18,880
I don't want to have 300 lines. 
Then yeah, you can totally use 

1443
01:24:18,880 --> 01:24:22,040
form data dot entries. 
Use object dot from entries and 

1444
01:24:22,040 --> 01:24:27,000
boom, you've got an object. 
But most of the time, especially

1445
01:24:27,000 --> 01:24:29,480
for smaller forms like this, 
I'll just do form data dot get 

1446
01:24:29,480 --> 01:24:32,320
for everything. 
OK, so now if you want a console

1447
01:24:32,320 --> 01:24:36,320
log name and e-mail or just 
trust me it it works we can move

1448
01:24:36,320 --> 01:24:38,040
on to actually creating the 
customer. 

1449
01:24:40,760 --> 01:24:43,720
You, you can go ahead and talk. 
Yeah, we'll just see what it. 

1450
01:24:45,560 --> 01:24:49,760
And then the name and e-mail or 
those logs are going to show up 

1451
01:24:49,760 --> 01:24:52,680
on the server because again, 
this code runs on the server. 

1452
01:24:52,920 --> 01:24:55,200
Yeah, it it's warning because 
we're not returning anything 

1453
01:24:55,200 --> 01:24:58,200
we're we're supposed to. 
But if you look at the terminal 

1454
01:24:58,480 --> 01:25:00,320
that's running your server. 
Oh, OK. 

1455
01:25:01,240 --> 01:25:03,680
Then you'll see that scroll up 
and boom, there it is. 

1456
01:25:04,120 --> 01:25:06,280
Yes, there we go. 
Oh. 

1457
01:25:07,320 --> 01:25:09,560
It's running on the server side.
That makes sense. 

1458
01:25:09,560 --> 01:25:11,440
That's why it didn't come 
through on the client. 

1459
01:25:11,600 --> 01:25:14,880
Yeah, and this is great because 
let's say you're integrating 

1460
01:25:14,880 --> 01:25:18,200
with a third party CMS or 
something and you've got private

1461
01:25:18,200 --> 01:25:20,320
keys. 
You don't need to make some sort

1462
01:25:20,320 --> 01:25:24,200
of special API endpoint for 
hiding your private key. 

1463
01:25:24,320 --> 01:25:26,800
You're just like literally in 
the same file where the form is,

1464
01:25:27,000 --> 01:25:28,480
and now you're writing server 
code. 

1465
01:25:29,320 --> 01:25:31,880
And so you can use that private 
key and not worry about leaking 

1466
01:25:31,880 --> 01:25:34,200
it out. 
Or in our case, we're going to 

1467
01:25:34,200 --> 01:25:37,280
talk to the database. 
So we've got a function called 

1468
01:25:37,280 --> 01:25:42,680
create customer that you can use
that is from the customer dot 

1469
01:25:42,680 --> 01:25:46,760
server in our models directory 
and. 

1470
01:25:46,800 --> 01:25:49,800
Where do we use that? 
I sent you the import and then 

1471
01:25:49,800 --> 01:25:53,400
you'll put it right under the 
just like that. 

1472
01:25:57,960 --> 01:26:00,520
And this is an async function. 
It's the TypeScript is 

1473
01:26:00,520 --> 01:26:05,360
complaining here. 
I can TypeScript is stupid 

1474
01:26:05,360 --> 01:26:06,760
something well, it's not too 
good. 

1475
01:26:06,920 --> 01:26:10,160
TypeScript is totally right. 
So The thing is that as far as 

1476
01:26:10,280 --> 01:26:16,880
as reality is concerned, that 
name and e-mail can be one of a 

1477
01:26:16,880 --> 01:26:20,160
couple of things. 
It can be null, like the form 

1478
01:26:20,160 --> 01:26:22,240
wasn't submitted with that 
information. 

1479
01:26:22,960 --> 01:26:26,200
It could or it could be a form 
data entry value, which is 

1480
01:26:26,240 --> 01:26:28,880
either a file or a string. 
Cause like the user could be 

1481
01:26:28,880 --> 01:26:31,960
uploading a file, right? 
So TypeScript is just saying, 

1482
01:26:31,960 --> 01:26:34,960
hey, create customer expects a 
string, but you're sending it 

1483
01:26:34,960 --> 01:26:38,960
null or a file or a string. 
So what is it? 

1484
01:26:39,400 --> 01:26:42,600
And so here's what we're going 
to do to fix that. 

1485
01:26:43,040 --> 01:26:49,080
You're going to import a package
called tiny Invariant, and then 

1486
01:26:49,080 --> 01:26:53,880
you're going to use this 
invariant stuff right before you

1487
01:26:53,880 --> 01:26:58,160
call create customer I. 
Have not heard of this. 

1488
01:26:59,000 --> 01:27:02,520
That invariant is actually. 
I don't know whether it was 

1489
01:27:02,520 --> 01:27:05,640
created by. 
It was at least made popular by 

1490
01:27:05,640 --> 01:27:09,680
the React team. 
And then somebody made a like a 

1491
01:27:09,680 --> 01:27:12,600
tiny invariant. 
So it's It's small with regard 

1492
01:27:12,600 --> 01:27:16,520
to bundle size, but what? 
That line 'cause you had it set 

1493
01:27:16,520 --> 01:27:19,200
to a variable, so I. 
Yeah, yeah. 

1494
01:27:19,280 --> 01:27:22,040
So that that's working now. 
So what what we're doing is 

1495
01:27:22,040 --> 01:27:25,000
we're saying, hey, if the type 
of name is a string, then 

1496
01:27:25,000 --> 01:27:26,560
everything's good. 
But if it's not, then we're 

1497
01:27:26,560 --> 01:27:28,080
gonna say, you know, throw an 
error. 

1498
01:27:29,160 --> 01:27:31,720
Now we we could do better error 
handling here and send a a 

1499
01:27:31,720 --> 01:27:34,320
response to the user and say, 
hey, this is messed up. 

1500
01:27:34,320 --> 01:27:37,480
But we are limited on our time, 
so we're just making TypeScript 

1501
01:27:37,480 --> 01:27:38,880
happy for now. 
OK. 

1502
01:27:41,160 --> 01:27:43,120
So sweet. 
Now we've created a customer. 

1503
01:27:43,760 --> 01:27:46,760
We've got that customer. 
Let's redirect to that 

1504
01:27:46,760 --> 01:27:48,680
customer's page. 
We just created them, so they 

1505
01:27:48,680 --> 01:27:53,080
should have a page now. 
And so to save a little bit of 

1506
01:27:53,080 --> 01:27:55,960
time, here's the oh, just 
kidding, it's not slash sales. 

1507
01:27:55,960 --> 01:27:58,640
We made that mistake. 
Before help fix it. 

1508
01:27:58,840 --> 01:28:00,440
There we go. 
OK. 

1509
01:28:02,920 --> 01:28:06,640
And we just want to return 
redirect and we're redirecting. 

1510
01:28:06,840 --> 01:28:08,560
Where's redirecting coming from 
that? 

1511
01:28:08,600 --> 01:28:16,320
Should come from Remix run node 
so that yeah, and you can delete

1512
01:28:16,320 --> 01:28:19,920
the type on on line four. 
Yeah, that should work. 

1513
01:28:21,000 --> 01:28:26,880
So save that and then come over.
It's it's complaining because 

1514
01:28:26,880 --> 01:28:28,400
action arcs is only a type 
thing. 

1515
01:28:28,480 --> 01:28:30,480
It, it doesn't matter, it's 
fine. 

1516
01:28:31,640 --> 01:28:35,240
So if you come back to the 
browser and submit the form, I 

1517
01:28:35,240 --> 01:28:39,840
want us to watch closely what 
happens so. 

1518
01:28:41,520 --> 01:28:44,760
It worked. 
There was nothing in our code to

1519
01:28:44,760 --> 01:28:48,600
say when there's a mutation, 
let's go and update that list of

1520
01:28:48,600 --> 01:28:50,400
customers because it's wrong 
now. 

1521
01:28:50,400 --> 01:28:53,400
So let's set state and here's my
new customers and all. 

1522
01:28:53,680 --> 01:28:56,040
It just. 
It just boom, it's there. 

1523
01:28:56,360 --> 01:28:58,800
Magic. 
It's amazing. 

1524
01:28:58,800 --> 01:29:01,840
Awesome. 
There's you don't have to think 

1525
01:29:01,840 --> 01:29:04,440
about that. 
Oh, and here's another fun fact.

1526
01:29:04,680 --> 01:29:05,920
What just happened? 
Yeah. 

1527
01:29:06,440 --> 01:29:07,760
What did it just? 
Worked. 

1528
01:29:07,800 --> 01:29:09,880
Oh my gosh. 
Here's another fun fact you 

1529
01:29:09,880 --> 01:29:12,520
remember if you go back to the 
new dot TSX. 

1530
01:29:12,520 --> 01:29:14,960
It's good. 
OMG yeah. 

1531
01:29:16,000 --> 01:29:21,280
If you go to the new dot TSX 
file in the new customer and 

1532
01:29:21,280 --> 01:29:24,640
you'll see the form on line 22, 
that is a lower case form. 

1533
01:29:25,080 --> 01:29:27,160
Yeah, so we. 
Were not using JavaScript to 

1534
01:29:27,160 --> 01:29:31,160
submit that form data. 
And there's no action posted 

1535
01:29:31,160 --> 01:29:34,600
here either, so it's it just 
knows to use this action. 

1536
01:29:34,760 --> 01:29:37,480
Function yeah, Remix is handling
that request and says, oh, 

1537
01:29:37,480 --> 01:29:39,480
here's the the route that you're
posting to. 

1538
01:29:40,160 --> 01:29:45,200
I know which action to post to. 
So what's happening here is I 

1539
01:29:45,200 --> 01:29:48,640
just showed you progressive 
enhancement and that you don't 

1540
01:29:48,640 --> 01:29:51,280
need state management with 
Remix, No state management. 

1541
01:29:51,360 --> 01:29:53,280
The thing works without 
JavaScript. 

1542
01:29:53,280 --> 01:29:56,200
So it, it must be able to work 
without state management and it 

1543
01:29:56,200 --> 01:30:00,120
does and it's amazing. 
But we do want to have 

1544
01:30:00,120 --> 01:30:02,040
JavaScript. 
We don't want to do a just a 

1545
01:30:02,040 --> 01:30:04,160
regular form because that's 
going to do a full page refresh 

1546
01:30:04,160 --> 01:30:05,480
and that's stupid. 
Who wants that? 

1547
01:30:05,480 --> 01:30:08,520
Not me. 
So let's change that form to an 

1548
01:30:08,520 --> 01:30:13,560
uppercase form again and now 
that is going to just do a fetch

1549
01:30:13,560 --> 01:30:16,880
request so you can make another 
new customer and the entire 

1550
01:30:16,880 --> 01:30:19,600
experience is the same, except 
this time no full page refresh. 

1551
01:30:23,320 --> 01:30:27,080
That's gonna good thing is not 
sending emails 'cause that might

1552
01:30:27,080 --> 01:30:29,520
be someone's actual. 
For Alex. 

1553
01:30:31,040 --> 01:30:36,320
So there you go. 
No, no innocent, no like weird 

1554
01:30:36,320 --> 01:30:40,680
API routes, no indirection, no 
use effect. 

1555
01:30:41,560 --> 01:30:45,880
All just like regular web APIs 
and this. 

1556
01:30:45,880 --> 01:30:49,960
Kind of makes me like React. 
I know that's the. 

1557
01:30:50,440 --> 01:30:53,200
Like I. 
It like it gets rid of all of 

1558
01:30:53,200 --> 01:30:55,160
the things. 
You I don't have to use the use 

1559
01:30:55,160 --> 01:30:57,720
state hooks. 
I don't have to use use effect. 

1560
01:30:58,000 --> 01:31:01,200
I haven't used anything that I'm
like, oh, I don't like this. 

1561
01:31:01,840 --> 01:31:06,240
Yeah, Yep. 
So that that's, that's remix for

1562
01:31:06,240 --> 01:31:09,200
you. 
It's pretty pretty rad. 

1563
01:31:11,760 --> 01:31:13,160
I forgot we weren't on the 
screen. 

1564
01:31:13,160 --> 01:31:15,360
I was like looking at you all. 
We're all like happy. 

1565
01:31:18,120 --> 01:31:21,960
This is pretty cool. 
Yeah, I mean, we, we could get 

1566
01:31:21,960 --> 01:31:24,800
into stuff like pending UI and 
optimistic UI. 

1567
01:31:24,800 --> 01:31:28,960
Things aren't always fast, but 
that's like these are the the 

1568
01:31:28,960 --> 01:31:32,360
main things that make Remix so 
special. 

1569
01:31:32,760 --> 01:31:36,440
Like we everything we've done so
far doesn't even need JavaScript

1570
01:31:36,440 --> 01:31:40,520
in the browser, it's when when 
we. 

1571
01:31:40,760 --> 01:31:43,280
So if you were shipping just 
this and you were happy with 

1572
01:31:43,280 --> 01:31:46,600
this experience, then I would 
say just delete the the if you 

1573
01:31:46,600 --> 01:31:49,160
go actually into the root dot 
TSX file. 

1574
01:31:51,120 --> 01:31:56,000
The index. 
No, it should be in the, not in 

1575
01:31:56,000 --> 01:31:58,480
the routes directory. 
Scroll down below components. 

1576
01:31:58,480 --> 01:32:00,840
Yeah, root dot TSX. 
So this is the thing that's 

1577
01:32:00,840 --> 01:32:03,600
responsible for the entire app. 
Like this is the first component

1578
01:32:03,600 --> 01:32:05,760
that's rendered if you Scroll 
down. 

1579
01:32:07,400 --> 01:32:10,640
So this is like the app for 
React, like the. 

1580
01:32:10,880 --> 01:32:14,080
So you got your, you're 
rendering HTML here, like the 

1581
01:32:14,080 --> 01:32:16,840
HTML element. 
You don't typically do that in 

1582
01:32:17,200 --> 01:32:20,800
in React apps, but you do that 
here on line 41. 

1583
01:32:20,800 --> 01:32:27,000
There's a Scripps tag or Scripps
element that is responsible 41. 

1584
01:32:27,720 --> 01:32:30,200
Oh, Yep. 
That is responsible for all of 

1585
01:32:30,200 --> 01:32:31,680
the JavaScript getting onto the 
page. 

1586
01:32:31,680 --> 01:32:34,440
So it it renders out all the 
script tags for all the modules 

1587
01:32:34,440 --> 01:32:35,440
and everything that we're 
loading. 

1588
01:32:35,760 --> 01:32:41,040
You could comment that out and 
the entire app experience will 

1589
01:32:41,040 --> 01:32:44,480
still work You go refresh the 
browser, you click between those

1590
01:32:44,480 --> 01:32:48,760
links and you go create a new 
customer. 

1591
01:32:49,640 --> 01:32:53,280
Everything still works. 
And so if you were happy with 

1592
01:32:53,280 --> 01:32:58,360
this experience, like one nice 
thing is that this the browser 

1593
01:32:58,360 --> 01:33:02,200
will show a pending UI, the 
favicon will spin the, you know,

1594
01:33:02,760 --> 01:33:06,320
like mobile browsers will have 
the little, you know, status 

1595
01:33:06,320 --> 01:33:09,560
thing that goes across whatever.
So like you, this is actually a 

1596
01:33:09,560 --> 01:33:12,360
better experience than having 
the scripts because we haven't 

1597
01:33:12,360 --> 01:33:14,840
actually thought about pending 
UI yet, right? 

1598
01:33:14,920 --> 01:33:18,560
So if if you were done and 
you're like, oh, I don't have 

1599
01:33:18,560 --> 01:33:21,480
time to think about loading 
spinners, you know, for like 

1600
01:33:21,480 --> 01:33:24,720
slow network or whatever, then I
would just disable the scripts 

1601
01:33:24,720 --> 01:33:26,360
and let the browser handle that 
for me. 

1602
01:33:27,440 --> 01:33:30,280
How is this updating this 
without the JavaScript? 

1603
01:33:33,440 --> 01:33:39,360
OK, so the way that it works, 
the way that what's happening is

1604
01:33:39,480 --> 01:33:43,640
you submit the form that goes to
the back end remixes like, oh, 

1605
01:33:43,640 --> 01:33:45,320
here's the route. 
You're making a post, let me 

1606
01:33:45,320 --> 01:33:48,080
find the action, let me run the 
action with the request and all 

1607
01:33:48,080 --> 01:33:50,400
that. 
You update the database and then

1608
01:33:50,400 --> 01:33:53,800
you send a redirect response. 
That redirect response goes back

1609
01:33:53,800 --> 01:33:55,360
to the browser. 
The browser's like, oh, you want

1610
01:33:55,360 --> 01:33:57,800
me to go somewhere else? 
Let me go to where that location

1611
01:33:57,800 --> 01:34:00,040
header says. 
So now it's making another 

1612
01:34:00,040 --> 01:34:03,440
request to your server to get 
that new location. 

1613
01:34:03,640 --> 01:34:05,320
Your server's like, oh sweet, I 
know that. 

1614
01:34:05,320 --> 01:34:07,480
Let me go look up that customer 
in the database that I just 

1615
01:34:07,480 --> 01:34:09,800
barely created. 
We generate some HTML and send 

1616
01:34:09,800 --> 01:34:12,240
that back to the browser. 
So that's how it works. 

1617
01:34:12,520 --> 01:34:15,160
It's like old PHP. 
Yeah, that's exactly what PHP 

1618
01:34:15,160 --> 01:34:19,360
used to do. 
Now what's cool though is that 

1619
01:34:19,360 --> 01:34:23,160
this is way better than PHP 
because we can uncomment that 

1620
01:34:23,160 --> 01:34:27,320
scripts tag and now we can start
adding stuff like pending UI and

1621
01:34:27,320 --> 01:34:32,000
spinners and optimistic UI like 
adding a new customer before 

1622
01:34:32,000 --> 01:34:33,800
they're actually created in the 
database. 

1623
01:34:34,040 --> 01:34:39,280
All sorts of really cool things 
we can do without having to like

1624
01:34:39,280 --> 01:34:41,600
duplicate templates. 
You know, you've got your PHP 

1625
01:34:41,600 --> 01:34:43,480
version of the template and your
JavaScript version of the 

1626
01:34:43,480 --> 01:34:48,520
template or you've got like you 
have to sprinkle JavaScript in 

1627
01:34:48,520 --> 01:34:51,880
or whatever by adding that 
script scripts tag. 

1628
01:34:51,960 --> 01:34:56,120
All of a sudden you've got all 
of the power of React and it's 

1629
01:34:56,160 --> 01:34:59,520
all the exact same code that's 
running on the server and the 

1630
01:34:59,520 --> 01:35:01,400
client. 
And so you can say, oh, if the 

1631
01:35:01,400 --> 01:35:05,160
user just submitted a form, let 
me add this new customer to this

1632
01:35:05,160 --> 01:35:08,960
list just optimistically 'cause 
we're going to assume it's going

1633
01:35:08,960 --> 01:35:12,160
to work. 
And then when it's done, Remix 

1634
01:35:12,160 --> 01:35:14,760
will automatically go and update
the data and that new customer 

1635
01:35:14,760 --> 01:35:16,720
will be in the the new data that
you just got. 

1636
01:35:16,720 --> 01:35:18,800
So the optimistic stuff 
naturally goes away. 

1637
01:35:18,960 --> 01:35:23,480
New customer is there it just 
yeah, the you. 

1638
01:35:23,520 --> 01:35:27,720
What's cool about Remix is that 
it gives you the mental model of

1639
01:35:27,720 --> 01:35:32,880
the late 90s, early 2000s, but 
the the power of 2022. 

1640
01:35:34,080 --> 01:35:37,320
I kind of, I kind of thought all
along like that, that's what the

1641
01:35:37,320 --> 01:35:40,400
static piece was giving me and 
then the like rehydration and 

1642
01:35:40,400 --> 01:35:43,560
client side. 
But like this is even closer to 

1643
01:35:43,560 --> 01:35:45,480
that web standard. 
I guess that's. 

1644
01:35:45,480 --> 01:35:46,120
Interesting. 
Yeah. 

1645
01:35:46,120 --> 01:35:48,280
Well, and on top of that, I. 
Just I want to make sure we 

1646
01:35:48,280 --> 01:35:51,880
don't miss this and we just 
covered that, but I wanna make 

1647
01:35:51,880 --> 01:35:53,200
sure I'm not reading it 
incorrectly. 

1648
01:35:54,320 --> 01:35:54,880
Yeah. 
OK. 

1649
01:35:54,880 --> 01:35:57,360
So when doing a progressive 
enhancement, say I want client 

1650
01:35:57,360 --> 01:36:00,960
transitions, but it required the
response before it can animate. 

1651
01:36:02,240 --> 01:36:02,840
Yeah. 
OK. 

1652
01:36:02,840 --> 01:36:08,880
So like let's say that I think I
might be misunderstanding that 

1653
01:36:08,880 --> 01:36:10,320
question. 
Actually, I might too. 

1654
01:36:11,240 --> 01:36:16,200
So let's say we're creating a 
new customer and we're gonna 

1655
01:36:16,200 --> 01:36:19,280
redirect them over to the 
customer's page, right? 

1656
01:36:19,280 --> 01:36:21,440
Or something. 
Actually, can I share my screen?

1657
01:36:22,400 --> 01:36:27,320
I think we, we can skip ahead to
to the end here and I can show 

1658
01:36:27,320 --> 01:36:31,520
you what, what the end state is 
of what you can do with Remix. 

1659
01:36:33,480 --> 01:36:38,160
So this is a, a different app 
that you can actually use. 

1660
01:36:38,160 --> 01:36:42,320
It does actually work. 
You can create an account and 

1661
01:36:42,320 --> 01:36:46,080
everything, but it's the good 
old to do NBC if you remember 

1662
01:36:46,080 --> 01:36:50,640
that. 
So I can make a new to do and 

1663
01:36:50,640 --> 01:36:56,160
this is great and I have it 
coded where if you include the 

1664
01:36:56,160 --> 01:37:01,640
word error in your to do, then 
that will throw an error and say

1665
01:37:01,640 --> 01:37:03,120
to do's cannot include the word 
error. 

1666
01:37:03,120 --> 01:37:07,400
So maybe you cannot use this for
your own To Do List because 

1667
01:37:07,560 --> 01:37:08,960
you'll never be able to use the 
word error. 

1668
01:37:09,360 --> 01:37:13,680
But here's the cool thing, and I
think this touches on what the 

1669
01:37:13,680 --> 01:37:17,280
question is. 
How do you do pending UI when 

1670
01:37:17,560 --> 01:37:21,120
like there's an element of web 
application development that you

1671
01:37:21,120 --> 01:37:25,720
do not control and that is the 
user's speed of their browser, 

1672
01:37:25,800 --> 01:37:29,560
right, or, or speed of their 
network, right? 

1673
01:37:30,200 --> 01:37:31,760
Even the user doesn't always 
control that. 

1674
01:37:32,320 --> 01:37:35,480
And so you do have to think 
about pending UI. 

1675
01:37:35,720 --> 01:37:40,880
So if I slow this down, and I 
say here, let me actually we're 

1676
01:37:40,880 --> 01:37:42,600
not gonna slow down. 
I don't wanna spoil this. 

1677
01:37:42,600 --> 01:37:46,440
So we're gonna here we'll toggle
them all, we'll clear them all 

1678
01:37:46,920 --> 01:37:49,600
and here we'll just do a full 
refresh. 

1679
01:37:49,760 --> 01:37:53,880
OK, so now if I slow this down, 
watch this, I'm on a slow 3G 

1680
01:37:53,880 --> 01:37:56,960
network. 
If I do that to like to Twitter 

1681
01:37:57,560 --> 01:38:01,640
slow 3G and I'm here waiting for
spinners and and all of this 

1682
01:38:01,640 --> 01:38:03,360
stuff too. 
I'm gonna leave Twitter up 

1683
01:38:03,360 --> 01:38:07,000
though, because it it's I wanna 
use it for something else. 

1684
01:38:07,440 --> 01:38:11,040
So I'm gonna slow 3G network. 
This means that network requests

1685
01:38:11,040 --> 01:38:12,560
are gonna take at least 2 
seconds. 

1686
01:38:12,760 --> 01:38:19,600
Is what the browser will do. 
Why then is this so fast? 

1687
01:38:22,120 --> 01:38:25,720
And check check check, it's all 
super fast. 

1688
01:38:25,720 --> 01:38:31,120
What? 
Why is it so freaking fast and. 

1689
01:38:31,440 --> 01:38:33,120
There's some errors in there 
too. 

1690
01:38:33,160 --> 01:38:35,280
Yeah, we've, we have some errors
here. 

1691
01:38:35,640 --> 01:38:39,640
I can delete this, I can clear 
the completed, I can do all of 

1692
01:38:39,640 --> 01:38:45,840
these things and the whole 
experience is feels like I'm on 

1693
01:38:45,840 --> 01:38:50,000
a really fast network. 
So what's what we're doing is 

1694
01:38:50,000 --> 01:38:52,280
optimistic UI. 
This is Twitter does the same 

1695
01:38:52,280 --> 01:38:55,000
thing. 
So if I, you know, let's not 

1696
01:38:55,000 --> 01:38:57,360
make it slow. 
No thanks. 

1697
01:38:58,320 --> 01:39:01,480
I don't need notifications. 
From Twitter More notifications.

1698
01:39:01,880 --> 01:39:07,200
OK, so this is a test. 
I open that up and I say I 

1699
01:39:07,200 --> 01:39:11,240
favorite that and then here 
actually, and let's slow this 

1700
01:39:11,240 --> 01:39:14,600
down. 
If I unfavored it on a slow 3G 

1701
01:39:14,600 --> 01:39:16,760
network, that's going to take at
least 2 seconds, right? 

1702
01:39:16,920 --> 01:39:20,760
But it instantly is gone, right?
It's instantly unfavorited. 

1703
01:39:20,920 --> 01:39:23,920
This is optimistic UI. 
It's a really common practice 

1704
01:39:23,920 --> 01:39:25,320
for the web. 
It's not as common as it should 

1705
01:39:25,320 --> 01:39:27,480
be. 
But the problem with optimistic 

1706
01:39:27,480 --> 01:39:30,280
UI is what if your optimism is 
misplaced? 

1707
01:39:30,280 --> 01:39:35,240
So I delete this tweet and then 
I try to unfavorite it and it 

1708
01:39:35,240 --> 01:39:37,640
instantly unfavorites. 
And then Twitter's like, oh, 

1709
01:39:37,640 --> 01:39:39,680
actually, sorry, that tweet was,
was deleted. 

1710
01:39:39,680 --> 01:39:42,360
You can never unfavorite it. 
You're you've favored that tweet

1711
01:39:42,360 --> 01:39:45,480
forever. 
I see this in Twitter all the 

1712
01:39:45,480 --> 01:39:47,160
time and I thought it was like 
buggy. 

1713
01:39:48,000 --> 01:39:49,880
Yeah, no. 
So like, what do you, what do 

1714
01:39:49,880 --> 01:39:52,440
you do when you're Twitter and 
somebody's on a, a tweet that 

1715
01:39:52,520 --> 01:39:55,800
has already been deleted? 
What they are trying to do is 

1716
01:39:55,800 --> 01:40:00,000
they're trying to say, hey, 
let's, let's just make this seem

1717
01:40:00,000 --> 01:40:04,200
like it's really fast because 
99.9% of the time this is gonna 

1718
01:40:04,200 --> 01:40:07,000
work. 
And so we'll just automatically 

1719
01:40:08,520 --> 01:40:11,760
make it look like it's done. 
And then if it's not, we'll roll

1720
01:40:11,760 --> 01:40:14,240
it back, you know, and say 
sorry, you know, give them an 

1721
01:40:14,240 --> 01:40:16,080
error message. 
So that's the same thing that 

1722
01:40:16,080 --> 01:40:18,280
I've implemented over here. 
We have optimistic UI. 

1723
01:40:18,560 --> 01:40:23,720
So it is fast. 
And even though you can see in 

1724
01:40:23,720 --> 01:40:25,920
the network tab like those, 
those requests are taking at 

1725
01:40:25,920 --> 01:40:31,040
least 2 seconds to complete. 
And then for like the what makes

1726
01:40:31,040 --> 01:40:34,320
optimistic UI really hard is 
fall back. 

1727
01:40:34,320 --> 01:40:37,080
So if your optimism was 
misplaced, the tweet was deleted

1728
01:40:37,080 --> 01:40:43,120
or whatever, then how do you 
fall back to a state where the 

1729
01:40:43,120 --> 01:40:45,920
user knows that oh, like 
something was messed up and I've

1730
01:40:45,920 --> 01:40:48,120
got to fix it. 
Or, you know, you, you bring the

1731
01:40:48,120 --> 01:40:49,760
state back to where it was 
before. 

1732
01:40:50,080 --> 01:40:51,600
And so I've implemented that 
here. 

1733
01:40:51,600 --> 01:40:57,680
So I can say 1 error 2-3 and 
then when error comes back and 

1734
01:40:57,680 --> 01:41:00,440
says hey that that's not 
allowed, it just pops right back

1735
01:41:00,440 --> 01:41:03,200
in and it says hey to do cannot 
include the word error. 

1736
01:41:03,200 --> 01:41:07,760
So now I can fix it and it will 
try again. 

1737
01:41:08,120 --> 01:41:10,600
Kent What What happens if you 
shut off your network and just 

1738
01:41:10,600 --> 01:41:12,880
put fast in? 
Yeah, yeah. 

1739
01:41:12,880 --> 01:41:17,040
If I if I'm not connected then 
you have to start thinking about

1740
01:41:17,040 --> 01:41:20,840
like offline mode for your app 
and Remix doesn't currently do 

1741
01:41:20,840 --> 01:41:22,240
anything. 
I just didn't know if it would 

1742
01:41:22,240 --> 01:41:25,320
drop in and then pop. 
Out, yeah. 

1743
01:41:25,320 --> 01:41:29,040
So I haven't programmed anything
in here for handling when a 

1744
01:41:29,040 --> 01:41:33,680
fetch fails, yeah. 
I deal with the Firebase all the

1745
01:41:33,680 --> 01:41:34,880
time, that's why I was kind of 
curious. 

1746
01:41:35,040 --> 01:41:45,160
Yeah, yeah. 
So Firebase implements Remix if 

1747
01:41:45,160 --> 01:41:50,000
you want to, but but yeah, 
offline this is not, this is 

1748
01:41:50,000 --> 01:41:54,840
just managing slow networks and 
it it does a pretty darn good 

1749
01:41:54,840 --> 01:41:57,560
job of it, I must say. 
So. 

1750
01:41:57,720 --> 01:41:59,440
Now we just need to start using 
quick. 

1751
01:41:59,560 --> 01:42:02,320
Have mish go on and put quick 
with remix. 

1752
01:42:02,320 --> 01:42:05,320
We'll be all set. 
Yeah, that would be really 

1753
01:42:05,320 --> 01:42:09,640
interesting. 
I I have opinions about all of 

1754
01:42:09,640 --> 01:42:11,080
this. 
I'm not. 

1755
01:42:11,080 --> 01:42:11,520
Whoa. 
Oh. 

1756
01:42:11,520 --> 01:42:15,640
Inception. 
Yeah. 

1757
01:42:15,640 --> 01:42:17,720
I I. 
Like opinions? 

1758
01:42:18,080 --> 01:42:21,560
Yeah, I I'm still unconvinced 
that we're chasing the biggest 

1759
01:42:21,560 --> 01:42:25,480
bang for our buck here with with
this stuff. 

1760
01:42:27,160 --> 01:42:33,520
I feel like you get a lot more 
headway on key metrics for most 

1761
01:42:33,520 --> 01:42:39,480
apps if you focus on on just 
making the server faster. 

1762
01:42:40,120 --> 01:42:44,200
And a lot of people have are are
like. 

1763
01:42:45,440 --> 01:42:49,720
So I, I guess I should say, if 
you are client side rendering, 

1764
01:42:50,720 --> 01:42:55,400
your app is just client side 
only, then there are so many 

1765
01:42:55,400 --> 01:42:58,840
other things that you can do to 
make your app faster before 

1766
01:42:58,840 --> 01:43:01,680
starting to think about the, you
know, 20 milliseconds you could 

1767
01:43:01,680 --> 01:43:04,280
save on, on the initial render, 
right? 

1768
01:43:05,160 --> 01:43:08,080
Even if it is that like on a, a 
slow device. 

1769
01:43:08,480 --> 01:43:12,880
So like for example, stop just 
client rendering and, and bring 

1770
01:43:12,880 --> 01:43:17,280
in a server you like that will 
make the user experience way 

1771
01:43:17,280 --> 01:43:20,440
better. 
And then when, when you get to 

1772
01:43:20,440 --> 01:43:26,120
the server rendering, now with 
React, we've got the streaming 

1773
01:43:26,120 --> 01:43:31,960
API and that has some really, 
really awesome capabilities with

1774
01:43:31,960 --> 01:43:33,880
it. 
That that is partial hydration, 

1775
01:43:34,200 --> 01:43:36,200
by the way, selective hydration 
as well. 

1776
01:43:37,040 --> 01:43:43,480
It's so, yeah, a lot of the 
things that are being worked on,

1777
01:43:43,480 --> 01:43:47,720
I think it are good that they're
being worked on, but it I am 

1778
01:43:47,720 --> 01:43:52,520
still not convinced that it's 
going to make that much of a 

1779
01:43:52,520 --> 01:43:56,320
difference for most people. 
So we shall see. 

1780
01:43:56,320 --> 01:44:01,640
I I welcome them to rebuild like
like we did with Next JSI, 

1781
01:44:01,640 --> 01:44:04,960
welcome them to rebuild one of 
our demos in their thing and 

1782
01:44:04,960 --> 01:44:07,880
show us the actual metrics of 
how it's faster. 

1783
01:44:08,080 --> 01:44:11,640
I do have to say I really enjoy 
those comparisons, like where 

1784
01:44:11,640 --> 01:44:14,440
you actually build an app and 
you show it in different 

1785
01:44:14,440 --> 01:44:16,480
frameworks. 
I like those, yeah. 

1786
01:44:16,480 --> 01:44:19,760
I love the back and forth too, 
because like, I haven't worked 

1787
01:44:19,760 --> 01:44:22,440
with a lot of those guys. 
It's, it's very interesting to 

1788
01:44:22,440 --> 01:44:25,200
see like opinions on one side 
and opinions on the other. 

1789
01:44:25,200 --> 01:44:29,440
And then just raw comparisons 
from like like Ryan Carnegato 

1790
01:44:29,440 --> 01:44:31,160
and and. 
Those I was going to say that 

1791
01:44:31,160 --> 01:44:34,720
Solid and quick and Remix have 
like made these conversations 

1792
01:44:34,720 --> 01:44:38,160
like come to the forefront and 
starting these are like the way 

1793
01:44:38,160 --> 01:44:40,240
to evolve the web to a better 
place. 

1794
01:44:41,160 --> 01:44:46,080
Yeah, I I think that Remix is 
really on to something here with

1795
01:44:46,080 --> 01:44:52,480
the the focus on the web 
platform and just creating an 

1796
01:44:52,480 --> 01:44:56,640
amazing developer experience. 
We didn't get time to talk about

1797
01:44:56,800 --> 01:45:00,600
streaming and the new deferred 
API that's coming up in the next

1798
01:45:00,600 --> 01:45:05,840
week or two with Remix, but like
that will really take things to 

1799
01:45:05,840 --> 01:45:09,680
the next level. 
Unfortunately, there are limited

1800
01:45:10,560 --> 01:45:15,720
hosts that will stream for you, 
so anybody built on top of AWS 

1801
01:45:16,960 --> 01:45:20,360
will not stream. 
So you cannot use Reactive Teen 

1802
01:45:20,360 --> 01:45:25,520
streaming on top of AWS. 
Luckily Netlify just released 

1803
01:45:25,520 --> 01:45:30,680
the Edge functions with Dino and
Dino does support streaming, so 

1804
01:45:31,000 --> 01:45:33,360
that's exciting really. 
Interesting because Versailles 

1805
01:45:33,400 --> 01:45:38,560
is all AWS, right? 
Yeah, so Versal also just 

1806
01:45:39,240 --> 01:45:44,800
released a while ago their their
edge functions which is wrapping

1807
01:45:44,800 --> 01:45:47,800
Cloudflare and Cloudflare 
supports streaming, so. 

1808
01:45:48,760 --> 01:45:51,600
I guess when you get to the edge
like that it can really change. 

1809
01:45:52,000 --> 01:45:54,200
Yeah. 
Like the lambdas and stuff are 

1810
01:45:54,200 --> 01:45:56,800
what are underneath. 
I think Nellify runs on AWS 

1811
01:45:56,840 --> 01:46:00,560
Lambda too for. 
The serverless functions do, but

1812
01:46:00,600 --> 01:46:02,800
the edge functions run on D 
note. 

1813
01:46:03,160 --> 01:46:04,640
Yeah. 
So that's interesting. 

1814
01:46:05,160 --> 01:46:05,880
Yeah. 
So just your. 

1815
01:46:06,600 --> 01:46:09,880
Hiccups. 
Just not. 

1816
01:46:09,880 --> 01:46:13,560
Not every app needs streaming 
because like it. 

1817
01:46:14,120 --> 01:46:16,760
And the only time you need 
streaming is when your back ends

1818
01:46:16,760 --> 01:46:18,880
are slow. 
Like you're hitting some back 

1819
01:46:18,880 --> 01:46:20,080
end that is slow for some 
reason. 

1820
01:46:20,080 --> 01:46:22,600
And there are, there are good 
reasons where you couldn't speed

1821
01:46:22,600 --> 01:46:26,160
things up, like you're doing 
some computation that just like 

1822
01:46:26,240 --> 01:46:27,680
it. 
It's hard to make this 

1823
01:46:27,680 --> 01:46:30,120
computation fast. 
It's impossible to cache it or 

1824
01:46:30,120 --> 01:46:33,360
whatever, but that's that's the 
only time we're streaming. 

1825
01:46:33,360 --> 01:46:36,880
Actually is useful. 
Otherwise you just, you know, do

1826
01:46:36,880 --> 01:46:42,160
a regular HTML render and you're
like 150 milliseconds and it's 

1827
01:46:42,160 --> 01:46:44,400
fine. 
Let me ask you something too 

1828
01:46:44,400 --> 01:46:47,400
about this. 
If if we have this app deployed 

1829
01:46:47,400 --> 01:46:51,080
to fly to IO, that's a single 
server in one location, right? 

1830
01:46:51,080 --> 01:46:52,400
It's not like a. 
CD. 

1831
01:46:53,200 --> 01:46:56,880
That's the way that the Indy 
stack is configured, but the 

1832
01:46:56,880 --> 01:47:00,400
Bluestack is configured to be 
able to deploy it to multiple 

1833
01:47:00,400 --> 01:47:03,680
regions, and they have something
like 35 regions all over the 

1834
01:47:03,680 --> 01:47:06,160
world. 
And so you could deploy it to 

1835
01:47:06,520 --> 01:47:09,080
multiple of those, not just one,
OK. 

1836
01:47:09,080 --> 01:47:11,480
And and so that's what I was 
going to get to is that 

1837
01:47:11,480 --> 01:47:14,480
deploying to the edge, what is 
the time difference? 

1838
01:47:14,480 --> 01:47:17,720
Would that be faster than having
that single server location? 

1839
01:47:17,960 --> 01:47:23,760
Yeah, it probably would it. 
So these are things to really 

1840
01:47:23,800 --> 01:47:28,560
measure. 
But the what's what's cool about

1841
01:47:28,560 --> 01:47:31,800
Fly in particular is that 
because they have all those 

1842
01:47:31,800 --> 01:47:34,440
regions all over the world, 
whether or not you've deployed 

1843
01:47:34,440 --> 01:47:38,960
to that region, the user 
wherever they are, they're going

1844
01:47:38,960 --> 01:47:41,520
to go to the region that's 
closest to them, whether or not 

1845
01:47:41,520 --> 01:47:43,680
your app is there. 
And then from that region, it 

1846
01:47:43,680 --> 01:47:46,360
will stay on Fly's network and 
and go bounces. 

1847
01:47:46,920 --> 01:47:50,240
Yeah, it bounces around to get 
to the region where your app is 

1848
01:47:50,240 --> 01:47:52,120
deployed. 
That network is like really 

1849
01:47:52,120 --> 01:47:54,440
fast. 
And so it's it's much better 

1850
01:47:54,440 --> 01:47:57,320
than the user having to go 
through their own, you know, 

1851
01:47:57,320 --> 01:48:02,080
whatever infrastructure their 
ISP has to to get to that. 

1852
01:48:02,120 --> 01:48:04,160
And maybe some of that 
infrastructure will actually be 

1853
01:48:04,160 --> 01:48:07,320
shared. 
But but yeah, for whatever that 

1854
01:48:07,320 --> 01:48:10,520
is, the fly infrastructure will 
will get it there probably 

1855
01:48:10,520 --> 01:48:12,440
faster. 
And so that's that's one cool 

1856
01:48:12,440 --> 01:48:15,400
thing is even if you don't 
leverage the multi region 

1857
01:48:15,400 --> 01:48:19,800
support, you're still in a 
pretty good place from that 

1858
01:48:19,920 --> 01:48:23,480
perspective. 
But yeah, like if you're going 

1859
01:48:24,520 --> 01:48:30,000
from Hong Kong to Virginia, US 
East or something, then yeah, 

1860
01:48:30,000 --> 01:48:33,560
you're there is definitely some 
latency there. 

1861
01:48:33,560 --> 01:48:38,760
And so deploying to the edge 
does matter if like 100 

1862
01:48:38,760 --> 01:48:41,360
milliseconds means millions of 
dollars for you, right? 

1863
01:48:41,520 --> 01:48:44,200
Yeah, Where e-commerce? 
That's e-commerce hats, yeah, 

1864
01:48:44,520 --> 01:48:47,680
yeah. 
So for for those use cases, 

1865
01:48:48,160 --> 01:48:51,080
deploying to multiple regions is
really nice. 

1866
01:48:51,440 --> 01:48:54,880
And and FLY also with with the 
Bluestack, it's configured with 

1867
01:48:55,320 --> 01:48:58,560
Postgres and fly supports 
Postgres cluster. 

1868
01:48:58,560 --> 01:49:02,040
So it'll automatically propagate
changes to all of the other 

1869
01:49:02,040 --> 01:49:05,080
databases within like 200 
milliseconds or less. 

1870
01:49:05,560 --> 01:49:07,960
When a change is made to the 
primary, it goes to all the 

1871
01:49:07,960 --> 01:49:12,080
other ones really pretty quick. 
And so and, and actually the 

1872
01:49:12,080 --> 01:49:16,600
other thing is you could, one 
concern that people have is, you

1873
01:49:16,600 --> 01:49:20,560
know, the GDPR stuff where data 
has to be stored in the country 

1874
01:49:20,560 --> 01:49:23,880
where the user's at or whatever.
So you can, you can do that with

1875
01:49:23,880 --> 01:49:26,720
fly as well, which is kind of 
interesting. 

1876
01:49:26,720 --> 01:49:31,240
But yeah, to point to the edge, 
it matters for some people, for 

1877
01:49:31,240 --> 01:49:35,560
others it really like if it's a 
matter of 500 millisecond 

1878
01:49:35,560 --> 01:49:38,760
difference, then it probably is 
not a huge deal. 

1879
01:49:41,440 --> 01:49:45,240
Nice, cool. 
I think we could probably pick 

1880
01:49:45,640 --> 01:49:49,680
Kent's brain all day long on 
remix, but it really makes me 

1881
01:49:49,680 --> 01:49:52,560
want to try more of it now, 
though, just to at least 

1882
01:49:52,560 --> 01:49:55,400
understand and be knowledgeable 
on on kind of more questions to 

1883
01:49:55,400 --> 01:49:58,160
ask. 
I keep thinking about like we I 

1884
01:49:58,160 --> 01:50:01,320
feel like we've rewritten coding
Kat a million times over back 

1885
01:50:01,320 --> 01:50:04,040
end, front end. 
And we were talking about like 

1886
01:50:04,040 --> 01:50:07,280
spelt kit, but spelt kit, we're 
having a lot of issue. 

1887
01:50:11,560 --> 01:50:14,400
Yeah, Steltkate is just going 
through a lot of API changes 

1888
01:50:14,400 --> 01:50:17,000
right now. 
It's coming up to one point O 

1889
01:50:17,000 --> 01:50:20,600
and they're just, they're doing 
a lot of API changes that are a 

1890
01:50:20,600 --> 01:50:23,720
little frustrating for the users
right now, but we'll get through

1891
01:50:23,720 --> 01:50:25,040
it. 
There's another big one coming 

1892
01:50:25,040 --> 01:50:28,360
that Rich posted about today. 
It's causing some uproar in the 

1893
01:50:28,360 --> 01:50:31,400
community. 
I I feel like the the biggest 

1894
01:50:31,400 --> 01:50:34,440
thing for me though is still 
React and frustrations with 

1895
01:50:34,440 --> 01:50:36,440
React. 
Do you find that there's less of

1896
01:50:36,440 --> 01:50:38,360
that with Remix? 
Oh yeah. 

1897
01:50:38,400 --> 01:50:39,720
Especially with state 
management. 

1898
01:50:39,960 --> 01:50:43,720
Yeah, the frustrations that 
people have with React don't 

1899
01:50:43,720 --> 01:50:47,200
really just. 
Just today, like I can see it 

1900
01:50:47,200 --> 01:50:52,280
here, like I am very outspoken, 
not really a fan of React and 

1901
01:50:52,960 --> 01:50:56,720
they know this on the show. 
Sorry, but this developer 

1902
01:50:56,720 --> 01:51:00,560
experience is much better and 
makes me feel better about using

1903
01:51:00,560 --> 01:51:03,520
React and JSXI can deal with 
this. 

1904
01:51:03,800 --> 01:51:07,160
Yeah. 
Well, and one of our employees 

1905
01:51:07,160 --> 01:51:10,600
who's working on the router, one
of the the big reasons that he 

1906
01:51:10,600 --> 01:51:12,680
is so excited about it is 
because he actually prefers 

1907
01:51:12,680 --> 01:51:16,920
view. 
And so he's absolutely going to 

1908
01:51:16,920 --> 01:51:19,680
be building a View version of 
Remix. 

1909
01:51:20,880 --> 01:51:26,600
And so and, and again, Austin 
was working on the spell router 

1910
01:51:26,600 --> 01:51:29,040
for Remix and, and so there 
could be a spell version of 

1911
01:51:29,040 --> 01:51:31,400
Remix. 
And we're, we are actively doing

1912
01:51:31,480 --> 01:51:35,280
work on some other things to 
make it easier to integrate 

1913
01:51:35,720 --> 01:51:41,200
remix with other build tools and
and other things as well. 

1914
01:51:42,160 --> 01:51:44,200
I don't want to talk too much 
about that because we haven't 

1915
01:51:44,200 --> 01:51:46,000
shipped anything. 
We tried to avoid talking about 

1916
01:51:46,000 --> 01:51:51,120
stuff we haven't shipped yet, 
but but yeah, so look forward to

1917
01:51:51,840 --> 01:51:54,640
things. 
If you started with React today 

1918
01:51:54,680 --> 01:51:59,240
with, with Remix today and 
started doing React then in a 

1919
01:51:59,240 --> 01:52:03,440
couple of months, if probably by
that time we'd support other 

1920
01:52:03,440 --> 01:52:05,160
frameworks. 
It wouldn't be like a lot of 

1921
01:52:05,160 --> 01:52:08,400
work to switch. 
Like it's literally just the the

1922
01:52:08,400 --> 01:52:14,000
UI like how you render HTML. 
So that's not very complicated 

1923
01:52:14,000 --> 01:52:17,520
to switch from JSX to, you know,
whatever else you want to use 

1924
01:52:17,760 --> 01:52:19,680
templates. 
Yeah, it sounds like a lot of a 

1925
01:52:19,680 --> 01:52:22,520
lot of exciting things are 
coming in the pipeline. 

1926
01:52:23,040 --> 01:52:25,760
Maybe I could go back to my 
Angular routes and still use 

1927
01:52:25,760 --> 01:52:26,840
Remix somehow? 
That'd be. 

1928
01:52:26,840 --> 01:52:29,280
Kind of, yeah. 
I mean somebody put together an 

1929
01:52:29,280 --> 01:52:34,080
Angular router with a Remix 
router, so if you want. 

1930
01:52:34,080 --> 01:52:38,800
To Austin is doing a talk on the
remix router spelt at spelt 

1931
01:52:38,800 --> 01:52:40,920
Summit. 
And I'm just, I'm really excited

1932
01:52:40,920 --> 01:52:42,200
to, I see that. 
Oh. 

1933
01:52:42,960 --> 01:52:46,240
Cool, I didn't know that. 
Oh and I haven't announced it on

1934
01:52:46,240 --> 01:52:49,280
here yet, I'm going to announce 
that I'm actually Co hosting Co 

1935
01:52:49,280 --> 01:52:52,080
MC ING the spelt summit. 
Oh, Congrats. 

1936
01:52:52,440 --> 01:52:55,480
I am so excited about that. 
We we talked about it on spelt 

1937
01:52:55,480 --> 01:52:58,440
radio yet. 
It's not out yet, but it'll be 

1938
01:52:58,560 --> 01:52:59,400
announced soon. 
That's. 

1939
01:53:00,000 --> 01:53:01,160
Awesome. 
Super exciting. 

1940
01:53:02,000 --> 01:53:05,080
That'll be sweet. 
I think that's probably it for 

1941
01:53:05,080 --> 01:53:08,440
Remix. 
I know B1 Mind has more 

1942
01:53:08,440 --> 01:53:11,880
questions on optimistic UI. 
Hopefully hit us up in the learn

1943
01:53:11,880 --> 01:53:13,640
buildings. 
Yeah, actually you know what I 

1944
01:53:13,640 --> 01:53:18,200
did? 
I gave a talk that went into 

1945
01:53:18,560 --> 01:53:20,880
optimistic UI quite a bit. 
So let me find a link to that 

1946
01:53:20,880 --> 01:53:25,960
and I'll put it in the whatever 
chat thing I was also. 

1947
01:53:25,960 --> 01:53:29,960
Going to ask, I finally have 
remembered to raid and I only 

1948
01:53:29,960 --> 01:53:32,520
see two people kind of out 
there. 

1949
01:53:32,520 --> 01:53:34,640
Did you want me to raid to you 
somehow, Brittany? 

1950
01:53:35,920 --> 01:53:38,120
No, it's OK because I'm not 
going to string right after 

1951
01:53:38,120 --> 01:53:39,600
this. 
I got to go check on my kids. 

1952
01:53:39,920 --> 01:53:41,960
They're running amok downstairs 
right now. 

1953
01:53:41,960 --> 01:53:44,480
I can hear it. 
OK. 

1954
01:53:44,520 --> 01:53:46,560
Thanks so much for for coming 
on. 

1955
01:53:46,560 --> 01:53:50,640
I if if I can like pin you right
now since you're on live, will 

1956
01:53:50,640 --> 01:53:53,480
you come back on once we learn 
more and can kind of ask you 

1957
01:53:53,480 --> 01:53:56,360
harder questions? 
Yeah, yeah, I'd love to come 

1958
01:53:56,360 --> 01:54:00,520
back and and dive in deeper. 
Like so far we've done like what

1959
01:54:00,520 --> 01:54:03,640
can you do without JavaScript? 
I'd like to talk about, OK, now 

1960
01:54:03,640 --> 01:54:06,120
we have JavaScript on the page. 
What JavaScript does it take to 

1961
01:54:06,680 --> 01:54:09,120
make this experience even better
than just what the browser can 

1962
01:54:09,120 --> 01:54:09,320
do? 
Oh. 

1963
01:54:09,320 --> 01:54:11,440
It'd be incredible. 
Let's schedule it up. 

1964
01:54:11,920 --> 01:54:13,360
Cool, cool. 
Sounds great. 

1965
01:54:13,360 --> 01:54:14,440
Awesome. 
All right. 

1966
01:54:14,440 --> 01:54:16,720
Well, thanks everybody. 
Happy weekend and we'll see you 

1967
01:54:16,720 --> 01:54:18,440
next week. 
All right, later. 

1968
01:54:18,760 --> 01:54:22,440
Take care, I need my music now. 
Do do do do.

