2.0.22 • Published 2 years ago

hyperapp v2.0.22

Weekly downloads
2,064
License
MIT
Repository
github
Last release
2 years ago

Hyperapp

The tiny framework for building hypertext applications.

  • Do more with less—We have minimized the concepts you need to learn to get stuff done. Views, actions, effects, and subscriptions are all pretty easy to get to grips with and work together seamlessly.
  • Write what, not how—With a declarative API that's easy to read and fun to write, Hyperapp is the best way to build purely functional, feature-rich, browser-based apps using idiomatic JavaScript.
  • Smaller than a favicon—1 kB, give or take. Hyperapp is an ultra-lightweight Virtual DOM, highly-optimized diff algorithm, and state management library obsessed with minimalism.

Here's the first example to get you started. Try it here—no build step required!

<script type="module">
  import { h, text, app } from "https://unpkg.com/hyperapp"

  const AddTodo = (state) => ({
    ...state,
    value: "",
    todos: state.todos.concat(state.value),
  })

  const NewValue = (state, event) => ({
    ...state,
    value: event.target.value,
  })

  app({
    init: { todos: [], value: "" },
    view: ({ todos, value }) =>
      h("main", {}, [
        h("h1", {}, text("To do list")),
        h("input", { type: "text", oninput: NewValue, value }),
        h("ul", {},
          todos.map((todo) => h("li", {}, text(todo)))
        ),
        h("button", { onclick: AddTodo }, text("New!")),
      ]),
    node: document.getElementById("app"),
  })
</script>

<main id="app"></main>

Check out more examples

The app starts by setting the initial state and rendering the view on the page. User input flows into actions, whose function is to update the state, causing Hyperapp to re-render the view.

When describing how a page looks in Hyperapp, we don't write markup. Instead, we use h() and text() to create a lightweight representation of the DOM (or virtual DOM for short), and Hyperapp takes care of updating the real DOM efficiently.

Installation

npm install hyperapp

Documentation

Learn the basics in the Tutorial, check out the Examples, or visit the Reference.

Packages

Official packages provide access to Web Platform APIs in a way that makes sense for Hyperapp. For third-party packages and real-world examples, browse the Hyperawesome collection.

