Skip to content

Commit 1b12546

Browse files
committed
Merge remote-tracking branch 'origin/master' into sites
2 parents dd96032 + 5a3a1e4 commit 1b12546

File tree

8 files changed

+29
-31
lines changed

8 files changed

+29
-31
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1043,7 +1043,7 @@ Also:
10431043

10441044
## 3.5.1
10451045

1046-
* Accommodate webpack idiosyncracies
1046+
* Accommodate webpack idiosyncrasies
10471047

10481048
## 3.5.0
10491049

package-lock.json

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

site/content/docs/03-template-syntax.md

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -663,7 +663,7 @@ A `<select>` value binding corresponds to the `value` property on the selected `
663663

664664
---
665665

666-
A `<select multiple>` element behaves similarly to a checkbox group.
666+
A `<select multiple>` element behaves similarly to a checkbox group. The bound variable is an array with an entry corresponding to the `value` property of each selected `<option>`.
667667

668668
```sv
669669
<select multiple bind:value={fillings}>
@@ -1024,7 +1024,7 @@ Like actions, transitions can have parameters.
10241024

10251025
Transitions can use custom functions. If the returned object has a `css` function, Svelte will create a CSS animation that plays on the element.
10261026

1027-
The `t` argument passed to `css` is a value between `0` and `1` after the `easing` function has been applied. *In* transitions run from `0` to `1`, *out* transitions run from `1` to `0` — in other words `1` is the element's natural state, as though no transition had been applied. The `u` argument is equal to `1 - t`.
1027+
The `t` argument passed to `css` is a value between `0` and `1` after the `easing` function has been applied. *In* transitions run from `0` to `1`, *out* transitions run from `1` to `0` — in other words, `1` is the element's natural state, as though no transition had been applied. The `u` argument is equal to `1 - t`.
10281028

10291029
The function is called repeatedly *before* the transition begins, with different `t` and `u` arguments.
10301030

@@ -1307,14 +1307,12 @@ A custom animation function can also return a `tick` function, which is called *
13071307
const d = Math.sqrt(dx * dx + dy * dy);
13081308
13091309
return {
1310-
delay: 0,
1311-
duration: Math.sqrt(d) * 120,
1312-
easing: cubicOut,
1313-
tick: (t, u) =>
1314-
Object.assign(node.style, {
1315-
color: t > 0.5 ? 'Pink' : 'Blue'
1316-
});
1317-
};
1310+
delay: 0,
1311+
duration: Math.sqrt(d) * 120,
1312+
easing: cubicOut,
1313+
tick: (t, u) =>
1314+
Object.assign(node.style, { color: t > 0.5 ? 'Pink' : 'Blue' })
1315+
};
13181316
}
13191317
</script>
13201318
@@ -1415,7 +1413,7 @@ Svelte's CSS Variables support allows for easily themeable components:
14151413

14161414
---
14171415

1418-
So you can set a high level theme color:
1416+
So you can set a high-level theme color:
14191417

14201418
```css
14211419
/* global.css */
@@ -1575,7 +1573,7 @@ Note that explicitly passing in an empty named slot will add that slot's name to
15751573

15761574
---
15771575

1578-
Slots can be rendered zero or more times, and can pass values *back* to the parent using props. The parent exposes the values to the slot template using the `let:` directive.
1576+
Slots can be rendered zero or more times and can pass values *back* to the parent using props. The parent exposes the values to the slot template using the `let:` directive.
15791577

15801578
The usual shorthand rules apply — `let:item` is equivalent to `let:item={item}`, and `<slot {item}>` is equivalent to `<slot item={item}>`.
15811579

@@ -1666,11 +1664,11 @@ If `this` is falsy, no component is rendered.
16661664

16671665
The `<svelte:element>` element lets you render an element of a dynamically specified type. This is useful for example when displaying rich text content from a CMS. Any properties and event listeners present will be applied to the element.
16681666

1669-
The only supported binding is `bind:this`, since the element type specific bindings that Svelte does at build time (e.g. `bind:value` for input elements) do not work with a dynamic tag type.
1667+
The only supported binding is `bind:this`, since the element type-specific bindings that Svelte does at build time (e.g. `bind:value` for input elements) do not work with a dynamic tag type.
16701668

16711669
If `this` has a nullish value, the element and its children will not be rendered.
16721670

1673-
If `this` is the name of a void tag (e.g., `br`) and `<svelte:element>` has child elements, a runtime error will be thrown in development mode.
1671+
If `this` is the name of a [void element](https://developer.mozilla.org/en-US/docs/Glossary/Void_element) (e.g., `br`) and `<svelte:element>` has child elements, a runtime error will be thrown in development mode.
16741672

16751673
```sv
16761674
<script>
@@ -1716,7 +1714,7 @@ You can also bind to the following properties:
17161714
* `outerHeight`
17171715
* `scrollX`
17181716
* `scrollY`
1719-
* `online` — an alias for window.navigator.onLine
1717+
* `online` — an alias for `window.navigator.onLine`
17201718

