{"id":28534576,"url":"https://github.com/weavejester/flupot","last_synced_at":"2025-08-19T09:11:15.391Z","repository":{"id":31442551,"uuid":"35006224","full_name":"weavejester/flupot","owner":"weavejester","description":"ClojureScript functions for creating React elements","archived":false,"fork":false,"pushed_at":"2016-05-26T18:51:26.000Z","size":35,"stargazers_count":44,"open_issues_count":3,"forks_count":2,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-07-07T22:39:22.454Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Clojure","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/weavejester.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}},"created_at":"2015-05-04T00:35:52.000Z","updated_at":"2025-03-24T07:58:48.000Z","dependencies_parsed_at":"2022-09-09T10:22:55.226Z","dependency_job_id":null,"html_url":"https://github.com/weavejester/flupot","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/weavejester/flupot","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/weavejester%2Fflupot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/weavejester%2Fflupot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/weavejester%2Fflupot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/weavejester%2Fflupot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/weavejester","download_url":"https://codeload.github.com/weavejester/flupot/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/weavejester%2Fflupot/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270579764,"owners_count":24610071,"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-08-15T02:00:12.559Z","response_time":110,"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":"2025-06-09T17:11:56.921Z","updated_at":"2025-08-19T09:11:15.377Z","avatar_url":"https://github.com/weavejester.png","language":"Clojure","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Flupot\n\nA ClojureScript library for creating [React][] elements, in a similar\nstyle to [Om][]'s `om.dom` namespace.\n\n[react]: https://facebook.github.io/react/\n[om]: https://github.com/omcljs/om\n\n## Installation\n\nAdd the following to your project `:dependencies`:\n\n    [flupot \"0.4.0\"]\n\n## Basic Usage\n\nRequire the `flupot.dom` namespace:\n\n```clojure\n(ns flupot.example\n  (:require [flupot.dom :as dom]))\n```\n\nThere is a function for each DOM element:\n\n```clojure\n(dom/div (dom/p \"Hello World\"))\n```\n\nIf the first argument is a map, it's used as the element's attributes:\n\n```clojure\n(dom/div {:class \"foo\"} (dom/p \"Hello World\"))\n```\n\nSpecial React options like `:key` are also supported.\n\nThe `class` attribute may be specified as a collection:\n\n```clojure\n(dom/p {:class [\"foo\" \"bar\"]} \"Hello World\")\n```\n\nAnd the `style` attribute may be specified as a map:\n\n```clojure\n(dom/p {:style {:color :red}} \"Hello World\")\n```\n\nIf one of the child arguments is a seq, it's expanded out automatically:\n\n```clojure\n(dom/ul\n (for [i (range 5)]\n   (dom/li {:key i} i)))\n```\n\n## Advanced Usage\n\nFlupot can also be used to define your own wrappers around React\nelements or similar libraries (such as [react-pixi][]). You probably\nwon't need to do this! But just in case...\n\nThere are two macros that allow you to do this: `defelement-fn` and\n`defelement-macro`.\n\n`defelement-fn` generates a function around an element method, with an\noptional attribute transformation function:\n\n```clojure\n(require '[flupot.core :refer [defelement-fn]])\n\n(defelement-fn span\n  :elemf React.DOM.span\n  :attrf cljs.core/clj-\u003ejs)\n```\n\nThis generates a function `span` that wraps `React.DOM.span`. The\nattribute map is transformed with the `cljs.core/clj-\u003ejs` function.\n\nComplementing this is `defelement-macro`. This generates a macro that\nwill try to pre-compile as much as possible. If you give the macro the\nsame name as the function defined by `defelement-fn`, ClojureScript\nwill choose the macro when possible, and fall back to the function\notherwise.\n\n```clojure\n(require '[flupot.core :refer [defelement-macro]])\n\n(defelement-macro span\n  :elemf React.DOM.span\n  :attrf cljs.core/clj-\u003ejs\n  :attrm flupot.core/clj-\u003ejs)\n```\n\nThis macro has third keyword argument, `:attrm`, which defines a\nfunction that is applied inside the macro. The `flupot.core/clj-\u003ejs`\nfunction mimics `cljs.core/clj-\u003ejs`, except that it attempts to\nperform as much as the conversion as possible during compile time.\n\n[react-pixi]: https://github.com/Izzimach/react-pixi/\n\n## License\n\nCopyright © 2016 James Reeves\n\nDistributed under the Eclipse Public License either version 1.0 or (at\nyour option) any later version.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fweavejester%2Fflupot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fweavejester%2Fflupot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fweavejester%2Fflupot/lists"}