-
Notifications
You must be signed in to change notification settings - Fork 780
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
Pass root in second argument to app(). #410
Comments
@jorgebucaran how would this work with HOAs? Would they need to accept multiple args as well, and call the |
@okwolf Oh, I didn't think about it. I am starting to dislike this proposal haha. |
You could possibly separate the app factory and the render factory. |
I think the current API works well. It's nice and clean.
…On Sun, Oct 8, 2017, 11:10 AM Phips Peter ***@***.***> wrote:
You could possibly separate the app factory and the render factory.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#410 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AMpDr-4gQUvoiMGdeFHjrFs-ghMXLeBNks5sqPQIgaJpZM4PxvKh>
.
|
I don't expect many people will actually include a |
|
Out of curiosity, what's the benefit of this change? I can't access Slack from work to read the conversation. |
Now, with HOA builtin support pushed to userland, we can revive this and as per discussion on Slack. Shall we implement it? |
I prefer it but I do think we should have principles for why to answer @SkaterDad |
The real (not really) question is, how do we feel about formatters like prettier making the code this: app(
{
init,
view,
state,
actions
},
document.getElementById("app")
) |
@SkaterDad The convo was basically that since builtin HOA support is out, and:
...was one of the reasons to turn this down, we can implement it now. Preact/React/Inferno users trying Hyperapp will feel at home and we can save some bytes too. |
I still want to make sure we have consistent reasoning for API changes. As we approach 1.0, the API will become locked. |
Well, let's approach it this way. What's not to like about app(props, container)
app({ init, view, state, actions }, document.getElementById("app")) |
@jorgebucaran FYI using this also breaks your |
@okwolf Thanks, I'll update it. |
The proposal is to remove the app's
root
property and do the same passing it in the second argument to app().Before
After
e.g.
Pros
render(elm, root)
, Elm'sElm.Main.embed(root)
, mithril'sm,mount(document.body, Counter)
(the order is reversed here though), Vue's$mount
, etc.Cons
Adds like 10 bytes.The text was updated successfully, but these errors were encountered: