Jorge Bucaran Profile picture
Apr 1, 2018 8 tweets 3 min read Read on X
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
 

Keep Current with Jorge Bucaran

Jorge Bucaran Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

PDF

Twitter may remove this content at anytime! Save it as PDF for later use!

Try unrolling a thread yourself!

how to unroll video
  1. Follow @ThreadReaderApp to mention us!

  2. From a Twitter thread mention us with a keyword "unroll"
@threadreaderapp unroll

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 two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3/month or $30/year) and get exclusive features!

Become Premium

Don't want to be a Premium member but still want to support us?

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

Donate via Paypal

Or Donate anonymously using crypto!

Ethereum

0xfe58350B80634f60Fa6Dc149a72b4DFbc17D341E copy

Bitcoin

3ATGMxNzCUFzxpMCHL5sWSt4DVtS8UqXpi copy

Thank you for your support!

Follow Us!

:(