Package Exports
- apprun
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (apprun) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
AppRun 

AppRun is a 3K library for building applications using the elm style model-view-update architecture and the event publication and subscription.
Quick Start
To give it a try, include AppRun in your html.
<script src="https://unpkg.com/apprun@latest/dist/apprun-html.js"></script>No other ceremony, you can start writing your model, view and update code right away.
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Counter</title>
</head>
<body>
<script src="https://unpkg.com/apprun@latest/dist/apprun-html.js"></script>
<div id="my-app"></div>
<script>
const model = 0;
const view = (model) => {
return `<div>
<h1>${model}</h1>
<button onclick='app.run("-1")'>-1</button>
<button onclick='app.run("+1")'>+1</button>
</div>`;
};
const update = {
'+1': (model) => model + 1,
'-1': (model) => model - 1
};
app.start('my-app', model, view, update);
</script>
</body>
</html>The example code above is a counter application that has implemented the model-view-update architecture.
Try it online: AppRun - Counter.
Larger applications can be built using components where each component has a model-view-update architecture.
e.g.
- RealWorld Example App - a blogging platform adheres to the RealWorld specification (1100 lines).
- Hacker News - PWA hacker news reader (230 lines)
- AppRun Demo App - a SPA that has 8 components, including a Todo component (90 lines)
Applications built with AppRun have less line of code, smaller js file and better performance. See a comparision from A Real-World Comparison of Front-End Frameworks with Benchmarks.
AppRun has also joined the js-framework-benchmark project. You can see its performance results compared to other frameworks and libraries.
Install
If you are interested in moving forward, you can install the AppRun CLI and initialize a TypeScript and webpack configured project:
npm install apprun -g
apprun --init --spa
npm start
Explore More
To explore more about AppRun, read the following.
Video Tutorials
- Building Applications with AppRun, Part 1 - Getting Started
- Building Applications with AppRun, Part 2 - Components
Articles
- Building Applications with AppRun
- Deep Dive into AppRun State
- Deep Dive into AppRun Events
- Dynamic Components Using TypeScript 2.4
Contribute
You can launch the webpack dev-server and the demo app from the demo folder with the following npm commands:
npm install
npm startYou can run the unit tests from the tests folder.
npm testUnit tests can serve as functional specifications.
Finally, to build optimized js files to the dist folder, just run:
npm run buildHave fun and send pull requests.
License
MIT
Copyright (c) 2015-2018 Yiyi Sun