File tree Expand file tree Collapse file tree 2 files changed +7
-9
lines changed
packages/svelte/src/internal/client Expand file tree Collapse file tree 2 files changed +7
-9
lines changed Original file line number Diff line number Diff line change @@ -48,8 +48,7 @@ function get_hydrate_nodes(node, insert_text = false) {
48
48
/** @type {import('#client').TemplateNode[] } */
49
49
var nodes = [ ] ;
50
50
51
- /** @type {null | Node } */
52
- var current_node = node ;
51
+ var current_node = /** @type {null | import('#client').TemplateNode } */ ( node ) ;
53
52
54
53
/** @type {null | string } */
55
54
var target_depth = null ;
@@ -67,18 +66,18 @@ function get_hydrate_nodes(node, insert_text = false) {
67
66
if ( insert_text && nodes . length === 0 ) {
68
67
var text = empty ( ) ;
69
68
nodes . push ( text ) ;
70
- text . before ( current_node ) ;
69
+ current_node . before ( text ) ;
71
70
}
72
71
return nodes ;
73
72
} else {
74
- nodes . push ( /** @type { Text | Comment | Element } */ ( current_node ) ) ;
73
+ nodes . push ( current_node ) ;
75
74
}
76
75
}
77
76
} else if ( target_depth !== null ) {
78
- nodes . push ( /** @type { Text | Comment | Element } */ ( current_node ) ) ;
77
+ nodes . push ( current_node ) ;
79
78
}
80
79
81
- current_node = current_node . nextSibling ;
80
+ current_node = /** @type { null | import('#client').TemplateNode } */ ( current_node . nextSibling ) ;
82
81
}
83
82
84
83
return null ;
Original file line number Diff line number Diff line change @@ -114,7 +114,6 @@ export function createRoot() {
114
114
* @returns {Exports }
115
115
*/
116
116
export function mount ( component , options ) {
117
- init_operations ( ) ;
118
117
const anchor = empty ( ) ;
119
118
options . target . appendChild ( anchor ) ;
120
119
// Don't flush previous effects to ensure order of outer effects stays consistent
@@ -139,8 +138,6 @@ export function mount(component, options) {
139
138
* @returns {Exports }
140
139
*/
141
140
export function hydrate ( component , options ) {
142
- init_operations ( ) ;
143
-
144
141
const container = options . target ;
145
142
const first_child = /** @type {ChildNode } */ ( container . firstChild ) ;
146
143
const previous_hydrate_nodes = hydrate_nodes ;
@@ -212,6 +209,8 @@ export function hydrate(component, options) {
212
209
* @returns {Exports }
213
210
*/
214
211
function _mount ( Component , options ) {
212
+ init_operations ( ) ;
213
+
215
214
const registered_events = new Set ( ) ;
216
215
const container = options . target ;
217
216
You can’t perform that action at this time.
0 commit comments