Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

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

License

NotificationsYou must be signed in to change notification settings

yysun/apprun

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Introduction

AppRun is a lightweight alternative to other frameworks and libraries. It has aunique architecture inspired by the Elm architecture that can help you manage states, routing, and other essential aspects of your web application.

Use aCounter as an example.

// define the initial stateconststate=0;// view is a function to display the state (JSX)constview=state=><div><h1>{state}</h1><buttononclick="app.run('-1')">-1</button><buttononclick="app.run('+1')">+1</button></div>;// update is a collection of event handlersconstupdate={'+1':state=>state+1,'-1':state=>state-1};// start the appapp.start(document.body,state,view,update);

  • AppRun is lightweight, only 6KB gzipped, but includes state management, rendering, event handling, and routing.

  • With only three functions:app.start,app.run, andapp.on in its API makes it easy to learn and use. And no worries about the incompatibility of version upgrades.

  • One more thing, you canuse AppRun with React to simplify state management and routing of your React applications.

At its core, AppRun harnesses the power of the event PubsSub pattern to streamline your application’s state handling and routing. The result? Cleaner, more maintainable code and a smoother development experience.

AppRun Benefits

  • Clean architecture that needs less code
  • State management and routing included
  • No proprietary syntax to learn (no hooks, no reducers, no signals)
  • Use directly in the browser or with a compiler/bundler
  • Advanced features: JSX, Web Components, Dev Tools, SSR, etc.

Getting Started

AppRun is distributed on npm. To get it, run:

npm install apprun

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

<html><body><scriptsrc="https://unpkg.com/apprun/dist/apprun-html.js"></script><script>  const view = state => `<div>${state}</div>`;  app.start(document.body, 'hello AppRun', view);</script></body></html>

Or, use the ESM version:

<html><body><scripttype="module">  import{app,html} from 'https://unpkg.com/apprun/dist/apprun-html.esm.js';  const view = state =>html`<div>${state}</div>`;  app.start(document.body, 'hello ESM', view);</script></body></html>

In addition to run directly in the browser, or with a compiler/bundler like Webpack or Vite.

You can run thenpm create apprun-app command to create an AppRun project.

npm create apprun-app [my-app]

Learn More

You can get started withAppRun Docs andthe AppRun Playground.

AppRun Book from Apress

Order from Amazon

Contribute

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

npm installnpm start

You can run the unit tests from thetests folder.

npmtest

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

Support

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

Thank you for your support

  • Athkahden Asura
  • Alfred Nerstu
  • Gyuri Lajos
  • Lorenz Glißmann
  • Kevin Shi
  • Chancy Kennedy

License

MIT

Copyright (c) 2015-2024 Yiyi Sun

About

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

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp