WEBVTT

1
00:00:06.639 --> 00:00:09.320
<v Speaker 1>Welcome to React round Up. I'm your host for today,

2
00:00:09.400 --> 00:00:13.560
<v Speaker 1>Jack Harrington, and with me is the incomparable TJ. Van Toll. Hey,

3
00:00:13.720 --> 00:00:17.000
<v Speaker 1>hey everybody, and our guest for today is veget i E.

4
00:00:17.600 --> 00:00:19.320
<v Speaker 1>Can you tell us a little about your background and

5
00:00:19.519 --> 00:00:22.679
<v Speaker 1>why you are of interest to the React round Up audience.

6
00:00:23.320 --> 00:00:26.640
<v Speaker 2>So my name is Vigit and I'm a software engineer

7
00:00:26.679 --> 00:00:29.679
<v Speaker 2>from Mumbai, India. I have been working with React and

8
00:00:29.719 --> 00:00:31.879
<v Speaker 2>reacting with you for the past couple of years and

9
00:00:32.079 --> 00:00:35.159
<v Speaker 2>recently I also started working with not js. When I'm

10
00:00:35.359 --> 00:00:37.920
<v Speaker 2>not at work, you will find me writing guides and

11
00:00:38.039 --> 00:00:41.880
<v Speaker 2>articles for Medium, log Rocket and my personal blog.

12
00:00:42.039 --> 00:00:43.719
<v Speaker 3>So yeah, that is pretty much.

13
00:00:44.079 --> 00:00:48.679
<v Speaker 1>That's awesome. So I know you recently wrote a blog

14
00:00:48.840 --> 00:00:51.759
<v Speaker 1>post on React took form. It's a personal favorite of

15
00:00:51.799 --> 00:00:52.960
<v Speaker 1>mine when you tell us a little bit rather it

16
00:00:53.240 --> 00:00:54.439
<v Speaker 1>so yeah.

17
00:00:54.479 --> 00:00:59.200
<v Speaker 2>So React hook form is basically a library that helps

18
00:00:59.240 --> 00:01:02.280
<v Speaker 2>you handle and manage state of the font like in

19
00:01:02.280 --> 00:01:04.120
<v Speaker 2>a very easy and clear way.

20
00:01:04.239 --> 00:01:07.280
<v Speaker 1>Yeah, very cool. So does that can include things like validation?

21
00:01:07.879 --> 00:01:13.400
<v Speaker 2>Yeah, it includes validation of state management like form data management,

22
00:01:13.599 --> 00:01:17.519
<v Speaker 2>and it has like it has a great developer experience

23
00:01:17.799 --> 00:01:20.280
<v Speaker 2>and one of the cool things I like about React

24
00:01:20.319 --> 00:01:24.920
<v Speaker 2>took form is that it has isolated rerenders, so when

25
00:01:25.599 --> 00:01:28.400
<v Speaker 2>a data in the form changes, so only that particular

26
00:01:28.439 --> 00:01:31.120
<v Speaker 2>component or input changes and not the whole form.

27
00:01:31.200 --> 00:01:35.719
<v Speaker 3>So that's a huge plus on the performance side.

28
00:01:35.840 --> 00:01:37.959
<v Speaker 4>Yeah, and even to take a step back, I've always

29
00:01:37.959 --> 00:01:42.159
<v Speaker 4>found it interesting how React really doesn't give you much.

30
00:01:42.719 --> 00:01:44.120
<v Speaker 4>You could argue it doesn't really give you much of

31
00:01:44.159 --> 00:01:48.439
<v Speaker 4>anything for handling forms, which I mean like there's two

32
00:01:48.879 --> 00:01:50.680
<v Speaker 4>like anything else. Right, you can look at it like, oh,

33
00:01:50.719 --> 00:01:53.599
<v Speaker 4>that's a positive because it enables this ecosystem of things,

34
00:01:53.799 --> 00:01:56.159
<v Speaker 4>but it could also be construed as a negative because

35
00:01:56.159 --> 00:01:58.480
<v Speaker 4>if you just went straight to the React documentation right

36
00:01:58.519 --> 00:02:01.079
<v Speaker 4>and you looked for building a form, you probably woth

37
00:02:01.159 --> 00:02:03.719
<v Speaker 4>walk away from that pretty disappointed because it's it's not

38
00:02:03.840 --> 00:02:07.560
<v Speaker 4>really gonna do a whole ton for you. So I'm curious,

39
00:02:07.599 --> 00:02:10.240
<v Speaker 4>like what forms are? What sort of forms are you building?

40
00:02:10.439 --> 00:02:13.719
<v Speaker 4>Like what made you like drawn to React form? Maybe

41
00:02:13.719 --> 00:02:15.120
<v Speaker 4>you could just lay out a little bit of like

42
00:02:15.400 --> 00:02:17.879
<v Speaker 4>the form landscape of React, like what are there other

43
00:02:17.919 --> 00:02:22.159
<v Speaker 4>options you explored other things? Because I think we could

44
00:02:22.879 --> 00:02:25.319
<v Speaker 4>there's a lot we could potentially cover with this because

45
00:02:25.319 --> 00:02:26.199
<v Speaker 4>there's a lot out there.

46
00:02:26.319 --> 00:02:29.960
<v Speaker 2>Correct, So like when I was starting out. I started

47
00:02:29.960 --> 00:02:34.719
<v Speaker 2>with reducs form I guess so like I didn't know

48
00:02:34.759 --> 00:02:37.439
<v Speaker 2>that there was other options. So for me, reducts was

49
00:02:37.479 --> 00:02:40.159
<v Speaker 2>a go to library when it came to state management.

50
00:02:40.560 --> 00:02:43.560
<v Speaker 2>But as I explored more than I realized that, okay,

51
00:02:43.599 --> 00:02:46.599
<v Speaker 2>so I don't need the whole state like the form

52
00:02:46.639 --> 00:02:50.599
<v Speaker 2>state to be in the global states. So I decided that, okay, cool,

53
00:02:50.919 --> 00:02:53.759
<v Speaker 2>so I need to look out for a new library.

54
00:02:53.960 --> 00:02:58.319
<v Speaker 2>So then I looked up Formic. So Formic was a great,

55
00:02:58.680 --> 00:03:01.080
<v Speaker 2>great library for me, like it worked like. I used

56
00:03:01.080 --> 00:03:04.319
<v Speaker 2>to install that on pretty much every project that I

57
00:03:04.439 --> 00:03:08.520
<v Speaker 2>worked on until I found React hook form that was

58
00:03:09.000 --> 00:03:11.719
<v Speaker 2>even more like. I found it even more better in

59
00:03:11.800 --> 00:03:15.039
<v Speaker 2>terms of performance and developer experience. Now, when I was

60
00:03:15.080 --> 00:03:18.400
<v Speaker 2>working with form the thing was that I had to use, uh,

61
00:03:18.960 --> 00:03:22.800
<v Speaker 2>the rapper for a Formic component higher ordered component. So

62
00:03:23.240 --> 00:03:25.639
<v Speaker 2>I thought that, okay, maybe this could be this could

63
00:03:25.639 --> 00:03:29.360
<v Speaker 2>be much better. And then I started looking around and

64
00:03:29.560 --> 00:03:33.560
<v Speaker 2>I found this great library, React hook form that that

65
00:03:33.960 --> 00:03:36.080
<v Speaker 2>just like that was very great one.

66
00:03:36.599 --> 00:03:38.439
<v Speaker 3>And yeah, the only.

67
00:03:38.479 --> 00:03:40.680
<v Speaker 2>Part of React hook form is that it does not

68
00:03:41.159 --> 00:03:43.879
<v Speaker 2>work with class components out of the box, so you

69
00:03:43.960 --> 00:03:46.719
<v Speaker 2>have to create a you know, a rapper or something

70
00:03:46.759 --> 00:03:46.960
<v Speaker 2>like that.

71
00:03:47.199 --> 00:03:49.199
<v Speaker 1>Are you using a lot of class components.

72
00:03:49.240 --> 00:03:53.039
<v Speaker 2>Not really like currently, like the code base currently I'm

73
00:03:53.039 --> 00:03:57.039
<v Speaker 2>working on it much has everything on function components.

74
00:03:58.240 --> 00:03:58.599
<v Speaker 3>Issue.

75
00:03:58.680 --> 00:04:01.280
<v Speaker 1>Yeah yeah, yeah, so can you tell folks who haven't

76
00:04:01.319 --> 00:04:03.479
<v Speaker 1>actually tried out React to form, like, so, what are

77
00:04:03.520 --> 00:04:05.280
<v Speaker 1>the basic mechanics of using this?

78
00:04:05.639 --> 00:04:09.159
<v Speaker 3>So, like you can just use the use like it

