Skip to content

Commit c51e906

Browse files
committed
conflict
2 parents 2482869 + 0d51dba commit c51e906

File tree

55 files changed

+787
-845
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+787
-845
lines changed

.changeset/flat-feet-visit.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"svelte": patch
3+
---
4+
5+
fix: ensure bound input content is resumed on hydration

.changeset/late-bees-vanish.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'svelte': patch
3+
---
4+
5+
feat: defer tasks without creating effects

.changeset/neat-jokes-beam.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"svelte": patch
3+
---
4+
5+
fix: enusre dev validation in dynamic component works as intended

.changeset/pre.json

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
"brave-walls-flow",
4141
"breezy-carrots-flash",
4242
"breezy-rules-beg",
43+
"breezy-waves-camp",
4344
"bright-falcons-float",
4445
"bright-peas-juggle",
4546
"bright-snakes-sing",
@@ -92,6 +93,7 @@
9293
"cyan-flowers-destroy",
9394
"cyan-spies-grin",
9495
"cyan-squids-drive",
96+
"cyan-toes-share",
9597
"dirty-bats-punch",
9698
"dirty-donuts-yell",
9799
"dirty-eyes-itch",
@@ -137,6 +139,7 @@
137139
"famous-kiwis-thank",
138140
"famous-knives-sneeze",
139141
"famous-pants-pay",
142+
"fast-donkeys-pay",
140143
"fast-penguins-matter",
141144
"fast-weeks-clean",
142145
"few-clouds-shop",
@@ -147,6 +150,7 @@
147150
"fifty-rice-wait",
148151
"fifty-steaks-float",
149152
"five-tigers-search",
153+
"flat-ghosts-fly",
150154
"flat-melons-protect",
151155
"flat-olives-live",
152156
"fluffy-dolls-share",
@@ -168,6 +172,7 @@
168172
"fresh-weeks-trade",
169173
"friendly-candles-relate",
170174
"friendly-lies-camp",
175+
"funny-dragons-double",
171176
"funny-ties-jump",
172177
"funny-trees-cry",
173178
"funny-wombats-argue",
@@ -254,6 +259,7 @@
254259
"kind-spoons-return",
255260
"large-clouds-carry",
256261
"large-turkeys-deny",
262+
"late-bees-vanish",
257263
"late-crabs-lay",
258264
"late-grapes-judge",
259265
"late-peaches-mate",
@@ -263,6 +269,7 @@
263269
"lazy-spiders-think",
264270
"lemon-geese-call",
265271
"lemon-geese-drum",
272+
"lemon-meals-appear",
266273
"lemon-trees-act",
267274
"light-badgers-glow",
268275
"light-days-clean",
@@ -312,6 +319,7 @@
312319
"neat-boats-shake",
313320
"neat-dingos-clap",
314321
"neat-files-rescue",
322+
"neat-jokes-beam",
315323
"nervous-berries-boil",
316324
"nervous-spoons-relax",
317325
"nervous-turkeys-end",
@@ -466,6 +474,7 @@
466474
"smart-cherries-leave",
467475
"smart-grapes-mate",
468476
"smart-parents-swim",
477+
"smart-spiders-fetch",
469478
"smart-turkeys-tell",
470479
"smart-zebras-pay",
471480
"smooth-kids-protect",
@@ -482,7 +491,9 @@
482491
"sour-rules-march",
483492
"sour-weeks-fix",
484493
"spicy-jeans-deliver",
494+
"spicy-peas-vanish",
485495
"spicy-plums-admire",
496+
"spotty-crabs-give",
486497
"spotty-houses-search",
487498
"spotty-pens-agree",
488499
"spotty-rocks-destroy",
@@ -525,6 +536,7 @@
525536
"ten-jokes-divide",
526537
"ten-peaches-sleep",
527538
"ten-singers-cough",
539+
"ten-teachers-travel",
528540
"ten-ties-repair",
529541
"ten-worms-reflect",
530542
"tender-rocks-walk",
@@ -534,6 +546,7 @@
534546
"thick-swans-type",
535547
"thin-colts-yawn",
536548
"thin-foxes-lick",
549+
"thin-spoons-float",
537550
"thin-years-rhyme",
538551
"thirty-flowers-sit",
539552
"thirty-ghosts-fix",
@@ -556,9 +569,11 @@
556569
"tiny-kings-whisper",
557570
"tiny-meals-deliver",
558571
"tiny-moose-kiss",
572+
"tiny-taxis-whisper",
559573
"tough-radios-punch",
560574
"tough-tomatoes-explain",
561575
"twelve-beans-drive",
576+
"twelve-cows-learn",
562577
"twelve-dragons-join",
563578
"twelve-onions-juggle",
564579
"twelve-worms-jog",
@@ -594,12 +609,14 @@
594609
"wise-kids-wash",
595610
"wise-radios-exercise",
596611
"wise-ties-clap",
612+
"witty-bikes-shave",
597613
"witty-camels-warn",
598614
"witty-readers-provide",
599615
"witty-steaks-dream",
600616
"witty-tomatoes-care",
601617
"witty-years-crash",
602618
"yellow-pugs-raise",
619+
"yellow-rockets-sit",
603620
"yellow-taxis-double",
604621
"yellow-trees-juggle",
605622
"young-ads-roll",

