Commit 75fc09a
Proxied state (#9739)
* magic objects
* read length eagerly — triggers reconciliation
* nested magic
* tests
* more tests
* fix array memory leak
* skipped, partially passing array test
* Fix each
revert bad changes
* more 1337
* eliminate closures
* maybe this is unnecessary?
* only create sources for own properties
* more
* rename stuff
* shuffle things around
* emit $.proxy
* remove proxy helper from public API
* only create sources for writable properties
* update test
* get tests passing
* fix
* remove state-not-mutated warning, which is no longer valid
* track reassignments separately from mutations
* update test - effects no longer fire on mutations unnecessarily
* move util into utils file
* move each logic into its own module; breathe sigh of relief
* tweaks
* more tweaks
* improve runtime
* fix mistake
* ensure we proxy when assigning to state
* fix test
* handle frozen
* create sources when reading proxy properties inside deriveds
* only mutate in legacy mode
* add immutable to transform state
* remove unused second argument to derived
* remove unused second argument to source, and runtime immutable option to createRoot (not sure what that was doing there?)
* oops, backwards
* dedicated binding.kind for legacy reactive imports
* avoid using prop_source in more cases. bit hacky, could be tidier, but it works
* distinguish between source and mutable_source
* remove immutable option from mount
* remove unused apparatus around immutable option
* deprecate immutable
* fix
* tweak
* better default value handling
* remove unnecessary exports
* whitespace is free
* remove obsolete symbol from proxy
* cleanup ts
* improve runtime perf by removing version reads in has()
* add missing proxy call
* tune perf of has() more
* ensure we only create sources in effect_active()
* fix proxy of computed fields
* simplify and fix issue with indexed each blocks
* fix compiler errors around exported state
* only create source for state that is reassigned
* temporary fix, we should come up with something better than this
* readonly props
* fix test
* add test for bind:
* make readonly dev-only
* docs
* forbid setPrototypeOf
* lol whoops
---------
Co-authored-by: Rich Harris <rich.harris@vercel.com>
Co-authored-by: Dominic Gannaway <dg@domgan.com>1 parent f0c47c3 commit 75fc09a
File tree
144 files changed
+2297
-1550
lines changed- packages/svelte
- src
- compiler
- phases
- 2-analyze
- 3-transform
- client
- visitors
- server
- types
- utils
- internal
- client
- proxy
- server
- legacy
- tests
- compiler-errors
- samples
- export-derived-state
- export-state
- parser-legacy/samples
- action-duplicate
- action-with-call
- action-with-identifier
- action-with-literal
- action
- animation
- attribute-class-directive
- attribute-containing-solidus
- attribute-curly-bracket
- attribute-dynamic-boolean
- attribute-dynamic
- attribute-empty
- attribute-escaped
- attribute-multiple
- attribute-shorthand
- attribute-static-boolean
- attribute-static
- attribute-style-directive-modifiers
- attribute-style-directive-shorthand
- attribute-style-directive-string
- attribute-style-directive
- attribute-style
- attribute-unquoted
- attribute-with-whitespace
- await-catch
- await-then-catch
- binding-shorthand
- binding
- comment-with-ignores
- comment
- component-dynamic
- convert-entities-in-element
- convert-entities
- css
- dynamic-element-string
- dynamic-element-variable
- dynamic-import
- each-block-destructured
- each-block-else
- each-block-indexed
- each-block-keyed
- each-block
- element-with-attribute-empty-string
- element-with-attribute
- element-with-mustache
- element-with-text
- elements
- event-handler
- if-block-elseif
- if-block-else
- if-block
- implicitly-closed-li
- nbsp
- no-error-if-before-closing
- raw-mustaches
- refs
- script-attribute-with-curly-braces
- script-context-module-unquoted
- script
- self-closing-element
- self-reference
- slotted-element
- space-between-mustaches
- spread
- style-inside-head
- textarea-children
- textarea-end-tag
- transition-intro-no-params
- transition-intro
- unusual-identifier
- whitespace-after-script-tag
- whitespace-after-style-tag
- whitespace-leading-trailing
- whitespace-normal
- runtime-legacy
- samples/binding-input-checkbox-deep-contextual
- runtime-runes/samples
- each-mutation
- effect-order
- nullish-operator
- proxy-array
- proxy-cyclical
- proxy-deep
- proxy-nested
- proxy-prop-bound
- proxy-prop-readonly
- proxy
- signals
- snapshot/samples
- class-state-field-constructor-assignment/_expected/client
- dynamic-attributes-casing/_expected/client
- export-state
- _expected
- client
- server
- function-prop-no-getter/_expected
- client
- server
- svelte-element/_expected
- client
- server
- validator/samples/runes-state-rune-not-mutated
- sites/svelte-5-preview/src/routes/docs/content
- 01-api
- 02-examples
- 03-appendix
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
144 files changed
+2297
-1550
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
167 | 167 | | |
168 | 168 | | |
169 | 169 | | |
170 | | - | |
171 | | - | |
| 170 | + | |
| 171 | + | |
172 | 172 | | |
173 | 173 | | |
174 | 174 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
183 | 183 | | |
184 | 184 | | |
185 | 185 | | |
186 | | - | |
| 186 | + | |
187 | 187 | | |
188 | 188 | | |
189 | 189 | | |
| |||
221 | 221 | | |
222 | 222 | | |
223 | 223 | | |
224 | | - | |
225 | | - | |
226 | | - | |
227 | | - | |
228 | | - | |
229 | | - | |
230 | | - | |
231 | | - | |
232 | | - | |
233 | 224 | | |
234 | 225 | | |
235 | 226 | | |
236 | 227 | | |
237 | | - | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
238 | 231 | | |
239 | 232 | | |
240 | 233 | | |
| |||
315 | 308 | | |
316 | 309 | | |
317 | 310 | | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
318 | 315 | | |
319 | 316 | | |
320 | 317 | | |
| |||
331 | 328 | | |
332 | 329 | | |
333 | 330 | | |
334 | | - | |
335 | | - | |
336 | | - | |
337 | | - | |
338 | | - | |
| 331 | + | |
| 332 | + | |
339 | 333 | | |
340 | 334 | | |
341 | 335 | | |
| |||
382 | 376 | | |
383 | 377 | | |
384 | 378 | | |
385 | | - | |
386 | | - | |
387 | | - | |
388 | | - | |
389 | | - | |
390 | | - | |
391 | | - | |
392 | | - | |
393 | | - | |
394 | 379 | | |
395 | 380 | | |
396 | 381 | | |
| |||
553 | 538 | | |
554 | 539 | | |
555 | 540 | | |
556 | | - | |
| 541 | + | |
557 | 542 | | |
558 | 543 | | |
559 | 544 | | |
| |||
Lines changed: 8 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
649 | 649 | | |
650 | 650 | | |
651 | 651 | | |
652 | | - | |
653 | | - | |
| 652 | + | |
| 653 | + | |
| 654 | + | |
| 655 | + | |
| 656 | + | |
| 657 | + | |
| 658 | + | |
| 659 | + | |
654 | 660 | | |
655 | 661 | | |
656 | 662 | | |
| |||
Lines changed: 7 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
159 | 159 | | |
160 | 160 | | |
161 | 161 | | |
162 | | - | |
| 162 | + | |
163 | 163 | | |
164 | 164 | | |
165 | 165 | | |
| |||
175 | 175 | | |
176 | 176 | | |
177 | 177 | | |
178 | | - | |
| 178 | + | |
179 | 179 | | |
180 | 180 | | |
181 | 181 | | |
| |||
240 | 240 | | |
241 | 241 | | |
242 | 242 | | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
243 | 246 | | |
244 | 247 | | |
245 | | - | |
246 | | - | |
247 | | - | |
| 248 | + | |
248 | 249 | | |
249 | 250 | | |
250 | 251 | | |
| |||
261 | 262 | | |
262 | 263 | | |
263 | 264 | | |
264 | | - | |
265 | | - | |
266 | | - | |
267 | | - | |
268 | | - | |
269 | | - | |
270 | | - | |
271 | | - | |
| 265 | + | |
272 | 266 | | |
273 | 267 | | |
274 | 268 | | |
| |||
Lines changed: 70 additions & 23 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| |||
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
70 | | - | |
| 70 | + | |
71 | 71 | | |
72 | 72 | | |
73 | 73 | | |
74 | 74 | | |
75 | 75 | | |
76 | 76 | | |
77 | | - | |
| 77 | + | |
78 | 78 | | |
79 | 79 | | |
80 | 80 | | |
81 | 81 | | |
82 | | - | |
| 82 | + | |
| 83 | + | |
83 | 84 | | |
84 | 85 | | |
85 | 86 | | |
| |||
99 | 100 | | |
100 | 101 | | |
101 | 102 | | |
102 | | - | |
| 103 | + | |
103 | 104 | | |
104 | 105 | | |
105 | 106 | | |
| |||
152 | 153 | | |
153 | 154 | | |
154 | 155 | | |
155 | | - | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
156 | 161 | | |
157 | 162 | | |
158 | 163 | | |
| |||
171 | 176 | | |
172 | 177 | | |
173 | 178 | | |
174 | | - | |
| 179 | + | |
175 | 180 | | |
176 | 181 | | |
177 | 182 | | |
| |||
202 | 207 | | |
203 | 208 | | |
204 | 209 | | |
205 | | - | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
206 | 215 | | |
207 | 216 | | |
208 | 217 | | |
| |||
216 | 225 | | |
217 | 226 | | |
218 | 227 | | |
219 | | - | |
| 228 | + | |
220 | 229 | | |
221 | 230 | | |
222 | 231 | | |
| |||
226 | 235 | | |
227 | 236 | | |
228 | 237 | | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
229 | 244 | | |
230 | 245 | | |
231 | 246 | | |
| |||
335 | 350 | | |
336 | 351 | | |
337 | 352 | | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
338 | 365 | | |
339 | 366 | | |
340 | | - | |
341 | | - | |
342 | | - | |
343 | | - | |
| 367 | + | |
344 | 368 | | |
345 | | - | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
346 | 381 | | |
347 | 382 | | |
348 | 383 | | |
349 | | - | |
350 | | - | |
351 | | - | |
352 | | - | |
353 | | - | |
354 | | - | |
355 | | - | |
| 384 | + | |
356 | 385 | | |
357 | 386 | | |
358 | 387 | | |
| |||
364 | 393 | | |
365 | 394 | | |
366 | 395 | | |
367 | | - | |
| 396 | + | |
368 | 397 | | |
369 | 398 | | |
370 | 399 | | |
| |||
374 | 403 | | |
375 | 404 | | |
376 | 405 | | |
377 | | - | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
378 | 410 | | |
379 | 411 | | |
380 | 412 | | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
Lines changed: 19 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| |||
84 | 84 | | |
85 | 85 | | |
86 | 86 | | |
87 | | - | |
| 87 | + | |
88 | 88 | | |
89 | 89 | | |
90 | 90 | | |
| |||
211 | 211 | | |
212 | 212 | | |
213 | 213 | | |
214 | | - | |
| 214 | + | |
215 | 215 | | |
216 | 216 | | |
217 | 217 | | |
218 | | - | |
219 | 218 | | |
220 | 219 | | |
221 | | - | |
222 | | - | |
223 | | - | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
224 | 236 | | |
225 | 237 | | |
226 | 238 | | |
| |||
0 commit comments