79
00:04:09.199 --> 00:04:11.000
<v Speaker 3>has use form hook.

80
00:04:11.439 --> 00:04:15.599
<v Speaker 2>So the use form hook basically returns an object with

81
00:04:15.879 --> 00:04:22.120
<v Speaker 2>the a registered function as set values function values object

82
00:04:22.959 --> 00:04:26.720
<v Speaker 2>and the errors and ceter So these are the basic ones.

83
00:04:27.240 --> 00:04:30.560
<v Speaker 2>And so if you want to you know, get data

84
00:04:30.600 --> 00:04:34.120
<v Speaker 2>from an input you just passed the you just destructure

85
00:04:34.120 --> 00:04:37.480
<v Speaker 2>the registered object on that input and it will just

86
00:04:37.720 --> 00:04:40.240
<v Speaker 2>do its own magic. So that is like a very

87
00:04:40.240 --> 00:04:41.240
<v Speaker 2>basic implementation.

88
00:04:41.680 --> 00:04:41.959
<v Speaker 1>Nice.

89
00:04:42.199 --> 00:04:45.120
<v Speaker 2>Right, you don't have any use a wrapper component or

90
00:04:45.160 --> 00:04:46.000
<v Speaker 2>anything like that.

91
00:04:46.680 --> 00:04:49.439
<v Speaker 1>Nice. And does it work with stuff like material, UI

92
00:04:49.600 --> 00:04:51.639
<v Speaker 1>or components like that if you were using.

93
00:04:51.480 --> 00:04:55.439
<v Speaker 2>Those, Yeah, it does work with material Like any third

94
00:04:55.480 --> 00:04:59.720
<v Speaker 2>party component that has ref that exposes the ref, you

95
00:04:59.759 --> 00:05:02.639
<v Speaker 2>can pretty much use React hook form with it. But

96
00:05:02.879 --> 00:05:06.800
<v Speaker 2>in some cases we don't usually get the option to

97
00:05:07.079 --> 00:05:11.600
<v Speaker 2>use ref. So you can use the controller component or

98
00:05:11.639 --> 00:05:15.639
<v Speaker 2>the use controller hook of React hook phone. Yeah, and

99
00:05:15.759 --> 00:05:17.600
<v Speaker 2>that will do the trick for you.

100
00:05:18.040 --> 00:05:20.279
<v Speaker 1>So I remember from the documentation there were some really

101
00:05:20.319 --> 00:05:23.800
<v Speaker 1>good examples of all of the systems working together, so

102
00:05:24.120 --> 00:05:25.560
<v Speaker 1>it's very well documented that way.

103
00:05:25.800 --> 00:05:29.959
<v Speaker 2>Yeah, the documentation is really nice, and they have like

104
00:05:30.040 --> 00:05:35.079
<v Speaker 2>they have the API difference of every every component, every

105
00:05:35.120 --> 00:05:39.040
<v Speaker 2>hook that they have, and it's very very well explained

106
00:05:39.079 --> 00:05:42.480
<v Speaker 2>and detailed there. So like your single source of truth

107
00:05:42.519 --> 00:05:43.600
<v Speaker 2>would be the documentation.

108
00:05:44.519 --> 00:05:44.800
<v Speaker 1>Nice.

109
00:05:44.920 --> 00:05:47.920
<v Speaker 4>And I'm really interested in the performance aspect of this

110
00:05:48.000 --> 00:05:50.439
<v Speaker 4>because I've just been kind of producing the react took

111
00:05:50.560 --> 00:05:53.720
<v Speaker 4>forms because in my head, like the two big players

112
00:05:53.759 --> 00:05:57.439
<v Speaker 4>in the react form world are formic in React took form,

113
00:05:57.519 --> 00:05:59.360
<v Speaker 4>or at least those are the two that seem to

114
00:05:59.360 --> 00:06:01.600
<v Speaker 4>come up to them in it. It sounds like which

115
00:06:01.639 --> 00:06:04.720
<v Speaker 4>you said, like performance was the main sort of differentiating

116
00:06:05.240 --> 00:06:08.879
<v Speaker 4>feature for you. So I'm curious, like, did you what

117
00:06:08.959 --> 00:06:12.439
<v Speaker 4>were using to like benchmarker determine those performance problems? Were

118
00:06:12.480 --> 00:06:14.959
<v Speaker 4>you using like benchmarks numbers or was it bad enough

119
00:06:14.959 --> 00:06:19.120
<v Speaker 4>that like it was even like visibly noticeable in your applications.

120
00:06:19.480 --> 00:06:21.360
<v Speaker 3>Yeah, So I'll tell your story.

121
00:06:21.439 --> 00:06:25.480
<v Speaker 2>So I got this you know form which had over

122
00:06:25.519 --> 00:06:29.399
<v Speaker 2>twenty twenty four twenty five inputs, so and there was

123
00:06:29.439 --> 00:06:31.879
<v Speaker 2>no library being used there, so it was just a

124
00:06:32.480 --> 00:06:35.160
<v Speaker 2>I think it was a custom book with the US

125
00:06:35.800 --> 00:06:38.839
<v Speaker 2>reducer or used it, I think. And what was happening

126
00:06:38.920 --> 00:06:42.519
<v Speaker 2>is every time you know, press the keyboard on any input,

127
00:06:43.240 --> 00:06:47.120
<v Speaker 2>so the whole form rendered, and the form was quite heavy,

128
00:06:47.399 --> 00:06:50.839
<v Speaker 2>like it had twenty five inputs in there, and every

129
00:06:50.839 --> 00:06:53.879
<v Speaker 2>time you pressed a key the whole form would lag.

130
00:06:54.040 --> 00:06:57.199
<v Speaker 3>You would visibly see it. So it was the worst.

131
00:06:57.279 --> 00:07:00.800
<v Speaker 2>So then I had to take a call, so like

132
00:07:01.199 --> 00:07:05.560
<v Speaker 2>I migrated from that custom hook to the React hook form.

133
00:07:05.759 --> 00:07:09.399
<v Speaker 1>Nice. So for folks who are in your like doing

134
00:07:09.399 --> 00:07:12.279
<v Speaker 1>the kind of stuff that you did with reducs and

135
00:07:12.399 --> 00:07:16.959
<v Speaker 1>forums managed in reducts, does using something like reactric form

136
00:07:17.160 --> 00:07:19.879
<v Speaker 1>preclude using reducts? Can you use the two together?

137
00:07:20.240 --> 00:07:20.439
<v Speaker 3>Yeah?

138
00:07:20.480 --> 00:07:23.680
<v Speaker 2>Yeah, you can definitely use them together. And you know,

139
00:07:24.000 --> 00:07:26.680
<v Speaker 2>they both have different functions. So for example, if you think,

140
00:07:27.000 --> 00:07:29.279
<v Speaker 2>if my like, the real question is do you want

141
00:07:29.279 --> 00:07:31.759
<v Speaker 2>your form state to be global or not? If you like,

142
00:07:31.879 --> 00:07:33.920
<v Speaker 2>if you want it to be global, you can go

143
00:07:34.000 --> 00:07:37.439
<v Speaker 2>with reducts form not a problem. But but in most

144
00:07:37.480 --> 00:07:41.000
<v Speaker 2>cases the I think the form states should be local,

145
00:07:41.120 --> 00:07:43.160
<v Speaker 2>like should be local to that particular component.

146
00:07:43.439 --> 00:07:46.360
<v Speaker 3>And so React hook form just does a job for you.

147
00:07:46.720 --> 00:07:50.000
<v Speaker 1>So you use reactric form then to manage the local form,

148
00:07:50.040 --> 00:07:53.519
<v Speaker 1>and then once it's done or saved or canceled, then

149
00:07:53.519 --> 00:07:56.639
<v Speaker 1>you'd fire off an action to reducces, say this is

150
00:07:56.680 --> 00:08:00.000
<v Speaker 1>the new state that kind of thing. Okay, well, very nice.

151
00:08:00.199 --> 00:08:02.600
<v Speaker 4>I'm curious. I keep coming back to the performance aspect

152
00:08:02.600 --> 00:08:07.360
<v Speaker 4>of this. But for the isolated like re render stuff

153
00:08:08.120 --> 00:08:11.120
<v Speaker 4>that's is that just built into the way react hook

154
00:08:11.160 --> 00:08:13.959
<v Speaker 4>form works. Is there something you have to be like

155
00:08:14.319 --> 00:08:17.600
<v Speaker 4>careful of of how you approach things, or like are

156
00:08:17.600 --> 00:08:20.120
<v Speaker 4>there any sort of like foot guns or things to

157
00:08:20.160 --> 00:08:22.319
<v Speaker 4>be aware of or does it kind of just is

