Commit 21a51b1
refactor(core): Inline Vue ViewModel checks in normalize and safeJoin
The isVueViewModel() and getVueInternalName() functions from is.ts and
stacktrace.ts were only called from two sites: normalize.ts (stringifyValue)
and string.ts (safeJoin). Inlining the checks directly at these call sites
allows tree-shaking to eliminate the standalone function definitions from
bundles that pull in normalize/string but not is.ts for other reasons.
Uses the `in` operator instead of `as any` casts to satisfy the linter's
no-explicit-any / no-unsafe-member-access rules.
The Vue check prevents infinite console warning loops when stringifying
Vue 2/3 ViewModel instances or VNodes (see #8981).
Saves ~15 bytes gzipped on the base browser bundle.
Co-Authored-By: Claude claude@anthropic.com1 parent 938ab2d commit 21a51b1
2 files changed
+16
-12
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| |||
216 | 216 | | |
217 | 217 | | |
218 | 218 | | |
219 | | - | |
220 | | - | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
221 | 225 | | |
222 | 226 | | |
223 | 227 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | | - | |
| 1 | + | |
3 | 2 | | |
4 | 3 | | |
5 | 4 | | |
| |||
76 | 75 | | |
77 | 76 | | |
78 | 77 | | |
79 | | - | |
80 | | - | |
81 | | - | |
82 | | - | |
| 78 | + | |
83 | 79 | | |
84 | | - | |
85 | | - | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
86 | 86 | | |
87 | 87 | | |
88 | 88 | | |
| |||
0 commit comments