.changeset/spotty-crabs-give.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'svelte': patch
3+
---
4+
5+
feat: more efficient output for attributes in SSR

.changeset/ten-teachers-travel.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'svelte': patch
3+
---
4+
5+
feat: detach inert effects

.changeset/thin-spoons-float.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
'svelte': patch
33
---
44

5-
fix: create sources on read for Set
5+
fix: update reactive set when deleting initial values

.changeset/tiny-taxis-whisper.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'svelte': patch
3+
---
4+
5+
feat: simpler string normalization

.changeset/witty-bikes-shave.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'svelte': patch
3+
---
4+
5+
feat: sort possible bindings in invalid binding error

.changeset/yellow-rockets-sit.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'svelte': patch
3+
---
4+
5+
fix: apply style directives to element with empty style attribute

packages/svelte/CHANGELOG.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,47 @@
11
# svelte
22

3+
## 5.0.0-next.153
4+
5+
### Patch Changes
6+
7+
- feat: defer tasks without creating effects ([#11960](https://github.com/sveltejs/svelte/pull/11960))
8+
9+
- fix: enusre dev validation in dynamic component works as intended ([#11985](https://github.com/sveltejs/svelte/pull/11985))
10+
11+
- feat: detach inert effects ([#11955](https://github.com/sveltejs/svelte/pull/11955))
12+
13+
- feat: sort possible bindings in invalid binding error ([#11950](https://github.com/sveltejs/svelte/pull/11950))
14+
15+
- fix: apply style directives to element with empty style attribute ([#11971](https://github.com/sveltejs/svelte/pull/11971))
16+
17+
## 5.0.0-next.152
18+
19+
### Patch Changes
20+
21+
- fix: validate form inside a form ([#11947](https://github.com/sveltejs/svelte/pull/11947))
22+
23+
- fix: more robust handling of events in spread attributes ([#11942](https://github.com/sveltejs/svelte/pull/11942))
24+
25+
- feat: simpler `<svelte:element> hydration ([#11773](https://github.com/sveltejs/svelte/pull/11773))
26+
27+
- fix: make `legacy.componentApi` option more visible ([#11924](https://github.com/sveltejs/svelte/pull/11924))
28+
29+
- feat: simpler hydration of CSS custom property wrappers ([#11948](https://github.com/sveltejs/svelte/pull/11948))
30+
31+
- chore: optimise effects that only exist to return a teardown ([#11936](https://github.com/sveltejs/svelte/pull/11936))
32+
33+
- feat: always create wrapper `<div>` for `<svelte:component>` with CSS custom properties ([#11792](https://github.com/sveltejs/svelte/pull/11792))
34+
35+
- feat: add svelte/events package and export `on` function ([#11912](https://github.com/sveltejs/svelte/pull/11912))
36+
37+
- feat: more efficient output for attributes in SSR ([#11949](https://github.com/sveltejs/svelte/pull/11949))
38+
39+
- fix: update reactive set when deleting initial values ([#11967](https://github.com/sveltejs/svelte/pull/11967))
40+
41+
- feat: simpler string normalization ([#11954](https://github.com/sveltejs/svelte/pull/11954))
42+
43+
- fix: always assign text.nodeValue ([#11944](https://github.com/sveltejs/svelte/pull/11944))
44+
345
## 5.0.0-next.151
446

547
### Patch Changes

packages/svelte/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "svelte",
33
"description": "Cybernetically enhanced web apps",
44
"license": "MIT",
5-
"version": "5.0.0-next.151",
5+
"version": "5.0.0-next.153",
66
"type": "module",
77
"types": "./types/index.d.ts",
88
"engines": {

packages/svelte/src/compiler/phases/2-analyze/validation.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,8 @@ const validation = {
421421
!binding_property.invalid_elements?.includes(parent.name))
422422
);
423423
})
424-
.map(([property_name]) => property_name);
424+
.map(([property_name]) => property_name)
425+
.sort();
425426
e.bind_invalid_name(
426427
node,
427428
node.name,

packages/svelte/src/compiler/phases/3-transform/client/visitors/javascript.js

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,6 @@ import { function_visitor, serialize_hoistable_params } from '../utils.js';
33

44
/** @type {import('../types.js').ComponentVisitors} */
55
export const javascript_visitors = {
6-
Program(node, { visit }) {
7-
return /** @type {import('estree').Program} */ ({
8-
...node,
9-
body: node.body.map((node) => /** @type {import('estree').Node} */ (visit(node)))
10-
});
11-
},
12-
BlockStatement(node, { visit }) {
13-
return /** @type {import('estree').BlockStatement} */ ({
14-
...node,
15-
body: node.body.map((node) => /** @type {import('estree').Node} */ (visit(node)))
16-
});
17-
},
186
FunctionExpression: function_visitor,
197
ArrowFunctionExpression: function_visitor,
208
FunctionDeclaration(node, context) {

packages/svelte/src/compiler/phases/3-transform/client/visitors/template.js

Lines changed: 25 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -671,6 +671,9 @@ function serialize_inline_component(node, component_name, context) {
671671
/** @type {import('estree').Identifier | import('estree').MemberExpression | null} */
672672
let bind_this = null;
673673

674+
/**
675+
* @type {import("estree").ExpressionStatement[]}
676+
*/
674677
const binding_initializers = [];
675678

676679
/**
@@ -920,6 +923,8 @@ function serialize_inline_component(node, component_name, context) {
920923
};
921924
}
922925

926+
const statements = [...snippet_declarations];
927+
923928
if (node.type === 'SvelteComponent') {
924929
const prev = fn;
925930

@@ -930,6 +935,7 @@ function serialize_inline_component(node, component_name, context) {
930935
b.arrow(
931936
[b.id(component_name)],
932937
b.block([
938+
...binding_initializers,
933939
b.stmt(
934940
context.state.options.dev
935941
? b.call('$.validate_dynamic_component', b.thunk(prev(node_id)))
@@ -939,10 +945,10 @@ function serialize_inline_component(node, component_name, context) {
939945
)
940946
);
941947
};
948+
} else {
949+
statements.push(...binding_initializers);
942950
}
943951

944-
const statements = [...snippet_declarations, ...binding_initializers];
945-
946952
if (Object.keys(custom_css_props).length > 0) {
947953
context.state.template.push(
948954
context.state.metadata.namespace === 'svg'
@@ -1337,10 +1343,7 @@ function process_children(nodes, expression, is_element, { visit, state }) {
13371343
b.assignment(
13381344
'=',
13391345
b.member(text_id, b.id('nodeValue')),
1340-
b.call(
1341-
'$.stringify',
1342-
/** @type {import('estree').Expression} */ (visit(node.expression))
1343-
)
1346+
/** @type {import('estree').Expression} */ (visit(node.expression))
13441347
)
13451348
)
13461349
);
@@ -1438,37 +1441,29 @@ function get_node_id(expression, state, name) {
14381441
}
14391442

14401443
/**
1441-
* @param {true | Array<import('#compiler').Text | import('#compiler').ExpressionTag>} attribute_value
1444+
* @param {true | Array<import('#compiler').Text | import('#compiler').ExpressionTag>} value
14421445
* @param {import('../types').ComponentContext} context
1443-
* @returns {[boolean, import('estree').Expression]}
1446+
* @returns {[contains_call_expression: boolean, import('estree').Expression]}
14441447
*/
1445-
function serialize_attribute_value(attribute_value, context) {
1446-
let contains_call_expression = false;
1447-
1448-
if (attribute_value === true) {
1449-
return [contains_call_expression, b.literal(true)];
1448+
function serialize_attribute_value(value, context) {
1449+
if (value === true) {
1450+
return [false, b.literal(true)];
14501451
}
14511452

1452-
if (attribute_value.length === 0) {
1453-
return [contains_call_expression, b.literal('')]; // is this even possible?
1454-
}
1453+
if (value.length === 1) {
1454+
const chunk = value[0];
14551455

1456-
if (attribute_value.length === 1) {
1457-
const value = attribute_value[0];
1458-
if (value.type === 'Text') {
1459-
return [contains_call_expression, b.literal(value.data)];
1460-
} else {
1461-
if (value.type === 'ExpressionTag') {
1462-
contains_call_expression = value.metadata.contains_call_expression;
1463-
}
1464-
return [
1465-
contains_call_expression,
1466-
/** @type {import('estree').Expression} */ (context.visit(value.expression))
1467-
];
1456+
if (chunk.type === 'Text') {
1457+
return [false, b.literal(chunk.data)];
14681458
}
1459+
1460+
return [
1461+
chunk.metadata.contains_call_expression,
1462+
/** @type {import('estree').Expression} */ (context.visit(chunk.expression))
1463+
];
14691464
}
14701465

1471-
return serialize_template_literal(attribute_value, context.visit, context.state);
1466+
return serialize_template_literal(value, context.visit, context.state);
14721467
}
14731468

14741469
/**
@@ -1524,7 +1519,7 @@ function serialize_template_literal(values, visit, state) {
15241519
);
15251520
expressions.push(b.call('$.get', id));
15261521
} else {
1527-
expressions.push(b.call('$.stringify', visit(node.expression, state)));
1522+
expressions.push(b.logical('??', visit(node.expression, state), b.literal('')));
15281523
}
15291524
quasis.push(b.quasi('', i + 1 === values.length));
15301525
}

0 commit comments

Comments
 (0)