WEBVTT

1
00:00:00.080 --> 00:00:03.359
<v Speaker 1>Welcome to the deep dive. Today, we're tackling modern web

2
00:00:03.359 --> 00:00:07.960
<v Speaker 1>development by zeroing in on Maya Chavin's Learning View.

3
00:00:08.119 --> 00:00:09.439
<v Speaker 2>Right. It's a great resource.

4
00:00:09.519 --> 00:00:13.679
<v Speaker 1>We've sifted through a lot here preface chapters one, three, thirteen,

5
00:00:13.800 --> 00:00:16.359
<v Speaker 1>basically the whole thing pretty much, and our goal is

6
00:00:16.399 --> 00:00:19.559
<v Speaker 1>to pull out the essential insights, help you grasp why

7
00:00:19.640 --> 00:00:22.640
<v Speaker 1>VJs is, you know, such a major player.

8
00:00:22.359 --> 00:00:24.559
<v Speaker 2>Today, Yeah, and get a solid handle on its core

9
00:00:24.600 --> 00:00:26.039
<v Speaker 2>principles exactly.

10
00:00:26.440 --> 00:00:29.079
<v Speaker 1>So, if you're looking to quickly understand a leading front

11
00:00:29.160 --> 00:00:32.439
<v Speaker 1>end framework, especially View, well, this is your shortcut.

12
00:00:32.520 --> 00:00:36.359
<v Speaker 2>Think of it as a focused tour through the heart

13
00:00:36.399 --> 00:00:38.880
<v Speaker 2>of VIEWJS, using Shavin's book as our guide.

14
00:00:38.880 --> 00:00:40.719
<v Speaker 1>We'll cover everything from setting things up.

15
00:00:40.600 --> 00:00:43.520
<v Speaker 2>To advanced rendering, testing, the whole life cycle.

16
00:00:43.600 --> 00:00:47.920
<v Speaker 1>Really, it's about understanding the well, the elegance and power

17
00:00:48.039 --> 00:00:52.000
<v Speaker 1>view brings precisely. Okay, let's unpack this. Then Shavin kicks

18
00:00:52.000 --> 00:00:54.719
<v Speaker 1>things off by highlighting why learning a framework like view

19
00:00:54.799 --> 00:00:55.799
<v Speaker 1>is just so vital.

20
00:00:55.880 --> 00:00:56.039
<v Speaker 2>Now.

21
00:00:56.799 --> 00:00:59.560
<v Speaker 1>It's not just hype, No, it directly impacts you know,

22
00:00:59.679 --> 00:01:02.960
<v Speaker 1>product quality, development, cost, coding standards.

23
00:01:02.600 --> 00:01:04.400
<v Speaker 2>Even just making development easier, right.

24
00:01:04.359 --> 00:01:07.480
<v Speaker 1>Totally for anyone in web deev front end full stack

25
00:01:07.719 --> 00:01:11.920
<v Speaker 1>knowing a framework like View it's becoming kind of crucial.

26
00:01:12.120 --> 00:01:15.719
<v Speaker 2>That's a really key point. And views rapid growth, especially

27
00:01:15.799 --> 00:01:19.079
<v Speaker 2>back around what twenty eighteen, that really shows its strengths.

28
00:01:19.159 --> 00:01:21.799
<v Speaker 1>It's known for being approachable but also adaptable.

29
00:01:22.040 --> 00:01:25.120
<v Speaker 2>Exactly, it's a user friendly, but you can build serious

30
00:01:25.120 --> 00:01:28.879
<v Speaker 2>stuff with it. We're talking scalable, interactive web apps that

31
00:01:28.920 --> 00:01:30.079
<v Speaker 2>actually perform well.

32
00:01:30.239 --> 00:01:33.840
<v Speaker 1>And Chavin mentions the documentation Apparently it's exceptionally good.

33
00:01:33.959 --> 00:01:38.040
<v Speaker 2>Oh yeah, that's a huge plus. Well written, easy to follow,

34
00:01:38.519 --> 00:01:39.760
<v Speaker 2>makes a big difference when you're.

35
00:01:39.719 --> 00:01:43.159
<v Speaker 1>Learning what's the ecosystem. Tools like view router for navigation,

36
00:01:43.519 --> 00:01:47.159
<v Speaker 1>Pazina for state management, they help streamline setup.

37
00:01:47.359 --> 00:01:51.760
<v Speaker 2>Definitely, having those solid official tools ready to go simplifies

38
00:01:51.799 --> 00:01:52.280
<v Speaker 2>things a lot.

39
00:01:52.359 --> 00:01:54.560
<v Speaker 1>Okay, now this is interesting, Chavine says, if you've used

40
00:01:54.599 --> 00:02:00.280
<v Speaker 1>older tech like Angular JS or like even jQuery, use

41
00:02:00.319 --> 00:02:02.200
<v Speaker 1>API's might feel kind of familiar.

42
00:02:02.319 --> 00:02:04.280
<v Speaker 2>That makes sense. There's a lineage there in some way.

43
00:02:04.120 --> 00:02:06.680
<v Speaker 1>And the template syntax is designed to be easier for

44
00:02:06.840 --> 00:02:09.680
<v Speaker 1>handling data and dom events.

45
00:02:10.000 --> 00:02:13.319
<v Speaker 2>Yeah, lowers that barrier to entry. View manages to blend

46
00:02:13.360 --> 00:02:17.759
<v Speaker 2>that ease of getting started with some really robust capabilities underneath.

47
00:02:17.759 --> 00:02:21.080
<v Speaker 1>So clear epis straightforward. Templates get you going quickly.

48
00:02:20.879 --> 00:02:23.639
<v Speaker 2>But the underlying design lets you build complex things, and

49
00:02:23.680 --> 00:02:26.520
<v Speaker 2>that strong ecosystem, like we said, makes a huge difference.

50
00:02:26.560 --> 00:02:28.919
<v Speaker 1>Okay, so you're sold on View, Where do you actually start?

51
00:02:29.000 --> 00:02:32.479
<v Speaker 1>Let's talk setup. Shavin says, NOJS first, right.

52
00:02:32.479 --> 00:02:34.680
<v Speaker 2>Got to have NOE installing It gives you the node

53
00:02:34.680 --> 00:02:36.240
<v Speaker 2>command itself and also.

54
00:02:36.080 --> 00:02:39.639
<v Speaker 1>MPM, NPM the node package manager. You can check your

55
00:02:39.759 --> 00:02:41.759
<v Speaker 1>version node V.

56
00:02:41.639 --> 00:02:43.520
<v Speaker 2>In the terminal node V easy check.

57
00:02:43.599 --> 00:02:47.280
<v Speaker 1>And NPM is how you grab packages like View itself exactly.

58
00:02:47.479 --> 00:02:50.280
<v Speaker 2>It manages all those external libraries your project depends on.

59
00:02:50.400 --> 00:02:52.400
<v Speaker 2>You check its version with NPMV.

60
00:02:52.199 --> 00:02:55.759
<v Speaker 1>And keep it updated with NPM. Install NPM at latest G.

61
00:02:56.280 --> 00:02:58.879
<v Speaker 2>That mash G is for global right mm hmm makes

62
00:02:58.879 --> 00:03:02.159
<v Speaker 2>it available everywhere on your system. Think of NPM like, well,

63
00:03:02.199 --> 00:03:04.840
<v Speaker 2>it stops you having to manually find and download every

64
00:03:04.879 --> 00:03:08.680
<v Speaker 2>single piece of code you need. It handles the dependencies.

65
00:03:08.000 --> 00:03:10.360
<v Speaker 1>Avoids dependency hell as they say.

