{"id":18347686,"url":"https://github.com/ghivert/web-components-kickstart","last_synced_at":"2026-04-28T01:32:51.900Z","repository":{"id":87233905,"uuid":"246354839","full_name":"ghivert/web-components-kickstart","owner":"ghivert","description":"Write WebComponents directly in Clojure, without hassle!","archived":false,"fork":false,"pushed_at":"2020-08-23T23:28:09.000Z","size":83,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-13T18:09:57.060Z","etag":null,"topics":["clojurescript","custom-elements","web-components"],"latest_commit_sha":null,"homepage":"","language":"Clojure","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/ghivert.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}},"created_at":"2020-03-10T16:40:32.000Z","updated_at":"2020-08-23T23:28:06.000Z","dependencies_parsed_at":"2023-03-13T19:37:43.328Z","dependency_job_id":null,"html_url":"https://github.com/ghivert/web-components-kickstart","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ghivert/web-components-kickstart","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ghivert%2Fweb-components-kickstart","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ghivert%2Fweb-components-kickstart/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ghivert%2Fweb-components-kickstart/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ghivert%2Fweb-components-kickstart/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ghivert","download_url":"https://codeload.github.com/ghivert/web-components-kickstart/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ghivert%2Fweb-components-kickstart/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32362781,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-27T20:07:02.737Z","status":"ssl_error","status_checked_at":"2026-04-27T20:07:00.910Z","response_time":128,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5: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":["clojurescript","custom-elements","web-components"],"created_at":"2024-11-05T21:14:40.276Z","updated_at":"2026-04-28T01:32:51.884Z","avatar_url":"https://github.com/ghivert.png","language":"Clojure","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Web Components Kickstart\n\nWeb components are great. But you probably thought « Gosh, this seems too much complicated for me! Let's rest in re-frame! ». And you probably would be right. But we're in Lisp there, and we can extend the language as much as we want. So let's try adding Web Components easily!\n\n# Getting Started\n\nGet the code. Do how you want, because this package is, of course, still not published yet.\n\nOh, I almost forgot! Run Shadow CLJS. It's cool. It's the best ClojureScript experience you can expect right now.\n\n# Using the package.\n\nOk, the hard part. Ready? Go.\n\n```clojure\n(ns my-awesome-app\n  (:require [component :refer-macros [defcomponent]]))\n\n(defcomponent my-awesome-component [value]\n  [:div \"Hello world! This is an awesome counter!\"\n   [:div\n    [:button {:on-click #(set-attribute :value (+ value 1))} \"+\"]\n    [:span (str value)]\n    [:button {:on-click #(set-attribute :value (- value 1))} \"-\"]]])\n\n(defcomponent ^:shadow my-awesome-component-open [value]\n  [:div \"Hello world! This is an awesome counter!\"\n   [:div\n    [:button {:on-click #(set-attribute :value (+ value 1))} \"+\"]\n    [:span (str value)]\n    [:button {:on-click #(set-attribute :value (- value 1))} \"-\"]]])\n\n(defcomponent ^{:shadow :closed} my-awesome-component-closed [value]\n  [:div \"Hello world! This is an awesome counter!\"\n   [:div\n    [:button {:on-click #(set-attribute :value (+ value 1))} \"+\"]\n    [:span (str value)]\n    [:button {:on-click #(set-attribute :value (- value 1))} \"-\"]]])\n\n(defcomponent lifecycled-component\n  {:on-enter (fn [this] (println \"Enter\"))\n   :on-update (fn [this] (println \"Update\"))\n   :on-exit (fn [this] (println \"Out\"))\n   :props [\"value\"]\n   :render (fn [{:keys [value]}]\n             [:div \"Hello world! This is a lifecycle counter!\"\n              [:div\n               [:button {:on-click #(set-attribute :value (+ value 1))} \"+\"]\n               [:span (str value)]\n               [:button {:on-click #(set-attribute :value (- value 1))} \"-\"]]])})\n\n(defn -main []\n  (-\u003e (js/document.getElementById \"app\")\n    (.appendChild (awesome-counter {:value 0}))))\n```\n\nYou're done.\n\nThis will create a WebComponent, register it in the Custom Elements registry, and mount one in the DOM. Try it, it’s working!\n\nOh, of course you can use hiccup. That’s the best HTML representation no? 😉 Oh. And of course it runs a virtual DOM (well, I should say « It should run a virtual DOM », because it’s not yet implemented) because that’s the easiest way to run DOM diffing no?\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fghivert%2Fweb-components-kickstart","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fghivert%2Fweb-components-kickstart","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fghivert%2Fweb-components-kickstart/lists"}