Skip to content

Commit b1fc702

Browse files
committed
Merge remote-tracking branch 'upstream/master'
* upstream/master: (190 commits) invalidate $$props and $$restProps only when there are changes (sveltejs#5123) site: use https in link in blog (sveltejs#5148) Simplify each block bindings example (sveltejs#5094) fix $$props reactive for slots (sveltejs#5125) site: add FAQ entry for how to document a svelte component (sveltejs#5131) site: remove an obsolete TODO in blog post (sveltejs#5135) Increase timeout for unit build Increase timeout for unit tests -> v3.24.0 spread condition for input element (sveltejs#5004) update changelog fix(5018): compare wholeText instead of data (sveltejs#5028) html anchor in head (sveltejs#5071) error on expression scope store (sveltejs#5079) update changelog preprocess self-closing script and style tags (sveltejs#5082) update changelog fix: Parameters with default values are optional (sveltejs#5083) make builds time out after a reasonable period (sveltejs#5100) site: fix blog typo (sveltejs#5090) ...
2 parents 0245239 + d472bd2 commit b1fc702

File tree

446 files changed

+8372
-2633
lines changed

Some content is hidden

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

446 files changed

+8372
-2633
lines changed

.eslintignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
**/expected.js
33
_output
44
test/*/samples/*/output.js
5-
node_modules
65

76
# automatically generated
87
internal_exports.ts

.eslintrc.js

Lines changed: 2 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -1,65 +1,6 @@
11
module.exports = {
22
root: true,
3-
rules: {
4-
indent: 'off',
5-
'no-unused-vars': 'off',
6-
semi: [2, 'always'],
7-
'keyword-spacing': [2, { before: true, after: true }],
8-
'space-before-blocks': [2, 'always'],
9-
'no-mixed-spaces-and-tabs': [2, 'smart-tabs'],
10-
'no-cond-assign': 0,
11-
'object-shorthand': [2, 'always'],
12-
'no-const-assign': 2,
13-
'no-class-assign': 2,
14-
'no-this-before-super': 2,
15-
'no-var': 2,
16-
'no-unreachable': 2,
17-
'valid-typeof': 2,
18-
'quote-props': [2, 'as-needed'],
19-
'one-var': [2, 'never'],
20-
'prefer-arrow-callback': 2,
21-
'prefer-const': [2, { destructuring: 'all' }],
22-
'arrow-spacing': 2,
23-
'no-inner-declarations': 0,
24-
'require-atomic-updates': 'off',
25-
'@typescript-eslint/indent': 'off',
26-
'@typescript-eslint/camelcase': 'off',
27-
'@typescript-eslint/no-use-before-define': 'off',
28-
'@typescript-eslint/array-type': ['error', 'array-simple'],
29-
'@typescript-eslint/explicit-function-return-type': 'off',
30-
'@typescript-eslint/no-explicit-any': 'off',
31-
'@typescript-eslint/explicit-member-accessibility': 'off',
32-
'@typescript-eslint/no-unused-vars': [
33-
'error',
34-
{
35-
argsIgnorePattern: '^_'
36-
}
37-
],
38-
'@typescript-eslint/no-object-literal-type-assertion': 'off',
39-
'@typescript-eslint/no-unused-vars': 'off',
40-
'@typescript-eslint/prefer-interface': 'off'
41-
},
42-
globals: {
43-
globalThis: false
44-
},
45-
env: {
46-
es6: true,
47-
browser: true,
48-
node: true,
49-
mocha: true
50-
},
51-
extends: [
52-
'eslint:recommended',
53-
'plugin:import/errors',
54-
'plugin:import/warnings',
55-
'plugin:import/typescript',
56-
'plugin:@typescript-eslint/recommended'
57-
],
58-
parserOptions: {
59-
ecmaVersion: 9,
60-
sourceType: 'module'
61-
},
62-
plugins: ['svelte3'],
3+
extends: '@sveltejs',
634
settings: {
645
'import/core-modules': [
656
'svelte',
@@ -69,20 +10,5 @@ module.exports = {
6910
'estree'
7011
],
7112
'svelte3/compiler': require('./compiler')
72-
},
73-
overrides: [
74-
{
75-
files: ['*.js'],
76-
rules: {
77-
'@typescript-eslint/no-var-requires': 'off'
78-
}
79-
},
80-
{
81-
files: ['*.svelte'],
82-
processor: 'svelte3/svelte3',
83-
rules: {
84-
'@typescript-eslint/indent': 'off'
85-
}
86-
}
87-
]
13+
}
8814
};

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11

22

33
### Before submitting the PR, please make sure you do the following
4-
- [ ] It's really useful if your PR relates to an outstanding issue, so please reference it in your PR, or create an explanatory one for discussion. In many cases features are absent for a reason.
4+
- [ ] It's really useful if your PR relates to an outstanding issue, so please reference it in your PR, or create an explanatory one for discussion. In many cases, features are absent for a reason.
55
- [ ] This message body should clearly illustrate what problems it solves. If there are related issues, remember to reference them.
66
- [ ] Ideally, include a test that fails without this PR but passes with it. PRs will only be merged once they pass CI. (Remember to `npm run lint`!)
77
### Tests
8-
- [ ] Run the tests tests with `npm test` or `yarn test`)
8+
- [ ] Run the tests with `npm test` or `yarn test`)

