{"id":18743962,"url":"https://github.com/dhl/omkara","last_synced_at":"2025-07-30T23:34:25.742Z","repository":{"id":13153123,"uuid":"15835767","full_name":"dhl/omkara","owner":"dhl","description":"A starting point for Clojure web apps based on the Om/React.js library","archived":false,"fork":false,"pushed_at":"2014-01-13T16:32:53.000Z","size":398,"stargazers_count":1,"open_issues_count":0,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-20T06:37:16.631Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"epl-1.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dhl.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}},"created_at":"2014-01-12T03:34:55.000Z","updated_at":"2021-12-18T23:23:58.000Z","dependencies_parsed_at":"2022-08-25T20:21:53.874Z","dependency_job_id":null,"html_url":"https://github.com/dhl/omkara","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/dhl/omkara","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dhl%2Fomkara","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dhl%2Fomkara/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dhl%2Fomkara/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dhl%2Fomkara/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dhl","download_url":"https://codeload.github.com/dhl/omkara/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dhl%2Fomkara/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267960827,"owners_count":24172507,"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-07-30T02:00:09.044Z","response_time":70,"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-11-07T16:13:17.476Z","updated_at":"2025-07-30T23:34:25.684Z","avatar_url":"https://github.com/dhl.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# omkara\n\nA starting point for Clojure web apps based on the Om/React.js library.\n\nIt makes good the promise of \"write once, run client and server side\" for HTML templates.  While the repository in it's current state is a bit rough, I hope you will take the time to fork it, make it better, and submit pull requests so that we, as the Clojure community, can have an example project to point to for those who want to get started with [Om/React](https://github.com/swannodette/om).\n\n## Server-side rendering\n\nThe `omkara.react` namespace is a simple implementation of server-side rendering of [Om/React](https://github.com/swannodette/om) templates.  Adjusting to your own needs should be straight-forward once you understand the basic architecture.\n\nThe [react.js](https://github.com/facebook/react) library can be used outside a browser, however, you need to supply a global object named `global` or `self` for the library to install itself into.  Omkara uses the `:preamble` option of [cljsbuild](https://github.com/emezeske/lein-cljsbuild) to create a javascript file along the lines of\n\n```javascript\nvar global = {}\n\n/* react.js source which installs itself in global.React */\n\nvar React = global.React; // create a React property on the global js object\n\n/* compiled clojurescript code follows */\n```\n\nThis can be fed to [Rhino](https://github.com/mozilla/rhino) and allows you to call `React.renderComponentToString()` to perform server-side rendering.  See the comments in `omkara.react` for some gotchas when dealing with Rhino.\n\n## Understanding Om\n\nIf you're looking into Om 0.1.0-SNAPSHOT for the first time, here are a couple of things to keep in mind:\n\n1. `om.core/component` doesn't create a React component.  It creates an object which implements `IRender` but which needs to be passed to `om.core/pure` to create an actual component via `React.createClass`.\n\n2. `om.core/root` takes a function as its second argument which returns rendering code wrapped in `om.core/component`.  See `omkara.datetime/render` for how to eventually create a React component.\n\n3. You will want to make your own global state atom and pass that to `om.core/root` as the first argument.  Otherwise, you won't have a reference to update when app data needs to be updated. See the code in `omkara.datetime` for details.\n\n## If you're new to Clojurescript...\n\nYou should be aware of the following *peculiarities* before charging in:\n\n1. The compiler option `:optimizations :none` is completely different than `:optimizations :simple|:whitespace|:advanced`.  The output file will asynchronously load files in the `:output-dir` which you will need to either place in a folder you are already serving static files from, or have special code to serve only during development.  The other optimization options will pack everything into a single file.\n\n2. The options `:libs` and `:foreign-libs` aren't particularly helpful.  All they do is trigger a recompile if one of the referenced files changes.  They do *not* add the javascript library code to the `:output-to` javascript file.  Use `:preamble` for this instead.\n\n3. The option `:preamble` only works for `:optimizations :simple|:whitespace|:advanced`.  It does nothing for `:optimization :none`.\n\n4. It's easy to create compiled ClojureScript which will not run headless in Rhino.  Particularly, using `clojure.browser.repl` brings in code which manipulates `window.location` which means that any embedded or headless build needs to exclude this code.  See the \"embedded\" cljsbuild for a way to conditionally bring in the nREPL code by keeping it in a separate directory.\n\n## License\n\nCopyright © 2013 brendanyounger\n\nDistributed under the Eclipse Public License, the same as Clojure.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdhl%2Fomkara","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdhl%2Fomkara","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdhl%2Fomkara/lists"}