{"action":"closed","issue":{"url":"https://api.github.com/repos/reactjs/react-rails/issues/625","repository_url":"https://api.github.com/repos/reactjs/react-rails","labels_url":"https://api.github.com/repos/reactjs/react-rails/issues/625/labels{/name}","comments_url":"https://api.github.com/repos/reactjs/react-rails/issues/625/comments","events_url":"https://api.github.com/repos/reactjs/react-rails/issues/625/events","html_url":"https://github.com/reactjs/react-rails/issues/625","id":185667638,"number":625,"title":"console history is not cleared between requests","user":{"login":"zetachang","id":839973,"avatar_url":"https://avatars1.githubusercontent.com/u/839973?v=3","gravatar_id":"","url":"https://api.github.com/users/zetachang","html_url":"https://github.com/zetachang","followers_url":"https://api.github.com/users/zetachang/followers","following_url":"https://api.github.com/users/zetachang/following{/other_user}","gists_url":"https://api.github.com/users/zetachang/gists{/gist_id}","starred_url":"https://api.github.com/users/zetachang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zetachang/subscriptions","organizations_url":"https://api.github.com/users/zetachang/orgs","repos_url":"https://api.github.com/users/zetachang/repos","events_url":"https://api.github.com/users/zetachang/events{/privacy}","received_events_url":"https://api.github.com/users/zetachang/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/reactjs/react-rails/milestones/3","html_url":"https://github.com/reactjs/react-rails/milestone/3","labels_url":"https://api.github.com/repos/reactjs/react-rails/milestones/3/labels","id":2433946,"number":3,"title":"2.0.0","description":"","creator":{"login":"rmosolgo","id":2231765,"avatar_url":"https://avatars0.githubusercontent.com/u/2231765?v=3","gravatar_id":"","url":"https://api.github.com/users/rmosolgo","html_url":"https://github.com/rmosolgo","followers_url":"https://api.github.com/users/rmosolgo/followers","following_url":"https://api.github.com/users/rmosolgo/following{/other_user}","gists_url":"https://api.github.com/users/rmosolgo/gists{/gist_id}","starred_url":"https://api.github.com/users/rmosolgo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rmosolgo/subscriptions","organizations_url":"https://api.github.com/users/rmosolgo/orgs","repos_url":"https://api.github.com/users/rmosolgo/repos","events_url":"https://api.github.com/users/rmosolgo/events{/privacy}","received_events_url":"https://api.github.com/users/rmosolgo/received_events","type":"User","site_admin":false},"open_issues":2,"closed_issues":14,"state":"open","created_at":"2017-04-04T15:32:21Z","updated_at":"2017-04-13T13:23:13Z","due_on":null,"closed_at":null},"comments":3,"created_at":"2016-10-27T13:25:12Z","updated_at":"2017-04-13T13:23:13Z","closed_at":"2017-04-13T13:23:13Z","body":"My app doesn't crash, but I'm getting unexpected behavior. So, I've described the unexpected behavior and suggested a new behavior.\n\n---\n\n`console.history` is not cleared when used with prerender method using `therubyracer` runtime. \n\nHere is an example extracted from the [sprockets_renderer_test](https://github.com/reactjs/react-rails/blob/d2cc6045ab460bbb667c51fd500c49dd37de21c5/test/react/server_rendering/sprockets_renderer_test.rb#L26)\n\n``` rb\n@renderer.render(\"TodoListWithConsoleLog\", {todos: [\"log some messages\"]}, nil)\nputs @renderer.render(\"TodoListWithConsoleLog\", {todos: [\"log some messages\"]}, nil)\n```\n\nwill result to\n\n``` html\n<ul data-reactroot=\"\" data-reactid=\"1\" data-react-checksum=\"-1309656939\"><li data-reactid=\"2\">Console Logged</li><li id=\"status\" data-reactid=\"3\">yep</li><li data-reactid=\"4\">log some messages</li></ul>\n<script>\nconsole.log.apply(console, [\"got initial state\"]);\nconsole.warn.apply(console, [\"mounted component\"]);\nconsole.error.apply(console, [\"rendered!\",\"foo\"]);\nconsole.log.apply(console, [\"got initial state\"]);\nconsole.warn.apply(console, [\"mounted component\"]);\nconsole.error.apply(console, [\"rendered!\",\"foo\"]);\n</script>\n```\n\nThe rubyracer `v8_context` deep inside is the same during multiple `eval`s, and so is other stuff user might stored in `global`.\n\nThis is not happened in the default execjs runtime given that [it shell out every time `eval` invoked.](https://github.com/rails/execjs/blob/master/lib/execjs/external_runtime.rb#L171)\n\nTest environment\n- `react-rails`: master\n- `therubyracer`: 0.12.2\n"}}
{"actor":{"display_login":"rmosolgo"}}