66
00:03:10.120 --> 00:03:12.159
<v Speaker 2>Pretty much, Yeah, keeps things organized.

67
00:03:12.479 --> 00:03:15.680
<v Speaker 1>Chavin also mentions yarn though another package manager.

68
00:03:15.759 --> 00:03:18.719
<v Speaker 2>Yeah, it's an alternative to NPM. The book uses yarn

69
00:03:18.800 --> 00:03:20.360
<v Speaker 2>for examples, actually.

70
00:03:20.039 --> 00:03:22.400
<v Speaker 1>So you'd check with yarns get a packages with yarn

71
00:03:22.520 --> 00:03:25.360
<v Speaker 1>ad and install everything for a project with just yarn.

72
00:03:25.520 --> 00:03:28.800
<v Speaker 2>Right, it shows the flexibility you know mpm's default yarn

73
00:03:28.879 --> 00:03:32.360
<v Speaker 2>is Another popular choice point is you need a package manager?

74
00:03:32.479 --> 00:03:37.639
<v Speaker 1>Gotcha? Okay? Note installed package manager ready? What about actually

75
00:03:37.759 --> 00:03:39.639
<v Speaker 1>like building the view project?

76
00:03:39.800 --> 00:03:43.039
<v Speaker 2>So the community is largely shifted now away from the

77
00:03:43.080 --> 00:03:47.800
<v Speaker 2>old view CLI which used Webpack, towards Vite exactly. Vite

78
00:03:47.840 --> 00:03:49.319
<v Speaker 2>is the default now it's fast.

79
00:03:49.360 --> 00:03:51.159
<v Speaker 1>And how do you start a new project with it?

80
00:03:51.319 --> 00:03:54.599
<v Speaker 2>Super simple? Command NPM and itview at latest.

81
00:03:54.759 --> 00:03:55.919
<v Speaker 1>NPM in it view at latest.

82
00:03:56.000 --> 00:03:58.360
<v Speaker 2>Okah, that runs create view, which is the official tool.

83
00:03:58.599 --> 00:04:01.199
<v Speaker 2>It asks you a few questions, sets up the basic

84
00:04:01.240 --> 00:04:02.319
<v Speaker 2>project structure for you.

85
00:04:02.439 --> 00:04:04.479
<v Speaker 1>Why the shift to vite. What makes it faster?

86
00:04:04.840 --> 00:04:08.159
<v Speaker 2>Well? It leverages native es modules in the browser during development,

87
00:04:08.520 --> 00:04:10.039
<v Speaker 2>so instead of budling everything.

88
00:04:09.800 --> 00:04:11.479
<v Speaker 1>Up front like webpac often does.

89
00:04:11.879 --> 00:04:14.680
<v Speaker 2>Right, vites are of code pieces as the browser requests them.

90
00:04:14.840 --> 00:04:17.879
<v Speaker 2>Much faster startup, much quicker updates when you change code.

91
00:04:18.040 --> 00:04:19.120
<v Speaker 2>Big win for developers.

92
00:04:19.360 --> 00:04:23.160
<v Speaker 1>Makes sense. Okay, project set up done? Now? Performance? You

93
00:04:23.199 --> 00:04:26.360
<v Speaker 1>mentioned view as performance Chavine talks about the virtual dom.

94
00:04:26.680 --> 00:04:29.319
<v Speaker 2>Ah, yes, the virtual dom. This is key.

95
00:04:29.720 --> 00:04:32.120
<v Speaker 1>So the browser makes this thing called the dom from

96
00:04:32.360 --> 00:04:34.879
<v Speaker 1>HTML right a tree structure.

97
00:04:34.600 --> 00:04:37.600
<v Speaker 2>Yep, and changing that real dom directly, especially often to

98
00:04:37.720 --> 00:04:40.120
<v Speaker 2>slow It forces the browser to.

99
00:04:40.079 --> 00:04:43.480
<v Speaker 1>Repaint, which is expensive computationally.

100
00:04:42.839 --> 00:04:46.199
<v Speaker 2>Speaking, exactly, especially on complex pages with lots of updates.

101
00:04:46.319 --> 00:04:48.160
<v Speaker 2>Older frameworks sometimes struggled there.

102
00:04:48.319 --> 00:04:51.959
<v Speaker 1>So View's solution is this virtual dom, which is what

103
00:04:52.319 --> 00:04:55.240
<v Speaker 1>exactly a JavaScript object basically.

104
00:04:55.319 --> 00:04:58.560
<v Speaker 2>Yes, it's a lightweight JavaScript representation like a blueprint of

105
00:04:58.560 --> 00:05:01.480
<v Speaker 2>the actual dom v nodes virtual nodes.

106
00:05:01.560 --> 00:05:05.040
<v Speaker 1>Okay, So when data changes in your view app, View.

107
00:05:04.920 --> 00:05:08.000
<v Speaker 2>Updates this virtual dom first, which is super fast, just

108
00:05:08.120 --> 00:05:10.279
<v Speaker 2>changing JavaScript objects in memory.

109
00:05:10.040 --> 00:05:12.000
<v Speaker 1>And then it figures out the best way to update.

110
00:05:11.759 --> 00:05:15.879
<v Speaker 2>The real dom precisely. It calculates the minimum necessary changes

111
00:05:15.920 --> 00:05:19.199
<v Speaker 2>and applies them in batches, like editing a draft before

112
00:05:19.240 --> 00:05:20.720
<v Speaker 2>finalizing the master copy.

113
00:05:20.800 --> 00:05:24.319
<v Speaker 1>So it does a bit more work upfront in JavaScript.

114
00:05:23.879 --> 00:05:27.000
<v Speaker 2>To avoid the much costly er direct dom manipulation.

115
00:05:27.399 --> 00:05:29.959
<v Speaker 1>That's the trade off, and that's why view feel smooth,

116
00:05:30.160 --> 00:05:31.800
<v Speaker 1>especially with frequent updates.

117
00:05:32.000 --> 00:05:34.839
<v Speaker 2>That's a huge part of it. Fewer expensive repaints mean

118
00:05:34.879 --> 00:05:36.519
<v Speaker 2>a more responseive UI.

119
00:05:36.560 --> 00:05:39.439
<v Speaker 1>Okay, cool, So how does a U app actually start?

120
00:05:39.720 --> 00:05:41.360
<v Speaker 1>Chavin mentions a root instance.

121
00:05:41.680 --> 00:05:44.279
<v Speaker 2>Yeah, every view app has a root component instance it's

122
00:05:44.279 --> 00:05:45.360
<v Speaker 2>the foundation.

123
00:05:45.199 --> 00:05:47.040
<v Speaker 1>And other components are nested inside it.

124
00:05:47.879 --> 00:05:50.519
<v Speaker 2>And the whole app gets mounted attached to a specific

125
00:05:50.639 --> 00:05:54.120
<v Speaker 2>HTML element, often a div with eight app you use

126
00:05:54.199 --> 00:05:56.079
<v Speaker 2>app do mount hashtag app.

127
00:05:55.839 --> 00:05:59.800
<v Speaker 1>And configuring these components. The main way is the options API.

128
00:06:00.040 --> 00:06:02.160
<v Speaker 2>That's one of the core ways. Yes, it's basically a

129
00:06:02.279 --> 00:06:06.079
<v Speaker 2>JavaScript object with different properties or options that define the

130
00:06:06.120 --> 00:06:07.000
<v Speaker 2>component's behavior.

131
00:06:07.040 --> 00:06:08.399
<v Speaker 1>Let's break down some key options.

132
00:06:08.480 --> 00:06:13.000
<v Speaker 2>First, data right, Data is a function. Importantly, it returns

