{"id":47698147,"url":"https://github.com/lukekania/ngc-rs","last_synced_at":"2026-04-28T11:01:35.701Z","repository":{"id":347558872,"uuid":"1194023396","full_name":"lukekania/ngc-rs","owner":"lukekania","description":"Fast Angular build toolchain written in Rust","archived":false,"fork":false,"pushed_at":"2026-04-24T06:00:59.000Z","size":791,"stargazers_count":0,"open_issues_count":17,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-24T08:02:43.963Z","etag":null,"topics":["angular","build-tool","cli","performance","rust","typescript"],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lukekania.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-03-27T20:46:10.000Z","updated_at":"2026-04-24T05:59:34.000Z","dependencies_parsed_at":null,"dependency_job_id":"854c9971-0bfe-4448-a4c8-b32d48196ae4","html_url":"https://github.com/lukekania/ngc-rs","commit_stats":null,"previous_names":["lukekania/ngc-rs"],"tags_count":36,"template":false,"template_full_name":null,"purl":"pkg:github/lukekania/ngc-rs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lukekania%2Fngc-rs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lukekania%2Fngc-rs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lukekania%2Fngc-rs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lukekania%2Fngc-rs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lukekania","download_url":"https://codeload.github.com/lukekania/ngc-rs/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lukekania%2Fngc-rs/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32377599,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-28T09:24:15.638Z","status":"ssl_error","status_checked_at":"2026-04-28T09:24:15.071Z","response_time":56,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["angular","build-tool","cli","performance","rust","typescript"],"created_at":"2026-04-02T16:49:54.368Z","updated_at":"2026-04-28T11:01:35.697Z","avatar_url":"https://github.com/lukekania.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ngc-rs\n\nA native Rust replacement for `ng build` in Angular projects. Drop-in swap, **~10× faster on real-world apps**.\n\n### Benchmarks\n\n| Project | `ngc-rs` | `ng build` | Speedup |\n|---------|----------|------------|---------|\n| Production Angular v21 app (~1,200 modules, 14 lazy chunks) | **~380 ms** | ~3,800 ms | **~10×** |\n\nMeasured with [hyperfine](https://github.com/sharkdp/hyperfine) on Apple Silicon, `-c production` (source maps, minification, tree shaking, content-hashed filenames).\n\n\u003e **Status: v0.7.18 — parallel build pipeline**\n\u003e ngc-rs reads `angular.json`, compiles templates to Ivy, bundles with code splitting, and emits production-ready output with source maps, minified code, tree-shaken exports, and content-hashed filenames. Every hot stage — project resolution, template compilation, TS transform, npm dependency crawl, Angular linker, tree-shaking, bundling, and minification — runs across rayon worker threads.\n\u003e See the [milestones](https://github.com/lukekania/ngc-rs/milestones) for the roadmap toward a full `ng build` replacement.\n\n## Why is it faster?\n\nThe Angular CLI build pipeline runs on Node.js and is largely single-threaded. ngc-rs replaces it with a Rust binary that is multi-threaded end-to-end:\n\n- **[oxc](https://oxc.rs/)** for native JS/TS parsing, codegen, and minification\n- **[rayon](https://github.com/rayon-rs/rayon)** for parallel per-file work at every stage\n- **[petgraph](https://github.com/petgraph/petgraph)** for the file dependency graph\n- **[dashmap](https://github.com/xacrimon/dashmap)** for a shared `canonicalize()` cache across worker threads — collapses duplicate filesystem `stat` syscalls\n\nAdditional wins on the critical path:\n- **PostCSS/Tailwind subprocess overlaps with bundling** rather than running after it — ~200 ms of wallclock absorbed\n- **Per-chunk bundling, minification, and tree-shake** all fan out to worker threads\n- **npm dependency BFS** resolves each frontier level in parallel\n- **Linker** (`ɵɵngDeclare*` → `ɵɵdefine*` for partially-compiled npm packages) processes all three of its passes in parallel\n\nType-checking is delegated to `tsc --noEmit` as a subprocess — we don't reimplement the TypeScript type system.\n\n## Installation\n\n```sh\ncargo install --git https://github.com/lukekania/ngc-rs\n```\n\nOr build from source:\n\n```sh\ngit clone https://github.com/lukekania/ngc-rs.git\ncd ngc-rs\ncargo build --release\n```\n\nThe binary will be at `target/release/ngc-rs`.\n\n## Usage\n\n### `ngc-rs info`\n\nResolve the project file graph and print a summary:\n\n```sh\nngc-rs info --project tsconfig.json\n```\n\n```\nngc-rs project info\n  Files:          1247\n  Entry points:   3\n  Edges:          4891\n  Unresolved:     12\n```\n\n### `ngc-rs build`\n\nCompile templates, transform TypeScript, and produce browser-ready output:\n\n```sh\nngc-rs build --project tsconfig.app.json\n```\n\nWhen an `angular.json` is found, ngc-rs reads styles, assets, polyfills, and file replacements from it automatically. Output includes:\n\n- `dist/main.{hash}.js` — ESM bundle with Ivy-compiled templates (content-hashed in production)\n- `dist/chunk-*.{hash}.js` — lazy-loaded route chunks\n- `dist/main.{hash}.js.map` — source maps (production: external files, development: inline)\n- `dist/index.html` — with injected script/style tags\n- `dist/styles.css` — concatenated global stylesheets\n- `dist/polyfills.js` — polyfill imports\n- `dist/assets/` — copied static assets\n- `dist/3rdpartylicenses.txt` — third-party license texts\n\nAdditional flags:\n\n```sh\n# Production build (minification, source maps, content hashes, npm bundling)\nngc-rs build --project tsconfig.app.json -c production\n\n# Development build (no optimizations, fast iteration)\nngc-rs build --project tsconfig.app.json\n\n# Machine-readable JSON output\nngc-rs build --project tsconfig.app.json --output-json\n```\n\n### Benchmark comparison\n\nReproduce the headline number against `ng build` with [hyperfine](https://github.com/sharkdp/hyperfine):\n\n```sh\ncargo build --release\n\nhyperfine --warmup 3 \\\n  \"./target/release/ngc-rs build --project /path/to/tsconfig.app.json --out-dir /tmp/ngc-rs-out -c production\" \\\n  \"npx ng build --configuration production\"\n```\n\nRun the `ng build` invocation from inside the Angular project directory, or pass a `cwd` flag. Both commands include full production optimizations.\n\n## Development\n\n```sh\n# Run tests\ncargo test --workspace\n\n# Lint\ncargo clippy --workspace --all-targets -- -D warnings\n\n# Format\ncargo fmt --all\n\n# All checks (CI runs this)\ncargo test --workspace \u0026\u0026 cargo clippy --workspace --all-targets -- -D warnings \u0026\u0026 cargo fmt --check\n```\n\n## Roadmap\n\nSee the [GitHub milestones](https://github.com/lukekania/ngc-rs/milestones) for the full plan:\n\n- **v0.1** — Project Resolver ✅\n- **v0.2** — TS Transform ✅ (strip types with oxc, emit plain JS)\n- **v0.3** — Bundling ✅ (ESM concatenation with dependency ordering)\n- **v0.4** — Angular Template Compiler ✅ (Ivy codegen, pest parser)\n- **v0.5** — Build Output Completeness ✅ (angular.json, index.html, styles, assets, polyfills, fileReplacements)\n- **v0.6** — Code Splitting \u0026 Lazy Routes ✅ (dynamic import detection, chunk graph, multi-file output)\n- **v0.7** — Source Maps \u0026 Optimization ✅ (source maps, minification, content hashing, npm bundling)\n- **v0.7.x** — Angular 21 \u0026 Performance ✅ (full-pipeline rayon parallelism, overlapped PostCSS, canonicalize cache — 4.2× → ~10× vs `ng build`)\n- **v0.8** — Watch Mode \u0026 Dev Server\n- **v1.0** — Angular CLI Drop-in (swap one line in `angular.json`). Angular linker for partially-compiled npm packages already landed.\n\n## Contributing\n\nContributions are welcome! Please see [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.\n\n## License\n\n[MIT](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flukekania%2Fngc-rs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flukekania%2Fngc-rs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flukekania%2Fngc-rs/lists"}