{"id":21995353,"url":"https://github.com/polymerlabs/actor-boilerplate","last_synced_at":"2025-04-08T10:28:11.832Z","repository":{"id":66263299,"uuid":"156378738","full_name":"PolymerLabs/actor-boilerplate","owner":"PolymerLabs","description":"A starting point for web apps based on the actor model.","archived":false,"fork":false,"pushed_at":"2025-02-10T22:30:17.000Z","size":305,"stargazers_count":429,"open_issues_count":11,"forks_count":54,"subscribers_count":31,"default_branch":"master","last_synced_at":"2025-04-01T09:24:28.828Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/PolymerLabs.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":"2018-11-06T12:15:17.000Z","updated_at":"2025-03-30T09:56:06.000Z","dependencies_parsed_at":null,"dependency_job_id":"2a7b73b8-7277-4956-9b8c-72bb864bb356","html_url":"https://github.com/PolymerLabs/actor-boilerplate","commit_stats":{"total_commits":11,"total_committers":4,"mean_commits":2.75,"dds":0.5454545454545454,"last_synced_commit":"eed6d98523fab694c16b2d953137aa1cd0218acf"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PolymerLabs%2Factor-boilerplate","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PolymerLabs%2Factor-boilerplate/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PolymerLabs%2Factor-boilerplate/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PolymerLabs%2Factor-boilerplate/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PolymerLabs","download_url":"https://codeload.github.com/PolymerLabs/actor-boilerplate/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247822910,"owners_count":21001965,"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-11-29T21:14:24.216Z","updated_at":"2025-04-08T10:28:11.813Z","avatar_url":"https://github.com/PolymerLabs.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Actor Boilerplate\n\nA starting point for web apps based on the actor model.\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://user-images.githubusercontent.com/617438/48304411-026e9e80-e4ce-11e8-86b9-250c9566e2bb.png\" alt=\"Screenshot of a stopwatch web app that uses the Actor model\"\u003e\n\u003c/p\u003e\n\n## Chrome Dev Summit 2018 Talk\n[Architecting Web Apps - Lights, Camera, Action!](https://www.youtube.com/watch?v=Vg60lf92EkM\u0026list=PLNYkxOF6rcIDjlCx1PcphPpmf43aKOAdF\u0026index=17\u0026t=0s)\n\nWe also wrote a series of blog posts with more detail on web development with the actor model:\n\n- [The 9am Rush Hour]\n- [Lights, Camera, Action!]\n- [Headless Web Development]\n\n## What is this repository that am I looking at?\n\nThis is a very basic web app that uses the [actor model]. The actor model helps you to break your app’s core logic into small pieces that have to communicate with messages instead of using function calls. Adopting this model has multiple benefits on the web:\n\n- Yields to browser (it naturally leads to chunked code)\n- Encourages lazy-loading and code splitting\n- Gives you a clear separation of concerns\n- Makes moving code off-main-thread easier\n- Resilience against unexpected long-running tasks\n- Enables multi-modality for web apps\n\n## What’s in here?\n\nThis boilerplate is a starting point to build web apps based on the actor model. It provides a build system that allows you to easily lazy-load actors and split your code. It relies on [actor-helpers] for the implementation of the actors and the messaging system. (Please read the docs of [`actor.ts`][actor.ts] for more details and examples.) \n\nBoth this build system and the actor-helpers library are provided by us for convenience. You are encouraged to explore your own approach to actorize your code.\n\n## How do I use this?\n\nTo get started, you can either [download] a snapshot of the master branch or fork this repository. Then run:\n\n```\n$ npm install\n$ npm run build\n$ npm run serve\n```\n\nand navigate to the address shown on the console to see the app.\n\n### Static content\n\nAll content in `static` will be copied to the root of the output folder. This is the place for stylesheets, images and other files that don’t need any processing at build time.\n\n### Bootstrapping\n\nThe entire web app bootstraps itself by loading the `bootstrap.ts` entrypoint. This is where we initialize the messaging system and create workers.\n\n### Actors\n\nAll actors are in the `src/actors` folder. For example, the state actor runs in a worker as we call `hookup(\"state\", new StateActor())` in `worker.ts`. However, if an actor explicitly requires access to the DOM, you can use this call in `bootstrap.ts` as well.\n\nThe message system takes care of delivering messages, regardless of where the actor is run. We strongly encourage to default all actors in a worker and only run an actor on the main thread if necessary.\n\nNote that while we have a single `worker.ts` in this project, larger projects can create as many workers as they like. Since messages are delivered irrespective of where an actor lives, you can assign any actor to any worker.\n\nFor example, if you have one actor that performs very expensive tasks, such as encoding and decoding messages, that actor can live in its own worker. Other (less CPU-intensive) actors can be grouped together in a single worker.\n\n## More examples\n\n- **Todo note-taking app:** Mandatory Todo app using the actor model with [preact] and [ImmerJS] ([branch][todo])\n\n---\n\nLicense BSD-3-clause\n\nPlease note: this is not a Google product.\n\n[actor-helpers]: https://github.com/PolymerLabs/actor-helpers\n[actor.ts]: https://github.com/PolymerLabs/actor-helpers/blob/master/src/actor/Actor.ts\n[download]: https://github.com/PolymerLabs/actor-boilerplate/archive/master.zip\n[actor model]: https://en.wikipedia.org/wiki/Actor_model\n[the 9am rush hour]: https://dassur.ma/things/the-9am-rush-hour/\n[lights, camera, action!]: https://dassur.ma/things/lights-camera-action/\n[headless web development]: https://dassur.ma/things/headless-web-development/\n[todo]: https://github.com/PolymerLabs/actor-boilerplate/tree/example/todo\n[preact]: https://preactjs.com/\n[immerjs]: https://github.com/mweststrate/immer\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpolymerlabs%2Factor-boilerplate","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpolymerlabs%2Factor-boilerplate","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpolymerlabs%2Factor-boilerplate/lists"}