{"id":16528459,"url":"https://github.com/rel1cx/compose-components","last_synced_at":"2025-10-28T10:31:14.521Z","repository":{"id":252848366,"uuid":"841610628","full_name":"Rel1cx/compose-components","owner":"Rel1cx","description":"Combine multiple React components (like providers) while maintaining fully typed props support. Up to 10x faster than using cloneElement.","archived":false,"fork":false,"pushed_at":"2025-06-16T11:34:05.000Z","size":302,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-10-13T15:33:09.705Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/Rel1cx.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"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}},"created_at":"2024-08-12T18:50:18.000Z","updated_at":"2025-06-16T11:34:08.000Z","dependencies_parsed_at":"2024-09-12T08:28:07.543Z","dependency_job_id":"51b8308b-0e4f-453c-adb2-5b0307382672","html_url":"https://github.com/Rel1cx/compose-components","commit_stats":null,"previous_names":["rel1cx/compose-components"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Rel1cx/compose-components","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rel1cx%2Fcompose-components","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rel1cx%2Fcompose-components/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rel1cx%2Fcompose-components/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rel1cx%2Fcompose-components/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Rel1cx","download_url":"https://codeload.github.com/Rel1cx/compose-components/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rel1cx%2Fcompose-components/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":281424646,"owners_count":26499021,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-28T02:00:06.022Z","response_time":60,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":[],"created_at":"2024-10-11T17:40:27.286Z","updated_at":"2025-10-28T10:31:14.200Z","avatar_url":"https://github.com/Rel1cx.png","language":"TypeScript","readme":"# compose-components\n\nCombine multiple React components (like providers) while maintaining fully typed props support. Up to **10 times faster** than using `cloneElement`.\n\n## Installation\n\n```bash\npnpm install compose-components\n```\n\n## Usage\n\n```tsx\nimport { ComposeComponents, composeComponents } from \"compose-components\";\n\nconst App = () =\u003e (\n  \u003cComposeComponents\n    renderComponents={composeComponents(\n      [PaletteProvider, { mode: \"light\" }],\n      [LayoutProvider, { layout: \"default\" }],\n      [TypographyProvider, { font: \"sans\" }],\n    )}\n  \u003e\n    \u003cdiv\u003eApp\u003c/div\u003e\n  \u003c/ComposeComponents\u003e\n);\n\ndeclare function PaletteProvider({ children }: React.PropsWithChildren\u003c{ mode: \"light\" | \"dark\" }\u003e): React.ReactNode;\ndeclare function LayoutProvider({ children }: React.PropsWithChildren\u003c{ layout: \"default\" | \"full\" }\u003e): React.ReactNode;\ndeclare function TypographyProvider({ children }: React.PropsWithChildren\u003c{ font: \"sans\" | \"serif\" }\u003e): React.ReactNode;\n```\n\n## Performance\n\nSince `cloneElement` is not used, this approach is nearly **10x** faster than the version that uses `cloneElement`.\n\n```bash\ncompose-components [ main][+][📦 v0.0.0][ v22.6.0]\n❯ pnpm benchmark\n\n\u003e compose-components@0.0.0 benchmark\n\u003e pnpm -F \"./benchmark\" run start\n\n\n\u003e benchmark@0.0.0 start compose-components/benchmark\n\u003e tsx ./main.tsx\n\n┌─────────┬────────────────────────┬─────────────┬───────────────────┬──────────┬─────────┐\n│ (index) │ Task Name              │ ops/sec     │ Average Time (ns) │ Margin   │ Samples │\n├─────────┼────────────────────────┼─────────────┼───────────────────┼──────────┼─────────┤\n│ 0       │ 'with cloneElement'    │ '222,705'   │ 4490.229389930139 │ '±0.25%' │ 66812   │\n│ 1       │ 'without cloneElement' │ '2,049,821' │ 487.8472469985147 │ '±0.35%' │ 614947  │\n└─────────┴────────────────────────┴─────────────┴───────────────────┴──────────┴─────────┘\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frel1cx%2Fcompose-components","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frel1cx%2Fcompose-components","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frel1cx%2Fcompose-components/lists"}