Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into fix-option-accept…
Browse files Browse the repository at this point in the history
…-named-exports-vite
  • Loading branch information
rixo committed Apr 11, 2022
2 parents cafb9bb + ae6b9c6 commit ac0c5bf
Show file tree
Hide file tree
Showing 8 changed files with 47 additions and 13 deletions.
5 changes: 0 additions & 5 deletions .changeset/khaki-pets-exercise.md

This file was deleted.

5 changes: 5 additions & 0 deletions .changeset/small-days-approve.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'svelte-hmr': patch
---

Fix recovery after error, when possible
5 changes: 0 additions & 5 deletions .changeset/tall-cheetahs-fetch.md

This file was deleted.

31 changes: 31 additions & 0 deletions packages/svelte-hmr-spec/test/revival.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
describe('revival after error', () => {
testHmr`
# revives after
---- App.svelte ----
<script>
::0 const key = 'foo'
::1
::2 const key = 'bar'
</script>
::0 <p data-focus>{key}</p>
::1 <p data-focus>{key}</p>
::2 <p data-focus>{key}</p>
*****
::0::
foo
${function*() {
yield this.cons.ignoreErrors()
}}
::1::
${function*() {
yield this.cons.ignoreErrors(false)
}}
::2 bar
`
})
8 changes: 8 additions & 0 deletions packages/svelte-hmr/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# svelte-hmr

## 0.14.11

### Patch Changes

- Fix preserving bind: directive (fixes [#43](https://github.com/sveltejs/svelte-hmr/issues/43)) ([#44](https://github.com/sveltejs/svelte-hmr/pull/44))

* Migrate README to svelte-hmr package (instead of monorepo root) ([#46](https://github.com/sveltejs/svelte-hmr/pull/46))

## 0.14.10

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/svelte-hmr/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "svelte-hmr",
"version": "0.14.10",
"version": "0.14.11",
"description": "Bundler agnostic HMR utils for Svelte 3",
"main": "index.js",
"author": "rixo <[email protected]>",
Expand Down
2 changes: 1 addition & 1 deletion packages/svelte-hmr/runtime/proxy.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ const relayCalls = (getTarget, names, dest = {}) => {
return dest
}

const isInternal = key => key !== '$$' && key.substr(0, 2) === '$$'
const isInternal = key => key !== '$$' && key.slice(0, 2) === '$$'

// This is intented as a somewhat generic / prospective fix to the situation
// that arised with the introduction of $$set in Svelte 3.24.1 -- trying to
Expand Down
2 changes: 1 addition & 1 deletion packages/svelte-hmr/runtime/svelte-hooks.js
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ export const createProxiedComponent = (
preserveLocalState
)

const callbacks = cmp.$$.on_hmr
const callbacks = cmp ? cmp.$$.on_hmr : []

const afterCallbacks = callbacks.map(fn => fn(cmp)).filter(Boolean)

Expand Down

0 comments on commit ac0c5bf

Please sign in to comment.