@memoized-dom/vite 0.0.4 → 0.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -9,22 +9,31 @@ import memoizedDom from '@memoized-dom/vite';
9
9
  export default defineConfig({
10
10
  plugins: [
11
11
  memoizedDom({
12
- entries: 'src/App.tsx',
13
- rootId: 'App',
12
+ entries: 'src/entry.ts',
14
13
  }),
15
14
  ],
16
15
  });
17
16
  ```
18
17
 
19
- Entries are authored graph roots, not necessarily the browser bootstrap module.
20
- The adapter follows local static value imports with Vite's resolver, compiles
21
- the graph through `compileModules()`, and caches output per Vite environment.
18
+ The entry is an ordinary TypeScript browser bootstrap containing one top-level
19
+ `mount(target, Component)` call. The adapter resolves that imported component,
20
+ derives its compiler entity identity, follows local static value imports with
21
+ Vite's resolver, compiles the graph through `compileModulesDetailed()`, returns
22
+ authored-module source maps from Vite transforms, and caches output per Vite
23
+ environment.
22
24
 
23
- Vite HMR cannot replace existing factory closures or their module state
24
- bindings. A change to any managed graph file therefore invalidates all managed
25
- modules through the environment module graph and requests a full browser
26
- reload. This is conservative state-resetting development behavior, not
27
- state-preserving component HMR.
25
+ During an edit, the adapter recompiles before notifying the browser. Compiler
26
+ failures therefore reach Vite's standard terminal and overlay feedback. It
27
+ diffs the linked generated graph and invalidates only outputs that changed.
28
+ Every generated module is a self-accepting HMR boundary. Ordinary live
29
+ components are disposed and recreated at their existing DOM position while
30
+ the browser document remains loaded. A root-component edit recreates that root
31
+ and therefore resets its local closure state. Lightweight keyed-row factories
32
+ currently remount their application root because retained rows do not own a
33
+ schedulable entity boundary.
34
+
35
+ Restart the Vite dev server after changing or rebuilding this server-side
36
+ plugin. An active Vite process does not hot-replace plugin hooks.
28
37
 
29
38
  Run the package-owned integration tests and adapter benchmark with:
30
39
 
@@ -1,8 +1,9 @@
1
+ import { type CompilerSourceMap } from '@memoized-dom/compiler';
1
2
  import type { ResolvedAdapterOptions } from '../options';
2
3
  import { type ParsedProgram } from './imports';
3
4
  export interface ResolvedImport {
4
5
  id: string;
5
- external?: boolean | 'absolute';
6
+ external?: boolean | 'absolute' | 'relative';
6
7
  }
7
8
  export interface GraphPluginContext {
8
9
  parse(source: string, options: {
@@ -12,10 +13,19 @@ export interface GraphPluginContext {
12
13
  skipSelf: true;
13
14
  }): Promise<ResolvedImport | null>;
14
15
  addWatchFile(file: string): void;
16
+ error(error: {
17
+ message: string;
18
+ id?: string;
19
+ loc?: {
20
+ line: number;
21
+ column: number;
22
+ };
23
+ }): never;
15
24
  }
16
25
  export interface CompiledGraph {
17
26
  files: ReadonlySet<string>;
18
27
  output: ReadonlyMap<string, string>;
28
+ maps: ReadonlyMap<string, CompilerSourceMap>;
19
29
  }
20
- export declare function compileGraph(context: GraphPluginContext, root: string, entries: readonly string[], options: ResolvedAdapterOptions, overrides: ReadonlyMap<string, string>): Promise<CompiledGraph>;
30
+ export declare function compileGraph(context: GraphPluginContext, root: string, entries: readonly string[], options: ResolvedAdapterOptions, overrides: ReadonlyMap<string, string>, hot: boolean): Promise<CompiledGraph>;
21
31
  //# sourceMappingURL=collector.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"collector.d.ts","sourceRoot":"","sources":["../../src/graph/collector.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,YAAY,CAAC;AAOzD,OAAO,EAAgB,KAAK,aAAa,EAAE,MAAM,WAAW,CAAC;AAE7D,MAAM,WAAW,cAAc;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,CAAC,EAAE,OAAO,GAAG,UAAU,CAAC;CACjC;AAED,MAAM,WAAW,kBAAkB;IACjC,KAAK,CACH,MAAM,EAAE,MAAM,EACd,OAAO,EAAE;QAAE,IAAI,EAAE,IAAI,GAAG,KAAK,GAAG,IAAI,GAAG,KAAK,CAAA;KAAE,GAC7C,aAAa,CAAC;IACjB,OAAO,CACL,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE;QAAE,QAAQ,EAAE,IAAI,CAAA;KAAE,GAC1B,OAAO,CAAC,cAAc,GAAG,IAAI,CAAC,CAAC;IAClC,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;CAClC;AAED,MAAM,WAAW,aAAa;IAC5B,KAAK,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAC3B,MAAM,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACrC;AAMD,wBAAsB,YAAY,CAChC,OAAO,EAAE,kBAAkB,EAC3B,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,SAAS,MAAM,EAAE,EAC1B,OAAO,EAAE,sBAAsB,EAC/B,SAAS,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,GACrC,OAAO,CAAC,aAAa,CAAC,CAyDxB"}
1
+ {"version":3,"file":"collector.d.ts","sourceRoot":"","sources":["../../src/graph/collector.ts"],"names":[],"mappings":"AAIA,OAAO,EAKL,KAAK,iBAAiB,EACvB,MAAM,wBAAwB,CAAC;AAChC,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,YAAY,CAAC;AAOzD,OAAO,EAAgB,KAAK,aAAa,EAAE,MAAM,WAAW,CAAC;AAE7D,MAAM,WAAW,cAAc;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,CAAC,EAAE,OAAO,GAAG,UAAU,GAAG,UAAU,CAAC;CAC9C;AAED,MAAM,WAAW,kBAAkB;IACjC,KAAK,CACH,MAAM,EAAE,MAAM,EACd,OAAO,EAAE;QAAE,IAAI,EAAE,IAAI,GAAG,KAAK,GAAG,IAAI,GAAG,KAAK,CAAA;KAAE,GAC7C,aAAa,CAAC;IACjB,OAAO,CACL,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE;QAAE,QAAQ,EAAE,IAAI,CAAA;KAAE,GAC1B,OAAO,CAAC,cAAc,GAAG,IAAI,CAAC,CAAC;IAClC,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC,KAAK,CAAC,KAAK,EAAE;QACX,OAAO,EAAE,MAAM,CAAC;QAChB,EAAE,CAAC,EAAE,MAAM,CAAC;QACZ,GAAG,CAAC,EAAE;YAAE,IAAI,EAAE,MAAM,CAAC;YAAC,MAAM,EAAE,MAAM,CAAA;SAAE,CAAC;KACxC,GAAG,KAAK,CAAC;CACX;AAED,MAAM,WAAW,aAAa;IAC5B,KAAK,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAC3B,MAAM,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACpC,IAAI,EAAE,WAAW,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAAC;CAC9C;AAMD,wBAAsB,YAAY,CAChC,OAAO,EAAE,kBAAkB,EAC3B,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,SAAS,MAAM,EAAE,EAC1B,OAAO,EAAE,sBAAsB,EAC/B,SAAS,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,EACtC,GAAG,EAAE,OAAO,GACX,OAAO,CAAC,aAAa,CAAC,CAoGxB"}
package/dist/hmr.d.ts CHANGED
@@ -1,7 +1,6 @@
1
1
  /**
2
- * Invalidates every Vite module backed by one linked compiler graph.
2
+ * Invalidates only linked modules whose generated output changed.
3
3
  */
4
4
  import type { DevEnvironment, EnvironmentModuleNode } from 'vite';
5
- import type { AdapterState } from './state';
6
- export declare function invalidateManagedGraph(environment: DevEnvironment, state: AdapterState, timestamp: number): EnvironmentModuleNode[];
5
+ export declare function invalidateManagedModules(environment: DevEnvironment, files: ReadonlySet<string>, timestamp: number): EnvironmentModuleNode[];
7
6
  //# sourceMappingURL=hmr.d.ts.map
package/dist/hmr.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"hmr.d.ts","sourceRoot":"","sources":["../src/hmr.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EACV,cAAc,EACd,qBAAqB,EACtB,MAAM,MAAM,CAAC;AACd,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAE5C,wBAAgB,sBAAsB,CACpC,WAAW,EAAE,cAAc,EAC3B,KAAK,EAAE,YAAY,EACnB,SAAS,EAAE,MAAM,GAChB,qBAAqB,EAAE,CAgBzB"}
1
+ {"version":3,"file":"hmr.d.ts","sourceRoot":"","sources":["../src/hmr.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EACV,cAAc,EACd,qBAAqB,EACtB,MAAM,MAAM,CAAC;AACd,wBAAgB,wBAAwB,CACtC,WAAW,EAAE,cAAc,EAC3B,KAAK,EAAE,WAAW,CAAC,MAAM,CAAC,EAC1B,SAAS,EAAE,MAAM,GAChB,qBAAqB,EAAE,CAezB"}
package/dist/index.js CHANGED
@@ -1 +1,8 @@
1
- import{readFile as N}from"node:fs/promises";import{compileModules as q}from"@memoized-dom/compiler";import{extname as D,isAbsolute as P,relative as A,resolve as O,sep as S}from"node:path";var K=new Set([".ts",".tsx",".js",".jsx"]);function f(e){let t=e.search(/[?#]/);return m(t===-1?e:e.slice(0,t))}function m(e){return O(e).replaceAll("\\","/")}function j(e,t){return t.map(n=>{if(P(n))return m(n);let i=n.startsWith("/")?n.slice(1):n;return m(O(e,i))})}function R(e,t){let n=A(e,t).split(S).join("/");return n!==".."&&!n.startsWith("../")&&!P(n)?`./${n}`:m(t)}function E(e,t){return e===void 0?!1:(e instanceof RegExp?[e]:e).some(i=>(i.lastIndex=0,i.test(t)))}function I(e,t,n){let i=m(t);if(!K.has(D(i))||i.includes("/node_modules/")||E(n.exclude,i))return!1;if(E(n.include,i))return!0;let l=A(e,i);return l!==".."&&!l.startsWith(`..${S}`)&&!P(l)}function G(e){let t=D(e);return t===".tsx"?"tsx":t===".ts"?"ts":t===".jsx"?"jsx":"js"}function T(e){return typeof e=="object"&&e!==null&&e.type==="ImportDeclaration"}function z(e){let t=[];for(let n of e.body){if(!T(n)||n.importKind==="type")continue;let i=n.specifiers??[];i.length>0&&i.every(l=>l.importKind==="type")||typeof n.source.value=="string"&&t.push(n.source.value)}return t}function b(e,t){return`${e}\0${t}`}async function V(e,t,n,i,l){let d=new Map,u=new Map,c=new Map,h=new Set;async function o(s){let a=f(s);if(h.has(a))return;h.add(a),e.addWatchFile(a);let v=R(t,a),g=l.get(a)??await N(a,"utf8");d.set(v,g),u.set(a,v);let y=e.parse(g,{lang:G(a)});for(let C of z(y)){let w=await e.resolve(C,a,{skipSelf:!0});if(w===null||w.external)continue;let M=f(w.id);I(t,M,i)&&(c.set(b(v,C),R(t,M)),await o(M))}}for(let s of n){if(!I(t,s,i))throw new Error(`memoized-dom: Vite entry is not an accepted source file: ${s}`);await o(s)}let r=q(Object.fromEntries(d),{...i.rootId===void 0?{}:{rootId:i.rootId},...i.runtimePath===void 0?{}:{runtimePath:i.runtimePath},resolveImport(s,a){return c.get(b(a,s))}}),p=new Map;for(let[s,a]of u)p.set(s,r[a]);return{files:new Set(u.keys()),output:p}}function F(e,t,n){let i=new Set;for(let l of t.files){let d=e.moduleGraph.getModulesByFile(l);if(d!==void 0)for(let u of d)e.moduleGraph.invalidateModule(u,i,n,!0)}return t.invalidate(),[...i]}function k(e){let t=typeof e.entries=="string"?[e.entries]:e.entries;if(t.length===0)throw new Error("memoized-dom: Vite adapter requires at least one entry");return{...e,entries:[...t]}}var x=class{files=new Set;output=new Map;compiling;replace(t){this.files.clear();for(let n of t.files)this.files.add(n);this.output.clear();for(let[n,i]of t.output)this.output.set(n,i)}invalidate(){this.output.clear()}};var W=/\.[jt]sx?(?:$|[?#])/;function $(e){let t=k(e),n=new Map,i,l=[];function d(o){let r=n.get(o);return r===void 0&&(r=new x,n.set(o,r)),r}function u(o){return{parse:(r,p)=>o.parse(r,p),resolve:(r,p,s)=>o.resolve(r,p,s),addWatchFile:r=>o.addWatchFile(r)}}async function c(o,r,p=new Map){if(i===void 0)throw new Error("memoized-dom: Vite graph compilation started before config resolution");r.compiling===void 0&&(r.compiling=V(u(o),i.root,l,t,p));let s=r.compiling;try{r.replace(await s)}finally{r.compiling===s&&(r.compiling=void 0)}}async function h(o,r,p){if(i===void 0||!W.test(p))return null;let s=f(p),a=d(o.environment);if(!(l.includes(s)||a.files.has(s))&&a.compiling===void 0)return null;let g=a.output.get(s);if(g!==void 0)return{code:g,map:null};a.compiling===void 0?await c(o,a,new Map([[s,r]])):await c(o,a);let y=a.output.get(s);if(y===void 0){if(!l.includes(s))return null;throw new Error(`memoized-dom: linked Vite graph omitted managed module ${s}`)}return{code:y,map:null}}return{name:"memoized-dom",enforce:"pre",perEnvironmentWatchChangeDuringDev:!0,perEnvironmentStartEndDuringDev:!0,applyToEnvironment(o){return o.name==="client"},configResolved(o){i=o,l=j(o.root,t.entries)},async buildStart(){await c(this,d(this.environment))},transform:{filter:{id:W},handler(o,r){return h(this,o,r)}},watchChange(o){let r=n.get(this.environment);r!==void 0&&r.files.has(f(o))&&r.invalidate()},hotUpdate(o){let r=n.get(this.environment),p=m(o.file);if(!(r===void 0||!r.files.has(p)))return F(this.environment,r,o.timestamp),this.environment.hot.send({type:"full-reload"}),[]}}}export{$ as default,$ as memoizedDom};
1
+ import{parseSync as Q}from"vite";import{readFile as L}from"node:fs/promises";import{compileModulesDetailed as q,toCompilerDiagnostic as B}from"@memoized-dom/compiler";import{extname as D,isAbsolute as P,relative as O,resolve as j,sep as G}from"node:path";var T=new Set([".ts",".tsx",".js",".jsx"]);function x(e){let t=e.search(/[?#]/);return y(t===-1?e:e.slice(0,t))}function y(e){return j(e).replaceAll("\\","/")}function b(e,t){return t.map(n=>{if(P(n))return y(n);let o=n.startsWith("/")?n.slice(1):n;return y(j(e,o))})}function R(e,t){let n=O(e,t).split(G).join("/");return n!==".."&&!n.startsWith("../")&&!P(n)?`./${n}`:y(t)}function z(e,t){return e===void 0?!1:(e instanceof RegExp?[e]:e).some(o=>(o.lastIndex=0,o.test(t)))}function E(e,t,n){let o=y(t);if(!T.has(D(o))||o.includes("/node_modules/")||z(n.exclude,o))return!1;if(z(n.include,o))return!0;let m=O(e,o);return m!==".."&&!m.startsWith(`..${G}`)&&!P(m)}function $(e){let t=D(e);return t===".tsx"?"tsx":t===".ts"?"ts":t===".jsx"?"jsx":"js"}function H(e){return typeof e=="object"&&e!==null&&e.type==="ImportDeclaration"}function A(e){let t=[];for(let n of e.body){if(!H(n)||n.importKind==="type")continue;let o=n.specifiers??[];o.length>0&&o.every(m=>m.importKind==="type")||typeof n.source.value=="string"&&t.push(n.source.value)}return t}function F(e,t){return`${e}\0${t}`}async function V(e,t,n,o,m,c){let f=new Map,u=new Map,h=new Map,M=new Set;async function i(l){let s=x(l);if(M.has(s))return;M.add(s),e.addWatchFile(s);let g=R(t,s),w=m.get(s)??await L(s,"utf8");f.set(g,w),u.set(s,g);let K=e.parse(w,{lang:$(s)});for(let I of A(K)){let S=await e.resolve(I,s,{skipSelf:!0});if(S===null||S.external)continue;let _=x(S.id);E(t,_,o)&&(h.set(F(g,I),R(t,_)),await i(_))}}for(let l of n){if(!E(t,l,o))throw new Error(`memoized-dom: Vite entry is not an accepted source file: ${l}`);await i(l)}let r={...o.runtimePath===void 0?{}:{runtimePath:o.runtimePath},...c?{hot:!0}:{},resolveImport(l,s){return h.get(F(s,l))}},a;try{a=q(Object.fromEntries(f),r)}catch(l){let s=B(l,[...f.keys()]),g=s.moduleId===void 0?void 0:[...u].find(([,w])=>w===s.moduleId)?.[0];e.error({message:s.message,...g===void 0?{}:{id:g},...s.line===void 0||s.column===void 0?{}:{loc:{line:s.line,column:s.column}}})}a.applicationRoot===void 0&&e.error({message:"memoized-dom: Vite entry graph must contain one top-level mount(target, Component) call"});let p=a.applicationRoot.rootId,d=new Map,v=new Map;for(let[l,s]of u){let g=a.output[s];d.set(l,c&&s!==a.applicationRoot.mountModuleId?U(g,a.metadata[s],s,o.runtimePath??"@memoized-dom/runtime",p):g),v.set(l,a.maps[s])}return{files:new Set(u.keys()),output:d,maps:v}}function U(e,t,n,o,m){let f=[...new Map(t.componentExports.map(u=>[u.local,u])).values()].map(u=>`[${u.local}, updatedModule[${JSON.stringify(u.exported)}], ${u.listLightweight}]`).join(", ");return`${e}
2
+ import { applyHotUpdate as __memoized_dom_apply_hot_update__, disposeHotModule as __memoized_dom_dispose_hot_module__ } from ${JSON.stringify(o)};
3
+ if (import.meta.hot) {
4
+ import.meta.hot.dispose(() => __memoized_dom_dispose_hot_module__(${JSON.stringify(n)}, ${JSON.stringify(m)}));
5
+ import.meta.hot.accept((updatedModule) => {
6
+ if (updatedModule) __memoized_dom_apply_hot_update__([${f}], ${JSON.stringify(m)});
7
+ });
8
+ }`}function k(e,t,n){let o=new Set;for(let m of t){let c=e.moduleGraph.getModulesByFile(m);if(c!==void 0)for(let f of c)e.moduleGraph.invalidateModule(f,o,n,!0)}return[...o]}function W(e){let t=typeof e.entries=="string"?[e.entries]:e.entries;if(t.length===0)throw new Error("memoized-dom: Vite adapter requires at least one entry");return{...e,entries:[...t]}}var C=class{files=new Set;output=new Map;maps=new Map;compiling;replace(t){this.files.clear();for(let n of t.files)this.files.add(n);this.output.clear();for(let[n,o]of t.output)this.output.set(n,o);this.maps.clear();for(let[n,o]of t.maps)this.maps.set(n,o)}};var N=/\.[jt]sx?(?:$|[?#])/;function J(e){let t=W(e),n=new Map,o,m=[];function c(i){let r=n.get(i);return r===void 0&&(r=new C,n.set(i,r)),r}function f(i){return{parse:(r,a)=>i.parse(r,a),resolve:(r,a,p)=>i.resolve(r,a,p),addWatchFile:r=>i.addWatchFile(r),error:r=>i.error(r)}}function u(i,r){return{parse:(a,p)=>Q(`module.${p.lang}`,a,p).program,async resolve(a,p){let d=await i.pluginContainer.resolveId(a,p);return d===null?null:{id:d.id,external:d.external}},addWatchFile:a=>i.pluginContainer.watchFiles.add(a),error:a=>r.error(a)}}async function h(i,r,a=new Map){if(o===void 0)throw new Error("memoized-dom: Vite graph compilation started before config resolution");r.compiling===void 0&&(r.compiling=V(f(i),o.root,m,t,a,o.command==="serve"));let p=r.compiling;try{r.replace(await p)}finally{r.compiling===p&&(r.compiling=void 0)}}async function M(i,r,a){if(o===void 0||!N.test(a))return null;let p=x(a),d=c(i.environment);if(!(m.includes(p)||d.files.has(p))&&d.compiling===void 0)return null;let l=d.output.get(p);if(l!==void 0)return{code:l,map:d.maps.get(p)};d.compiling===void 0?await h(i,d,new Map([[p,r]])):await h(i,d);let s=d.output.get(p);if(s===void 0){if(!m.includes(p))return null;throw new Error(`memoized-dom: linked Vite graph omitted managed module ${p}`)}return{code:s,map:d.maps.get(p)}}return{name:"memoized-dom",enforce:"pre",perEnvironmentWatchChangeDuringDev:!0,perEnvironmentStartEndDuringDev:!0,applyToEnvironment(i){return i.name==="client"},configResolved(i){o=i,m=b(i.root,t.entries)},async buildStart(){await h(this,c(this.environment))},transform:{filter:{id:N},handler(i,r){return M(this,i,r)}},async hotUpdate(i){let r=n.get(this.environment),a=y(i.file);if(r===void 0||!r.files.has(a))return;let p=new Map(r.output),d=i.type==="delete"?new Map:new Map([[a,await i.read()]]);await h(u(this.environment,this),r,d);let v=new Set;for(let l of new Set([...p.keys(),...r.output.keys()]))p.get(l)!==r.output.get(l)&&v.add(l);return k(this.environment,v,i.timestamp)}}}export{J as default,J as memoizedDom};
package/dist/options.d.ts CHANGED
@@ -2,12 +2,11 @@
2
2
  * Public configuration for the Vite connected-graph adapter.
3
3
  */
4
4
  import type { CompileModulesOptions } from '@memoized-dom/compiler';
5
- export interface MemoizedDomViteOptions extends Omit<CompileModulesOptions, 'aliases' | 'resolveImport'> {
5
+ export interface MemoizedDomViteOptions extends Omit<CompileModulesOptions, 'aliases' | 'resolveImport' | 'hot'> {
6
6
  /**
7
- * Authored graph roots, relative to Vite's configured project root.
8
- *
9
- * Every local TypeScript/JavaScript dependency reachable from these entries
10
- * is compiled as one linked graph.
7
+ * Ordinary TypeScript browser entries, relative to Vite's project root.
8
+ * Each connected graph must contain one top-level mount(target, Component)
9
+ * call; local dependencies are compiled as one linked application graph.
11
10
  */
12
11
  entries: string | readonly string[];
13
12
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"options.d.ts","sourceRoot":"","sources":["../src/options.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAEpE,MAAM,WAAW,sBACf,SAAQ,IAAI,CAAC,qBAAqB,EAAE,SAAS,GAAG,eAAe,CAAC;IAChE;;;;;OAKG;IACH,OAAO,EAAE,MAAM,GAAG,SAAS,MAAM,EAAE,CAAC;IACpC;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,MAAM,EAAE,CAAC;IACrC;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,MAAM,EAAE,CAAC;CACtC;AAED,MAAM,WAAW,sBACf,SAAQ,IAAI,CAAC,sBAAsB,EAAE,SAAS,CAAC;IAC/C,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;CAC5B;AAED,wBAAgB,qBAAqB,CACnC,OAAO,EAAE,sBAAsB,GAC9B,sBAAsB,CAOxB"}
1
+ {"version":3,"file":"options.d.ts","sourceRoot":"","sources":["../src/options.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAEpE,MAAM,WAAW,sBACf,SAAQ,IAAI,CAAC,qBAAqB,EAAE,SAAS,GAAG,eAAe,GAAG,KAAK,CAAC;IACxE;;;;OAIG;IACH,OAAO,EAAE,MAAM,GAAG,SAAS,MAAM,EAAE,CAAC;IACpC;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,MAAM,EAAE,CAAC;IACrC;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,MAAM,EAAE,CAAC;CACtC;AAED,MAAM,WAAW,sBACf,SAAQ,IAAI,CAAC,sBAAsB,EAAE,SAAS,CAAC;IAC/C,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;CAC5B;AAED,wBAAgB,qBAAqB,CACnC,OAAO,EAAE,sBAAsB,GAC9B,sBAAsB,CAOxB"}
package/dist/plugin.d.ts CHANGED
@@ -1,6 +1,3 @@
1
- /**
2
- * Vite 8 plugin backed by connected compiler graphs and full-reload HMR.
3
- */
4
1
  import type { Plugin } from 'vite';
5
2
  import { type MemoizedDomViteOptions } from './options';
6
3
  export declare function memoizedDom(input: MemoizedDomViteOptions): Plugin;
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EACV,MAAM,EAEP,MAAM,MAAM,CAAC;AAId,OAAO,EAEL,KAAK,sBAAsB,EAC5B,MAAM,WAAW,CAAC;AAUnB,wBAAgB,WAAW,CACzB,KAAK,EAAE,sBAAsB,GAC5B,MAAM,CAwIR"}
1
+ {"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAGV,MAAM,EAEP,MAAM,MAAM,CAAC;AAKd,OAAO,EAEL,KAAK,sBAAsB,EAC5B,MAAM,WAAW,CAAC;AAUnB,wBAAgB,WAAW,CACzB,KAAK,EAAE,sBAAsB,GAC5B,MAAM,CAwKR"}
package/dist/state.d.ts CHANGED
@@ -1,12 +1,13 @@
1
1
  /**
2
2
  * Owns per-Vite-environment linked output and compilation coordination.
3
3
  */
4
+ import type { CompilerSourceMap } from '@memoized-dom/compiler';
4
5
  import type { CompiledGraph } from './graph/collector';
5
6
  export declare class AdapterState {
6
7
  readonly files: Set<string>;
7
8
  readonly output: Map<string, string>;
9
+ readonly maps: Map<string, CompilerSourceMap>;
8
10
  compiling: Promise<CompiledGraph> | undefined;
9
11
  replace(graph: CompiledGraph): void;
10
- invalidate(): void;
11
12
  }
12
13
  //# sourceMappingURL=state.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"state.d.ts","sourceRoot":"","sources":["../src/state.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAEvD,qBAAa,YAAY;IACvB,QAAQ,CAAC,KAAK,cAAqB;IACnC,QAAQ,CAAC,MAAM,sBAA6B;IAC5C,SAAS,EAAE,OAAO,CAAC,aAAa,CAAC,GAAG,SAAS,CAAC;IAE9C,OAAO,CAAC,KAAK,EAAE,aAAa,GAAG,IAAI;IAOnC,UAAU,IAAI,IAAI;CAGnB"}
1
+ {"version":3,"file":"state.d.ts","sourceRoot":"","sources":["../src/state.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAChE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAEvD,qBAAa,YAAY;IACvB,QAAQ,CAAC,KAAK,cAAqB;IACnC,QAAQ,CAAC,MAAM,sBAA6B;IAC5C,QAAQ,CAAC,IAAI,iCAAwC;IACrD,SAAS,EAAE,OAAO,CAAC,aAAa,CAAC,GAAG,SAAS,CAAC;IAE9C,OAAO,CAAC,KAAK,EAAE,aAAa,GAAG,IAAI;CAQpC"}
package/package.json CHANGED
@@ -1,8 +1,11 @@
1
1
  {
2
2
  "name": "@memoized-dom/vite",
3
- "version": "0.0.4",
3
+ "version": "0.0.6",
4
4
  "description": "Vite 8 adapter for connected memoized-dom module graphs",
5
5
  "type": "module",
6
+ "engines": {
7
+ "node": ">=24.11.0"
8
+ },
6
9
  "sideEffects": false,
7
10
  "files": [
8
11
  "dist"
@@ -15,14 +18,15 @@
15
18
  }
16
19
  },
17
20
  "scripts": {
18
- "build": "bun run ./scripts/clean.ts && esbuild ./src/index.ts --bundle --outfile=./dist/index.js --platform=node --format=esm --target=node20 --packages=external --minify && tsc -p tsconfig.build.json",
21
+ "build": "bun run ./scripts/clean.ts && esbuild ./src/index.ts --bundle --outfile=./dist/index.js --platform=node --format=esm --target=node24 --packages=external --minify && tsc -p tsconfig.build.json",
19
22
  "test": "vitest run --config vitest.config.ts",
20
23
  "bench": "bun run ./bench/run.ts"
21
24
  },
22
25
  "dependencies": {
23
- "@memoized-dom/compiler": "^0.0.3"
26
+ "@memoized-dom/compiler": "^0.0.5"
24
27
  },
25
28
  "peerDependencies": {
29
+ "@memoized-dom/runtime": "^0.0.6",
26
30
  "vite": "^8.0.0"
27
31
  },
28
32
  "publishConfig": {