Remove the Rust/WASM crate and its build step
Nothing live used it: main.js awaited the wasm init() on every page load, but the only consumer, components/util/wasm/AutoScroll.vue, was never imported. Dropping it removes the rust:slim + wasm-pack stage from the vue image, the two Vite plugins that existed only for it, and the src/wasm/ guard in `make check-vue`, so a fresh clone builds without a Rust toolchain. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
@@ -1,36 +0,0 @@
|
||||
<template>
|
||||
<div ref="container" class="overflow-y-auto">
|
||||
<slot />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
/**
|
||||
* Rust/wasm port of components/util/AutoScroll.vue — the whole rAF loop lives in
|
||||
* the AutoScroller struct from src/wasm/.
|
||||
*
|
||||
* Note the two-step teardown: destroy() detaches the loop and listeners, free()
|
||||
* releases the Rust-side memory. Skipping free() leaks the wasm allocation, which
|
||||
* JS garbage collection cannot reclaim.
|
||||
*
|
||||
* STATUS: not imported anywhere; the JS AutoScroll is what the widgets use.
|
||||
*/
|
||||
import { useTemplateRef, onMounted, onBeforeUnmount } from "vue";
|
||||
import { AutoScroller } from "@/wasm/stp_wasm.js";
|
||||
|
||||
const container = useTemplateRef("container");
|
||||
|
||||
let scroller = null;
|
||||
|
||||
onMounted(() => {
|
||||
if (!container.value) return;
|
||||
scroller = new AutoScroller(container.value);
|
||||
scroller.start();
|
||||
});
|
||||
|
||||
onBeforeUnmount(() => {
|
||||
scroller?.destroy();
|
||||
scroller?.free();
|
||||
scroller = null;
|
||||
});
|
||||
</script>
|
||||
@@ -1,10 +1,5 @@
|
||||
/**
|
||||
* App entry point. Mounts <App> on #app with the router and a fresh Pinia.
|
||||
*
|
||||
* The top-level `await init()` loads the Rust/wasm bundle before anything else
|
||||
* renders, so components that reach for a wasm export (components/util/wasm/)
|
||||
* never see an uninitialised module. Top-level await in an entry module is what
|
||||
* `vite-plugin-top-level-await` in vite.config.js is there to support.
|
||||
*/
|
||||
|
||||
import { createApp } from "vue";
|
||||
@@ -12,9 +7,6 @@ import { createPinia } from "pinia";
|
||||
import App from "./App.vue";
|
||||
import router from "./router";
|
||||
import "./assets/styles.css";
|
||||
import init from "@/wasm/stp_wasm.js";
|
||||
|
||||
await init();
|
||||
|
||||
const app = createApp(App);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user