WIP: feat(lib): Incremental Build Tool API #96
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "incremental"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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.tsandincremental.tsas a new system that only depends on these node builtins. here is a big todo list for progressincremental.graph.import("src/main.ts");.tsx,.marko,.svelteWork, other files, and other directory contentsimport.meta.hotsince it's so easyby implementing
@clo/lib/incremental, clover sitegen can:esbuildpoweredhot.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.
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: - able to reflect what files are pointed to by each file - can adjust how files are processed before loading - can unload/reload modules, with old ones being garbage collected this commit rebuilds `hot.ts` and `incremental.ts` as a new system that only depends on these node builtins, which (TODO) provides: - simple module loading `new Incremental().import("src/main.ts");` - plugin system to load extensions like `.tsx`, `.marko`, `.svelte` - tracing the files used in resolution and initialization - allowing arbitrary dependencies to be added - allowing arbitrary jobs that cache when re-run - creating a filesystem watcher to detect changes - performing trivial module reloading (maybe full HMR) - serializing the graph state to disk, along with v8 cache data by implementing this, clover sitegen can: - stop patching node.js internals - drop the server-side esbuild code (frontend still needs it) - use real es modules - provide a base for more features (issue 4 and 5), which could possibly be solved as their own top-level projects. this is also a great time to solve issue 27 (incremntal tracking)neat idea:
low key think this should be named something else top level
2477fbe717to1e02d3c568WIP: feat(lib): Incremental Module Loader APIto WIP: feat(lib): Incremental Build Tool API1e02d3c568to26c98740bb26c98740bbto46ce321c0446ce321c04to6a4e985a96View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.