133
00:06:13.000 --> 00:06:14.000
<v Speaker 2>an object.

134
00:06:13.680 --> 00:06:17.120
<v Speaker 1>And that object holds the components reactive data exactly.

135
00:06:17.319 --> 00:06:20.680
<v Speaker 2>Reactive means when these properties change, View knows and it

136
00:06:20.720 --> 00:06:22.720
<v Speaker 2>automatically updates the parts of the UI.

137
00:06:22.600 --> 00:06:24.360
<v Speaker 1>That use them, and you use them in the template

138
00:06:24.439 --> 00:06:25.759
<v Speaker 1>with double curly braces.

139
00:06:25.839 --> 00:06:29.240
<v Speaker 2>Yep, property name. That's one way data binding data flows

140
00:06:29.240 --> 00:06:31.120
<v Speaker 2>from the component to the template.

141
00:06:31.199 --> 00:06:34.160
<v Speaker 1>Shaven recommends the viewdev Tools extension here.

142
00:06:34.360 --> 00:06:37.800
<v Speaker 2>Oh absolutely essential. Lets you inspect even edit that reactive

143
00:06:37.879 --> 00:06:41.480
<v Speaker 2>data live in your browser. Great for debugging and understanding

144
00:06:41.519 --> 00:06:42.000
<v Speaker 2>what's happening.

145
00:06:42.079 --> 00:06:44.560
<v Speaker 1>Okay. Then there's v model that's for two way binding.

146
00:06:44.680 --> 00:06:47.319
<v Speaker 2>Correct. It creates a direct link between say, an input

147
00:06:47.319 --> 00:06:49.120
<v Speaker 2>field and a data property.

148
00:06:48.800 --> 00:06:51.319
<v Speaker 1>So user types in the input data updates you change

149
00:06:51.360 --> 00:06:53.680
<v Speaker 1>the data incode input updates.

150
00:06:53.399 --> 00:06:57.079
<v Speaker 2>Exactly, super common for forms, and it has modifiers like

151
00:06:57.120 --> 00:06:58.639
<v Speaker 2>dot trim to remove white.

152
00:06:58.399 --> 00:07:02.399
<v Speaker 1>Space, lazy to update on on blur not every keystroke.

153
00:07:02.120 --> 00:07:04.240
<v Speaker 2>And dot number to try and cast the input to

154
00:07:04.279 --> 00:07:05.839
<v Speaker 2>a number. Handy shortcuts.

155
00:07:05.959 --> 00:07:09.560
<v Speaker 1>What about just binding data to HTML attributes.

156
00:07:09.000 --> 00:07:12.319
<v Speaker 2>One way that's v bind or the shorthand just to colon.

157
00:07:12.480 --> 00:07:14.959
<v Speaker 1>So like ming dot src imager.

158
00:07:14.600 --> 00:07:19.399
<v Speaker 2>Decisely binds the image of data property to the src attribute.

159
00:07:19.439 --> 00:07:21.439
<v Speaker 2>You can bind almost any attribute.

160
00:07:20.959 --> 00:07:23.439
<v Speaker 1>And Shavin says you can bind a whole object.

161
00:07:23.639 --> 00:07:27.680
<v Speaker 2>Yeah, like die dot index, dot index, dot index. If

162
00:07:27.720 --> 00:07:31.800
<v Speaker 2>the object keys match attribute names, view applies them neat and.

163
00:07:31.639 --> 00:07:34.160
<v Speaker 1>You can use the colon for dot class in dot

164
00:07:34.199 --> 00:07:36.839
<v Speaker 1>style too. For dynamic styling.

165
00:07:36.519 --> 00:07:38.920
<v Speaker 2>Definitely, you can bind dot class to an object where

166
00:07:38.959 --> 00:07:42.120
<v Speaker 2>keys are class names and values are booleans, or to

167
00:07:42.240 --> 00:07:44.600
<v Speaker 2>an array of class names. Same idea for dot style

168
00:07:44.839 --> 00:07:47.959
<v Speaker 2>binding to an object of CSS properties. Very flexible.

169
00:07:48.079 --> 00:07:50.959
<v Speaker 1>Okay, what about lists rendering rays of things.

170
00:07:51.000 --> 00:07:52.839
<v Speaker 2>That's the V for directive. You put it on the

171
00:07:52.839 --> 00:07:53.600
<v Speaker 2>element you want to.

172
00:07:53.519 --> 00:07:57.040
<v Speaker 1>Repeat like leaf V for iteman items exactly.

173
00:07:57.079 --> 00:08:00.439
<v Speaker 2>It loops over the items array or object properties and

174
00:08:00.480 --> 00:08:01.759
<v Speaker 2>live for each one and.

175
00:08:01.680 --> 00:08:04.600
<v Speaker 1>The crucial thing here is the dot key attribute.

176
00:08:04.079 --> 00:08:08.279
<v Speaker 2>Absolutely trucal live for item and items key item, dot ID,

177
00:08:08.600 --> 00:08:10.439
<v Speaker 2>you need to give each item a unique key.

178
00:08:10.560 --> 00:08:11.600
<v Speaker 1>Why is that so important?

179
00:08:11.680 --> 00:08:14.639
<v Speaker 2>It helps view track each element efficiently. When the list

180
00:08:14.720 --> 00:08:18.199
<v Speaker 2>changes items added, removed, reordered, View uses the key to

181
00:08:18.240 --> 00:08:21.000
<v Speaker 2>figure out the minimal updates needed. Without keys, it might

182
00:08:21.040 --> 00:08:23.639
<v Speaker 2>have to rerender much more, which hurts performance.

183
00:08:23.920 --> 00:08:28.720
<v Speaker 1>Gotcha keys are essential for list performance now handling user

184
00:08:28.759 --> 00:08:30.040
<v Speaker 1>actions like clicks.

185
00:08:30.279 --> 00:08:34.039
<v Speaker 2>That's v on or the shorthand at say so, at click,

186
00:08:34.279 --> 00:08:35.159
<v Speaker 2>do something.

187
00:08:35.000 --> 00:08:37.799
<v Speaker 1>Attaches an event. Listener calls a method in your component

188
00:08:37.919 --> 00:08:39.320
<v Speaker 1>do something in this case yep.

189
00:08:39.559 --> 00:08:42.399
<v Speaker 2>Or you can put simple inline JavaScript expressions right there

190
00:08:42.440 --> 00:08:45.120
<v Speaker 2>like at click count plus plus meg. But for anything,

191
00:08:45.159 --> 00:08:46.399
<v Speaker 2>complex methods are.

192
00:08:46.279 --> 00:08:49.440
<v Speaker 1>Better, and ven O's modifiers too, like stop and dot prevent.

193
00:08:49.399 --> 00:08:52.399
<v Speaker 2>Right at click. Dot stop prevents the event bubbling up

194
00:08:52.399 --> 00:08:55.720
<v Speaker 2>the dom. At click, dot prevent stops the browser's default action,

195
00:08:56.200 --> 00:08:57.480
<v Speaker 2>like preventing form submission.

196
00:08:57.720 --> 00:09:00.159
<v Speaker 1>There are others too, self not wants.

197
00:09:00.120 --> 00:09:03.279
<v Speaker 2>Dot capture Yeah, dot self means the event must originate

198
00:09:03.320 --> 00:09:06.360
<v Speaker 2>on this specific element, not bubble up from a child.

199
00:09:06.919 --> 00:09:10.240
<v Speaker 2>Johns makes the listener fire only one time. Dot capture

200
00:09:10.399 --> 00:09:13.960
<v Speaker 2>uses the capture phase of event handling, which is less

201
00:09:14.000 --> 00:09:15.159
<v Speaker 2>common but sometimes.

