Skip to content

Commit

Permalink
chore(repl): hide globals (#10125)
Browse files Browse the repository at this point in the history
  • Loading branch information
gtm-nayan authored Jan 9, 2024
1 parent 1ff9c0f commit b623890
Showing 1 changed file with 21 additions and 17 deletions.
38 changes: 21 additions & 17 deletions sites/svelte-5-preview/src/lib/Output/Viewer.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -111,26 +111,30 @@
${styles}
const styles = document.querySelectorAll('style[id^=svelte-]');
let i = styles.length;
while (i--) styles[i].parentNode.removeChild(styles[i]);
if (window.unmount) {
try {
window.unmount();
} catch (err) {
console.error(err);
{
const styles = document.querySelectorAll('style[id^=svelte-]');
let i = styles.length;
while (i--) styles[i].parentNode.removeChild(styles[i]);
if (window.__unmount_previous) {
try {
window.__unmount_previous();
} catch (err) {
console.error(err);
}
}
}
document.body.innerHTML = '';
window._svelteTransitionManager = null;
const { mount, App } = ${$bundle.client?.code};
const [, destroy] = mount(App, { target: document.body });
document.body.innerHTML = '';
window._svelteTransitionManager = null;
}
window.unmount = destroy;
const __repl_exports = ${$bundle.client?.code};
{
const { mount, App } = __repl_exports;
const [, destroy] = mount(App, { target: document.body });
window.__unmount_previous = destroy;
}
//# sourceURL=playground:output
`);
error = null;
Expand Down

1 comment on commit b623890

@vercel
Copy link

@vercel vercel bot commented on b623890 Jan 9, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

svelte-5-preview – ./sites/svelte-5-preview

svelte-5-preview-git-main-svelte.vercel.app
svelte-5-preview.vercel.app
svelte-5-preview-svelte.vercel.app
svelte-octane.vercel.app

Please sign in to comment.