Frontend uudelleenrakennettu: Astro-komponentit, Wasm pääsäikeessä, ei Workeria
Vanha frontend siirretty temp/. Uusi rakenne: - StatusBar.astro, Terminal.astro, Editor.astro, Guide.astro - global.css erillinen - Wasm pääsäikeessä (ei Worker — yksinkertainen, debugattava) - Tab-completion, dropdown, projektikortti, Monaco, GUIDE.md - Ei tokenisointia eikä koodilaboratoriota Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
7
network-poc/frontend/node_modules/astro/dist/vite-plugin-hmr-reload/index.d.ts
generated
vendored
Normal file
7
network-poc/frontend/node_modules/astro/dist/vite-plugin-hmr-reload/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
import type { Plugin } from 'vite';
|
||||
/**
|
||||
* The very last Vite plugin to reload the browser if any SSR-only module are updated
|
||||
* which will require a full page reload. This mimics the behaviour of Vite 5 where
|
||||
* it used to unconditionally reload for us.
|
||||
*/
|
||||
export default function hmrReload(): Plugin;
|
||||
40
network-poc/frontend/node_modules/astro/dist/vite-plugin-hmr-reload/index.js
generated
vendored
Normal file
40
network-poc/frontend/node_modules/astro/dist/vite-plugin-hmr-reload/index.js
generated
vendored
Normal file
@@ -0,0 +1,40 @@
|
||||
import { VIRTUAL_PAGE_RESOLVED_MODULE_ID } from "../vite-plugin-pages/const.js";
|
||||
import { getDevCssModuleNameFromPageVirtualModuleName } from "../vite-plugin-css/util.js";
|
||||
import { isAstroServerEnvironment } from "../environments.js";
|
||||
function hmrReload() {
|
||||
return {
|
||||
name: "astro:hmr-reload",
|
||||
enforce: "post",
|
||||
hotUpdate: {
|
||||
order: "post",
|
||||
handler({ modules, server, timestamp }) {
|
||||
if (!isAstroServerEnvironment(this.environment)) return;
|
||||
let hasSsrOnlyModules = false;
|
||||
const invalidatedModules = /* @__PURE__ */ new Set();
|
||||
for (const mod of modules) {
|
||||
if (mod.id == null) continue;
|
||||
const clientModule = server.environments.client.moduleGraph.getModuleById(mod.id);
|
||||
if (clientModule != null) continue;
|
||||
this.environment.moduleGraph.invalidateModule(mod, invalidatedModules, timestamp, true);
|
||||
hasSsrOnlyModules = true;
|
||||
}
|
||||
for (const invalidatedModule of invalidatedModules) {
|
||||
if (invalidatedModule.id?.startsWith(VIRTUAL_PAGE_RESOLVED_MODULE_ID)) {
|
||||
const cssMod = this.environment.moduleGraph.getModuleById(
|
||||
getDevCssModuleNameFromPageVirtualModuleName(invalidatedModule.id)
|
||||
);
|
||||
if (!cssMod || cssMod.id == null) continue;
|
||||
this.environment.moduleGraph.invalidateModule(cssMod, void 0, timestamp, true);
|
||||
}
|
||||
}
|
||||
if (hasSsrOnlyModules) {
|
||||
server.ws.send({ type: "full-reload" });
|
||||
return [];
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
export {
|
||||
hmrReload as default
|
||||
};
|
||||
Reference in New Issue
Block a user