202
00:09:14.879 --> 00:09:18.000
<v Speaker 1>Useful, and specific key modifiers like at keydown dot enter

203
00:09:18.080 --> 00:09:18.679
<v Speaker 1>super handy.

204
00:09:18.879 --> 00:09:21.279
<v Speaker 2>Instead of checking event dot key coode, you just use

205
00:09:21.320 --> 00:09:23.519
<v Speaker 2>a key doown dot enter or at keyp dot shift.

206
00:09:23.720 --> 00:09:24.360
<v Speaker 2>Much cleaner.

207
00:09:24.399 --> 00:09:27.240
<v Speaker 1>You can chain them like at keydown dot ctrl dot enter.

208
00:09:27.559 --> 00:09:31.159
<v Speaker 2>You can, though shaven notes using key coodes like part

209
00:09:31.200 --> 00:09:34.320
<v Speaker 2>one three for enter might be more reliable for complex

210
00:09:34.399 --> 00:09:39.200
<v Speaker 2>chaining than keynames sometimes, and there's dot exact for requiring

211
00:09:39.200 --> 00:09:40.919
<v Speaker 2>only the specified modifiers. Okay.

212
00:09:41.279 --> 00:09:45.720
<v Speaker 1>Last directive in this group conditional rendering showing hiding elements right.

213
00:09:45.840 --> 00:09:49.080
<v Speaker 2>V IF, VLSIF and VLS e if takes an expression.

214
00:09:49.440 --> 00:09:52.519
<v Speaker 1>If it's truth y, the element is rendered exactly.

215
00:09:52.759 --> 00:09:55.480
<v Speaker 2>If it's false, the element isn't just hidden, it's completely

216
00:09:55.519 --> 00:09:56.519
<v Speaker 2>removed from the dom.

217
00:09:56.440 --> 00:09:58.759
<v Speaker 1>And VLS must follow via.

218
00:09:58.720 --> 00:10:02.159
<v Speaker 2>Or vlsif it renders if the preceding VF or vlsf

219
00:10:02.279 --> 00:10:05.519
<v Speaker 2>was false allows you to change conditions.

220
00:10:04.879 --> 00:10:09.200
<v Speaker 1>So VF actually at removes elements, unlike just using CSS

221
00:10:09.240 --> 00:10:10.320
<v Speaker 1>display right.

222
00:10:10.320 --> 00:10:15.200
<v Speaker 2>None correct, it's true conditional rendering, not just toggling visibility. Right.

223
00:10:15.600 --> 00:10:19.080
<v Speaker 1>Okay, Moving on, let's talk component life cycle. Components have stages.

224
00:10:18.799 --> 00:10:21.679
<v Speaker 2>Right, They do from creation to destruction and view gives

225
00:10:21.720 --> 00:10:24.360
<v Speaker 2>you hooks functions you can define to run code at

226
00:10:24.399 --> 00:10:25.519
<v Speaker 2>specific points in that.

227
00:10:25.440 --> 00:10:27.320
<v Speaker 1>Cycle, like what what are some key hooks?

228
00:10:27.480 --> 00:10:30.200
<v Speaker 2>Well, early on you have before creating, created, then before

229
00:10:30.279 --> 00:10:32.840
<v Speaker 2>mountain mounted, just before and after it's added.

230
00:10:32.559 --> 00:10:36.840
<v Speaker 1>To the down mounted sounds useful, like for fetching data.

231
00:10:36.440 --> 00:10:40.440
<v Speaker 2>Exactly common use case. Then when data changes and the

232
00:10:40.480 --> 00:10:42.639
<v Speaker 2>component updates, you get before.

233
00:10:42.399 --> 00:10:44.600
<v Speaker 1>Update and updated, and when it's removed.

234
00:10:44.240 --> 00:10:47.759
<v Speaker 2>For unmounted unmounted Yeah, good for cleanup, like clearing timers

235
00:10:48.159 --> 00:10:50.399
<v Speaker 2>or removing manual event listeners you might have added.

236
00:10:50.480 --> 00:10:53.600
<v Speaker 1>You mentioned the composition API earlier, Shavin talks about a

237
00:10:53.639 --> 00:10:55.440
<v Speaker 1>setup hook related to that.

238
00:10:55.639 --> 00:10:58.960
<v Speaker 2>Yes, setup is the entry point for the composition API.

239
00:10:59.039 --> 00:11:02.320
<v Speaker 2>It actually runs before four before create and create it.

240
00:11:02.320 --> 00:11:05.279
<v Speaker 1>And the script setup syntax kind of hides that complexity, right.

241
00:11:05.320 --> 00:11:09.440
<v Speaker 2>Script setup handles the setup part implicitly, making it more concise.

242
00:11:09.919 --> 00:11:12.919
<v Speaker 2>The setup function gets props and a contact object. What's

243
00:11:12.960 --> 00:11:16.320
<v Speaker 2>in the context useful stuff access to attributes passed to

244
00:11:16.360 --> 00:11:19.759
<v Speaker 2>the component slots which let you pass markup into the component,

245
00:11:20.120 --> 00:11:22.240
<v Speaker 2>and the emit function for sending events up to the parent.

246
00:11:22.320 --> 00:11:24.080
<v Speaker 1>And you can use set up with render functions too.

247
00:11:24.360 --> 00:11:26.360
<v Speaker 1>For really low level control you can.

248
00:11:26.519 --> 00:11:30.039
<v Speaker 2>Yeah, if you need very dynamic rendering logic where templates

249
00:11:30.039 --> 00:11:33.200
<v Speaker 2>get awkward, setup can return render function using the h

250
00:11:33.240 --> 00:11:35.480
<v Speaker 2>function to create v nodes programmatically.

251
00:11:35.799 --> 00:11:39.960
<v Speaker 1>Okay, now, derived data. What if one piece of data

252
00:11:40.000 --> 00:11:40.840
<v Speaker 1>depends on another.

253
00:11:41.000 --> 00:11:43.799
<v Speaker 2>That's what computed properties are for. You use the computed

254
00:11:43.799 --> 00:11:47.279
<v Speaker 2>option and these are cased. Yes, that's the key benefit.

255
00:11:47.559 --> 00:11:51.120
<v Speaker 2>A computed property only recalculates its value if one of

256
00:11:51.120 --> 00:11:56.360
<v Speaker 2>the reactive properties depends on changes. Otherwise, it just returns

257
00:11:56.399 --> 00:11:59.840
<v Speaker 2>the cached value. Very efficient for complex calculations.

258
00:12:00.080 --> 00:12:02.639
<v Speaker 1>But what if you need to do something else when

259
00:12:02.720 --> 00:12:06.399
<v Speaker 1>data changes, like not just calculative value, but run some code,

260
00:12:06.480 --> 00:12:07.360
<v Speaker 1>an API call.

261
00:12:07.559 --> 00:12:09.399
<v Speaker 2>That's where watchers come in the watch.

262
00:12:09.120 --> 00:12:12.480
<v Speaker 1>Option, so you watch a specific data property and.

263
00:12:12.519 --> 00:12:15.600
<v Speaker 2>Provide a callback function that runs whenever that property changes.

264
00:12:15.720 --> 00:12:18.080
<v Speaker 1>It's for side effects, and you have options like deep

265
00:12:18.159 --> 00:12:20.240
<v Speaker 1>for watching inside objects yep, deep.

266
00:12:20.159 --> 00:12:23.639
<v Speaker 2>True watches nested properties, and immediate true makes the watcher

267
00:12:23.720 --> 00:12:26.440
<v Speaker 2>run once right away when the component is created, not

