{"_id":"@deijose/nix-js-compiler","name":"@deijose/nix-js-compiler","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@deijose/nix-js-compiler","version":"1.0.0","description":"Build-time compiler for Nix.js html`` templates — pre-computes descriptors, pathMaps, and generates direct node access code.","type":"module","main":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"scripts":{"build":"tsc","test":"vitest run","prepublishOnly":"npm run build"},"keywords":["nix-js","compiler","template","dom","reactive","signals","vite"],"author":{"name":"DeijoseDevelop"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/DeijoseDevelop/nix-js-compiler.git"},"homepage":"https://github.com/DeijoseDevelop/nix-js-compiler#readme","bugs":{"url":"https://github.com/DeijoseDevelop/nix-js-compiler/issues"},"devDependencies":{"typescript":"^7.0.0","vitest":"^4.1.11"},"_id":"@deijose/nix-js-compiler@1.0.0","gitHead":"46209560fdecde6481f003b4803b5aa8961e1a97","_nodeVersion":"22.14.0","_npmVersion":"10.9.9","dist":{"integrity":"sha512-26T+xTJ6FdBkv/Nl9Gqwfh8jz3A4GR1PzbSkwS3FzF9JjM7UTY54/lwmq8ggqK/VVPu6l2ayVT98nsMB6PO/Rg==","shasum":"5617a267dca516c4c628ef714b602f5a1c161526","tarball":"https://registry.npmjs.org/@deijose/nix-js-compiler/-/nix-js-compiler-1.0.0.tgz","fileCount":32,"unpackedSize":115904,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQCFAWgcA+2oZdsRtWyGfGEW1ZSPFGX9OriMjLtDFlLyKAIgHBiSA4k4V7M+2owGpToG3rSpWGv9SulwiFcmp48UpFI="}]},"_npmUser":{"name":"deijose","email":"estudiandovazmore@gmail.com"},"directories":{},"maintainers":[{"name":"deijose","email":"estudiandovazmore@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/nix-js-compiler_1.0.0_1787601133290_0.5056637534241222"},"_hasShrinkwrap":false}},"time":{"created":"2026-08-24T19:52:13.101Z","1.0.0":"2026-08-24T19:52:13.429Z","modified":"2026-08-24T19:52:13.651Z"},"maintainers":[{"name":"deijose","email":"estudiandovazmore@gmail.com"}],"description":"Build-time compiler for Nix.js html`` templates — pre-computes descriptors, pathMaps, and generates direct node access code.","homepage":"https://github.com/DeijoseDevelop/nix-js-compiler#readme","keywords":["nix-js","compiler","template","dom","reactive","signals","vite"],"repository":{"type":"git","url":"git+https://github.com/DeijoseDevelop/nix-js-compiler.git"},"author":{"name":"DeijoseDevelop"},"bugs":{"url":"https://github.com/DeijoseDevelop/nix-js-compiler/issues"},"license":"MIT","readme":"# @deijose/nix-js-compiler\n\nBuild-time compiler for [Nix.js](https://github.com/DeijoseDevelop/nix-js-microframework) `html\\`\\`` templates.\n\n## What it does\n\n- Parses `html\\`\\`` tagged template literals at build time\n- Analyzes binding contexts (nodes, attributes, events)\n- Generates direct DOM manipulation code (firstChild/nextSibling navigation)\n- Eliminates runtime TreeWalker, detectContext, and buildHTML overhead\n- Produces specialized factories that clone templates and set up bindings directly\n- Falls back to generic compiled templates when specialization is unsafe\n\n## Performance\n\nBenchmarked against the [js-framework-benchmark](https://github.com/krausest/js-framework-benchmark) methodology (5 runs, 15 iterations each):\n\n- **create 1k**: -24.7% vs runtime-only\n- **replace 1k**: -26.8%\n- **update 10th**: -39.4%\n- **clear 1k**: -44.0%\n- **create 10k**: -25.1%\n\nNix.js + compiler matches or beats Solid on 6 of 9 CPU benchmarks, with lower memory and faster startup.\n\n## Usage\n\nThis compiler is used internally by [`@deijose/vite-plugin-nix-js`](https://github.com/DeijoseDevelop/vite-plugin-nix). You don't typically use it directly.\n\n```ts\nimport { compileTemplate, genFactoryCode } from \"@deijose/nix-js-compiler\";\n\nconst compiled = compileTemplate(strings, expressionKinds);\nconst factory = genFactoryCode(\"_nixFactory$1\", compiled);\n// factory.code → generated JS string\n// factory.runtimeImports → runtime helpers needed\n```\n\n## License\n\nMIT\n","readmeFilename":"README.md","_rev":"1-919b228638fb572bdf11ae4e1ba9a0d9"}