-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BREAKING: A bridge to 2.0 #37
The head ref may contain hidden characters: "zweibr\u00FCcke"
Conversation
without a way to fix this yet
Codecov Report
@@ Coverage Diff @@
## master #37 +/- ##
=====================================
Coverage 100% 100%
=====================================
Files 6 6
Lines 141 138 -3
Branches 15 20 +5
=====================================
- Hits 141 138 -3
Continue to review full report at Codecov.
|
also allow arrays again for dispatching a mix of actions and fx
use strictMode to enable errors for 2.0 incompatible usage
also made fx runners more deterministic
This effort has been superseded/ported to okwolf/hyperapp-compat now. |
The eventual goal of this is to provide support for as many Hyperapp 2.0 features as possible in order to assist with upgrading 1.0 apps. This PR is not the proper place to debate the merits of the new API, those discussions should continue in the
hyperapp/hyperapp
repo and Slack.Instead - this should be focused on implementation issues with supporting 2.0 style in a 1.0 Hyperapp.
This PR is still in an early stage, but so far has support for:
{ dispatch }
returned fromapp
dispatch
, but as a wired actionfx
fx
using an array as a poor tuple substitute (more powerful than the 2.0 RFC right now, allows any length n-tuple)view
detect old event handlers if using a function that doesn't return a valuedispatch
with the value assigned to the handler - passing the event as the second parameter when using an action functionstrictMode
optionfx
except:action
since actions may be directlydispatch
ed, this doesn't seem useful anymoreevent
since event handler actions already support receiving the event data and actions/fx that are returned from this will bedispatch
eddispatch
with thelogger
option. This should be replaced with an implementation of 2.0 middleware instead when readyUnresolved issues
fx
based on the existing 1.0 API still be separately maintained/supported?fx
built for 2.0dispatch
is implemented as a wired action, which is a unary functionmakeDispatchAction
insrc/fxCreators.js
keydown
andkeyup
probably should be converted to subsExamples
Let's start with the classic quote example (updated pen):
And now, our favorite counter example (go ahead and try it online):