{"id":24848661,"url":"https://github.com/yhwh-script/elements","last_synced_at":"2025-10-14T20:30:42.680Z","repository":{"id":273783796,"uuid":"920870010","full_name":"yhwh-script/elements","owner":"yhwh-script","description":"A lifecycle implementation of customElements for WebComponents.","archived":false,"fork":false,"pushed_at":"2025-01-30T15:30:46.000Z","size":490,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-30T16:28:55.383Z","etag":null,"topics":["customelements","javascript","javascript-framework","sfc","webcomponents"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/@yhwh-script/elements","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"unlicense","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/yhwh-script.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":"2025-01-22T23:02:22.000Z","updated_at":"2025-01-30T15:30:49.000Z","dependencies_parsed_at":null,"dependency_job_id":"4d2639cc-8d34-4c5e-b963-26a87138bd3c","html_url":"https://github.com/yhwh-script/elements","commit_stats":null,"previous_names":["yhwh-script/elements"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yhwh-script%2Felements","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yhwh-script%2Felements/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yhwh-script%2Felements/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yhwh-script%2Felements/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yhwh-script","download_url":"https://codeload.github.com/yhwh-script/elements/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":236382952,"owners_count":19140403,"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":["customelements","javascript","javascript-framework","sfc","webcomponents"],"created_at":"2025-01-31T12:16:41.206Z","updated_at":"2025-10-14T20:30:42.675Z","avatar_url":"https://github.com/yhwh-script.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# elements\nThis is a minimalistic, reactive **lifecycle implementation of customElements for WebComponents**. Check it out!\n\n## Installation\nIt is recommended to use npx\n\n```npx @yhwh-script/create-app {YOUR_PROJECT}```\n\nHowever, you can also clone this repository:\n\n```git clone https://github.com/yhwh-script/elements.git\n   cd elements\n   npm install\n   npm run dev\n```\n\n## How-To\n- create single file HTML components as customElements with `\u003cscript\u003e`, `\u003cstyle\u003e` and `\u003ctemplate\u003e` under `./public/elements/{prefix}/{prefix}-{suffix}.html` \n- use them as usual customElements `\u003cprefix-suffix\u003e`\n- you have access to the `shadowDocument` and `state`\n- set state by `shadowDocument.host.dataset.state = JSON.stringify({newState})`\n- use event bubbling\n\n## NO-GOs\n- **never** `addEventListener` to `shadowDocument`\n\n## Further reading\n- Check out my [examples project](https://github.com/yhwh-script/examples)\n- the [SQLite extension](https://github.com/yhwh-script/sqlite)\n- or (recommended) the [SQLite extension with examples](https://github.com/yhwh-script/sqlite-examples)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyhwh-script%2Felements","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyhwh-script%2Felements","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyhwh-script%2Felements/lists"}