17211719
All except `scrollX` and `scrollY` are readonly.
17221720

src/compiler/compile/compiler_errors.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ export default {
4444
code: 'invalid-binding',
4545
message: 'Cannot bind to a variable declared with {@const ...}'
4646
},
47-
invalid_binding_writibale: {
47+
invalid_binding_writable: {
4848
code: 'invalid-binding',
4949
message: 'Cannot bind to a variable which is not writable'
5050
},

src/compiler/compile/nodes/Binding.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ export default class Binding extends Node {
8080
variable[this.expression.node.type === 'MemberExpression' ? 'mutated' : 'reassigned'] = true;
8181

8282
if (info.expression.type === 'Identifier' && !variable.writable) {
83-
component.error(this.expression.node as any, compiler_errors.invalid_binding_writibale);
83+
component.error(this.expression.node as any, compiler_errors.invalid_binding_writable);
8484
return;
8585
}
8686
}

src/compiler/compile/nodes/Element.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1034,14 +1034,14 @@ export default class Element extends Node {
10341034
}
10351035
}
10361036

1037-
const regex_starts_with_vovel = /^[aeiou]/;
1037+
const regex_starts_with_vowel = /^[aeiou]/;
10381038

10391039
function should_have_attribute(
10401040
node,
10411041
attributes: string[],
10421042
name = node.name
10431043
) {
1044-
const article = regex_starts_with_vovel.test(attributes[0]) ? 'an' : 'a';
1044+
const article = regex_starts_with_vowel.test(attributes[0]) ? 'an' : 'a';
10451045
const sequence = attributes.length > 1 ?
10461046
attributes.slice(0, -1).join(', ') + ` or ${attributes[attributes.length - 1]}` :
10471047
attributes[0];

test/js/samples/capture-inject-state/expected.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ function create_fragment(ctx) {
4848
t8 = text(/*$prop*/ ctx[2]);
4949
t9 = space();
5050
t10 = text(/*shadowedByModule*/ ctx[4]);
51-
add_location(p, file, 22, 0, 430);
51+
add_location(p, file, 22, 0, 431);
5252
},
5353
l: function claim(nodes) {
5454
throw new Error("options.hydrate only works if the component was compiled with the `hydratable: true` option");
@@ -91,7 +91,7 @@ function create_fragment(ctx) {
9191
}
9292

9393
let moduleLiveBinding;
94-
const moduleContantProps = 4;
94+
const moduleConstantProps = 4;
9595
let moduleLet;
9696
const moduleConst = 2;
9797
let shadowedByModule;
@@ -137,7 +137,7 @@ function instance($$self, $$props, $$invalidate) {
137137

138138
$$self.$capture_state = () => ({
139139
moduleLiveBinding,
140-
moduleContantProps,
140+
moduleConstantProps,
141141
moduleLet,
142142
moduleConst,
143143
shadowedByModule,
@@ -197,4 +197,4 @@ class Component extends SvelteComponentDev {
197197
}
198198

199199
export default Component;
200-
export { moduleLiveBinding, moduleContantProps };
200+
export { moduleLiveBinding, moduleConstantProps };

test/js/samples/capture-inject-state/input.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<script context="module">
22
export let moduleLiveBinding;
3-
export const moduleContantProps = 4;
3+
export const moduleConstantProps = 4;
44
let moduleLet;
55
const moduleConst = 2;
66
let shadowedByModule;

0 commit comments

Comments
 (0)