{"id":19501272,"url":"https://github.com/acryps/vldom","last_synced_at":"2026-07-23T22:30:15.383Z","repository":{"id":63044983,"uuid":"351567524","full_name":"acryps/vldom","owner":"acryps","description":"simple component system","archived":false,"fork":false,"pushed_at":"2023-08-09T13:35:55.000Z","size":107,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-08T10:14:38.730Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/acryps.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2021-03-25T20:30:21.000Z","updated_at":"2022-08-01T12:03:30.000Z","dependencies_parsed_at":"2024-11-10T22:22:16.197Z","dependency_job_id":null,"html_url":"https://github.com/acryps/vldom","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/acryps%2Fvldom","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/acryps%2Fvldom/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/acryps%2Fvldom/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/acryps%2Fvldom/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/acryps","download_url":"https://codeload.github.com/acryps/vldom/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240749066,"owners_count":19851399,"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","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-11-10T22:12:12.150Z","updated_at":"2026-07-23T22:30:15.298Z","avatar_url":"https://github.com/acryps.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![npm version](http://badge.acryps.com/npm/vldom)](http://badge.acryps.com/go/npm/vldom)\n\n\u003cimg src=\"logo.svg\" height=\"50\"\u003e\n\n# vldom TypeScript Frontend Component System\n\nSimple component system with integrated routing.\n\n\u003e version 9: new engine, even more efficient\n\n## Setup\nYou\"ll need to enable jsx in your tsconfig\n\u003cpre\u003e{\n\t\"compileOnSave\": false,\n\t\"compilerOptions\": {\n\t\t\u003cb\u003e\"jsx\": \"react\",\n\t\t\"jsxFactory\": \"this.createElement\",\u003c/b\u003e\n\t\t....\n\t}\n}\u003c/pre\u003e\n\nCompile your client with `tsc` and `vldom compile`!\n```\ntsc \u0026\u0026 vldom compile\n```\n\n## Usage\nCreate a component by extending the component class\n\n```\nexport class ExampleComponent extends Component {\n\tconstructor() {\n\t\tsuper();\n\t}\n\n\trender() {\n\t\treturn \u003csection\u003e\n\t\t\tExample Component!\n\t\t\u003c/section\u003e;\n\t}\n}\n\nnew ExampleComponent().host(document.body);\n```\n\nLet\"s extends this by creating a recursive component\n\n```\nexport class ExampleRecursiveComponent extends Component {\n\tconstructor(private index: number) {\n\t\tsuper();\n\t}\n\n\trender() {\n\t\treturn \u003csection\u003e\n\t\t\tComponent {this.index}\n\n\t\t\t{index \u003e 0 \u0026\u0026 new ExampleRecursiveComponent(index - 1)}\n\t\t\u003c/section\u003e;\n\t}\n}\n\nnew ExampleRecursiveComponent(10).host(document.body);\n```\n\n## Router\nvldom has a built-in router\n```\nconst router = new Router(PageComponent\n\t.route(\"/home\", HomeComponent),\n\t.route(\"/books\", BooksComponent\n\t\t.route(\"/:id\", BookComponent)\n\t)\n);\n\nclass PageComponent extends Component {\n\trender(child) {\n\t\treturn \u003cmain\u003e\n\t\t\t\u003cnav\u003eApp\u003c/nav\u003e\n\n\t\t\t{child}\n\t\t\u003c/main\u003e;\n\t}\n}\n\nclass HomeComponent extends Component {\n\trender() {\n\t\treturn \u003cp\u003eWelcome to my Book Store\u003c/p\u003e;\n\t}\n}\n\nclass BooksComponent extends Component {\n\trender() {\n\t\treturn \u003csection\u003e\n\t\t\t\u003ch1\u003eBooks!\u003c/h1\u003e\n\n\t\t\t\u003cbutton ui-href=\"someid\"\u003eSome Book!\u003c/button\u003e\n\t\t\u003c/section\u003e;\n\t}\n}\n\nclass BookComponent extends Component {\n\tparams: { id: string }\n\n\trender() {\n\t\treturn \u003cp\u003eBook with id {this.params.id}\u003c/p\u003e;\n\t}\n}\n\nrouter.host(document.body);\n\nonhashchange = () =\u003e router.update();\n```\n\n## Directives\nYou can create custom directives (attribute handlers).\n\n```\nComponent.directives[\"epic-link\"] = (element, value, tag, attributes, content) =\u003e {\n\telement.onclick = () =\u003e {\n\t\tlocation.href = value;\n\t}\n}\n\nexport class ExampleComponent extends Component {\n\tconstructor() {\n\t\tsuper();\n\t}\n\n\trender() {\n\t\treturn \u003csection\u003e\n\t\t\tTest \u003ca epic-link=\"http://github.com/\"\u003eLink\u003c/a\u003e\n\t\t\u003c/section\u003e;\n\t}\n}\n\nnew ExampleComponent().host(document.body);\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Facryps%2Fvldom","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Facryps%2Fvldom","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Facryps%2Fvldom/lists"}