svelte-loader
Advanced tools
Comparing version 2.5.0 to 2.5.1
# svelte-loader changelog | ||
## 2.5.1 | ||
* Wrap components with proxies when hot reloading ([#44](https://github.com/sveltejs/svelte-loader/pull/44)) | ||
## 2.5.0 | ||
@@ -4,0 +8,0 @@ |
@@ -11,4 +11,2 @@ const { basename, extname, posix, relative } = require('path'); | ||
let proxyComponent = $2; | ||
if (module.hot) { | ||
@@ -23,10 +21,11 @@ | ||
configure(${options}); | ||
proxyComponent = register(${id}, $2); | ||
$2 = register(${id}, $2); | ||
} else { | ||
// hot update | ||
reload(${id}, proxyComponent); | ||
$2 = reload(${id}, $2); | ||
} | ||
} | ||
export default proxyComponent; | ||
export default $2; | ||
`; | ||
@@ -33,0 +32,0 @@ |
@@ -21,3 +21,11 @@ import { Registry, configure as configureProxy, createProxy } from 'svelte-dev-helper'; | ||
return createProxy(id); | ||
//create the proxy itself | ||
const proxy = createProxy(id); | ||
//patch the registry record with proxy constructor | ||
const record = Registry.get(id); | ||
record.proxy = proxy; | ||
Registry.set(id, record); | ||
return proxy; | ||
} | ||
@@ -37,6 +45,9 @@ | ||
//re-render the proxies | ||
//re-render the proxy instances | ||
record.instances.slice().forEach(function(instance) { | ||
instance && instance._rerender(); | ||
}); | ||
//return the original proxy constructor that was `register()`-ed | ||
return record.proxy; | ||
} |
{ | ||
"name": "svelte-loader", | ||
"version": "2.5.0", | ||
"version": "2.5.1", | ||
"author": "Nico Rehwaldt <git_nikku@nixis.de>", | ||
@@ -5,0 +5,0 @@ "description": "A webpack loader for svelte", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
83371
1519