268
00:12:26.480 --> 00:12:27.720
<v Speaker 2>just unchanges makes sense.

269
00:12:27.799 --> 00:12:31.080
<v Speaker 1>Okay. Communication between components. How does a parent talk to a.

270
00:12:31.159 --> 00:12:34.080
<v Speaker 2>Child primarily through props? Props are like custom attributes.

271
00:12:34.120 --> 00:12:36.399
<v Speaker 1>You passed down using v bind or the cull in

272
00:12:36.480 --> 00:12:39.240
<v Speaker 1>shorthand like child component message parent.

273
00:12:39.039 --> 00:12:41.799
<v Speaker 2>Data exactly, and the child component has to declare the

274
00:12:41.799 --> 00:12:44.320
<v Speaker 2>props it expects using the props option.

275
00:12:44.360 --> 00:12:46.960
<v Speaker 1>Or define crops in script setup.

276
00:12:47.080 --> 00:12:50.159
<v Speaker 2>Right, you can specify types for props, make them required,

277
00:12:50.360 --> 00:12:52.600
<v Speaker 2>give them default values. It's a clear contract.

278
00:12:52.639 --> 00:12:54.919
<v Speaker 1>How does the child talk back to the parent.

279
00:12:54.799 --> 00:12:59.200
<v Speaker 2>By emitting custom events? The child calls this emit event

280
00:12:59.279 --> 00:13:02.159
<v Speaker 2>name optional pay load in the options API.

281
00:13:02.080 --> 00:13:04.840
<v Speaker 1>Or uses the emit function from setup or define up

282
00:13:05.120 --> 00:13:06.840
<v Speaker 1>in script setup, and.

283
00:13:06.720 --> 00:13:09.519
<v Speaker 2>The parent listens for that event using v on or

284
00:13:09.559 --> 00:13:12.639
<v Speaker 2>at on the child component tag like child component at

285
00:13:12.639 --> 00:13:14.480
<v Speaker 2>event name, handle event.

286
00:13:14.440 --> 00:13:17.639
<v Speaker 1>Okay, props down events up. What if components are nested

287
00:13:17.720 --> 00:13:21.039
<v Speaker 1>really deep? Passing drops through many levels sounds tedious?

288
00:13:21.320 --> 00:13:23.600
<v Speaker 2>It can be. That's where provide an inject come in

289
00:13:23.639 --> 00:13:26.399
<v Speaker 2>a great inject Yeah, a parent or ancestor component can

290
00:13:26.440 --> 00:13:28.840
<v Speaker 2>provide some data or functionality.

291
00:13:28.159 --> 00:13:31.679
<v Speaker 1>And any descendant component, no matter how deep, can inject.

292
00:13:31.399 --> 00:13:34.600
<v Speaker 2>It exactly bypasses all the intermediate components. Great for global

293
00:13:34.600 --> 00:13:37.360
<v Speaker 2>things like user authentication, status or theme settings.

294
00:13:37.440 --> 00:13:39.879
<v Speaker 1>Cool. And one more thing here, teleport what's that?

295
00:13:40.399 --> 00:13:42.639
<v Speaker 2>Telecord is neat It lets you render a part of

296
00:13:42.679 --> 00:13:45.840
<v Speaker 2>your component's template somewhere else of the dom entirely.

297
00:13:45.720 --> 00:13:47.919
<v Speaker 1>Like outside the component's normal place.

298
00:13:48.080 --> 00:13:51.120
<v Speaker 2>Right. Think modals or pop up notifications. You might want

299
00:13:51.159 --> 00:13:54.039
<v Speaker 2>them rendered directly under the body tag to avoid CSSZ

300
00:13:54.120 --> 00:13:57.679
<v Speaker 2>index issues or clipping from parent elements.

301
00:13:57.320 --> 00:13:59.879
<v Speaker 1>So you use teleport to hashtag modal, target or something.

302
00:14:00.000 --> 00:14:02.960
<v Speaker 2>Actly. You specify the target selector using the two problems.

303
00:14:03.000 --> 00:14:06.000
<v Speaker 1>All right, let's circle back to the composition API. Chavin

304
00:14:06.120 --> 00:14:10.600
<v Speaker 1>covers it extensively. It's an alternative way to organize component logic.

305
00:14:10.480 --> 00:14:15.440
<v Speaker 2>Yes using functions. The core ideas are ref and reactive.

306
00:14:15.559 --> 00:14:19.039
<v Speaker 1>For a primitive values like strings or numbers.

307
00:14:18.759 --> 00:14:21.919
<v Speaker 2>Generally yes, or when you need to potentially reassign the

308
00:14:21.919 --> 00:14:24.519
<v Speaker 2>whole thing. It wraps the value in an object and

309
00:14:24.559 --> 00:14:26.879
<v Speaker 2>you access it using dot value, So my.

310
00:14:26.919 --> 00:14:29.240
<v Speaker 1>Ref dot value to get or set the value.

311
00:14:29.399 --> 00:14:32.600
<v Speaker 2>Correct and reactive is for objects or rays. It makes

312
00:14:32.639 --> 00:14:34.519
<v Speaker 2>the object itself reactive.

313
00:14:34.159 --> 00:14:36.759
<v Speaker 1>So you just modify properties directly on the reactive object.

314
00:14:36.840 --> 00:14:41.240
<v Speaker 2>Yep, my reactive object dot property, new value, view tracks.

315
00:14:40.919 --> 00:14:44.080
<v Speaker 1>It and computed properties and watchers exist in the composition

316
00:14:44.120 --> 00:14:44.799
<v Speaker 1>API two.

317
00:14:45.159 --> 00:14:48.559
<v Speaker 2>They do you import and use computed and watch or

318
00:14:48.679 --> 00:14:49.639
<v Speaker 2>watch effect functions.

319
00:14:49.679 --> 00:14:52.759
<v Speaker 1>The real power seems to be incomposables. What are those?

320
00:14:53.200 --> 00:14:57.840
<v Speaker 2>Composables are reusable pieces of logic built with composition API functions.

321
00:14:58.399 --> 00:15:01.600
<v Speaker 2>Think of them as custom hooks like in React, but

322
00:15:01.679 --> 00:15:02.200
<v Speaker 2>for View.

323
00:15:02.559 --> 00:15:04.960
<v Speaker 1>So you extract stateful logic.

324
00:15:04.679 --> 00:15:07.960
<v Speaker 2>Into a function exactly like you could create a use

325
00:15:08.039 --> 00:15:13.360
<v Speaker 2>mouse position composable that tracks the mouse coordinates using ref internally.

326
00:15:12.919 --> 00:15:16.279
<v Speaker 1>And then reuse that use mouse position logic in any

327
00:15:16.279 --> 00:15:18.000
<v Speaker 1>component that needs it precisely.

328
00:15:18.120 --> 00:15:21.279
<v Speaker 2>It makes your code much more organized, reusable, and testable.

329
00:15:21.679 --> 00:15:25.000
<v Speaker 2>A use fetch composable for API calls is another classic.

330
00:15:24.639 --> 00:15:28.279
<v Speaker 1>Example that sounds powerful. Okay, shifting gears to more advanced

331
00:15:28.320 --> 00:15:30.519
<v Speaker 1>rendering render functions.

332
00:15:30.159 --> 00:15:33.559
<v Speaker 2>Right, we touched on this. Using the H function directly

333
00:15:33.600 --> 00:15:36.759
<v Speaker 2>to create vnodes gives you full programmatic control over the output.

334
00:15:37.039 --> 00:15:38.559
<v Speaker 2>Good for highly dynamic.

335
00:15:38.120 --> 00:15:40.799
<v Speaker 1>Stuff, and JSX is an alternative syntax for that.