PackageStatusAbout
@hyperapp/domnpmInspect the DOM, focus and blur.
@hyperapp/svgnpmDraw SVG with plain functions.
@hyperapp/htmlnpmWrite HTML with plain functions.
@hyperapp/timenpmSubscribe to intervals, get the time now.
@hyperapp/eventsnpmSubscribe to mouse, keyboard, window, and frame events.
@hyperapp/httpnpmTalk to servers, make HTTP requests (#1027).
@hyperapp/randomnpmDeclarative random numbers and values.
@hyperapp/navigationnpmSubscribe and manage the browser URL history.

Need to create your own effects and subscriptions? You can do that too.

Help, I'm stuck!

If you've hit a stumbling block, hop on our Discord server to get help, and if you remain stuck, please file an issue, and we'll help you figure it out.

Contributing

Hyperapp is free and open-source software. If you want to support Hyperapp, becoming a contributor or sponsoring is the best way to give back. Thank you to everyone who already contributed to Hyperapp! <3

npm.io

License

MIT

@finepoint/hyperapp-prerender@finepoint/hyperapp-page@shish2k/hyperapp-jsxhyperapp-site-generatorhyperapp-devtoolshyperapp-tags@infinitebrahmanuniverse/nolb-hypera@everything-registry/sub-chunk-1883@andronov04/cnttrbluelight-calendar-applicationbluelight-firstboot-applicationbluelight-settings-applicationcxco-va-plugin-chatdata-tunneldeepest-lorentmldoug-hyperapp-seed-tsnodysseusphone-number-input-field@cxco/ui-chat@cxco/ui-faq@cxco/ui-seo@bluelightos/installer-application@bluelightos/procviewer-application@bluelightos/calendar-application@bluelightos/disks-application@bluelightos/firstboot-application@bluelightos/settings-applicationbloater@deepest-lore/html-exportentorno@handsfree/accessabar@handsfree/accessangelryperryper-styled-components@hyperapp/render@freedom-editor/hyperapp-code-block@firstfleet/hyperappcomponentsreducer-registry@frontmen/hyperapp-redux-devtoolsreggora-widget@gjmcn/happyradiofave-widgetotto-completeosjs-bluelight-installer-applicationosjs-browser-applicationosjs-gba-applicationosjs-glitch-applicationosjs-linux-installer-applicationosjs-nes-applicationosjs-syscfg-applicationosjs-sysinfo-applicationosjs-tetris-applicationosjs-twilioclient-applicationosjs-videoplayer-applicationrazzle-examples-with-hyperapp@emberliteos/filemanager-application@hyperlight/hyperapp-typesgame-visiongchart.devunpkg-websiteuwyejsxhtml@kdh/client@kdh/dialogs@kdh/dockcontainer@kdh/gui@kdh/osjs@kdh/panels@martel/heat-storybook@martel/hyperapp-snowpack@martel/hyperstaticld-components@osjs/epub-application@osjs/filemanager-application@osjs/gui@osjs/htmlviewer-application@osjs/musicplayer-application@osjs/panels@osjs/pdfreader-application@osjs/preview-application@osjs/settings-application@osjs/strophejs-application@osjs/textpad-application@osjs/vnc-application@osjs/webodf-application@osjs/writer-application@osjs/xpra-application@osjs/xterm-applicationhyperapp-snapshothyperapp-stylehyperapp-styled-componentshyperapp-tsx-parserhyperapp-webpackhyperapp.csshyperapplicablehyperapp-multiselecthyperapp-firebase-authhyperapp-google-invisible-recaptchahyperapp-html
2.0.22

2 years ago

2.0.21

2 years ago

2.0.20

2 years ago

2.0.19

3 years ago

2.0.16

3 years ago

2.0.17

3 years ago

2.0.18

3 years ago

2.0.15

3 years ago

2.0.14

3 years ago

2.0.13

3 years ago

2.0.12

3 years ago

2.0.11

3 years ago

2.0.10

3 years ago

2.0.9

3 years ago

2.0.8

4 years ago

2.0.7

4 years ago

2.0.6

4 years ago

2.0.5

4 years ago

2.0.4

4 years ago

2.0.3

5 years ago

2.0.2

5 years ago

2.0.1

5 years ago

2.0.0

5 years ago

2.0.0-beta.25

5 years ago

2.0.0-beta.24

5 years ago

2.0.0-beta.23

5 years ago

2.0.0-beta.22

5 years ago

2.0.0-beta.21

5 years ago

2.0.0-beta.20

5 years ago

1.2.10

5 years ago

2.0.0-beta.19

5 years ago

2.0.0-beta.18

5 years ago

2.0.0-beta.17

5 years ago

2.0.0-beta.16

5 years ago

2.0.0-beta.15

5 years ago

2.0.0-beta.14

5 years ago

2.0.0-beta.13

5 years ago

2.0.0-beta.12

5 years ago

2.0.0-beta.11

5 years ago

2.0.0-beta.10

5 years ago

2.0.0-beta.9

5 years ago

2.0.0-beta.8

5 years ago

2.0.0-beta.7

5 years ago

2.0.0-beta.6

5 years ago

2.0.0-beta.5

5 years ago

2.0.0-beta.4

5 years ago

2.0.0-beta.3

5 years ago

2.0.0-beta.2

5 years ago

2.0.0-beta.1

5 years ago

2.0.0-alpha.10

5 years ago

2.0.0-alpha.9

5 years ago

2.0.0-alpha.8

5 years ago

2.0.0-alpha.7

5 years ago

2.0.0-alpha.6

5 years ago

2.0.0-alpha.5

5 years ago

2.0.0-alpha.4

5 years ago

2.0.0-alpha.3

5 years ago

2.0.0-alpha.2

5 years ago

2.0.0-alpha.1

5 years ago

2.0.0-alpha.0

5 years ago

1.2.9

6 years ago

1.2.8

6 years ago

1.2.7

6 years ago

1.2.6

6 years ago

1.2.5

6 years ago

1.2.4

6 years ago

1.2.3

6 years ago

1.2.2

6 years ago

1.2.1

6 years ago

1.2.0

6 years ago

1.1.2

6 years ago

1.1.1

6 years ago

1.1.0

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago

0.18.5

6 years ago

0.18.4

6 years ago

0.18.3

6 years ago

0.18.2

6 years ago

0.18.1

6 years ago

0.18.0

6 years ago

0.17.1

6 years ago

0.17.0

6 years ago

0.16.2

6 years ago

0.16.1

6 years ago

0.16.0

6 years ago

0.15.1

7 years ago

0.15.0

7 years ago

0.14.0

7 years ago

0.13.0

7 years ago

0.12.1

7 years ago

0.12.0

7 years ago

0.11.0

7 years ago

0.10.1

7 years ago

0.10.0

7 years ago

0.9.3

7 years ago

0.9.2

7 years ago

0.9.1

7 years ago

0.9.0

7 years ago

0.8.1

7 years ago

0.8.0

7 years ago

0.7.1

7 years ago

0.7.0

7 years ago

0.6.0

7 years ago

0.5.0

7 years ago

0.4.2

7 years ago

0.4.1

7 years ago

0.4.0

7 years ago

0.3.2

7 years ago

0.3.1

7 years ago

0.3.0

7 years ago

0.2.1

7 years ago

0.2.0

7 years ago

0.1.0

7 years ago

0.0.14

7 years ago

0.0.13

7 years ago

0.0.12

7 years ago

0.0.11

7 years ago

0.0.10

7 years ago

0.0.9

7 years ago

0.0.8

7 years ago

0.0.7

7 years ago

0.0.6

7 years ago

0.0.5

7 years ago

0.0.4

7 years ago

0.0.3

7 years ago

0.0.2

7 years ago

0.0.1

7 years ago

0.0.0

7 years ago