.github/workflows/ci.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@ on: [push, pull_request]
33
jobs:
44
Tests:
55
runs-on: ${{ matrix.os }}
6+
timeout-minutes: 10
67
strategy:
78
matrix:
8-
node-version: [8, 10, 12]
9+
node-version: [8, 10, 12, 14]
910
os: [ubuntu-latest, windows-latest, macOS-latest]
1011
steps:
11-
- run: git config --global core.autocrlf false
1212
- uses: actions/checkout@v1
1313
- uses: actions/setup-node@v1
1414
with:
@@ -19,12 +19,17 @@ jobs:
1919
CI: true
2020
Lint:
2121
runs-on: ubuntu-latest
22+
timeout-minutes: 2
2223
steps:
2324
- uses: actions/checkout@v1
2425
- uses: actions/setup-node@v1
2526
- run: 'npm i && npm run lint'
2627
Unit:
27-
runs-on: ubuntu-latest
28+
runs-on: ${{ matrix.os }}
29+
timeout-minutes: 5
30+
strategy:
31+
matrix:
32+
os: [ubuntu-latest, windows-latest, macOS-latest]
2833
steps:
2934
- uses: actions/checkout@v1
3035
- uses: actions/setup-node@v1

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
.idea
22
.DS_Store
33
.nyc_output
4+
.vscode
45
node_modules
56
*.map
67
/src/compiler/compile/internal_exports.ts

CHANGELOG.md

Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,114 @@
11
# Svelte changelog
22

