0
0
mirror of https://github.com/sveltejs/svelte.git synced 2024-12-01 17:30:59 +01:00
Commit Graph

44 Commits

Author SHA1 Message Date
Hasan Altan Birler
04bc37de31
Improve hydration by reordering optimally (#6395)
* Implement new hydration optimization

During hydration, greedily pick nodes that exist in the original HTML that should not be detached.
Detach the rest.

* Implement optimal reordering during hydration

During hydration we track the order in which children are claimed.
Afterwards, rather than reordering them greedily one-by-one, we reorder all claimed children during the first append optimally.
The optimal reordering first finds the longest subsequence of children that have been claimed in order.
These children will not be moved.
The rest of the children are reordered to where they have to go.
This algorithm is guaranteed to be optimal in the number of reorderings.

The hydration/head-meta-hydrate-duplicate test sample has been modified slightly.
The order in which the <title> tag is being generated changed, which does not affect correctness.

* Fix issue potentially causing extra reorders

Not sorting children before executing the `insertBefore` calls in `init_hydrate` potentially caused extra `insertBefore` calls in `append`

* Simplify`init_hydrate` sorting logic
2021-06-22 10:34:48 -04:00
Conduitry
6d16e92606
Revert hydration optimisation (#6290)
Co-authored-by: haveyaseen <haveyaread@gmail.com>
2021-05-03 16:37:19 -04:00
Tan Li Hau
94bfeae5d5
fix claim_text (#6275) 2021-05-01 11:08:30 -04:00
Ben McCann
7ea6a2994a
Curly braces linting fixes (#5585) 2020-10-26 13:25:03 -04:00
Andreas Ehrencrona
ddf13211af
Updated to ESLint config 5.4.0 (#5541) 2020-10-21 15:23:08 -07:00
Ben McCann
229a16d6e7
upgrade ESLint config (#5472) 2020-09-29 20:19:43 -04:00
Ben McCann
0645631b28
Use TypeScript in tests (#5433) 2020-09-29 11:19:21 -04:00
Antony Jones
82dc26a31c
Fix lint warnings (#5263) 2020-08-20 08:51:28 -07:00
Tan Li Hau
ec3589e314
fix hydration of top-level content (#4550) 2020-03-14 14:15:24 -04:00
Conduitry
455a5cc754
fix hydration of <title> (#4311) 2020-01-23 10:06:42 -05:00
Conduitry
33c3a02ee4 failing test 2020-01-20 10:31:31 -05:00
Tan Li Hau
b3582c7fb2 fix hydrating <head> (#4082) 2020-01-13 11:55:55 -05:00
Tan Li Hau
7c3e34c00b fix hydrating each else (#4253) 2020-01-12 15:42:45 -05:00
Tan Li Hau
d8b9274697 update test snapshot with --update flag 2019-11-07 08:34:19 +08:00
Tan Li Hau
8d722ae1aa look for test folder name for solo mode as well 2019-10-28 12:41:53 +08:00
Tan Li Hau
5dbb08d19b allow solo for test suite (#3747) 2019-10-23 14:52:49 -04:00
Richard Harris
3f33d35573 handle special null case when hydrating 2019-09-08 18:09:27 -04:00
Sebastian Silbermann
12c667f898 Add failing test for null hydration 2019-08-08 13:42:28 +02:00
Richard Harris
d67ffcd3d3 fix hydration tests 2019-04-13 19:40:45 -04:00
Richard Harris
aa653558d0 only create fallback content if no slot is provided - fixes #2354 2019-04-13 19:34:42 -04:00
Richard Harris
83a9b6af23 default to accessors: false (#2144) 2019-03-17 10:29:02 -04:00
Richard Harris
ca0e5df0d8 update parser and js tests 2019-03-15 23:51:04 -04:00
Richard Harris
be0a3aafbd update hydration tests 2019-03-15 23:24:54 -04:00
Richard Harris
3953c2dbfc error on invalid compiler options — closes #2094 2019-02-17 13:10:37 -05:00
Rich Harris
206a3d0131 update tests 2019-02-08 09:32:36 -05:00
Rich Harris
687e352209 rename .html files to .svelte 2019-02-08 08:48:10 -05:00
Rich Harris
722e1fd383 get name based on filename 2019-01-30 11:09:24 -05:00
Rich Harris
48f1f6b4d0
implement bind:this 2018-12-16 09:26:53 -05:00
Rich Harris
f45e2b70fd
Implement reactive assignments (#1839)
This also includes elements of RFCs 2 and 3
2018-12-15 19:18:03 -05:00
Rich Harris
39d0b862d4 update hydration tests 2018-04-15 23:29:21 -04:00
Rich Harris
a3add04e7c remove code, map and cssMap from svelte.compile output 2018-04-15 19:34:42 -04:00
Rich Harris
2f86bd339d update tests to account for removal of observe 2018-04-15 19:08:49 -04:00
esarbanis
9218f20330 Use a block scoped unique name for the context 2017-11-06 12:43:38 +02:00
Rich Harris
8020fe53fc remove babel etc 2017-07-30 03:20:15 -04:00
Rich Harris
65e484b6ae remove reify 2017-07-29 23:35:12 -04:00
Rich Harris
46cb2a4da3 update jsdom 2017-07-29 22:26:22 -04:00
Rich Harris
b47e2527b3 test with hydratable: true and hydratable: false 2017-06-18 01:04:38 -04:00
Rich Harris
d10ddc0c51 fix most non-hydration tests 2017-06-17 23:41:35 -04:00
Rich Harris
97b70bccc5 events, bindings, if block fixes 2017-06-17 21:45:05 -04:00
Rich Harris
dc29b2d466 fix component hydration 2017-06-17 17:06:51 -04:00
Rich Harris
0bbd917442 more hydration 2017-06-17 16:28:43 -04:00
Rich Harris
14fe89eae8 hydration working with elements, text nodes, tags and if blocks 2017-06-17 14:31:19 -04:00
Rich Harris
dceb2b533b first, very incorrect stab at hydration 2017-06-14 16:34:12 -04:00
Rich Harris
f361d4287a add hydration tests 2017-06-13 17:54:59 -04:00