Profile picture
Jorge Bucaran @JorgeBucaran
, 8 tweets, 3 min read Read on Twitter
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.

Like this thread? Get email updates or save it to PDF!

Subscribe to Jorge Bucaran
Profile picture

Get real-time email alerts when new unrolls are available from this author!

This content may be removed anytime!

Twitter may remove this content at anytime, convert it as a PDF, save and print for later use!

Try unrolling a thread yourself!

how to unroll video

1) Follow Thread Reader App on Twitter so you can easily mention us!

2) Go to a Twitter thread (series of Tweets by the same owner) and mention us with a keyword "unroll" @threadreaderapp unroll

You can practice here first or read more on our help page!

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just three indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member and get exclusive features!

Premium member ($3.00/month or $30.00/year)

Too expensive? Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal Become our Patreon

Thank you for your support!