mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-10-03 09:08:13 +08:00
Fix frontend HMR so the page doesn't break upon saving TS files and restructure frontend architecture (#3871)
* Clean up component setup/tear-down side effects * Clean up more component setup/tear-down side effects * Remove nonfunctional debouncer * Clean up even more component setup/tear-down side effects * Reuse backend state * Fix HMR for IO Managers and for State Providers * Rename IO Managers -> Managers and State Providers -> Stores * Restructure and partially flatten managers/stores * Code review fixes * Review fixes
This commit is contained in:
@@ -1,9 +1,14 @@
|
||||
// This file is the browser's entry point for the JS bundle
|
||||
|
||||
import { mount } from "svelte";
|
||||
import { mount, unmount } from "svelte";
|
||||
|
||||
import App from "@graphite/App.svelte";
|
||||
|
||||
document.body.setAttribute("data-app-container", "");
|
||||
|
||||
export default mount(App, { target: document.body });
|
||||
const app = mount(App, { target: document.body });
|
||||
|
||||
// Ensure the old component tree is properly torn down during HMR so all onDestroy hooks fire (which clean up IO managers, state providers, etc.)
|
||||
import.meta.hot?.dispose(() => unmount(app));
|
||||
|
||||
export default app;
|
||||
|
||||
Reference in New Issue
Block a user