3+
## Unreleased
4+
5+
* Fix reactivity when passing `$$props` to a `<slot>` ([#3364](https://github.com/sveltejs/svelte/issues/3364))
6+
* Fix unneeded invalidation of `$$props` and `$$restProps` ([#4993](https://github.com/sveltejs/svelte/issues/4993), [#5118](https://github.com/sveltejs/svelte/issues/5118))
7+
8+
## 3.24.0
9+
10+
* Support nullish coalescing (`??`) and optional chaining (`?.`) operators ([#1972](https://github.com/sveltejs/svelte/issues/1972))
11+
* Support `import.meta` ([#4379](https://github.com/sveltejs/svelte/issues/4379))
12+
* Fix only setting `<input>` values when they're changed when there are spread attributes ([#4418](https://github.com/sveltejs/svelte/issues/4418))
13+
* Fix placement of `{@html}` when used at the root of a slot, at the root of a component, or in `<svelte:head>` ([#5012](https://github.com/sveltejs/svelte/issues/5012), [#5071](https://github.com/sveltejs/svelte/pull/5071))
14+
* Fix certain handling of two-way bound `contenteditable` elements ([#5018](https://github.com/sveltejs/svelte/issues/5018))
15+
* Fix handling of `import`ed value that is used as a store and is also mutated ([#5019](https://github.com/sveltejs/svelte/issues/5019))
16+
* Do not display `a11y-missing-content` warning on elements with `contenteditable` bindings ([#5020](https://github.com/sveltejs/svelte/issues/5020))
17+
* Fix handling of `this` in inline function expressions in the template ([#5033](https://github.com/sveltejs/svelte/issues/5033))
18+
* Fix collapsing HTML with static content ([#5040](https://github.com/sveltejs/svelte/issues/5040))
19+
* Prevent use of `$store` at compile time when top-level `store` has been shadowed ([#5048](https://github.com/sveltejs/svelte/issues/5048))
20+
* Update `<select>` with one-way `value` binding when the available `<option>`s change ([#5051](https://github.com/sveltejs/svelte/issues/5051))
21+
* Fix published `tweened` types so the `.set()` and `.update()` options are optional ([#5062](https://github.com/sveltejs/svelte/issues/5062))
22+
* Fix contextual `bind:this` inside `{#each}` block ([#5067](https://github.com/sveltejs/svelte/issues/5067))
23+
* Preprocess self-closing `<script>` and `<style>` tags ([#5080](https://github.com/sveltejs/svelte/issues/5080))
24+
* Fix types for animation- and transition-related param objects so each param is optional ([#5083](https://github.com/sveltejs/svelte/pull/5083))
25+
26+
## 3.23.2
27+
28+
* Fix `bind:group` inside `{#each}` ([#3243](https://github.com/sveltejs/svelte/issues/3243))
29+
* Don't crash when using an arrow function as a statement ([#4617](https://github.com/sveltejs/svelte/issues/4617))
30+
* Deconflict `bind:this` variable ([#4636](https://github.com/sveltejs/svelte/issues/4636))
31+
32+
## 3.23.1
33+
34+
* Fix checkbox `bind:group` when multiple options have the same value ([#4397](https://github.com/sveltejs/svelte/issues/4397))
35+
* Fix `bind:this` to the value of an `{#each}` block ([#4517](https://github.com/sveltejs/svelte/issues/4517))
36+
* Fix reactivity when assigning to contextual `{#each}` variable ([#4574](https://github.com/sveltejs/svelte/issues/4574), [#4744](https://github.com/sveltejs/svelte/issues/4744))
37+
* Fix binding to contextual `{#each}` values that shadow outer names ([#4757](https://github.com/sveltejs/svelte/issues/4757))
38+
* Work around EdgeHTML DOM issue when removing attributes during hydration ([#4911](https://github.com/sveltejs/svelte/pull/4911))
39+
* Throw CSS parser error when `:global()` does not contain a selector ([#4930](https://github.com/sveltejs/svelte/issues/4930))
40+
41+
## 3.23.0
42+
43+
* Update `<select>` with `bind:value` when the available `<option>`s change ([#1764](https://github.com/sveltejs/svelte/issues/1764))
44+
* Add `muted` binding for media elements ([#2998](https://github.com/sveltejs/svelte/issues/2998))
45+
* Fix inconsistencies when setting a two-way bound `<input>` to `undefined` ([#3569](https://github.com/sveltejs/svelte/issues/3569))
46+
* Fix setting `<select multiple>` when there are spread attributes ([#4392](https://github.com/sveltejs/svelte/issues/4392))
47+
* Fix let-less `<slot>` with context overflow ([#4624](https://github.com/sveltejs/svelte/issues/4624))
48+
* Fix resize listening on certain older browsers ([#4752](https://github.com/sveltejs/svelte/issues/4752))
49+
* Add `a11y-no-onchange` warning ([#4788](https://github.com/sveltejs/svelte/pull/4788))
50+
* Fix `use:` actions being recreated when a keyed `{#each}` is reordered ([#4693](https://github.com/sveltejs/svelte/issues/4693))
51+
* Fix `{@html}` when using tags that can only appear inside certain tags ([#4852](https://github.com/sveltejs/svelte/issues/4852))
52+
* Fix reactivity when binding directly to `{#each}` context ([#4879](https://github.com/sveltejs/svelte/issues/4879))
53+
54+
## 3.22.3
55+
56+
* Support default values and trailing commas in destructuring `{#await}` ([#4560](https://github.com/sveltejs/svelte/issues/4560), [#4810](https://github.com/sveltejs/svelte/issues/4810))
57+
* Fix handling of `tweened` store when set using `duration: 0` ([#4799](https://github.com/sveltejs/svelte/issues/4799), [#4846](https://github.com/sveltejs/svelte/issues/4846))
58+
* Fix setting `value` attribute with `bind:group` and attribute spread ([#4803](https://github.com/sveltejs/svelte/issues/4803))
59+
* Fix issue with compound `{#if}` block involving static condition, dynamic condition, and inline component ([#4840](https://github.com/sveltejs/svelte/issues/4840))
60+
* Update a11y warnings per ARIA 1.2 working draft ([#4844](https://github.com/sveltejs/svelte/issues/4844))
61+
62+
## 3.22.2
63+
64+
* Fix compiler exception with `a11y-img-redundant-alt` and value-less `alt` attribute ([#4777](https://github.com/sveltejs/svelte/issues/4777))
65+
66+
## 3.22.1
67+
68+
* Fix compiler exception with `a11y-img-redundant-alt` and dynamic `alt` attribute ([#4770](https://github.com/sveltejs/svelte/issues/4770))
69+
70+
## 3.22.0
71+
72+
* Fix misaligned line numbers in source maps ([#3906](https://github.com/sveltejs/svelte/issues/3906))
73+
* Make setting a `tweened` store using `duration: 0` instantly update the value ([#4399](https://github.com/sveltejs/svelte/issues/4399))
74+
* Fix reactivity with imported values that are then mutated ([#4555](https://github.com/sveltejs/svelte/issues/4555))
75+
* Fix contextual dynamic `bind:this` inside `{#each}` block ([#4686](https://github.com/sveltejs/svelte/issues/4686))
76+
* Do not display a11y warning about missing `href` for `<a>` with `name` or `id` ([#4697](https://github.com/sveltejs/svelte/issues/4697))
77+
* Disable infinite loop guard inside generators ([#4698](https://github.com/sveltejs/svelte/issues/4698))
78+
* Display `a11y-invalid-attribute` warning for `href="javascript:..."` ([#4733](https://github.com/sveltejs/svelte/pull/4733))
79+
* Implement `a11y-img-redundant-alt` warning ([#4750](https://github.com/sveltejs/svelte/pull/4750))
80+
* Fix variable name conflict with component called `<Anchor>` ([#4768](https://github.com/sveltejs/svelte/issues/4768))
81+
82+
## 3.21.0
83+
84+
* Support dimension bindings in cross-origin environments ([#2147](https://github.com/sveltejs/svelte/issues/2147))
85+
* Fix several related outro bugs ([#3202](https://github.com/sveltejs/svelte/issues/3202), [#3410](https://github.com/sveltejs/svelte/issues/3410), [#3685](https://github.com/sveltejs/svelte/issues/3685), [#4620](https://github.com/sveltejs/svelte/issues/4620), [#4630](https://github.com/sveltejs/svelte/issues/4630))
86+
* Try using `globalThis` rather than `globals` for the benefit of non-Node servers and web workers ([#3561](https://github.com/sveltejs/svelte/issues/3561), [#4545](https://github.com/sveltejs/svelte/issues/4545))
87+
* Support `{#await ... catch ...}` syntax shorthand ([#3623](https://github.com/sveltejs/svelte/issues/3623))
88+
* Fix attaching of JS debugging comments to HTML comments ([#4565](https://github.com/sveltejs/svelte/issues/4565))
89+
* Fix `<svelte:component/>` within `<slot/>` ([#4597](https://github.com/sveltejs/svelte/issues/4597))
90+
* Fix bug with updating simple `{#if}` blocks ([#4629](https://github.com/sveltejs/svelte/issues/4629))
91+
* Fix issues with `<input type="number">` updates ([#4631](https://github.com/sveltejs/svelte/issues/4631), [#4687](https://github.com/sveltejs/svelte/issues/4687))
92+
* Prevent illegal attribute names ([#4648](https://github.com/sveltejs/svelte/issues/4648))
93+
* Fix `{#if}` block directly within `<slot/>` ([#4703](https://github.com/sveltejs/svelte/issues/4703))
94+
95+
## 3.20.1
96+
97+
* Fix compiler regression with slots ([#4562](https://github.com/sveltejs/svelte/issues/4562))
98+
99+
## 3.20.0
100+
101+
* Allow destructuring in `{#await}` blocks ([#1851](https://github.com/sveltejs/svelte/issues/1851))
102+
* Allow `<svelte:self>` to be used in a slot ([#2798](https://github.com/sveltejs/svelte/issues/2798))
103+
* Expose object of unknown props in `$$restProps` ([#2930](https://github.com/sveltejs/svelte/issues/2930))
104+
* Prevent passing named slots other than from the top level within a component ([#3385](https://github.com/sveltejs/svelte/issues/3385))
105+
* Allow transitions and animations to work within iframes ([#3624](https://github.com/sveltejs/svelte/issues/3624))
106+
* Fix initialising slot fallbacks when unnecessary ([#3763](https://github.com/sveltejs/svelte/issues/3763))
107+
* Disallow binding directly to `const` variables ([#4479](https://github.com/sveltejs/svelte/issues/4479))
108+
* Fix re-attaching event handlers on keyed `{#each}` blocks ([#4491](https://github.com/sveltejs/svelte/issues/4491))
109+
* Fix updating keyed `{#each}` blocks with `{:else}` ([#4536](https://github.com/sveltejs/svelte/issues/4536), [#4549](https://github.com/sveltejs/svelte/issues/4549))
110+
* Fix hydration of top-level content ([#4542](https://github.com/sveltejs/svelte/issues/4542))
111+
3112
## 3.19.2
4113

5114
* In `dev` mode, display a runtime warning when a component is passed an unexpected slot ([#1020](https://github.com/sveltejs/svelte/issues/1020), [#1447](https://github.com/sveltejs/svelte/issues/1447))

CONTRIBUTING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ Test samples are kept in `/test/xxx/samples` folder.
9393

9494
#### Running tests
9595

96-
1. To run test, run `npm run test`
96+
1. To run test, run `npm run test`.
9797
1. To run test for a specific feature, you can use the `-g` (aka `--grep`) option. For example, to only run test involving transitions, run `npm run test -- -g transition`.
9898

9999
##### Running solo test
@@ -130,7 +130,7 @@ The core Svelte team will be monitoring for pull requests. Do help us by making
130130

131131
### Code conventions
132132

133-
- `snake_case` for internal variable names and methods
133+
- `snake_case` for internal variable names and methods.
134134
- `camelCase` for public variable names and methods.
135135

136136
## License

README.md

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,6 @@ npm install
3434

3535
> Do not use Yarn to install the dependencies, as the specific package versions in `package-lock.json` are used to build and test Svelte.
3636
37-
> Many tests depend on newlines being preserved as `<LF>`. On Windows, you can ensure this by cloning with:
38-
> ```bash
39-
> git -c core.autocrlf=false clone https://github.com/sveltejs/svelte.git
40-
> ```
41-
4237
To build the compiler, and all the other modules included in the package:
4338

4439
```bash
@@ -69,14 +64,11 @@ npm run test -- -g transition
6964

7065
## svelte.dev
7166

72-
The source code for https://svelte.dev, including all the documentation, lives in the [site](site) directory. The site is built with [Sapper](https://sapper.svelte.dev). To develop locally:
67+
The source code for https://svelte.dev, including all the documentation, lives in the [site](site) directory. The site is built with [Sapper](https://sapper.svelte.dev).
7368

74-
```bash
75-
cd site
76-
npm install && npm run update
77-
npm run dev
78-
```
69+
### Is svelte.dev down?
7970

71+
Probably not, but it's possible. If you can't seem to access any `.dev` sites, check out [this SuperUser question and answer](https://superuser.com/q/1413402).
8072

8173
## License
8274

banner.png

-46.3 KB
Binary file not shown.

0 commit comments

Comments
 (0)