158
00:08:22.319 --> 00:08:24.160
<v Speaker 4>that just sort of the design that it works in

159
00:08:24.199 --> 00:08:26.000
<v Speaker 4>that isolated sort of way.

160
00:08:26.480 --> 00:08:30.519
<v Speaker 2>Yeah, reactok form is built with performance in mind. So

161
00:08:30.920 --> 00:08:35.559
<v Speaker 2>it uses uncontrolled inputs, right, it leverages ref so that

162
00:08:35.639 --> 00:08:39.600
<v Speaker 2>the whole component does not rerender us only that particular input.

163
00:08:39.919 --> 00:08:40.360
<v Speaker 1>I see.

164
00:08:40.679 --> 00:08:45.039
<v Speaker 4>So, and I'm guessing, like, does does formic work more

165
00:08:45.159 --> 00:08:47.480
<v Speaker 4>or yeah? Does formic work more on like a controlled

166
00:08:47.519 --> 00:08:52.159
<v Speaker 4>basis then where it's actually having to then adapt like

167
00:08:52.320 --> 00:08:55.360
<v Speaker 4>sort of rerender based off like each key pressor to

168
00:08:55.480 --> 00:08:56.960
<v Speaker 4>like each change that sort of thing.

169
00:08:57.039 --> 00:09:01.399
<v Speaker 2>Yeah, Yeah, formic does that. Formic rerenders on every change.

170
00:09:01.840 --> 00:09:04.440
<v Speaker 2>Like it's been a while since I used phoming, so

171
00:09:04.679 --> 00:09:06.200
<v Speaker 2>like I don't know the currents.

172
00:09:06.320 --> 00:09:09.120
<v Speaker 4>Yeah, and it's interesting too because I think it I'm

173
00:09:09.120 --> 00:09:11.399
<v Speaker 4>guessing it sort of depends on what you're building, right,

174
00:09:11.440 --> 00:09:15.360
<v Speaker 4>because that you're considerations for building a log in form,

175
00:09:15.519 --> 00:09:18.000
<v Speaker 4>like chances are like you're not going to hit any

176
00:09:18.039 --> 00:09:21.200
<v Speaker 4>performance issues on a username and a passwords sort of thing.

177
00:09:21.320 --> 00:09:24.200
<v Speaker 4>But I think with forms specifically, like it's totally reasonable

178
00:09:24.240 --> 00:09:27.759
<v Speaker 4>they have forms with twenty some inputs. I've worked on

179
00:09:28.159 --> 00:09:30.679
<v Speaker 4>big insurance apps in the past, and those things are

180
00:09:30.720 --> 00:09:35.320
<v Speaker 4>just absolute monsters, right, So it's it's those are like

181
00:09:35.440 --> 00:09:38.679
<v Speaker 4>real world, real considerations. So it's I don't know. I

182
00:09:38.679 --> 00:09:40.200
<v Speaker 4>don't know if there's a question here. I'm just sort

183
00:09:40.240 --> 00:09:43.360
<v Speaker 4>of interested in the different approaches these libraries are taking.

184
00:09:43.519 --> 00:09:45.559
<v Speaker 1>Yeah, I think it'd be interesting to talk about controlled

185
00:09:45.639 --> 00:09:48.799
<v Speaker 1>versus uncontrolled, because I don't know if everybody is up

186
00:09:48.840 --> 00:09:51.799
<v Speaker 1>to speed on that. So a controlled input is when

187
00:09:52.360 --> 00:09:53.759
<v Speaker 1>and this is what you see kind of in that

188
00:09:53.879 --> 00:09:58.919
<v Speaker 1>traditional React walkthrough, which is like you've got use date,

189
00:09:59.159 --> 00:10:01.159
<v Speaker 1>you know, which would be have your state of your

190
00:10:01.240 --> 00:10:03.879
<v Speaker 1>text field right, and you have value equals and that

191
00:10:03.960 --> 00:10:06.080
<v Speaker 1>value and then on change you go and set the

192
00:10:06.080 --> 00:10:09.200
<v Speaker 1>state and all that, and that would be a controlled input, right,

193
00:10:09.240 --> 00:10:11.120
<v Speaker 1>and then uncontrolled input is where you just have a

194
00:10:11.159 --> 00:10:13.840
<v Speaker 1>ref and you got a ref to that that component,

195
00:10:14.200 --> 00:10:16.120
<v Speaker 1>and then when you need the value, you just go

196
00:10:16.159 --> 00:10:19.039
<v Speaker 1>to the ref dot current dot value whatever it is,

197
00:10:19.279 --> 00:10:21.320
<v Speaker 1>and you get the value and then there you go.

198
00:10:21.480 --> 00:10:25.200
<v Speaker 1>And there's a big speed boost in using those uncontrolled components.

199
00:10:25.200 --> 00:10:28.039
<v Speaker 1>And actually in the React documentation they now recommend that.

200
00:10:28.159 --> 00:10:31.279
<v Speaker 1>So if if that's the basic mechanism of reactive form

201
00:10:31.360 --> 00:10:34.519
<v Speaker 1>is to do that with uncontrolled inputs, that's actually really cool.

202
00:10:34.720 --> 00:10:37.279
<v Speaker 4>Yeah, yeah, And I think also too for beginners, like

203
00:10:37.639 --> 00:10:40.519
<v Speaker 4>if anybody here hasn't tried building a form and React

204
00:10:40.559 --> 00:10:45.639
<v Speaker 4>without any libraries, it's it's a worthwhile effort to do once,

205
00:10:45.720 --> 00:10:49.559
<v Speaker 4>probably only once, just to see how painful it can get.

206
00:10:49.679 --> 00:10:51.840
<v Speaker 4>Cause it sounds like you say, like, oh, you like

207
00:10:52.000 --> 00:10:54.000
<v Speaker 4>use state and then like you need an un change

208
00:10:54.080 --> 00:10:56.919
<v Speaker 4>handler that updates the state, and like you do it

209
00:10:56.919 --> 00:10:59.919
<v Speaker 4>for one form control and it's like, oh, okay, whatever,

210
00:11:00.039 --> 00:11:02.639
<v Speaker 4>But then you work in a real app that has

211
00:11:02.960 --> 00:11:05.200
<v Speaker 4>once you get to like three or four fields on

212
00:11:05.240 --> 00:11:09.440
<v Speaker 4>a form, you instantly realize like okay, like I do

213
00:11:09.519 --> 00:11:11.679
<v Speaker 4>not want to type this anymore. I'm either going to

214
00:11:11.720 --> 00:11:14.240
<v Speaker 4>make a mistake or like, I'm going to lose my

215
00:11:14.360 --> 00:11:17.559
<v Speaker 4>mind typing all of this out. So I think that's

216
00:11:17.639 --> 00:11:20.879
<v Speaker 4>what leads you to the Google searches that brings us

217
00:11:20.919 --> 00:11:23.679
<v Speaker 4>to a library like this, because it just gets it

218
00:11:23.679 --> 00:11:26.320
<v Speaker 4>gets monotonous at any sort of scale whatsoever.

219
00:11:26.639 --> 00:11:30.600
<v Speaker 1>Oh yeah, there's validation, and then there's also managing dirty

220
00:11:30.639 --> 00:11:34.120
<v Speaker 1>state and errors. You know, it's not an error until

221
00:11:34.159 --> 00:11:36.919
<v Speaker 1>somebody puts in the wrong value and then it's dirty

222
00:11:36.960 --> 00:11:39.120
<v Speaker 1>and it's an error and all. And you have to

223
00:11:39.120 --> 00:11:41.360
<v Speaker 1>do this on a per field basis. It's a huge,

224
00:11:42.000 --> 00:11:43.360
<v Speaker 1>huge pain. Yeah.

225
00:11:43.440 --> 00:11:46.559
<v Speaker 4>Actually that leads me to a question. So with re form,

226
00:11:46.679 --> 00:11:49.559
<v Speaker 4>is it only about the like logic end of things.

227
00:11:49.559 --> 00:11:52.600
<v Speaker 4>Does it help you presentationally at all? Like, well does it?

228
00:11:52.919 --> 00:11:54.799
<v Speaker 4>Or is that totally up to you, Like will it

229
00:11:54.840 --> 00:11:59.279
<v Speaker 4>help with where you place validation messages or anything like that?

230
00:12:00.080 --> 00:12:04.879
<v Speaker 2>Not really, Like it does not help with any presentation side,

231
00:12:04.960 --> 00:12:08.240
<v Speaker 2>but it does give you the independence to you know,

232
00:12:08.399 --> 00:12:12.080
<v Speaker 2>work with whatever design you got and you can access

233
00:12:12.200 --> 00:12:15.840
<v Speaker 2>the errors object from the you know, used formbook and

