{"id":18456884,"url":"https://github.com/bhauman/figwheel-repl","last_synced_at":"2025-04-04T07:03:55.520Z","repository":{"id":44737647,"uuid":"138917593","full_name":"bhauman/figwheel-repl","owner":"bhauman","description":"Figwheel REPL provides a stable multiplexing REPL for ClojureScript","archived":false,"fork":false,"pushed_at":"2025-02-14T22:52:18.000Z","size":218,"stargazers_count":47,"open_issues_count":4,"forks_count":11,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-03-28T06:08:48.551Z","etag":null,"topics":["clojure","clojurescript","repl","tooling"],"latest_commit_sha":null,"homepage":null,"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/bhauman.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","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},"funding":{"github":["bhauman"]}},"created_at":"2018-06-27T18:15:58.000Z","updated_at":"2025-03-13T02:20:09.000Z","dependencies_parsed_at":"2024-12-27T23:36:02.195Z","dependency_job_id":"2f728305-8ec6-4d5a-bcda-486693771bb5","html_url":"https://github.com/bhauman/figwheel-repl","commit_stats":{"total_commits":171,"total_committers":8,"mean_commits":21.375,"dds":"0.040935672514619936","last_synced_commit":"1571a6374d9b38ffdc072fbc850ec0110368f64d"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bhauman%2Ffigwheel-repl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bhauman%2Ffigwheel-repl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bhauman%2Ffigwheel-repl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bhauman%2Ffigwheel-repl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bhauman","download_url":"https://codeload.github.com/bhauman/figwheel-repl/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247135139,"owners_count":20889420,"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":["clojure","clojurescript","repl","tooling"],"created_at":"2024-11-06T08:12:55.659Z","updated_at":"2025-04-04T07:03:55.495Z","avatar_url":"https://github.com/bhauman.png","language":"Clojure","funding_links":["https://github.com/sponsors/bhauman"],"categories":[],"sub_categories":[],"readme":"# figwheel-repl\n\nFigwheel-REPL is intended to provide a best of class `repl-env` for\nClojureScript.\n\nFigwheel-REPL is **only** a ClojureScript `repl-env` and doesn't do anything\nspecific to help with automatic file reloading. As such, it is more\nsimilar to Weasel in function than to Figwheel.\n\nIt is intended to be a single `repl-env` that will work on as many\nplatforms as possible: including Browser, Node, Worker, ReactNative,\netc.\n\nIt is also intended to handle multiple clients, think browser tabs,\nmuch more gracefully than the current Figwheel REPL.\n\nIt is also different in that it only evaluates code on a single client\nby default. You will still be able to choose to broadcast an eval\noperation to all connected clients if you prefer. You can also provide\na filter function when you create the Figwheel repl-env, to filter the\nconnections to the set of connected clients you want an eval operation\nto be sent to.\n\n## Multiple REPL behavior\n\nThe new `figwheel.repl` namespace currently offers some ClojureScript\nfunctions to help you list and choose which connected client to focus on.\n\nThe `figwheel.repl/conns` macro allows you to list the connected clients:\n\nFor example:\n\n```\ncljs.user\u003e (figwheel.repl/conns)\nWill Eval On:  Darin\nSession Name     Age URL\nDarin            25m /figwheel-connect\nJudson          152m /figwheel-connect\nnil\n```\n\n\nThe above `figwheel.repl/conns` call lists the clients available for the\nREPL to target.\n\nAll connections are given easy to remember session names. The\nintention is that this will help you easily identify which browser tab\nyour, through the REPL client feedback in the browsers dev-tool\nconsole.\n\nThe `Will Eval On: Darin` indicates that the `Darin` client is where\nthe next eval operation will be sent to because this is currently the\n**youngest** connected client.\n\nThis **youngest client** heuristic for choosing which client to\nevaluate on, allows for a simple understanding of which REPL is the\ncurrent target of eval operations. Open a new browser tab, or start an\nnew node instance and that becomes the new eval target.\n\nIf you want to focus on a specific client,\n\n```\ncljs.user\u003e (figwheel.repl/focus Judson)\nFocused On: Judson\n```\n\nFrom now on all evals will go to `Judson` unless the connection to\n`Judson` is lost in which case the behavior will revert to selecting\nthe youngest connection.\n\nYou can confirm that the repl is currently focused with:\n\n```\ncljs.user\u003e (figwheel.repl/conns)\nFocused On: Judson\nSession Name     Age URL\nDarin            28m /figwheel-connect\nJudson          155m /figwheel-connect\nnil\n```\n\nI think this goes a long way toward solving a problem that has existed\nsince the very beginning of Figwheel.\n\n## Attention toward embedding the figwheel-repl endpoint\n\nThe other problem that I'm currently trying to work out is how to best\nsupport embedding the Figwheel REPL endpoint in your server.\n\nFor larger projects it simplest to use figwheel connection as a\nside-channel, a separate REPL connection, that is distinct from your\nprojects HTTP server. Figwheel's use of Web-sockets and CORS make this\nside connection a simple matter. But inevitably there are situations\nwhere you want to embed the Figwheel endpoint in your server. So I'm\ngiving this some serious attention.\n\nIn addition to the Web-socket connection, I have implemented a simple\nHTTP polling connection which should allow anyone to embed\nfigwheel-repl ring middleware into their stack. (Side note: I'm also\nlooking at long polling).\n\nIt is too bad that as a community we haven't landed on an agreed upon\nRing web-socket interface, as this makes it much harder to allow simple\nembedding of a web-socket endpoint into the server of your choice. But\nI'm going to do my best to facilitate this by making it easier to\ncreate a web-socket endpoint from the provided api.\n\nOn a side note: I'm also considering making the default server a the\n`ring.jetty.adapter` as it is such a common dependency.\n\n## License\n\nCopyright © 2018 Bruce Hauman\n\nDistributed under the Eclipse Public License either version 1.0 or any\nlater version.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbhauman%2Ffigwheel-repl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbhauman%2Ffigwheel-repl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbhauman%2Ffigwheel-repl/lists"}