JSPM

apprun

1.26.2
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 801
  • Score
    100M100P100Q111216F
  • License MIT

JavaScript library that has Elm inspired architecture, event pub-sub and components

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 Build NPM version Downloads License twitter Discord Chat

AppRun is a JavaScript library for building reliable, high-performance web applications using the Elm inspired architecture, events, and components.

AppRun is an MIT-licensed open source project. Please consider supporting the project on Patreon. 👍❤️🙏

AppRun Benefits

  • Write less code
  • No proprietary syntax to learn
  • Compiler/transpiler is optional
  • State management and routing included
  • Run side-by-side with jQuery, chartjs, D3, lit-html ...

AppRun is distributed on npm.

npm install apprun

You can also load AppRun directly from the unpkg.com CDN:

<script src="https://unpkg.com/apprun/dist/apprun-html.js"></script>

Or use it as ES module from unpkg.com:

<script type="module">
  import { app, Component } from 'https://unpkg.com/apprun@next/esm/apprun-html?module';
</script>

Architecture Concept

apprun-demo

Try it in AppRun Playground.

You can build applications using Component that also have state, view, and update.

AppRun Book from Apress

Order from Amazon

AppRun CLI

We recommend using TypeScript and JSX. TypeScript provides strong typing. JSX provides more advanced features.

We recommend using webpack for building production code. However, you can also have fast and productive development experiences with esm-server.

Use the AppRun CLI to initialize a TypeScript and webpack configured project:

npx apprun --init
npm start

You can also initialize a SPA project.

npx apprun --init --spa

To initialize a project that targets ES5, use the AppRun CLI with the --es5 flag:

npx apprun --init --spa --es5

Starter Templates

Optionally, you can directly scaffold AppRun projects from the AppRun starter templates.

npx degit apprunjs/apprun-rollup my-app
npx degit apprunjs/apprun-rollup-lit-html my-app
npx degit apprunjs/apprun-webpack my-app
npx degit apprunjs/apprun-parcel my-app
npx degit apprunjs/apprun-web-components my-app
npx degit apprunjs/apprun-bootstrap my-app
npx degit apprunjs/apprun-coreui my-app
npx degit apprunjs/apprun-pwa my-app
npx degit apprunjs/apprun-pwa-workbox my-app
npx degit yysun/apprun-d3 my-app
npx degit yysun/apprun-electron my-app
npx degit yysun/apprun-electron-forge my-app
npx degit yysun/apprun-websockets my-app
npx degit yysun/apprun-websockets-sqlite my-app

ES2015 by Default

In the past, the AppRun default version on npm is 1.x. The CLI creates tsconfig for es5. You can use --es6 option to create tsconfig for 2.x.

On Feb 21, 2020, the default version on npm has been changed from 1.x to 2.x. And the CLI creates tsconfig for es2015. You can use --es5 option for 1.x.

When upgrading projects to the latest version (2.x), please modify the tsconfig from targeting es5 to es2015.

Currently, the npm tags are as following:

  • apprun@es5: 1.x, stable, es5
  • apprun@latest: 2.x, stable, es2015, web components
  • apprun@next: 3.x, dev, es2015, web components, lit-html

Developer Tools

CLI in Console

To use the AppRun dev-tools CLI, include the dev-tools script.

<script src="https://unpkg.com/apprun@latest/dist/apprun-dev-tools.js"></script>

See AppRun CLI Run in the Console

Dev-Tools Extensions

AppRun supports the Redux DevTools Extension. To use the dev-tools, install the Redux DevTools Extension. You can monitor the events and states in the devtools.

app-dev-tools

VS Code Extension

AppRun has a code snippet extension for VS Code that you can install from the extension marketplace. It inserts the AppRun code template for application, component and event handling.

app-dev-tools

Contribute

You can launch the webpack dev-server and the demo app from the demo folder with the following npm commands:

npm install
npm start

You can run the unit tests from the tests folder.

npm test

Unit tests can serve as functional specifications.

Finally, to build optimized js files to the dist folder, just run:

npm run build

Have fun and send pull requests.

Contributors

License

MIT

Copyright (c) 2015-2020 Yiyi Sun