234
00:12:15.879 --> 00:12:18.799
<v Speaker 2>then you know you just placed wherever you don't want

235
00:12:18.799 --> 00:12:20.480
<v Speaker 2>the error to be displayed.

236
00:12:20.600 --> 00:12:23.200
<v Speaker 4>Do you have any libraries you've used or you've recommend

237
00:12:23.240 --> 00:12:25.039
<v Speaker 4>for that sort of thing, because I think probably for

238
00:12:25.120 --> 00:12:28.120
<v Speaker 4>most people you need a form like this almost to

239
00:12:28.159 --> 00:12:30.000
<v Speaker 4>me sounds like one part of the problem, right, Like

240
00:12:30.039 --> 00:12:32.279
<v Speaker 4>I need like the plumbing under the hood, But then

241
00:12:32.919 --> 00:12:35.279
<v Speaker 4>I also want my inputs to look good. I want

242
00:12:35.679 --> 00:12:38.480
<v Speaker 4>air messages to show up logically, because I mean we

243
00:12:38.519 --> 00:12:41.120
<v Speaker 4>could almost have a full conversation on the UX side

244
00:12:41.120 --> 00:12:44.279
<v Speaker 4>of like how forms are supposed to work, right, because

245
00:12:44.279 --> 00:12:46.639
<v Speaker 4>that can come into play too, and libraries can somewhat

246
00:12:46.679 --> 00:12:48.639
<v Speaker 4>help with that. So I'm curious what you've used in

247
00:12:48.679 --> 00:12:50.360
<v Speaker 4>the past for that sort of thing, and if you

248
00:12:50.399 --> 00:12:52.000
<v Speaker 4>have any recommendations.

249
00:12:52.279 --> 00:12:55.559
<v Speaker 2>So I've worked with material Ui before, like I have

250
00:12:55.759 --> 00:13:00.000
<v Speaker 2>used material Ui Bootstrap and yeah, also Bulma. So these

251
00:13:00.120 --> 00:13:03.279
<v Speaker 2>libraries help with the presentation site. So you can simply

252
00:13:03.320 --> 00:13:07.039
<v Speaker 2>integrate reac hook foam with these you know, UI liabilities,

253
00:13:07.360 --> 00:13:09.120
<v Speaker 2>and it is pretty seamless.

254
00:13:09.159 --> 00:13:12.720
<v Speaker 4>And and I think I think these hook libraries, I

255
00:13:12.720 --> 00:13:16.600
<v Speaker 4>think both hook form and form it They're they're tiny,

256
00:13:16.679 --> 00:13:19.240
<v Speaker 4>aren't they like that? Do people have to be worried

257
00:13:19.240 --> 00:13:22.440
<v Speaker 4>about file size of this? I'm pretty sure they're small.

258
00:13:22.759 --> 00:13:26.320
<v Speaker 2>Yeah, the yag hook foam has like yeah, has a

259
00:13:26.440 --> 00:13:30.480
<v Speaker 2>very tiny size, like I think it's file six sky.

260
00:13:31.000 --> 00:13:33.639
<v Speaker 4>Oh yeah, that's that's tiny.

261
00:13:34.519 --> 00:13:36.559
<v Speaker 1>Yeah. Bundle Phobia I think puts it at twenty four,

262
00:13:36.559 --> 00:13:39.759
<v Speaker 1>which is still like super light. Bundle Phobia is a

263
00:13:39.799 --> 00:13:41.840
<v Speaker 1>great site for doing that kind of stuff.

264
00:13:41.919 --> 00:13:43.840
<v Speaker 4>I love that name, bundle Phobia.

265
00:13:43.919 --> 00:13:49.159
<v Speaker 1>Bundle Phobia, yeah, absolutely, So you went from reducts to hooks, right,

266
00:13:49.519 --> 00:13:52.080
<v Speaker 1>and tell us a little bit about that that migration

267
00:13:52.200 --> 00:13:54.320
<v Speaker 1>for you, because I think it is a very different

268
00:13:54.399 --> 00:13:57.679
<v Speaker 1>model of thinking about how you manage and structure and

269
00:13:57.720 --> 00:13:59.440
<v Speaker 1>store state right right.

270
00:13:59.519 --> 00:14:04.120
<v Speaker 2>So, like like any other bigner developer, I decided straight

271
00:14:04.159 --> 00:14:08.320
<v Speaker 2>away that I wanted to use reducts because everywhere I

272
00:14:08.360 --> 00:14:12.120
<v Speaker 2>looked online everyone was like, okay, you if you're using React,

273
00:14:12.159 --> 00:14:15.559
<v Speaker 2>you also need a state management library like reducts or morbids.

274
00:14:15.679 --> 00:14:20.240
<v Speaker 2>So I was so okay, I was like ticket, let's okay, fine,

275
00:14:20.279 --> 00:14:20.919
<v Speaker 2>let's go with it.

276
00:14:21.399 --> 00:14:22.759
<v Speaker 3>Let's go with reducts.

277
00:14:22.799 --> 00:14:25.879
<v Speaker 2>And I pretty much started with there, and then I've

278
00:14:26.200 --> 00:14:29.799
<v Speaker 2>like gott into this form problem, like I didn't like

279
00:14:29.840 --> 00:14:31.879
<v Speaker 2>I had to write the form myself.

280
00:14:31.919 --> 00:14:34.600
<v Speaker 3>So I was like, okay, let's go with the reducts form.

281
00:14:34.600 --> 00:14:38.080
<v Speaker 2>Because it is you know, compatible, So I choose that,

282
00:14:38.720 --> 00:14:42.559
<v Speaker 2>and then after that I was like, then then I

283
00:14:42.639 --> 00:14:45.879
<v Speaker 2>realized that, Okay, I don't need reducts for every project

284
00:14:45.879 --> 00:14:50.200
<v Speaker 2>that I work on, so I can use context, right,

285
00:14:50.360 --> 00:14:54.919
<v Speaker 2>I can use context. So then yeah, then I sort

286
00:14:54.960 --> 00:14:58.879
<v Speaker 2>of changed my thought process into you know, think statement

287
00:14:58.960 --> 00:15:02.399
<v Speaker 2>management from a component level instead of a global level.

288
00:15:02.679 --> 00:15:05.559
<v Speaker 1>School. Yeah, and were there anything? Was there any learning

289
00:15:05.559 --> 00:15:07.240
<v Speaker 1>that you had to do to make that happen? Like,

290
00:15:07.440 --> 00:15:09.720
<v Speaker 1>were there any like, oh, yeah, I have to rethink

291
00:15:09.759 --> 00:15:12.519
<v Speaker 1>my thinking about how I would do this versus that.

292
00:15:13.000 --> 00:15:16.519
<v Speaker 2>Not really like I just you know, I've just been

293
00:15:16.559 --> 00:15:20.320
<v Speaker 2>through a couple of guides on those topics like how

294
00:15:20.360 --> 00:15:24.480
<v Speaker 2>to structure your React project or how to organize your

295
00:15:24.480 --> 00:15:25.000
<v Speaker 2>React code.

296
00:15:25.559 --> 00:15:28.279
<v Speaker 3>So those those sort of topics.

297
00:15:28.759 --> 00:15:29.840
<v Speaker 1>Yeah, that is it.

298
00:15:30.320 --> 00:15:34.120
<v Speaker 4>See it said you have some React Native experience as well,

299
00:15:34.279 --> 00:15:38.000
<v Speaker 4>So I'm curious what the form world is like there,

300
00:15:38.000 --> 00:15:40.840
<v Speaker 4>because it looks like reacts hook forms websites as they

301
00:15:40.960 --> 00:15:43.840
<v Speaker 4>run on React Native as well. So are you using

302
00:15:43.879 --> 00:15:47.720
<v Speaker 4>the same library on the web and native. How does

303
00:15:47.720 --> 00:15:48.480
<v Speaker 4>all that work?

304
00:15:49.159 --> 00:15:49.399
<v Speaker 3>Yes?

305
00:15:49.519 --> 00:15:52.240
<v Speaker 2>Yes, so on the native world as well. Like I

306
00:15:52.360 --> 00:15:55.759
<v Speaker 2>used to work with formic, but then I switch to

307
00:15:55.919 --> 00:16:00.200
<v Speaker 2>use form this React hook form and the ideal is

308
00:16:00.240 --> 00:16:03.840
<v Speaker 2>that you cannot use ref directly, so you had to

309
00:16:03.960 --> 00:16:06.960
<v Speaker 2>use Unfortunately, you had to use the controller higher order

310
00:16:07.039 --> 00:16:08.960
<v Speaker 2>component for that in reacty to do.

311
00:16:09.240 --> 00:16:13.039
<v Speaker 4>And so what does that mean, Like you're like, is

