{"id":13567138,"url":"https://github.com/yysun/apprun","last_synced_at":"2025-05-14T04:07:34.776Z","repository":{"id":11641048,"uuid":"70208212","full_name":"yysun/apprun","owner":"yysun","description":"AppRun is a JavaScript library for developing high-performance and reliable web applications using the elm inspired architecture, events and components.","archived":false,"fork":false,"pushed_at":"2025-01-08T21:52:26.000Z","size":27104,"stargazers_count":1178,"open_issues_count":8,"forks_count":57,"subscribers_count":33,"default_branch":"master","last_synced_at":"2025-04-10T22:30:51.962Z","etag":null,"topics":["component","event-driven","framework","javascript","router","state-management","typescript","virtual-dom"],"latest_commit_sha":null,"homepage":"https://apprun.js.org","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/yysun.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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,"zenodo":null}},"created_at":"2016-10-07T02:07:44.000Z","updated_at":"2025-01-19T22:29:42.000Z","dependencies_parsed_at":"2023-12-08T18:30:52.425Z","dependency_job_id":"592037ea-883f-412d-a833-61e8ab4898d2","html_url":"https://github.com/yysun/apprun","commit_stats":{"total_commits":1335,"total_committers":16,"mean_commits":83.4375,"dds":0.05018726591760303,"last_synced_commit":"9b6b1ab00e2f686be763949d620de659c96adae3"},"previous_names":[],"tags_count":239,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yysun%2Fapprun","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yysun%2Fapprun/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yysun%2Fapprun/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yysun%2Fapprun/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yysun","download_url":"https://codeload.github.com/yysun/apprun/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254069216,"owners_count":22009511,"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":["component","event-driven","framework","javascript","router","state-management","typescript","virtual-dom"],"created_at":"2024-08-01T13:02:24.585Z","updated_at":"2025-05-14T04:07:34.727Z","avatar_url":"https://github.com/yysun.png","language":"TypeScript","funding_links":["https://www.patreon.com/apprun"],"categories":["TypeScript","typescript"],"sub_categories":[],"readme":"# AppRun [![Build][travis-image]][travis-url] [![NPM version][npm-image]][npm-url] [![Downloads][downloads-image]][downloads-url] [![License][license-image]][license-url] [![twitter][twitter-badge]][twitter] [![Discord Chat][discord-image]][discord-invite]\n\n\n## Introduction\n\nAppRun is a lightweight alternative to other frameworks and libraries. It has a [unique architecture](https://apprun.js.org/docs/architecture/) inspired by the Elm architecture that can help you manage states, routing, and other essential aspects of your web application.\n\nUse a _Counter_ as an example.\n\n```js\n// define the initial state\nconst state = 0;\n\n// view is a function to display the state (JSX)\nconst view = state =\u003e \u003cdiv\u003e\n  \u003ch1\u003e{state}\u003c/h1\u003e\n  \u003cbutton onclick=\"app.run('-1')\"\u003e-1\u003c/button\u003e\n  \u003cbutton onclick=\"app.run('+1')\"\u003e+1\u003c/button\u003e\n\u003c/div\u003e;\n\n// update is a collection of event handlers\nconst update = {\n  '+1': state =\u003e state + 1,\n  '-1': state =\u003e state - 1\n};\n\n// start the app\napp.start(document.body, state, view, update);\n```\n\u003capprun-code\u003e\u003c/apprun-code\u003e\n\n* AppRun is lightweight, only 6KB gzipped, but includes state management, rendering, event handling, and routing.\n\n* With only three functions: `app.start`, `app.run`, and `app.on` in its API makes it easy to learn and use. And no worries about the incompatibility of version upgrades.\n\n* One more thing, you can [use AppRun with React](https://apprun.js.org/docs/react) to simplify state management and routing of your React applications.\n\nAt its core, AppRun harnesses the power of the [event PubsSub]([Publish-Subscribe](https://apprun.js.org/docs/event-pubsub/)) pattern to streamline your application’s state handling and routing. The result? Cleaner, more maintainable code and a smoother development experience.\n\n## AppRun Benefits\n\n* Clean architecture that needs less code\n* State management and routing included\n* No proprietary syntax to learn (no hooks, no reducers, no signals)\n* Use directly in the browser or with a compiler/bundler\n* Advanced features: JSX, Web Components, Dev Tools, SSR, etc.\n\n\n## Getting Started\n\nAppRun is distributed on npm. To get it, run:\n\n```sh\nnpm install apprun\n```\nYou can also load AppRun directly from the unpkg.com CDN:\n\n```js\n\u003chtml\u003e\n\u003cbody\u003e\n\u003cscript src=\"https://unpkg.com/apprun/dist/apprun-html.js\"\u003e\u003c/script\u003e\n\u003cscript\u003e\n  const view = state =\u003e `\u003cdiv\u003e${state}\u003c/div\u003e`;\n  app.start(document.body, 'hello AppRun', view);\n\u003c/script\u003e\n\u003c/body\u003e\n\u003c/html\u003e\n```\n\u003capprun-code style=\"height:200px\"\u003e\u003c/apprun-code\u003e\n\nOr, use the ESM version:\n```js\n\u003chtml\u003e\n\u003cbody\u003e\n\u003cscript type=\"module\"\u003e\n  import { app, html } from 'https://unpkg.com/apprun/dist/apprun-html.esm.js';\n  const view = state =\u003e html`\u003cdiv\u003e${state}\u003c/div\u003e`;\n  app.start(document.body, 'hello ESM', view);\n\u003c/script\u003e\n\u003c/body\u003e\n\u003c/html\u003e\n```\n\u003capprun-code style=\"height:200px\"\u003e\u003c/apprun-code\u003e\n\nIn addition to run directly in the browser,  or with a compiler/bundler like Webpack or Vite.\n\nYou can run the `npm create apprun-app` command to create an AppRun project.\n\n```sh\nnpm create apprun-app [my-app]\n```\n\n### Learn More\n\nYou can get started with [AppRun Docs](https://apprun.js.org/docs) and [the AppRun Playground](https://apprun.js.org/#play).\n\n### AppRun Book from Apress\n\n[![Order from Amazon](https://images-na.ssl-images-amazon.com/images/I/51cr-t1pdSL._SX348_BO1,204,203,200_.jpg)](https://www.amazon.com/Practical-Application-Development-AppRun-High-Performance/dp/1484240685/)\n\n* [Order from Amazon](https://www.amazon.com/Practical-Application-Development-AppRun-High-Performance/dp/1484240685/)\n\n\n## Contribute\n\nYou can launch the webpack dev-server and the demo app from the _demo_ folder with the following npm commands:\n```sh\nnpm install\nnpm start\n```\n\nYou can run the unit tests from the _tests_ folder.\n```sh\nnpm test\n```\nUnit tests can serve as functional specifications.\n\nFinally, to build optimized js files to the dist folder, just run:\n```sh\nnpm run build\n```\n\nHave fun and send pull requests.\n\n## Contributors\n[![](https://contributors-img.firebaseapp.com/image?repo=yysun/apprun)](https://github.com/yysun/apprun/graphs/contributors)\n\n## Support\n\nAppRun is an MIT-licensed open-source project. Please consider [supporting the project on Patreon](https://www.patreon.com/apprun). 👍❤️🙏\n\n### Thank you for your support\n\n* Athkahden Asura\n* Alfred Nerstu\n* Gyuri Lajos\n* Lorenz Glißmann\n* Kevin Shi\n* Chancy Kennedy\n\n## License\n\nMIT\n\nCopyright (c) 2015-2024 Yiyi Sun\n\n\n[travis-image]: https://travis-ci.org/yysun/apprun.svg?branch=master\n[travis-url]: https://travis-ci.org/yysun/apprun\n[npm-image]: https://img.shields.io/npm/v/apprun.svg\n[npm-url]: https://npmjs.org/package/apprun\n[license-image]: https://img.shields.io/:license-mit-blue.svg\n[license-url]: LICENSE.md\n[downloads-image]: https://img.shields.io/npm/dm/apprun.svg\n[downloads-url]: https://npmjs.org/package/apprun\n\n[twitter]: https://twitter.com/intent/tweet?text=Check%20out%20AppRun%20by%20%40yysun%20https%3A%2F%2Fgithub.com%2Fyysun%2Fapprun%20%F0%9F%91%8D%20%40apprunjs\n[twitter-badge]: https://img.shields.io/twitter/url/https/github.com/yysun/apprun.svg?style=social\n\n[discord-image]: https://img.shields.io/discord/476903999023480842.svg\n[discord-invite]: https://discord.gg/CETyUdx","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyysun%2Fapprun","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyysun%2Fapprun","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyysun%2Fapprun/lists"}