{"action":"created","issue":{"url":"https://api.github.com/repos/lhorie/mithril.js/issues/1014","repository_url":"https://api.github.com/repos/lhorie/mithril.js","labels_url":"https://api.github.com/repos/lhorie/mithril.js/issues/1014/labels{/name}","comments_url":"https://api.github.com/repos/lhorie/mithril.js/issues/1014/comments","events_url":"https://api.github.com/repos/lhorie/mithril.js/issues/1014/events","html_url":"https://github.com/lhorie/mithril.js/issues/1014","id":148439216,"number":1014,"title":"false values in views should be coerced to zero length text nodes ","user":{"login":"barneycarroll","id":83627,"avatar_url":"https://avatars.githubusercontent.com/u/83627?v=3","gravatar_id":"","url":"https://api.github.com/users/barneycarroll","html_url":"https://github.com/barneycarroll","followers_url":"https://api.github.com/users/barneycarroll/followers","following_url":"https://api.github.com/users/barneycarroll/following{/other_user}","gists_url":"https://api.github.com/users/barneycarroll/gists{/gist_id}","starred_url":"https://api.github.com/users/barneycarroll/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/barneycarroll/subscriptions","organizations_url":"https://api.github.com/users/barneycarroll/orgs","repos_url":"https://api.github.com/users/barneycarroll/repos","events_url":"https://api.github.com/users/barneycarroll/events{/privacy}","received_events_url":"https://api.github.com/users/barneycarroll/received_events","type":"User","site_admin":false},"labels":[{"id":86465859,"url":"https://api.github.com/repos/lhorie/mithril.js/labels/enhancement","name":"enhancement","color":"84b6eb","default":true},{"id":362013854,"url":"https://api.github.com/repos/lhorie/mithril.js/labels/rewrite","name":"rewrite","color":"0e8a16","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/lhorie/mithril.js/milestones/1","html_url":"https://github.com/lhorie/mithril.js/milestones/1.0%20(Rewrite)","labels_url":"https://api.github.com/repos/lhorie/mithril.js/milestones/1/labels","id":1835772,"number":1,"title":"1.0 (Rewrite)","description":"Issues and pull requests geared towards completing the rewrite.","creator":{"login":"isiahmeadows","id":4483844,"avatar_url":"https://avatars.githubusercontent.com/u/4483844?v=3","gravatar_id":"","url":"https://api.github.com/users/isiahmeadows","html_url":"https://github.com/isiahmeadows","followers_url":"https://api.github.com/users/isiahmeadows/followers","following_url":"https://api.github.com/users/isiahmeadows/following{/other_user}","gists_url":"https://api.github.com/users/isiahmeadows/gists{/gist_id}","starred_url":"https://api.github.com/users/isiahmeadows/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/isiahmeadows/subscriptions","organizations_url":"https://api.github.com/users/isiahmeadows/orgs","repos_url":"https://api.github.com/users/isiahmeadows/repos","events_url":"https://api.github.com/users/isiahmeadows/events{/privacy}","received_events_url":"https://api.github.com/users/isiahmeadows/received_events","type":"User","site_admin":false},"open_issues":9,"closed_issues":34,"state":"open","created_at":"2016-06-18T08:01:00Z","updated_at":"2016-11-29T22:41:04Z","due_on":null,"closed_at":null},"comments":20,"created_at":"2016-04-14T18:04:29Z","updated_at":"2016-11-30T19:15:02Z","closed_at":null,"body":"I'm surprised this isn't in while undefined and null are translated — the irony is that an undefined value is more likely to be indicative of a fault in application logic (author expected a value when there was none), but Mithril papers over this, which could lead to frustration as bugs fail silently. But I digress.\n\nConditional logic is essential to clever views. Even the most restrictive of templating languages (consider Handlebars, used as the basis for Ember, where the prevailing attitude is decidedly against Turing-complete views) implement their own if handlers.\n\nMithril can't do ifs without resorting to temporary assignment or split returns, which represent an unpleasant deviation into imperative coding in an idiom that favours functional, point-free code.\n\nTernary operators are always possible but I'm not the first to complain at the ugliness of `condition ? content :  ''` — especially when success content may be voluminous it's inelegant to leave a hanging `else`, especially when so often the else outcome is just a dangling empty string; even more contrived is `!condition ? '' : content`, which makes it clearer early on that there is no else content, but introduces a lot of cruft.\n\nThe ultimate use case for `false` virtual nodes outputing empty text nodes is the ability to write `condition && content` or `condition || content` for simple ifs without elses.\n\n[Consider this stupid fiddle](https://jsfiddle.net/barney/0a8835be/) — and then think of non-trivial conditional content (eg a component invocation, like a modal). Wouldn't it be awesome?\n"},"comment":{"url":"https://api.github.com/repos/lhorie/mithril.js/issues/comments/263966365","html_url":"https://github.com/lhorie/mithril.js/issues/1014#issuecomment-263966365","issue_url":"https://api.github.com/repos/lhorie/mithril.js/issues/1014","id":263966365,"user":{"login":"pygy","id":54515,"avatar_url":"https://avatars.githubusercontent.com/u/54515?v=3","gravatar_id":"","url":"https://api.github.com/users/pygy","html_url":"https://github.com/pygy","followers_url":"https://api.github.com/users/pygy/followers","following_url":"https://api.github.com/users/pygy/following{/other_user}","gists_url":"https://api.github.com/users/pygy/gists{/gist_id}","starred_url":"https://api.github.com/users/pygy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pygy/subscriptions","organizations_url":"https://api.github.com/users/pygy/orgs","repos_url":"https://api.github.com/users/pygy/repos","events_url":"https://api.github.com/users/pygy/events{/privacy}","received_events_url":"https://api.github.com/users/pygy/received_events","type":"User","site_admin":false},"created_at":"2016-11-30T19:15:02Z","updated_at":"2016-11-30T19:15:02Z","body":"> @pygy I don't like the idea of sentinel values. [snip]\r\n\r\n@barneycarroll did you mean to ping me here? I don't remember suggesting API changes related to this... By \"placeholders\", I meant empty text nodes."}}
{"actor":{"display_login":"pygy"}}