336
00:15:40.919 --> 00:15:43.960
<v Speaker 2>Yeah, it's like writing HTML inside your JavaScript. Some people,

337
00:15:44.039 --> 00:15:46.919
<v Speaker 2>especially from a React background, prefer it over templates.

338
00:15:47.279 --> 00:15:49.159
<v Speaker 1>View supports it dynamic components.

339
00:15:49.240 --> 00:15:52.759
<v Speaker 2>What's the use case using component dot is component name variable.

340
00:15:53.200 --> 00:15:55.720
<v Speaker 2>You can switch which component gets rendered in a particular

341
00:15:55.799 --> 00:15:58.879
<v Speaker 2>spot just by changing the value of component name variable.

342
00:15:59.039 --> 00:16:02.000
<v Speaker 2>Think tabs or different views based on user.

343
00:16:01.840 --> 00:16:04.240
<v Speaker 1>Selection and plugins adding global stuff.

344
00:16:04.360 --> 00:16:07.840
<v Speaker 2>YEP plugins let you add global components, methods, or integrate

345
00:16:07.879 --> 00:16:11.440
<v Speaker 2>libraries like view router or Plena into your whole application

346
00:16:11.759 --> 00:16:13.960
<v Speaker 2>via app dot use Mike Luggins.

347
00:16:13.559 --> 00:16:16.480
<v Speaker 1>Speaking of view Router, that's for single page apps right

348
00:16:16.960 --> 00:16:18.679
<v Speaker 1>handling navigation exactly.

349
00:16:18.720 --> 00:16:22.000
<v Speaker 2>It's the official router. It maps URL paths to your

350
00:16:22.120 --> 00:16:22.879
<v Speaker 2>view components.

351
00:16:23.039 --> 00:16:26.639
<v Speaker 1>So about shows the about component, Users shows the user's component.

352
00:16:26.720 --> 00:16:28.200
<v Speaker 2>Pretty much. You define those mappings.

353
00:16:28.320 --> 00:16:31.039
<v Speaker 1>You use router view as the placeholder where the match

354
00:16:31.120 --> 00:16:31.960
<v Speaker 1>component appears.

355
00:16:32.080 --> 00:16:34.679
<v Speaker 2>Correct Router views where the content changes based on.

356
00:16:34.679 --> 00:16:37.840
<v Speaker 1>The URL, and Router link for a navigation instead of

357
00:16:37.919 --> 00:16:38.840
<v Speaker 1>regular autags.

358
00:16:38.919 --> 00:16:42.440
<v Speaker 2>Yes, routerlink to about creates the link and handles the

359
00:16:42.519 --> 00:16:45.600
<v Speaker 2>navigation without a full page reload. Keeps it feeling like

360
00:16:45.679 --> 00:16:46.080
<v Speaker 2>an app.

361
00:16:46.320 --> 00:16:49.679
<v Speaker 1>Does it handle dynamic parts in the URL like users

362
00:16:49.679 --> 00:16:50.720
<v Speaker 1>one two three, Oh.

363
00:16:50.720 --> 00:16:55.120
<v Speaker 2>Yeah, dynamic routes, users, dot ID, nested routes like having

364
00:16:55.159 --> 00:16:58.639
<v Speaker 2>subviews within a user profile, route guards for controlling access.

365
00:16:59.039 --> 00:17:00.000
<v Speaker 2>It's very cabable.

366
00:17:00.039 --> 00:17:04.279
<v Speaker 1>Okay. State management for data shared across many components. You

367
00:17:04.319 --> 00:17:05.720
<v Speaker 1>mentioned Pinia, Yes.

368
00:17:05.680 --> 00:17:10.240
<v Speaker 2>Pinia is the official recommended state management library, now replaced fux.

369
00:17:11.160 --> 00:17:12.599
<v Speaker 1>It uses stores right.

370
00:17:12.720 --> 00:17:16.079
<v Speaker 2>You define stores to hold specific pieces of your application state.

371
00:17:16.160 --> 00:17:18.440
<v Speaker 1>What's inside a store typically.

372
00:17:18.000 --> 00:17:21.519
<v Speaker 2>State, the actual data usually return from a function, getters

373
00:17:22.000 --> 00:17:26.640
<v Speaker 2>like computed properties for the store, and actions methods for

374
00:17:26.759 --> 00:17:27.359
<v Speaker 2>changing the state.

375
00:17:27.400 --> 00:17:29.640
<v Speaker 1>And it's built with the composition API in mind.

376
00:17:29.759 --> 00:17:32.839
<v Speaker 2>Very much. So you define stores with define store and

377
00:17:32.960 --> 00:17:35.599
<v Speaker 2>access them in components using a composable like function.

378
00:17:35.759 --> 00:17:39.680
<v Speaker 1>Conventionally use my store and something called store terrefs ah.

379
00:17:39.759 --> 00:17:42.960
<v Speaker 2>Yeah. If you want to destructure state properties or getters

380
00:17:42.960 --> 00:17:46.400
<v Speaker 2>from a store in your component, storage threats keeps them reactive,

381
00:17:46.480 --> 00:17:48.880
<v Speaker 2>Otherwise you might lose reactivity if you just pull them

382
00:17:48.920 --> 00:17:49.480
<v Speaker 2>out directly.

383
00:17:49.599 --> 00:17:52.960
<v Speaker 1>Got it. Styling components, how do you avoid CSS conflicts

384
00:17:52.960 --> 00:17:53.880
<v Speaker 1>between components?

385
00:17:54.079 --> 00:17:56.880
<v Speaker 2>The easiest way is style scoped. Just add the scope

386
00:17:56.920 --> 00:17:58.640
<v Speaker 2>attribute to your style tech.

387
00:17:58.400 --> 00:18:01.839
<v Speaker 1>And view automatically makes those styles only apply to that component.

388
00:18:01.960 --> 00:18:05.000
<v Speaker 2>Yep. Under the hood, it adds unique data attributes data

389
00:18:05.119 --> 00:18:08.960
<v Speaker 2>v something to your component's elements and scopes the CSS

390
00:18:09.000 --> 00:18:12.839
<v Speaker 2>selectors to match. Prevents styles leaking out or in what.

391
00:18:12.839 --> 00:18:16.079
<v Speaker 1>About CSS modules style module.

392
00:18:15.799 --> 00:18:19.440
<v Speaker 2>That's another scoping mechanism. It generates unique class names for

393
00:18:19.480 --> 00:18:22.680
<v Speaker 2>your styles like BUTTONBC one, two, three, and make them

394
00:18:22.720 --> 00:18:25.559
<v Speaker 2>available in your template via a special style object, so

395
00:18:25.599 --> 00:18:28.960
<v Speaker 2>you'd write dot class styled dot. My button class offers

396
00:18:29.119 --> 00:18:30.559
<v Speaker 2>very strong isolation.

397
00:18:30.319 --> 00:18:33.599
<v Speaker 1>Cool now making things look nice when they appear or disappear.

398
00:18:34.039 --> 00:18:38.000
<v Speaker 2>Transitions Yeah, view has built in support with the transition component.

399
00:18:38.079 --> 00:18:40.160
<v Speaker 1>You wrap the element you want to animate, like one

400
00:18:40.160 --> 00:18:41.759
<v Speaker 1>controlled by viv exactly.

401
00:18:42.039 --> 00:18:45.319
<v Speaker 2>Wrap the element or component in transition name fade.

402
00:18:45.039 --> 00:18:48.279
<v Speaker 1>And view adds CSS classes during the enter leave phases.

403
00:18:48.400 --> 00:18:51.200
<v Speaker 2>It does like fade in or from fade interactive, fade

