Commit Graph

31 Commits

Author SHA1 Message Date
Zacharias Enochsson ffafc680a6
remove settimeout fallback (#1093) 2022-05-12 09:49:41 -03:00
Zacharias Enochsson 6f1a8c8a61
Move createClass to h revisited (#1091)
Doesn't enforce a class property on every vnode
2022-03-25 10:37:01 -03:00
Zacharias Enochsson f6c6d31fe9
Less class patching (#1090)
Move createClass to h.
2022-03-22 19:24:46 -03:00
Zacharias Enochsson 82caa5d941
Allow bare effecter as effect (#1075) 2022-03-02 09:25:20 -03:00
Zacharias Enochsson 3a1318ba1f
Fix create node options when props.is undefined (#1076) 2021-12-05 12:22:13 -03:00
Jorge Bucaran 62782d9954
Refactor app stopping out of dispatch
Non-breaking, internal refactor to consolidate the app
stopping logic out of dispatch into update (previously
setState). Now the notion that null or undefined state
terminates the app is more convincing.
2021-01-27 20:11:05 +09:00
Jorge Bucaran ced6048492
Make init optional
This allows you to create apps without the init
property, which is convenient for prototyping.

app({
  view: () => text("Fee-fi-fo-fum!"),
})
2021-01-27 04:20:33 +09:00
Jorge Bucaran b22432e098
Rename middleware app prop to dispatch
Because it's not like traditional middleware, and we
want to avoid drawing comparisons with frameworks
where use of middleware is heavily relied on.
2021-01-27 04:18:44 +09:00
Zacharias Enochsson d97b79e971
Return dispatch, allow stopping apps (#1018)
1. Return dispatch so it could be used for tooling,
   automation, tests, and so on.
2. Make dispatch with no arguments stop the app (#873).

Stopping an app means that future calls to dispatch do
nothing and all active subscriptions are unsubscribed.
2021-01-25 21:22:10 +09:00
Wolf 1b7cb2f21f
Clean up before subscribe on restart (#1012)
This reverses the restart order for subscriptions 
by calling unsubscribe first and then subscribe. 

Also avoids storing whatever unsubscribe returns, 
which we don't need to keep track of anywhere.
2021-01-24 15:49:50 +09:00
Sergey 3049f8858c
Fix subscriptions restart bug (#992) 2021-01-23 02:37:05 +09:00
Jorge Bucaran 8e6a490895
Don't obfuscate VDOM shape
There was no need to mutilate the VDOM shape beyond
recognition just to save a few bytes. Now each prop
clearly expresses its intent:

  {
    tag,
    props,
    children,
    node,
    type,
    key,
  }
2021-01-21 22:43:08 +09:00
Jorge Bucaran 9d5433e00a
Simplify build process; fix broken sourcemaps 2020-07-17 13:10:02 +09:00
Jorge Bucaran 62312eec6a
To src. 2017-02-09 21:41:56 +09:00
Jorge Bucaran d49a3a01a8
Move back to root. 2017-02-09 00:42:06 +09:00
Jorge Bucaran 72cf176698
chore: Move files. 2017-02-09 00:37:44 +09:00
Jorge Bucaran 88d6204fc2
Require, rollup, UMD bundle for JSX/Hyperx and jest.
Also add preliminary (working) JSX support, and update the docs.
2017-02-08 01:35:10 +09:00
Jorge Bucaran ac124e057c
Modernize 🛰
* Use more ES6 idioms, arrow funcs, let, and remove hash-based routing by @jbucaran. #34, #35 & #36.
* Introduce webpack, transpile with babel, minify with babili by @maraisr.
* Add some tests by @maraisr 
* Use src directory by @maraisr 
* Use Travis and setup code coverage by @maraisr
2017-02-06 22:16:01 +09:00
Jorge Bucaran 0f50318838
Rename to HyperApp, and add custom virtual-dom implementation. 2017-01-20 14:18:56 +09:00
Jorge Bucaran c1d980a7d5
Factor app and html into their own sub modules. 2016-12-29 01:00:12 +09:00
Jorge Bucaran 8db8513627
Remove examples from main repo. 2016-12-28 22:11:30 +09:00
Jorge Bucaran 40b3191248
Process data-hook attribute to support Snabbdom hooks. 2016-12-28 17:11:27 +09:00
Jorge Bucaran e3b288737c
Use single options argument as signature for app({ model, view, update, subs, effects, root }). 2016-12-25 17:54:13 +09:00
Jorge Bucaran d52db1bb81
Add effects and better error logging. 2016-12-24 22:30:03 +09:00
Jorge Bucaran 3582984379
Rewrite in ES5 syntax for better browser support out of the box. 2016-12-22 00:13:18 +09:00
Jorge Bucaran ca9917f7ac
Mutate model and container / nextNode reference immediately.
Otherwise we can't correctly update the model via dispatch/send
inside subscriptions.

For the same reason, extract dispatch method outside the render
closure.
2016-12-21 22:39:56 +09:00
Jorge Bucaran 97e8862c0f
Add subscriptions / event dispatchers. Invoke on DOM ready. 2016-12-21 01:40:38 +09:00
Jorge Bucaran a36425b5f8
Transform literal "true" or "false" string values in properties
to boolean true and false.

This allows for html`<input type="checkbox" checked=${model.checked} />`
and the like.

Also flatten children array (not deep flatten for now).
2016-12-19 22:25:09 +09:00
Jorge Bucaran 103b893069
Flatten children and add missing html/app exports. 2016-12-19 03:58:15 +09:00
Jorge Bucaran a1455cb591
Drop virtual dom in favor of snabbdom.
* Elm arch implementation is more pure this time, but
  more code was needed to transform hyperx attrs into
  a data object that snabbdom/h can use.

* The reason to switch to Snabbdom is due to the project
  significantly better results in some known vdom benchmarks,
  smaller size and no deps (as opposed to virtual-dom that
  had 8 deps, at the time of writing this commit).

* See also http://vdom-benchmark.github.io/vdom-benchmark
2016-12-19 02:50:28 +09:00
Jorge Bucaran 72f764932a
Initial commit. 2016-12-18 02:44:44 +09:00