{"id":16447261,"url":"https://github.com/junekelly/cljs-playtime","last_synced_at":"2025-02-26T11:40:36.757Z","repository":{"id":16750882,"uuid":"19508508","full_name":"JuneKelly/cljs-playtime","owner":"JuneKelly","description":"Playing with Clojurescript","archived":false,"fork":false,"pushed_at":"2014-05-06T19:57:51.000Z","size":708,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-09T04:30:53.412Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/JuneKelly.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":"2014-05-06T19:53:57.000Z","updated_at":"2014-05-06T19:57:52.000Z","dependencies_parsed_at":"2022-09-24T10:01:20.239Z","dependency_job_id":null,"html_url":"https://github.com/JuneKelly/cljs-playtime","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/JuneKelly%2Fcljs-playtime","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JuneKelly%2Fcljs-playtime/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JuneKelly%2Fcljs-playtime/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JuneKelly%2Fcljs-playtime/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JuneKelly","download_url":"https://codeload.github.com/JuneKelly/cljs-playtime/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240847842,"owners_count":19867609,"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-10-11T09:50:11.651Z","updated_at":"2025-02-26T11:40:36.726Z","avatar_url":"https://github.com/JuneKelly.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# cljsbuild-example-advanced\n\nThis is an example web application that uses [lein-cljsbuild][1],\n[Ring][2], and [Compojure][3]. It demonstrates several things:\n\n1. The use of lein-cljsbuild to build ClojureScript into JavaScript.\n2. How to share code between Clojure and ClojureScript, including macros.\n3. How to use lein-cljsbuild's various REPL commands.\n4. How to configure lein-cljsbuild to perform multiple parallel builds.\n\nTo play around with this example project, you will first need\n[Leiningen][4] installed.\n\n## Running the App\n\nSet up and start the server like this:\n\n    $ cd example-projects/advanced\n    $ lein ring server-headless 3000\n\n\u003e NOTE 1: You do not need to issue the `lein cljsbuild once`\n\u003e subtask. This is because `cljsbuild` has been hooked to `lein` tasks\n\u003e in the `project.clj` (i.e. `:hooks [leiningen.cljsbuild]`). This way\n\u003e when the above `lein ring server-headless 3000` subtask is executed,\n\u003e it implicitly executes the `lein compile` task which, in turn,\n\u003e implicitly executes the `lein cljsbuild once` subtask as well.\n\nNow, point your web browser at `http://localhost:3000`, and see the web app in action!\n\n## PhantomJS\n\n[PhantomJS] (http://www.phantomjs.org) is a headless Webkit browser, which can be automated\nvia Javascript.  It provides a Javascript execution environment with access to all browser\nfeatures (the DOM, etc), without opening a browser GUI.\n\nThe tests and the \"phantom-*\" REPLs require PhantomJS 1.3 or newer to be installed.\nThe process for accomplishing This is OS dependent.  See [PhantomJS] (http://www.phantomjs.org)\nfor information on installing it on your OS.\n\nIf you do not plan to run the tests and only want to use the rhino or firefox REPLs, you can skip this step.\n\n## Running the Tests\n\nTo run the unit tests:\n\n    $ lein cljsbuild test\n\nNote that if more than one test were configured in the project, the above command would\nrun all tests.  To run the \"unit\" tests in isolation:\n\n    $ lein cljsbuild test unit\n\nThe unit tests live in `test-cljs`.  They are written in ClojureScript, and thus must\nbe compiled, so they have their own entry in the `:builds` configuration.  Note that\nall of the `:source-path` entries from the `:builds` are added to the classpath, so\nthe tests can `:require` ClojureScript namespaces from, e.g., the `src-cljs` directory.\n\nSee the `phantom/unit-test.js` file for more details on how PhantomJS is configured to\nmake this work.\n\n## Connecting Firefox to a REPL\n\nFirst, in one terminal, start the Ring server:\n\n    $ lein ring server-headless 3000\n\nNow, in a different terminal, run `repl-launch` with the \"firefox\" identifier and the URL of the REPL demo page:\n\n    $ lein trampoline cljsbuild repl-launch firefox http://localhost:3000/repl-demo\n\nThe REPL should start, and in a moment, Firefox should start up and browse to the `repl-demo`\npage.  Viewing the source for `repl-demo`, you'll see that after loading the main JavaScript\nfile, it calls `example.repl.connect()`.  This function connects back to the REPL, thereby\nallowing you to execute arbitrary ClojureScript code in the context of the `repl-demo` page.\n\nThere's also a launcher configured for a \"naked\" page.  This is just a simple static\nHTML page that will connect to the REPL.  This is convenient when you want to run\na ClojureScript REPL with access to your project, but don't need a specific page to\nbe loaded at the time.  The biggest advantage to the \"naked\" launcher is that you don't\nneed to have your app running in the background:\n\n    $ lein trampoline cljsbuild repl-launch firefox-naked\n\n## Connecting PhantomJS to a REPL\n\nTo try out a PhantomJS-based REPL, first start the Ring server in one terminal:\n\n    $ lein ring server-headless 3000\n\nNow, in a different terminal, run `repl-launch` with the \"phantom\" identifier and the URL of the REPL demo page:\n\n    $ lein trampoline cljsbuild repl-launch phantom http://localhost:3000/repl-demo\n\nThe REPL should start, and in a moment, PhantomJS should start up and browse to the `repl-demo`\npage, in the background.  This is a convenient way to interact with your application in cases\nwhere you don't need to open a full browser UI.\n\nAs with the Firefox example, there's a launch configured for a \"naked\" page.  This is probably\nthe most convenient way to launch a REPL when you just want to try running a couple snippets\nof ClojureScript code.  As with the \"firefox-naked\" launcher, you don't need your app to be\nrunning in the background:\n\n    $ lein trampoline cljsbuild repl-launch phantom-naked\n\n[1]: https://github.com/emezeske/lein-cljsbuild\n[2]: https://github.com/mmcgrana/ring\n[3]: https://github.com/weavejester/compojure\n[4]: https://github.com/technomancy/leiningen\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjunekelly%2Fcljs-playtime","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjunekelly%2Fcljs-playtime","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjunekelly%2Fcljs-playtime/lists"}