resolves #27 resolves #88 blocked by #90 because i don't want to configure a JSX plugin
been playing with node:vm's experimental modules. it is neat because it gives us a hook into the module system that no other runtime has:
this commit rebuilds hot.ts and incremental.ts as a new system that only depends on these node builtins. here is a big todo list for progress
incremental.graph.import("src/main.ts");
.tsx, .marko, .svelteWork, other files, and other directory contentsimport.meta.hot since it's so easyby implementing @clo/lib/incremental, clover sitegen can:
esbuild powered hot.ts, using real ESM whenever possiblebut most importantly, it makes the incremental api available for anyone who wants to use it, intead of it being a very hyper specific component to clover sitegen.
this pr also drops msgpackr. since lib cannot have dependencies, data serialization is unified into the core format instead of being a stupid layer on top; the incremental state is a rich sqlite database. this should help with large incremental graphs that contain many megabytes of files.
Imported pull request: incremental → master.
neat idea:
// run.js would use something like this
incremental.reviveAndExecute(import.meta.resolve("./framework/generate.ts"));
incremental.graph.import("./") // untraced?
incremental.graph.transaction() // similar to incr.compile? this is where ref comes in?
// inside of generate.ts
const result = await inc.cachedWork([key], async (io) => {
// do a task. rules are to not pollute globals
io.import("...");
});
low key think this should be named something else top level