{"action":"created","issue":{"url":"https://api.github.com/repos/Microsoft/TypeScript/issues/5546","labels_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/5546/labels{/name}","comments_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/5546/comments","events_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/5546/events","html_url":"https://github.com/Microsoft/TypeScript/issues/5546","id":115476893,"number":5546,"title":"Customizable JSX/TSX mode","user":{"login":"Deathspike","id":198601,"avatar_url":"https://avatars.githubusercontent.com/u/198601?v=3","gravatar_id":"","url":"https://api.github.com/users/Deathspike","html_url":"https://github.com/Deathspike","followers_url":"https://api.github.com/users/Deathspike/followers","following_url":"https://api.github.com/users/Deathspike/following{/other_user}","gists_url":"https://api.github.com/users/Deathspike/gists{/gist_id}","starred_url":"https://api.github.com/users/Deathspike/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Deathspike/subscriptions","organizations_url":"https://api.github.com/users/Deathspike/orgs","repos_url":"https://api.github.com/users/Deathspike/repos","events_url":"https://api.github.com/users/Deathspike/events{/privacy}","received_events_url":"https://api.github.com/users/Deathspike/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/Microsoft/TypeScript/labels/In%20Discussion","name":"In Discussion","color":"556b75"},{"url":"https://api.github.com/repos/Microsoft/TypeScript/labels/Suggestion","name":"Suggestion","color":"006b75"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-11-06T10:18:27Z","updated_at":"2015-11-22T20:31:53Z","closed_at":null,"body":"We currently have two `jsx` modes, `preserve` and `react`. Using `preserve` leaves the `<Something />` for an additional compilation step, and `react` ties you into using the `React` library. I want to propose a compiler option which allows you to define the emitted types. For example setting:\r\n\r\n    \"jsx\": {createElement: \"el\"}\r\n\r\nWhich would transform this code:\r\n\r\n    let test = <div><span /><span /></div>;\r\n\r\nInto this result:\r\n\r\n    var test = el(\"div\", null, el(\"span\", null), el(\"span\", null));\r\n\r\nEssentially, replacing `React.createElement` with `el`. Now I can define an `el` function like:\r\n\r\n    (name: string, properties: {[key: string]: string}, ...children: MyElement[]) => MyElement\r\n\r\nTo implement an own library. Why? Because some of us don't like being forced into using `React`, and this would allow us to either create our own libraries or use an existing DSL such as `virtual-hyperscript` (perhaps with some minor modifications there)."},"comment":{"url":"https://api.github.com/repos/Microsoft/TypeScript/issues/comments/158795656","html_url":"https://github.com/Microsoft/TypeScript/issues/5546#issuecomment-158795656","issue_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/5546","id":158795656,"user":{"login":"Lenne231","id":2046557,"avatar_url":"https://avatars.githubusercontent.com/u/2046557?v=3","gravatar_id":"","url":"https://api.github.com/users/Lenne231","html_url":"https://github.com/Lenne231","followers_url":"https://api.github.com/users/Lenne231/followers","following_url":"https://api.github.com/users/Lenne231/following{/other_user}","gists_url":"https://api.github.com/users/Lenne231/gists{/gist_id}","starred_url":"https://api.github.com/users/Lenne231/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Lenne231/subscriptions","organizations_url":"https://api.github.com/users/Lenne231/orgs","repos_url":"https://api.github.com/users/Lenne231/repos","events_url":"https://api.github.com/users/Lenne231/events{/privacy}","received_events_url":"https://api.github.com/users/Lenne231/received_events","type":"User","site_admin":false},"created_at":"2015-11-22T20:31:53Z","updated_at":"2015-11-22T20:31:53Z","body":"There are more and more frameworks using JSX coming up, i.e. https://github.com/garbles/yolk. So this would be very useful."}}