404
00:18:51.200 --> 00:18:54.440
<v Speaker 2>inner two and corresponding leave classes. You define the actual

405
00:18:54.480 --> 00:18:56.920
<v Speaker 2>animation using CSS rules for these classes.

406
00:18:57.039 --> 00:18:58.720
<v Speaker 1>Can you customize the class names?

407
00:18:58.920 --> 00:19:02.759
<v Speaker 2>You can using props on transition and there are javascripts

408
00:19:02.759 --> 00:19:05.960
<v Speaker 2>hooks at before, enter, at enter, et cetera. If you

409
00:19:06.000 --> 00:19:08.799
<v Speaker 2>need more complex JS driven animations.

410
00:19:08.240 --> 00:19:11.200
<v Speaker 1>What about animating lists items added or removed from a

411
00:19:11.279 --> 00:19:12.039
<v Speaker 1>V four For.

412
00:19:12.039 --> 00:19:15.720
<v Speaker 2>That, you use transition group. It's similar, but designed specifically

413
00:19:15.799 --> 00:19:19.960
<v Speaker 2>for animating list elements, including move transitions when items are reordered.

414
00:19:20.160 --> 00:19:22.519
<v Speaker 2>Remember the dot key attribute is vital here too.

415
00:19:22.480 --> 00:19:25.079
<v Speaker 1>Right keys again. Okay. Testing, got to make sure things work.

416
00:19:25.319 --> 00:19:29.119
<v Speaker 1>Unit testing first, testing small pieces in isolation.

417
00:19:29.400 --> 00:19:35.079
<v Speaker 2>Yeah, testing individual components or composables, shaven highlights, vtist vitist

418
00:19:35.240 --> 00:19:38.680
<v Speaker 2>integrates well with v exactly. It's fast and modern. You

419
00:19:38.680 --> 00:19:41.440
<v Speaker 2>can figure it, invite dot config dot ts.

420
00:19:41.000 --> 00:19:45.319
<v Speaker 1>And you write tests using describe it expect standard.

421
00:19:44.960 --> 00:19:48.240
<v Speaker 2>Stuff, pretty standard testing syntax. Yes. A key thing in

422
00:19:48.319 --> 00:19:52.200
<v Speaker 2>unit tests is mocking dependencies like API calls. Vitis has

423
00:19:52.200 --> 00:19:53.880
<v Speaker 2>tools like via dots beyond for that.

424
00:19:54.160 --> 00:19:56.920
<v Speaker 1>How do you test composables, especially if they use life

425
00:19:56.920 --> 00:19:57.559
<v Speaker 1>cycle hooks?

426
00:19:57.640 --> 00:20:00.039
<v Speaker 2>Often you need a little helper setup maybe creating a

427
00:20:00.119 --> 00:20:03.240
<v Speaker 2>temporary component instance to mount the composable within its life cycle,

428
00:20:03.440 --> 00:20:04.119
<v Speaker 2>using something like.

429
00:20:04.079 --> 00:20:06.960
<v Speaker 1>With setup and the view test utels library helps with

430
00:20:07.039 --> 00:20:08.880
<v Speaker 1>interacting with components in tests.

431
00:20:09.160 --> 00:20:12.160
<v Speaker 2>Definitely, shall them ount or mount to render the component,

432
00:20:12.480 --> 00:20:15.279
<v Speaker 2>find the select elements triggered to simulate clicks or input

433
00:20:15.519 --> 00:20:19.480
<v Speaker 2>dot text that attributes to's the output to match snapshot.

434
00:20:19.559 --> 00:20:24.279
<v Speaker 1>For snapshot testing, Vitist has a UI too and code Coverage.

435
00:20:23.839 --> 00:20:26.519
<v Speaker 2>YEP, a graphical interface for running tests and tools like

436
00:20:26.559 --> 00:20:29.200
<v Speaker 2>at vitis coverage is dan bull to see how much

437
00:20:29.200 --> 00:20:31.759
<v Speaker 2>of your code is covered by tests. Good to aim

438
00:20:31.799 --> 00:20:32.720
<v Speaker 2>for decent coverage.

439
00:20:32.799 --> 00:20:36.440
<v Speaker 1>Okay, that's unit tests. What about testing the whole app

440
00:20:36.480 --> 00:20:38.240
<v Speaker 1>flow like a real user.

441
00:20:38.039 --> 00:20:41.160
<v Speaker 2>That's end to end or E two E testing. The

442
00:20:41.160 --> 00:20:42.720
<v Speaker 2>book introduces playwright for this.

443
00:20:42.880 --> 00:20:44.400
<v Speaker 1>Playwright automates browsers.

444
00:20:44.519 --> 00:20:46.920
<v Speaker 2>Right, you write scripts that tell Playwright and go to

445
00:20:46.960 --> 00:20:49.319
<v Speaker 2>this page, find this button, click it. Fill in this form,

446
00:20:49.519 --> 00:20:50.599
<v Speaker 2>check if this text.

447
00:20:50.319 --> 00:20:53.160
<v Speaker 1>Appeared, simulating the user journey exactly.

448
00:20:53.279 --> 00:20:57.559
<v Speaker 2>You locate elements using selectors, CSS, text data tested attributes

449
00:20:57.599 --> 00:21:00.559
<v Speaker 2>are good practice, and make consertions about the application state.

450
00:21:00.680 --> 00:21:02.279
<v Speaker 1>Does Playwright help with debugging?

451
00:21:02.680 --> 00:21:06.039
<v Speaker 2>Yeah? It has great debugging tools and produces nice hetmail

452
00:21:06.160 --> 00:21:09.680
<v Speaker 2>reports showing test results, screenshots, even videos.

453
00:21:09.279 --> 00:21:12.400
<v Speaker 1>Sometimes automating all this building, testing, deploying.

454
00:21:12.400 --> 00:21:17.400
<v Speaker 2>That's CICD continuous integration, continuous deployment. Yes. Chavin covers using

455
00:21:17.559 --> 00:21:18.960
<v Speaker 2>GitHub actions.

456
00:21:18.640 --> 00:21:21.839
<v Speaker 1>Getub actions, runs workflows defined in YAML files.

457
00:21:21.519 --> 00:21:25.680
<v Speaker 2>In your rebuff correct workflows have jobs, jobs, have steps, steps,

458
00:21:25.720 --> 00:21:28.720
<v Speaker 2>run actions or scripts. You set it up so when

459
00:21:28.720 --> 00:21:32.160
<v Speaker 2>you push code or open a poll request, it automatically builds,

460
00:21:32.559 --> 00:21:33.759
<v Speaker 2>runs tests, and.

461
00:21:33.799 --> 00:21:37.079
<v Speaker 1>Maybe deploys if everything passes. That's the goal, CDEs, Where

462
00:21:37.079 --> 00:21:39.759
<v Speaker 1>do you deploy chavin mentions? Netlphi.

463
00:21:40.160 --> 00:21:43.359
<v Speaker 2>Netlaphi is a popular choice for hosting modern web apps.

464
00:21:43.599 --> 00:21:46.359
<v Speaker 2>It integrates really well with kit providers like GitHub.

465
00:21:46.119 --> 00:21:49.359
<v Speaker 1>So Netlify can watch your repository and automatically deploy on

466
00:21:49.400 --> 00:21:50.559
<v Speaker 1>commits to Maine YEP.

467
00:21:51.000 --> 00:21:53.920
<v Speaker 2>It handles the build process, deploys to a global CDN,

468
00:21:54.200 --> 00:21:58.640
<v Speaker 2>gives you custom domains, hgtps build previews for poll requests.

469
00:21:58.799 --> 00:21:59.480
<v Speaker 2>Lots of features.

