{"action":"opened","issue":{"url":"https://api.github.com/repos/floatdrop/plugin-jsx/issues/9","labels_url":"https://api.github.com/repos/floatdrop/plugin-jsx/issues/9/labels{/name}","comments_url":"https://api.github.com/repos/floatdrop/plugin-jsx/issues/9/comments","events_url":"https://api.github.com/repos/floatdrop/plugin-jsx/issues/9/events","html_url":"https://github.com/floatdrop/plugin-jsx/issues/9","id":70748683,"number":9,"title":"Live-reloading","user":{"login":"geelen","id":23264,"avatar_url":"https://avatars.githubusercontent.com/u/23264?v=3","gravatar_id":"","url":"https://api.github.com/users/geelen","html_url":"https://github.com/geelen","followers_url":"https://api.github.com/users/geelen/followers","following_url":"https://api.github.com/users/geelen/following{/other_user}","gists_url":"https://api.github.com/users/geelen/gists{/gist_id}","starred_url":"https://api.github.com/users/geelen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/geelen/subscriptions","organizations_url":"https://api.github.com/users/geelen/orgs","repos_url":"https://api.github.com/users/geelen/repos","events_url":"https://api.github.com/users/geelen/events{/privacy}","received_events_url":"https://api.github.com/users/geelen/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-04-24T17:33:39Z","updated_at":"2015-04-24T17:33:39Z","closed_at":null,"body":"Wondering whether it'd be possible to add live-reloading to this plugin. I've managed to get this working, but it's very restrictive, and needs some review & consideration before it'd be ready for a PR.\r\n\r\nHere's what I've done so far:\r\n\r\n- **[jspm-server](https://github.com/geelen/jspm-server)** — a fork of live-server that injects a SystemJS-aware snippet that looks for events from the file system and sees if the plugin that loaded that file exports a `hotReload` function\r\n- **[jsx.js](https://github.com/geelen/typeslab/blob/master/src/jsx.js)** — a copy of this project which then appends a snippet to each JSX source file in development, based off an example in the react-hot-loader [readme](https://github.com/gaearon/react-hot-api#usage). It works, too!\r\n\r\n![live-reloading-jspm](https://cloud.githubusercontent.com/assets/23264/7324124/ce7ab162-eab3-11e4-9505-4c142085e838.gif)\r\n\r\nThe restrictions are pretty huge though:\r\n\r\n- It has to be using ES6 syntax\r\n- The name of the component must be PascalCase version of the filename (e.g. drop-down.js becomes `class DropDown`)\r\n- It must be using a default export for the component\r\n\r\nI want to work with @guybedford to make jspm-server a real part of jspm, and I think React hot loading would be a great thing to start with. I also want to chat with @gaearon about making better use of the hot-loader to remove some of these limitations of my version, but what do you think?"}}