Commit 4b8944f
Sync alphalib 2025 05 06 (#226)
* w
* w
* Update template.ts
* Fix deep types error (#227)
* Fix deep types error
One of the big features of TypeScript, is that it can infer types based
on context. This is powerful, but it comes at a cost. Determining types
based on inference consumes much more resources than using a type
annotation. This is an important reason to add explicit type
annotations.
We heavily rely on Zod though. Zod is powerful, but it heavily relies on
inference. This means that by using Zod, we sacrifice type checking
performance. Zod 4 will supposedly be more performant. This is great, but
by definition it can’t be as performant as regular types.
When the types become really complex, TypeScript may error on this. An
explicit type annotation in the right spot fixes this. This PR uses this
to resolve the type error. I can’t explain why this surfaced here, but
not in our internal repos these schemas originate from.
* Update src/alphalib/types/template.ts
---------
Co-authored-by: Kevin van Zonneveld <vanzonneveld@gmail.com>
---------
Co-authored-by: Remco Haszing <remcohaszing@gmail.com>1 parent 4c7b7e3 commit 4b8944f
File tree
97 files changed
+2283
-724
lines changed- examples
- src
- alphalib
- types
- robots
- test
- integration
- unit
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
97 files changed
+2283
-724
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
35 | | - | |
| 35 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
47 | | - | |
| 47 | + | |
48 | 48 | | |
49 | | - | |
| 49 | + | |
50 | 50 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
33 | | - | |
| 33 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
36 | | - | |
| 36 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
29 | | - | |
| 29 | + | |
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
40 | | - | |
| 40 | + | |
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
| |||
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
59 | | - | |
| 59 | + | |
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
310 | 310 | | |
311 | 311 | | |
312 | 312 | | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
313 | 319 | | |
314 | 320 | | |
315 | 321 | | |
| |||
341 | 347 | | |
342 | 348 | | |
343 | 349 | | |
| 350 | + | |
| 351 | + | |
344 | 352 | | |
345 | | - | |
346 | | - | |
347 | | - | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
348 | 362 | | |
349 | 363 | | |
350 | 364 | | |
| |||
0 commit comments