Hyperapp 2.0 is coming! Unwired actions, effects as data, built-in dynamic import support, new subscriptions API, middleware and few more. github.com/hyperapp/hyper…#javascript#hyperapp
Let's break this down. "Unwired actions" is just a fancy name for what really is a profound change in the actions API.
In HA 1.0 you create an object with functions (actions), pass it to the app() call, then HA traverses the object and creates a new function for each action with "special" logic that knows how to update the global state and redraw your view.
Wiring actions to the state-change-redraw mechanism is slow and does not scale well. It locks you down to a particular set of actions that must be available when you start the app and makes it awkward to pass down actions through the component tree.
In HA 2.0 actions are plain, unwired & untapped JavaScript functions. You can import them in your component or use them anywhere you like. The view layer is designed to dispatch actions to the app's built-in state-update-redraw mechanism. It Just Works. Oh, Hi, dynamic import().
"Effects as data" is the norm in @elmlang and we're following suit. No callbacks, no promises, no async/await, no generators, no observers. Plain old objects with props and data that tell HA what side-effect to produce. We are calling these managed side-effects.
Built-in dynamic import support is saying that HA 2.0 will allow you to create `lazy` or `dynamic` component factory functions, not unlike react-loadable or zeit's next/dynamic. The future is now old man!
The new subscriptions API is one of the most exciting parts of 2.0. It's the missing piece in HA 1.0. Aptly ripped off Elm's subscriptions, this will be our functionally pure gateway to external input and middleware.
• • •
Missing some Tweet in this thread? You can try to
force a refresh