312
00:16:13.080 --> 00:16:17.200
<v Speaker 4>it like registering what the components are? So like because

313
00:16:17.200 --> 00:16:19.759
<v Speaker 4>I imagine like the part that and I did some

314
00:16:19.840 --> 00:16:21.840
<v Speaker 4>native stuff for a while too, but this still blows

315
00:16:21.840 --> 00:16:24.720
<v Speaker 4>my mind. But like something about the act of like

316
00:16:24.840 --> 00:16:29.360
<v Speaker 4>React talking to like native Valus and native anderid controls.

317
00:16:29.399 --> 00:16:32.720
<v Speaker 4>I imagine what like this is like wrapping it so

318
00:16:32.840 --> 00:16:36.919
<v Speaker 4>that format knows how to talk to those React native controls.

319
00:16:37.000 --> 00:16:39.679
<v Speaker 4>That more or less am I'm making things up?

320
00:16:39.919 --> 00:16:43.440
<v Speaker 2>Yeah, like the same thing, only because like the controller,

321
00:16:44.039 --> 00:16:47.919
<v Speaker 2>like in React to your the native inputs have these

322
00:16:48.639 --> 00:16:53.200
<v Speaker 2>props like on change, text, on blur, et cetera. So

323
00:16:53.279 --> 00:16:57.639
<v Speaker 2>these work like these do the same job as your

324
00:16:57.879 --> 00:16:59.200
<v Speaker 2>web web component.

325
00:16:59.480 --> 00:17:01.240
<v Speaker 3>So so that is pretty much it.

326
00:17:01.440 --> 00:17:06.160
<v Speaker 2>And uh basically controller has this uh rend render prop

327
00:17:06.400 --> 00:17:09.559
<v Speaker 2>render prop which gives you these value on change, these

328
00:17:10.039 --> 00:17:13.799
<v Speaker 2>properties like on change and value of that particular field,

329
00:17:14.559 --> 00:17:18.400
<v Speaker 2>and then you can just simply map those field to

330
00:17:18.599 --> 00:17:19.319
<v Speaker 2>your component.

331
00:17:19.480 --> 00:17:23.160
<v Speaker 3>Like for example, your input can have a name and yeah,

332
00:17:23.200 --> 00:17:26.000
<v Speaker 3>so important part is that the controller must have a

333
00:17:26.319 --> 00:17:30.400
<v Speaker 3>name property. Otherwise the uh uh, the form wouldn't know

334
00:17:30.440 --> 00:17:31.240
<v Speaker 3>which field it is.

335
00:17:31.559 --> 00:17:34.440
<v Speaker 1>That's meant so I'm curious the React native application that

336
00:17:34.480 --> 00:17:37.160
<v Speaker 1>you're working on, is it the same form as the

337
00:17:37.200 --> 00:17:38.519
<v Speaker 1>one that you had on the web?

338
00:17:39.359 --> 00:17:39.680
<v Speaker 3>No?

339
00:17:39.680 --> 00:17:43.480
<v Speaker 2>No, no, you don't have that much inputs in that

340
00:17:43.519 --> 00:17:45.680
<v Speaker 2>form like simple log in, logout.

341
00:17:45.880 --> 00:17:49.400
<v Speaker 1>Yeah, all right, because I think it's great the idea

342
00:17:49.480 --> 00:17:53.720
<v Speaker 1>of sharing business logic code like validation and how the

343
00:17:53.759 --> 00:17:57.000
<v Speaker 1>forms work together, independencies and the configuration of that and

344
00:17:57.039 --> 00:18:01.200
<v Speaker 1>sharing that between React and React Native. I would love

345
00:18:01.279 --> 00:18:05.240
<v Speaker 1>to see that because that's the point, right. Yeah.

346
00:18:05.319 --> 00:18:07.640
<v Speaker 4>Yeah. I worked back in a few years ago. I

347
00:18:07.680 --> 00:18:09.839
<v Speaker 4>worked on the Native script team and we were like

348
00:18:09.920 --> 00:18:13.079
<v Speaker 4>a kind of sort of competitor with React Native, and

349
00:18:13.640 --> 00:18:15.680
<v Speaker 4>we had some stuff in that space as well, And

350
00:18:16.319 --> 00:18:19.759
<v Speaker 4>that was always the dream. It's the reality is it's

351
00:18:20.319 --> 00:18:23.519
<v Speaker 4>it can work, but it has to be like the right,

352
00:18:24.000 --> 00:18:26.519
<v Speaker 4>it's got to be an app that's like relatively simple,

353
00:18:26.599 --> 00:18:28.400
<v Speaker 4>Like it's got to be complex enough that you're actually

354
00:18:28.720 --> 00:18:32.240
<v Speaker 4>getting some value out of sharing code, but it also

355
00:18:32.359 --> 00:18:36.599
<v Speaker 4>can't be so complex because once you start needing things

356
00:18:36.680 --> 00:18:39.799
<v Speaker 4>customized for each platform, then the value of sharing that

357
00:18:39.920 --> 00:18:43.640
<v Speaker 4>code can kind of fall apart. So we had some

358
00:18:43.680 --> 00:18:46.039
<v Speaker 4>success stories. We had some people that were doing it,

359
00:18:46.440 --> 00:18:49.799
<v Speaker 4>but they were like the like I guess, like load

360
00:18:49.799 --> 00:18:53.920
<v Speaker 4>to mid complexity, sorts of situations where it tended to

361
00:18:53.920 --> 00:18:56.960
<v Speaker 4>work out the best. But it's interesting stuff and I

362
00:18:57.599 --> 00:19:00.799
<v Speaker 4>still find it cool, like it even, like I said,

363
00:19:00.799 --> 00:19:02.079
<v Speaker 4>I've worked in this world for a while, and even

364
00:19:02.119 --> 00:19:04.359
<v Speaker 4>when I see websites for this and they say can

365
00:19:04.400 --> 00:19:07.279
<v Speaker 4>work on web native, that still just strikes me as

366
00:19:07.400 --> 00:19:10.160
<v Speaker 4>really really fun because how cool is it that you

367
00:19:10.200 --> 00:19:12.119
<v Speaker 4>can learn this library and then you go over to

368
00:19:12.160 --> 00:19:14.880
<v Speaker 4>your iOS or Android A development and it's like, oh, hey,

369
00:19:14.920 --> 00:19:17.519
<v Speaker 4>I already know how to do forms here, Like that's

370
00:19:17.720 --> 00:19:18.400
<v Speaker 4>kind of cool.

371
00:19:18.480 --> 00:19:21.759
<v Speaker 1>Actually yeah, And there are component libraries out there nowadays

372
00:19:21.799 --> 00:19:26.359
<v Speaker 1>that supposedly are cross react and react native, so that

373
00:19:26.400 --> 00:19:27.279
<v Speaker 1>could be really cool.

374
00:19:27.519 --> 00:19:30.680
<v Speaker 4>We have more questions, so we talked about react to forms.

375
00:19:30.720 --> 00:19:32.519
<v Speaker 4>You said you work on other stuff. Are there any

376
00:19:32.559 --> 00:19:36.079
<v Speaker 4>other topics you're you're interested in that you've been writing about.

377
00:19:36.160 --> 00:19:37.519
<v Speaker 4>You're passionate about.

378
00:19:37.519 --> 00:19:40.759
<v Speaker 3>Love work with Like, have you guys worked with type before?

379
00:19:41.279 --> 00:19:43.640
<v Speaker 4>Could you say it again? I have?

380
00:19:44.640 --> 00:19:47.960
<v Speaker 2>So it's basically so I've used the type or with

381
00:19:48.000 --> 00:19:50.880
<v Speaker 2>the React and you do so like it's like a

382
00:19:51.200 --> 00:19:55.599
<v Speaker 2>you know, a model layer for communicating with the Esquelite database,

383
00:19:55.880 --> 00:20:00.480
<v Speaker 2>so you can use objects to represent data uh in

384
00:20:00.640 --> 00:20:01.279
<v Speaker 2>the jaws.

385
00:20:01.440 --> 00:20:03.160
<v Speaker 1>So nice. And this would be on the client side,

386
00:20:03.720 --> 00:20:05.160
<v Speaker 1>Yeah nice.

387
00:20:05.440 --> 00:20:09.640
<v Speaker 2>Like type pretty much works on every plant, like on

388
00:20:10.720 --> 00:20:14.200
<v Speaker 2>client as well and as well as on the server

389
00:20:14.319 --> 00:20:20.400
<v Speaker 2>with as well and the Mango deb I think, so yeah.

390
00:20:20.119 --> 00:20:22.960
<v Speaker 1>So very cool. Does it have typescript bindings so it's