470
00:21:59.559 --> 00:22:02.480
<v Speaker 1>Okay, fine, A big topic. Server side rendering SSR and

471
00:22:02.519 --> 00:22:05.599
<v Speaker 1>Static side generation SSG. Why bother with these instead of

472
00:22:05.599 --> 00:22:07.200
<v Speaker 1>just client side rendering CSR.

473
00:22:07.400 --> 00:22:11.079
<v Speaker 2>Well, standard CSR where the browser downloads JavaScript and then

474
00:22:11.079 --> 00:22:13.960
<v Speaker 2>builds the page can sometimes be slow on initial load

475
00:22:14.599 --> 00:22:17.079
<v Speaker 2>users see a blank page for a bit, and it

476
00:22:17.079 --> 00:22:19.319
<v Speaker 2>could be trickier for SEO crawlers.

477
00:22:19.039 --> 00:22:20.160
<v Speaker 1>So SSR helps with that.

478
00:22:20.279 --> 00:22:23.519
<v Speaker 2>How With SSR, the server runs your view code, renders

479
00:22:23.519 --> 00:22:26.440
<v Speaker 2>the page to HTML, and sends that fully formed HTML

480
00:22:26.480 --> 00:22:27.319
<v Speaker 2>to the browser.

481
00:22:27.000 --> 00:22:30.319
<v Speaker 1>First, so the user sees content much faster and SEO

482
00:22:30.480 --> 00:22:32.400
<v Speaker 1>bots get HTML exactly.

483
00:22:32.559 --> 00:22:36.200
<v Speaker 2>The browser then hydrates the static HTML, making it interactive

484
00:22:36.240 --> 00:22:38.799
<v Speaker 2>by attaching the JavaScript event listeners.

485
00:22:38.440 --> 00:22:41.039
<v Speaker 1>In state and SSG. Static Site Generation.

486
00:22:40.920 --> 00:22:43.319
<v Speaker 2>SSG takes it further. It pre renders every page of

487
00:22:43.359 --> 00:22:45.960
<v Speaker 2>your site into static HTML files at build.

488
00:22:45.720 --> 00:22:48.160
<v Speaker 1>Time, so you just serve plane HTML files.

489
00:22:48.240 --> 00:22:51.160
<v Speaker 2>Basically, Yes, it's the fastest possible option and great for

490
00:22:51.319 --> 00:22:54.359
<v Speaker 2>SEO ideal for sites where content doesn't change super frequently,

491
00:22:54.440 --> 00:22:55.440
<v Speaker 2>like blogs or dogs.

492
00:22:55.920 --> 00:22:59.799
<v Speaker 1>Implementing SSR SSG in view sounds complex.

493
00:22:59.359 --> 00:23:02.039
<v Speaker 2>Though it can setting it up manually. That's why frameworks

494
00:23:02.039 --> 00:23:03.240
<v Speaker 2>like nets dot as exist.

495
00:23:03.440 --> 00:23:07.400
<v Speaker 1>Nextjs builds on top of view to simplify SSR and SSG.

496
00:23:07.440 --> 00:23:11.000
<v Speaker 2>Massively simplifies it. Next handles routing based on your file

497
00:23:11.039 --> 00:23:14.519
<v Speaker 2>structure in a page's directory, provides layouts built in data

498
00:23:14.519 --> 00:23:18.680
<v Speaker 2>fetching methods for server side. It makes building SSR ssgview

499
00:23:18.680 --> 00:23:19.920
<v Speaker 2>apps much more straightforward.

500
00:23:19.920 --> 00:23:22.519
<v Speaker 1>Wow, Okay, that was a lot. Let's try to recap

501
00:23:22.559 --> 00:23:23.200
<v Speaker 1>this deep dive.

502
00:23:23.359 --> 00:23:29.200
<v Speaker 2>Yeah, definitely. So fundamentally, viewjs is this progressive, really versatile

503
00:23:29.240 --> 00:23:31.240
<v Speaker 2>framework for modern web development.

504
00:23:31.319 --> 00:23:34.039
<v Speaker 1>It balances ease of use for getting started.

505
00:23:34.000 --> 00:23:37.519
<v Speaker 2>With really advanced features for building complex, production grade apps.

506
00:23:37.720 --> 00:23:40.680
<v Speaker 1>We went through setup, the performance boost from the virtual dome.

507
00:23:40.640 --> 00:23:45.119
<v Speaker 2>State management with Peona, routing with view router, testing strategies

508
00:23:45.119 --> 00:23:48.720
<v Speaker 2>with vetist and Playwright, deployment workflows.

509
00:23:48.200 --> 00:23:51.240
<v Speaker 1>And the whole ecosystem around it vite nextjs. It's a

510
00:23:51.279 --> 00:23:54.799
<v Speaker 1>comprehensive toolkit, it really is. And those aha moments, I

511
00:23:54.799 --> 00:23:57.200
<v Speaker 1>think the efficiency of the VDOM is one.

512
00:23:57.079 --> 00:23:59.440
<v Speaker 2>Definitely, and just the clarity you get from the options

513
00:23:59.480 --> 00:24:01.920
<v Speaker 2>API or the flexibility of the composition, API.

514
00:24:01.799 --> 00:24:03.319
<v Speaker 1>Composables for reuse.

515
00:24:03.440 --> 00:24:07.279
<v Speaker 2>This seems huge, absolutely, and just the overall streamline developer

516
00:24:07.319 --> 00:24:09.079
<v Speaker 2>experience the ecosystem provides.

517
00:24:09.440 --> 00:24:11.920
<v Speaker 1>Hopefully this has given you a solid foundation and maybe

518
00:24:11.960 --> 00:24:13.079
<v Speaker 1>spark some curiosity.

519
00:24:13.200 --> 00:24:15.839
<v Speaker 2>Yeah, you might be wondering, now, Okay, when exactly do

520
00:24:15.920 --> 00:24:19.319
<v Speaker 2>I use SSR versus SSG? Yeah? Or how do I

521
00:24:19.400 --> 00:24:23.440
<v Speaker 2>test really complex components or integrate View with my specific

522
00:24:23.480 --> 00:24:23.920
<v Speaker 2>back end?

523
00:24:24.160 --> 00:24:27.079
<v Speaker 1>Lots of avenues for deeper exploration, for sure.

524
00:24:26.880 --> 00:24:31.839
<v Speaker 2>The official docks for View Router, Pinia, nuxt. They're excellent

525
00:24:31.880 --> 00:24:34.799
<v Speaker 2>resources and the community is incredibly active and helpful.

526
00:24:35.000 --> 00:24:37.720
<v Speaker 1>So a final thought to leave you with. As web

527
00:24:37.759 --> 00:24:42.160
<v Speaker 1>development keeps evolving so rapidly, frameworks like View really shared

528
00:24:42.200 --> 00:24:46.519
<v Speaker 1>this constant push for better performance, the better developer experience, and.

529
00:24:46.559 --> 00:24:50.319
<v Speaker 2>Just more robust, scalable, and honestly more enjoyable web applications.

530
00:24:50.680 --> 00:24:54.759
<v Speaker 1>So how will these core ideas, component architecture, reactive, data,

531
00:24:54.839 --> 00:24:57.960
<v Speaker 1>efficient rendering, How will they continue to shape the future

532
00:24:57.960 --> 00:25:00.200
<v Speaker 1>of the web experiences we all use every day?

533
00:25:00.440 --> 00:25:02.440
<v Speaker 2>Something to think about, definitely something to think about.

534
00:25:02.480 --> 00:25:04.039
<v Speaker 1>Thanks for taking this deep dive with us,
