-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path2023-10-23-react-server.html
213 lines (186 loc) · 8.02 KB
/
2023-10-23-react-server.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>React 18 Training</title>
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
<meta
name="viewport"
content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, minimal-ui"
/>
<link rel="stylesheet" href="slides/revealjs/reveal.js/dist/reset.css" />
<link rel="stylesheet" href="slides/revealjs/reveal.js/dist/reveal.css" />
<link rel="stylesheet" href="slides/revealjs/reveal.js/dist/theme/solarized.css" />
<!-- Theme used for syntax hislides/ghlighted code -->
<link rel="stylesheet" href="slides/revealjs/highlight-js-github-theme.css" />
<link rel="stylesheet" href="slides/revealjs/styles.css" />
</head>
<body>
<div class="reveal">
<!-- Any section element inside of this container is displayed as a slide -->
<div class="slides">
<section data-state="title">
<h2 class="title" style="font-size: 7rem">
<b>React Fullstack 2023 Workshop</b>
</h2>
<h4>
<span class="transparent-bg">
<a href="https://nilshartmann.net" target="_blank">Nils Hartmann</a>
|
<a href="https://twitter.com/nilshartmann" target="_blank">@nilshartmann</a>
</span>
</h4>
<p style="margin-top: 4rem"></p>
<div>
<h3><span class="transparent-bg">Repository</span></h3>
<p>
<span class="transparent-bg"
>Remote:
<a href="https://github.com/nilshartmann/react-fullstack-workshop"
>https://github.com/nilshartmann/react-fullstack-workshop</a
></span
>
</p>
</div>
<p style="margin-top: 4rem"></p>
<div>
<h3><span class="transparent-bg">Slides</span></h3>
<p>
<span class="transparent-bg"
>Lokal: 2023-10-23-react-server.html</span
>
</p>
<p>
<span class="transparent-bg"
>Remote:
<a
href="https://nilshartmann.github.io/react-fullstack-workshop/2023-10-23-react-server.html"
>https://nilshartmann.github.io/react-fullstack-workshop/2023-10-23-react-server.html</a
></span
>
</p>
</div>
</section>
<section>
<h2>Nils Hartmann</h2>
<p style="margin-top: 2rem">
<a href="https://nilshartmann.net" target="_blank">https://nilshartmann.net</a>
/
<a href="https://twitter.com/nilshartmann" target="_blank">@nilshartmann</a>
</p>
<p style="margin-top: 2rem">
<em>Freiberuflicher Software-Entwickler, Berater und Trainer aus Hamburg</em>
</p>
<p></p>
<p style="margin-top: 5rem">Java | JavaScript, TypeScript | React | GraphQL</p>
<div style="display: flex; justify-content: center; margin-top: 2rem">
<div style="margin-left: 15px">
<a href="https://graphql.schule/video-kurs"
><img
style="max-height: 450px"
src="slides/images/screenshot-graphql-kurs.png"
/><br />https://graphql.schule/video-kurs</a
>
<br />
</div>
<!-- -->
<div style="margin-left: 100px">
<a href="https://reactbuch.de"
><img
style="max-height: 450px"
src="slides/images/react-buch-v2.jpg"
/><br />https://reactbuch.de</a
>
<br />
</div>
</div>
</section>
<!-- ============================================================================= -->
<section data-markdown>
<textarea data-template>
### Zeitplan
* 09:00 - 16:00
* 12:00 bis 13:00 Mittagspause 🍝
* Kurze Pausen zwischendurch ☕️
---
### Agenda
* Tag 1: Serverseitiges React mit Next.js
* Tag 2: Neues in React 18, DataFetching mit TanStack/React Query und React Router
* Eure Fragen, Diskussionen: **jederzeit**
* Eher *Workshop* als *Schulung*
* **Habt ihr jetzt schon Wünsche oder Fragen? => Miro Board**
* Jeder schreibt (mindestens) eine Frage auf
* oder einen Satz/eine Meinung/Stimmung zu React+Co ("I ❤️ TypeScript", "Redux ist doof", ...)
---
### Vorkenntnisse
* Mal sehen, ob ich das richtige vorbereitet habe...
* ...die folgenden Themen würde ich im Workshop besprechen wollen
* ...wenn ihr das alles kennt, sind wir schnell fertig 🎅 🎄
* Wer von Euch kennt, bzw. setzt eines der folgenden Tools ein?
* Zod
* Tailwind CSS
* Next.js
* TanStack Query bzw. React Query
* React Router mit DataFetching
---
## Demo-Anwendung
* http://localhost:4000
</textarea>
</section>
<section data-markdown="zod.md">
</section>
<section data-markdown="tailwind.md">
</section>
<section data-markdown="nextjs.md">
</section>
<section data-markdown="data-fetching.md">
</section>
<!-- ============================================================================= -->
<section data-markdown>
<textarea data-template>
## Komponententest mit Playwright
* Vorteil gegenüber RTL: Läuft im echten Browser
* Man kann den Browser bzw. die Render-Ausgabe sehen
* Genau wie RTL: man kann Props / Callbacks mocken
* Netzwork mock von Playwright kann genutzt werden
* Responsiveness etc. kann getestet werden
* Aber:
* Genau wie bei RTL muss die Komponente "lauffähig" sein
* Alle Abhängigkeiten (Redux, GraphQL, Context, globales CSS (!)), die die Komponente
nutzt, müssen im Test vorhanden sein
* `index.ts`
* Man kann keine Funktionen mocken (so wie mit jest/vitest) https://github.com/microsoft/playwright/issues/14572
* Playwright muss die Komponente bauen können (Bundling, TS)
* Man muss ggf. Konfiguration nachbauen https://playwright.dev/docs/test-components#i-have-a-project-that-already-uses-vite-can-i-reuse-the-config
* Funktioniert das mit Next.js? mit *asynchronen* RSCs?
* Wie kann man mischen? "Echte" PW-Test und Component-Tests in einem Projekt
* Build-Stack: Vite, beim Test ausführen wird eine Vite-Anwendung gebaut und deployed
* Mögliche Probleme:
* e2e test runner und comp test runner sind verschieden: https://github.com/microsoft/playwright/issues/27486
* Plans for component testing (still experimental!) https://github.com/microsoft/playwright/issues/26778
</textarea>
</section>
<!-- ============================================================================= -->
<section>
<h2>Geschafft! 😊</h2>
<h3>Vielen Dank für Eure Teilnahme!</h3>
<h3>Viel Spaß und Erfolg mit React!</h3>
<p>Wenn ihr noch Fragen habt, könnt ihr mich erreichen:</p>
<p>Mail: <a href="mailto:nils@nilshartmann.net">nils@nilshartmann.net</a></p>
<p>
Web: <a href="https://nilshartmann.net" target="_blank">https://nilshartmann.net</a>
</p>
<p>
Twitter: <a href="https://twitter.com/nilshartmann" target="_blank">@nilshartmann</a>
</p>
</section>
</div>
</div>
<script src="slides/revealjs/reveal.js/dist/reveal.js"></script>
<script src="slides/revealjs/reveal.js/plugin/notes/notes.js"></script>
<script src="slides/revealjs/reveal.js/plugin/markdown/markdown.js"></script>
<script src="slides/revealjs/reveal.js/plugin/highlight/highlight.js"></script>
<script src="slides/revealjs/config.js"></script>
</body>
</html>