391
00:20:22.960 --> 00:20:25.160
<v Speaker 1>actually like strongly typed if you want them?

392
00:20:25.559 --> 00:20:25.839
<v Speaker 3>Yeah?

393
00:20:25.920 --> 00:20:26.160
<v Speaker 1>Nice?

394
00:20:26.240 --> 00:20:27.880
<v Speaker 3>It has it has type.

395
00:20:28.480 --> 00:20:29.440
<v Speaker 1>Do you do any typescript?

396
00:20:29.960 --> 00:20:30.079
<v Speaker 3>Uh?

397
00:20:30.200 --> 00:20:30.279
<v Speaker 1>Not?

398
00:20:31.000 --> 00:20:35.160
<v Speaker 4>So I'm curious type orm Like this is like I'm

399
00:20:35.519 --> 00:20:37.039
<v Speaker 4>I'm just trying to think of how I use this

400
00:20:37.119 --> 00:20:39.400
<v Speaker 4>in a real world app. Right, So I'm building my

401
00:20:40.279 --> 00:20:44.359
<v Speaker 4>React app. I've got my form and I need to

402
00:20:44.400 --> 00:20:48.039
<v Speaker 4>push I'm building an insurance form, so I need people's

403
00:20:48.079 --> 00:20:51.400
<v Speaker 4>like name, address, that sort of thing, and then presumably

404
00:20:51.400 --> 00:20:55.119
<v Speaker 4>I need to push this to some database. So is

405
00:20:55.160 --> 00:20:59.599
<v Speaker 4>this helping me then like map my calls to actually

406
00:20:59.640 --> 00:21:03.960
<v Speaker 4>like directly inject that data into the database and updated

407
00:21:04.079 --> 00:21:06.720
<v Speaker 4>or how is I guess I'm not totally clear and

408
00:21:07.039 --> 00:21:09.240
<v Speaker 4>what this library is is doing for me?

409
00:21:09.759 --> 00:21:12.880
<v Speaker 3>So like, are you talking about the client side or

410
00:21:12.920 --> 00:21:13.720
<v Speaker 3>the server side? Right?

411
00:21:14.200 --> 00:21:18.519
<v Speaker 4>Potentially both, I've because type of M is is it

412
00:21:18.680 --> 00:21:21.720
<v Speaker 4>entirely what you said, it works on both hands of things?

413
00:21:21.759 --> 00:21:23.000
<v Speaker 3>Yeah, yeah, yeah right.

414
00:21:23.319 --> 00:21:25.920
<v Speaker 2>So on the client side, like in general, what you

415
00:21:26.000 --> 00:21:29.240
<v Speaker 2>do is you have some tables like in your database,

416
00:21:29.599 --> 00:21:34.680
<v Speaker 2>and you have the columns. So you can create an object, right,

417
00:21:34.960 --> 00:21:38.799
<v Speaker 2>which is called an entity to represent those tables. Right,

418
00:21:39.039 --> 00:21:41.720
<v Speaker 2>So if you have a user's table, you can create

419
00:21:41.759 --> 00:21:46.440
<v Speaker 2>a user entity and have properties like name, password and

420
00:21:46.559 --> 00:21:50.200
<v Speaker 2>the other stuff. So in terms of client, in client,

421
00:21:50.240 --> 00:21:52.960
<v Speaker 2>what you can do is in a React applicant React

422
00:21:53.039 --> 00:21:56.880
<v Speaker 2>native application, you can have a form, you know, and

423
00:21:56.920 --> 00:22:00.920
<v Speaker 2>then on summit you can just call the insert method

424
00:22:01.000 --> 00:22:04.279
<v Speaker 2>or the same method of type oorn with that entity.

425
00:22:04.759 --> 00:22:08.119
<v Speaker 2>So from an entity, you can create a repository, and

426
00:22:08.359 --> 00:22:11.279
<v Speaker 2>repository gives you access to those methods like save an

427
00:22:11.319 --> 00:22:15.759
<v Speaker 2>insert and basically you just give those values to the same.

428
00:22:15.599 --> 00:22:18.240
<v Speaker 4>Method, gotcha. So it's kind of helping with some of

429
00:22:18.279 --> 00:22:20.559
<v Speaker 4>the boiler plates so that you don't have to like

430
00:22:20.799 --> 00:22:23.160
<v Speaker 4>wire all of that up yourself.

431
00:22:23.559 --> 00:22:23.799
<v Speaker 3>Right.

432
00:22:23.839 --> 00:22:27.839
<v Speaker 2>So here the main uh, like the main problem that

433
00:22:28.039 --> 00:22:30.799
<v Speaker 2>type OM solves on the client, on the reactitive world

434
00:22:30.960 --> 00:22:33.359
<v Speaker 2>is that you don't have to write.

435
00:22:33.079 --> 00:22:35.400
<v Speaker 3>The raw scual queries yourself.

436
00:22:36.480 --> 00:22:38.599
<v Speaker 2>So as a front end developer, I don't need to

437
00:22:38.680 --> 00:22:44.559
<v Speaker 2>write scale queries like directly. So basically type om gives you,

438
00:22:44.559 --> 00:22:48.000
<v Speaker 2>you know, ability to write insert into database, like communicated

439
00:22:48.000 --> 00:22:49.920
<v Speaker 2>with database without having to write queries.

440
00:22:50.039 --> 00:22:51.880
<v Speaker 4>Oh it's interesting. I didn't even think about this from

441
00:22:51.960 --> 00:22:55.079
<v Speaker 4>like a React native perspective, but I guess like when

442
00:22:55.119 --> 00:22:58.160
<v Speaker 4>you're in React Native, you could have the database right

443
00:22:58.200 --> 00:23:01.160
<v Speaker 4>there right like you don't have to hit a back

444
00:23:01.279 --> 00:23:03.720
<v Speaker 4>end to do it. So that's actually kind of cool.

445
00:23:03.839 --> 00:23:06.920
<v Speaker 4>If you get generated it itself, you're like instantaneously working

446
00:23:07.359 --> 00:23:09.359
<v Speaker 4>with the database without any extra.

447
00:23:09.200 --> 00:23:12.000
<v Speaker 1>Work, right Yeah, particularly if you want like a cash

448
00:23:12.279 --> 00:23:13.799
<v Speaker 1>or something like that and you want to manage that,

449
00:23:13.880 --> 00:23:15.400
<v Speaker 1>this is a really nice way to do that in

450
00:23:15.400 --> 00:23:17.799
<v Speaker 1>a kind of a strongly type way and then get

451
00:23:17.839 --> 00:23:20.400
<v Speaker 1>you know, structured the data on the client just as

452
00:23:20.440 --> 00:23:22.200
<v Speaker 1>well as you do on the back end. It's pretty

453
00:23:22.200 --> 00:23:24.000
<v Speaker 1>cool and it works on native script.

454
00:23:24.880 --> 00:23:27.880
<v Speaker 4>Yeah, oh yeah, there you go. So then this this

455
00:23:27.960 --> 00:23:29.559
<v Speaker 4>sort of fascinates me a little bit. So if you're

456
00:23:29.599 --> 00:23:34.519
<v Speaker 4>working with like a local SQL based database, is that

457
00:23:34.720 --> 00:23:37.119
<v Speaker 4>are you working on that like in a cash sort

458
00:23:37.160 --> 00:23:41.519
<v Speaker 4>of setting or are you eventually taking that that data

459
00:23:41.519 --> 00:23:44.200
<v Speaker 4>and then like persisting it to a back end as well,

460
00:23:44.240 --> 00:23:45.920
<v Speaker 4>and how does that interaction work?

461
00:23:46.920 --> 00:23:50.559
<v Speaker 2>Yes, so we usually store like it as a cash

462
00:23:50.960 --> 00:23:54.039
<v Speaker 2>as a local storage mainly for you know, better providing

463
00:23:54.039 --> 00:23:57.640
<v Speaker 2>better user experience. So you know, whenever the user you

464
00:23:57.680 --> 00:24:01.319
<v Speaker 2>push some data, we first stored in dealal database right

465
00:24:01.519 --> 00:24:03.960
<v Speaker 2>and then you know, once he has a stable connection,

466
00:24:04.000 --> 00:24:05.880
<v Speaker 2>we then push it to our server.

467
00:24:06.359 --> 00:24:07.839
<v Speaker 3>So that's how it works.

468
00:24:08.119 --> 00:24:10.880
<v Speaker 2>So it just basically helps you in plodding better user

469
00:24:10.920 --> 00:24:13.680
<v Speaker 2>experience and users don't have to wait for that data

470
00:24:13.799 --> 00:24:16.279
<v Speaker 2>to be pushed like it can be. It can happen

471
00:24:16.319 --> 00:24:20.480
<v Speaker 2>in a background, background service or synchronously back around.

472
00:24:20.640 --> 00:24:23.359
<v Speaker 4>And does type O RM help with that specifically or

473
00:24:23.400 --> 00:24:26.480
<v Speaker 4>it is something else that handles like the sinking of

474
00:24:26.559 --> 00:24:28.000
<v Speaker 4>the database.

475
00:24:28.680 --> 00:24:31.200
<v Speaker 3>No type on and does not do that out of

476
00:24:31.240 --> 00:24:31.680
<v Speaker 3>the box.

477
00:24:31.839 --> 00:24:36.559
<v Speaker 2>Like for me, we had a separate table which you know,

478
00:24:36.839 --> 00:24:39.640
<v Speaker 2>which mapped these entities to a bullion value like is

479
00:24:39.680 --> 00:24:42.319
<v Speaker 2>syncd is one or zero? Like if it is SYNCD,

480
00:24:42.359 --> 00:24:45.319
<v Speaker 2>then we don't sink it like like that.

481
00:24:45.319 --> 00:24:48.279
<v Speaker 1>That's really handy from a customer, Yeah, that's really handy

482
00:24:48.279 --> 00:24:50.160
<v Speaker 1>from a customer perspective, you know, being able to have

483
00:24:50.160 --> 00:24:53.880
<v Speaker 1>that offline mode and then work offline and then resink

484
00:24:53.920 --> 00:24:56.319
<v Speaker 1>when you have connectivity. That's just absolutely one ful, right.

485
00:24:56.400 --> 00:24:59.319
<v Speaker 2>Yeah, so you don't have to show you know, no

486
00:24:59.440 --> 00:25:01.039
<v Speaker 2>internet to your customer.

487
00:25:01.480 --> 00:25:04.240
<v Speaker 4>I imagine though, like there you probably do have to

488
00:25:04.240 --> 00:25:07.759
<v Speaker 4>deal with like out of sync type of problems or

489
00:25:07.839 --> 00:25:10.839
<v Speaker 4>like like you have in your apps. Are users like

490
00:25:10.920 --> 00:25:13.319
<v Speaker 4>isolated in their own data? Like do you have to

491
00:25:13.319 --> 00:25:17.720
<v Speaker 4>worry about like users potentially messing without the data and

492
00:25:17.799 --> 00:25:20.240
<v Speaker 4>like how to deal with conflicts and stuff like that.

493
00:25:20.440 --> 00:25:24.839
<v Speaker 2>So usually we have like data like the local database

494
00:25:24.880 --> 00:25:27.960
<v Speaker 2>does not have the ability to store data for multiple

495
00:25:28.039 --> 00:25:31.480
<v Speaker 2>users like the currently Lobbin users that users that you have,

496
00:25:31.680 --> 00:25:35.480
<v Speaker 2>only uh that users data would be available in the

497
00:25:35.559 --> 00:25:39.279
<v Speaker 2>client set and for if suppose any like we don't

498
00:25:39.319 --> 00:25:42.319
<v Speaker 2>SNK all the data to this server, only what we require.

499
00:25:42.440 --> 00:25:46.000
<v Speaker 2>But in case that is you know there is a

500
00:25:46.000 --> 00:25:49.279
<v Speaker 2>slight miss or inconsistency, that is just you know, you

501
00:25:49.319 --> 00:25:50.119
<v Speaker 2>have to roll with it.

502
00:25:51.599 --> 00:25:53.960
<v Speaker 4>Yeah, it definitely makes it a lot easier because like

503
00:25:54.519 --> 00:25:56.960
<v Speaker 4>those sorts of situations I've dealt with people in the

504
00:25:57.000 --> 00:26:00.400
<v Speaker 4>past that are it's like, oh, we want our apps

505
00:26:00.400 --> 00:26:04.319
<v Speaker 4>to totally work offline, and the situation is like it's

506
00:26:04.400 --> 00:26:07.119
<v Speaker 4>a it's a group of employees that are all working

507
00:26:07.160 --> 00:26:09.519
<v Speaker 4>on like some sort of dashboard, right, and they can

508
00:26:09.559 --> 00:26:12.880
<v Speaker 4>all be messing with the same ones, and it's like okay,

509
00:26:13.119 --> 00:26:15.839
<v Speaker 4>like you we can do this, but like what happens

510
00:26:15.880 --> 00:26:18.960
<v Speaker 4>if employee A changes the order date and employee B

511
00:26:19.200 --> 00:26:21.960
<v Speaker 4>changes the order date offline and then the employee comes

512
00:26:22.000 --> 00:26:26.680
<v Speaker 4>back online and it's just becomes like you can spend

513
00:26:27.119 --> 00:26:30.400
<v Speaker 4>lots and lots of cycles and time trying to work

514
00:26:30.440 --> 00:26:32.960
<v Speaker 4>through those, and I know, like there are frameworks out

515
00:26:33.000 --> 00:26:36.359
<v Speaker 4>there that try to have smart defaults around that, but

516
00:26:36.759 --> 00:26:39.640
<v Speaker 4>none of them are especially fun when you get into

517
00:26:39.680 --> 00:26:40.359
<v Speaker 4>that situation.

518
00:26:41.440 --> 00:26:48.200
<v Speaker 1>Wins, Yes, exactly, period right, make it easy time or picks?

519
00:26:48.480 --> 00:26:52.000
<v Speaker 4>Yeah the GD Is there any other pieces of tech,

520
00:26:52.079 --> 00:26:55.359
<v Speaker 4>any other things you you think are interesting or want

521
00:26:55.359 --> 00:26:56.839
<v Speaker 4>to discuss before we head into picks?

522
00:26:57.279 --> 00:27:00.599
<v Speaker 3>Well, can we talk about the back and stuff?

523
00:27:00.839 --> 00:27:00.920
<v Speaker 1>Like?

524
00:27:01.119 --> 00:27:01.400
<v Speaker 4>Sure?

525
00:27:01.720 --> 00:27:02.119
<v Speaker 1>Yeah?

526
00:27:02.160 --> 00:27:06.240
<v Speaker 3>So, like, are you guys familiar with nest JS the framework?

527
00:27:06.240 --> 00:27:09.400
<v Speaker 1>That'd be great. Yeah, we'll talk about that. Yeah, go

528
00:27:09.480 --> 00:27:13.200
<v Speaker 1>for it. Oh okay, so I think you also have

529
00:27:13.359 --> 00:27:15.480
<v Speaker 1>some experience with nest JS when you tell us about that.

530
00:27:15.720 --> 00:27:20.839
<v Speaker 3>So yeah, SOSJS is a back end frame, not just

531
00:27:20.920 --> 00:27:25.119
<v Speaker 3>framework that you know, helps you organize your code and

532
00:27:25.240 --> 00:27:29.759
<v Speaker 3>have strong typings on your services, so like which comes

533
00:27:29.799 --> 00:27:32.880
<v Speaker 3>really handy when you have a lot of services and

534
00:27:33.000 --> 00:27:37.240
<v Speaker 3>a lot of APIs and suddainly and also it has

535
00:27:37.359 --> 00:27:40.640
<v Speaker 3>a great developer experience. Once again, you can isolate your

536
00:27:40.759 --> 00:27:45.400
<v Speaker 3>code and you can have separate modules as for your

537
00:27:45.440 --> 00:27:48.680
<v Speaker 3>business logic and yeah.

538
00:27:48.720 --> 00:27:51.079
<v Speaker 1>Cool. So this is for building your rest back end

539
00:27:51.240 --> 00:27:54.119
<v Speaker 1>in node if that's what you want to do. Yeah, right, nice,

540
00:27:54.240 --> 00:27:55.640
<v Speaker 1>and it makes it really easy to do that.

541
00:27:56.039 --> 00:27:56.240
<v Speaker 3>Yeah.

542
00:27:56.319 --> 00:28:00.519
<v Speaker 2>So basically nestjs has these boiler plate commands, so you

543
00:28:00.640 --> 00:28:03.680
<v Speaker 2>just run a command for module and it would automatic

544
00:28:03.759 --> 00:28:06.839
<v Speaker 2>it would create a module file for you. So it

545
00:28:06.960 --> 00:28:12.000
<v Speaker 2>is inspired by Angular, right, it has syntax and decorators

546
00:28:12.000 --> 00:28:15.799
<v Speaker 2>similar to Angular, and they have they have pretty much

547
00:28:15.839 --> 00:28:19.200
<v Speaker 2>everything or you know covered in the library. If you

548
00:28:19.240 --> 00:28:22.480
<v Speaker 2>want cash, if you want database, and the type ONEm

549
00:28:22.680 --> 00:28:26.440
<v Speaker 2>is you know is the go to choice for handling database.

550
00:28:26.759 --> 00:28:28.559
<v Speaker 1>So if you're thinking about building your own rest API,

551
00:28:28.839 --> 00:28:31.759
<v Speaker 1>instead of just going direct to like an express and

552
00:28:32.200 --> 00:28:35.720
<v Speaker 1>building it down to the kind of base layer, you

553
00:28:35.759 --> 00:28:40.000
<v Speaker 1>can use next js and level up there nice.

554
00:28:39.799 --> 00:28:43.279
<v Speaker 4>Right, right, And it's any e s T correct not

555
00:28:43.480 --> 00:28:45.920
<v Speaker 4>any T, I swear.

556
00:28:45.880 --> 00:28:49.319
<v Speaker 1>Like two different things. Yes, It's like, if you're.

557
00:28:49.200 --> 00:28:51.119
<v Speaker 4>Building a front end React framework, you have to name

558
00:28:51.160 --> 00:28:55.079
<v Speaker 4>it something that starts with R E, like remix, reducts react,

559
00:28:55.160 --> 00:28:57.160
<v Speaker 4>and like if you're doing back end stuff, you gotta

560
00:28:57.200 --> 00:29:01.480
<v Speaker 4>go an E. Apparently I did have a question though

561
00:29:02.000 --> 00:29:05.319
<v Speaker 4>with nest is. Is there anything proprietary about it? Can

562
00:29:05.319 --> 00:29:07.119
<v Speaker 4>you then take your back end and throw it up

563
00:29:07.160 --> 00:29:11.119
<v Speaker 4>on like any back end or is there specific hosting requirements?

564
00:29:11.680 --> 00:29:16.160
<v Speaker 2>No, like there's no property license or anything like. You

565
00:29:16.200 --> 00:29:19.160
<v Speaker 2>can create your own good base and just push it

566
00:29:19.440 --> 00:29:20.519
<v Speaker 2>to Aw's or.

567
00:29:20.839 --> 00:29:24.359
<v Speaker 4>Any Okay, And they have cats all over their website,

568
00:29:24.480 --> 00:29:25.920
<v Speaker 4>so there's that too.

569
00:29:26.680 --> 00:29:31.200
<v Speaker 1>That's always a win. Well, Wig, thank you for bringing

570
00:29:31.240 --> 00:29:33.240
<v Speaker 1>some great stuff to us today, and I think that

571
00:29:33.400 --> 00:29:38.640
<v Speaker 1>brings us around to picks. So Veg, you want to

572
00:29:38.640 --> 00:29:40.400
<v Speaker 1>start us off and give your pick.

573
00:29:40.839 --> 00:29:45.039
<v Speaker 2>Yeah, So my pick would be Stephen Ryder's micro Services course.

574
00:29:45.319 --> 00:29:48.759
<v Speaker 2>So he talks about micro services, not just in great

575
00:29:48.799 --> 00:29:51.559
<v Speaker 2>detail in that course, so do check it out.

576
00:29:51.759 --> 00:29:52.920
<v Speaker 1>Fantastic DJ.

577
00:29:53.279 --> 00:29:55.920
<v Speaker 4>So I'm going to pick a game called Super Mario

578
00:29:56.119 --> 00:30:00.440
<v Speaker 4>three D World for the Switch. It's a fun multiplayer game.

579
00:30:00.480 --> 00:30:03.240
<v Speaker 4>It's it's basically just your classic Mario, right, I think

580
00:30:03.240 --> 00:30:06.000
<v Speaker 4>that's that's they know what they're doing right there. There's

581
00:30:06.039 --> 00:30:08.960
<v Speaker 4>not much curve balls, but it's it's just typical, like

582
00:30:09.000 --> 00:30:11.559
<v Speaker 4>really well executed. It's a great multiplayer game. So I

583
00:30:11.599 --> 00:30:15.440
<v Speaker 4>play with my kids. It's up to four people simultaneously

584
00:30:15.480 --> 00:30:19.039
<v Speaker 4>playing Classic Mario and it's just you know, if you're

585
00:30:19.079 --> 00:30:21.680
<v Speaker 4>if you're looking for Mario. It's just a really good

586
00:30:21.759 --> 00:30:23.640
<v Speaker 4>one for the switch. So we've been having some some

587
00:30:23.720 --> 00:30:25.720
<v Speaker 4>fun with that and playing through it, and it's pretty

588
00:30:25.799 --> 00:30:28.400
<v Speaker 4>challenging actually too. I've been playing Mario for a long time,

589
00:30:29.640 --> 00:30:31.400
<v Speaker 4>but I've got to get my kids, like got to

590
00:30:31.480 --> 00:30:33.920
<v Speaker 4>train them up, right, like gott to get the next

591
00:30:33.960 --> 00:30:34.960
<v Speaker 4>generation ready.

592
00:30:35.079 --> 00:30:37.079
<v Speaker 1>Yeah, I've been playing some Ratchet and Clank lately and

593
00:30:37.160 --> 00:30:39.000
<v Speaker 1>I'm in a competition with my next door neighbor to

594
00:30:39.000 --> 00:30:42.160
<v Speaker 1>see how can go faster. And unfortunately, my work has

595
00:30:42.279 --> 00:30:47.799
<v Speaker 1>taken over my life, so I know, works, the responsibilities,

596
00:30:47.839 --> 00:30:53.440
<v Speaker 1>I mean, always adulting. It's tough. So my pick for

597
00:30:53.599 --> 00:30:58.920
<v Speaker 1>today is NX dot dev. It's a mono repo management system.

598
00:30:58.920 --> 00:31:02.720
<v Speaker 1>It's it's really cool. So I've got a very small

599
00:31:02.960 --> 00:31:05.319
<v Speaker 1>engineering team at my company. I mean, it's just basically

600
00:31:05.319 --> 00:31:10.039
<v Speaker 1>three folks, and we manage four different applications and like

601
00:31:10.359 --> 00:31:14.480
<v Speaker 1>six different libraries, and to do that all in different

602
00:31:14.960 --> 00:31:19.400
<v Speaker 1>GitHub repositories would be crazy just in terms of managing

603
00:31:19.480 --> 00:31:22.559
<v Speaker 1>all that. And so we use a mono repo. And

604
00:31:22.599 --> 00:31:24.759
<v Speaker 1>I know there's a lot of contention around that, but

605
00:31:24.960 --> 00:31:28.039
<v Speaker 1>they've it's coming really really handy for us and NX

606
00:31:28.119 --> 00:31:30.960
<v Speaker 1>if you haven't actually built your own, Mono repo is

607
00:31:31.000 --> 00:31:33.960
<v Speaker 1>a fantastic way to do it. It's got extensions for

608
00:31:35.160 --> 00:31:38.680
<v Speaker 1>Next and as we just talked about, and Next and

609
00:31:39.720 --> 00:31:43.279
<v Speaker 1>just basic React apps or Angular, whatever kind of projects

610
00:31:43.319 --> 00:31:45.000
<v Speaker 1>you want to put into this mono repo. It's got

611
00:31:45.039 --> 00:31:47.680
<v Speaker 1>generators for them and it makes them all talk together

612
00:31:47.799 --> 00:31:49.799
<v Speaker 1>and do it in a really really nice way. So

613
00:31:50.359 --> 00:31:53.880
<v Speaker 1>if you want a monor repo in your project and

614
00:31:53.920 --> 00:31:55.519
<v Speaker 1>you're like, h how am I going to get there?

615
00:31:55.599 --> 00:31:58.279
<v Speaker 1>Do I need to know how to make this thing myself?

616
00:31:58.319 --> 00:32:00.640
<v Speaker 1>You don't have to check it out.

617
00:32:00.720 --> 00:32:02.400
<v Speaker 4>Really cool, We're gonna have to do a show on

618
00:32:02.680 --> 00:32:06.960
<v Speaker 4>mono repo's once please. That's uh. I have opinions, and

619
00:32:07.039 --> 00:32:11.440
<v Speaker 4>I think it's one of those classic dev topics. Right everybody, Oh,

620
00:32:12.359 --> 00:32:13.599
<v Speaker 4>you either like it or you hate.

621
00:32:13.400 --> 00:32:16.839
<v Speaker 1>It I think so. Yeah, absolutely all right, Well that's

622
00:32:16.839 --> 00:32:19.200
<v Speaker 1>been wonderful. Thank you so much for coming on the podcast.

623
00:32:20.079 --> 00:32:22.160
<v Speaker 3>It's been a good experience coming to you.

624
00:32:22.519 --> 00:32:24.960
<v Speaker 1>Well, thanks everyone for joining us, and we'll see you

625
00:32:25.000 --> 00:32:25.480
<v Speaker 1>next week.
