{"action":"created","issue":{"url":"https://api.github.com/repos/rust-lang/crates.io/issues/1173","repository_url":"https://api.github.com/repos/rust-lang/crates.io","labels_url":"https://api.github.com/repos/rust-lang/crates.io/issues/1173/labels{/name}","comments_url":"https://api.github.com/repos/rust-lang/crates.io/issues/1173/comments","events_url":"https://api.github.com/repos/rust-lang/crates.io/issues/1173/events","html_url":"https://github.com/rust-lang/crates.io/pull/1173","id":275173575,"node_id":"MDExOlB1bGxSZXF1ZXN0MTUzNTA0Nzkw","number":1173,"title":"RFC: Server-side rendering","user":{"login":"seanlinsley","id":688886,"node_id":"MDQ6VXNlcjY4ODg4Ng==","avatar_url":"https://avatars3.githubusercontent.com/u/688886?v=4","gravatar_id":"","url":"https://api.github.com/users/seanlinsley","html_url":"https://github.com/seanlinsley","followers_url":"https://api.github.com/users/seanlinsley/followers","following_url":"https://api.github.com/users/seanlinsley/following{/other_user}","gists_url":"https://api.github.com/users/seanlinsley/gists{/gist_id}","starred_url":"https://api.github.com/users/seanlinsley/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/seanlinsley/subscriptions","organizations_url":"https://api.github.com/users/seanlinsley/orgs","repos_url":"https://api.github.com/users/seanlinsley/repos","events_url":"https://api.github.com/users/seanlinsley/events{/privacy}","received_events_url":"https://api.github.com/users/seanlinsley/received_events","type":"User","site_admin":false},"labels":[{"id":620927496,"node_id":"MDU6TGFiZWw2MjA5Mjc0OTY=","url":"https://api.github.com/repos/rust-lang/crates.io/labels/S-waiting-on-review","name":"S-waiting-on-review","color":"d3dddd","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":18,"created_at":"2017-11-19T16:52:53Z","updated_at":"2018-10-16T09:16:04Z","closed_at":"2017-12-21T01:10:05Z","author_association":"NONE","pull_request":{"url":"https://api.github.com/repos/rust-lang/crates.io/pulls/1173","html_url":"https://github.com/rust-lang/crates.io/pull/1173","diff_url":"https://github.com/rust-lang/crates.io/pull/1173.diff","patch_url":"https://github.com/rust-lang/crates.io/pull/1173.patch"},"body":"This PR represents my efforts as a beginner Rust programmer to rewrite the UI so that it's rendered by the server, instead of by Ember in the browser.\r\n\r\nFor the pages converted so far, `/` and `/categories`, I refactored the existing JSON API functions so that they could be called by the server to be rendered by the `handlebars` Rust crate.\r\n\r\n\r\n<img width=\"50%\" alt=\"screen shot 2017-11-14 at 7 47 57 pm\" src=\"https://user-images.githubusercontent.com/688886/32992932-a404d474-cd16-11e7-95d6-187140e19a93.png\"><img width=\"50%\" alt=\"screen shot 2017-11-17 at 1 53 03 pm\" src=\"https://user-images.githubusercontent.com/688886/32992935-a6b8ad6c-cd16-11e7-8d63-89e27584401b.png\">\r\n\r\n\r\n\r\n### Is server-side rendering the right option?\r\n\r\nI wasn't sure if this would be a welcome change, so I've only gone far enough to have a working prototype. Here's why I think it's worthwhile:\r\n\r\n+ dogfooding\r\n  + Crates.io could become a great example of how to build server-side apps, like Rubygems.org\r\n  + this paves the way to write WebAssembly instead of JavaScript\r\n+ ease of contribution\r\n  + Ember is a great framework, but for such a simple app it just adds complexity & duplication\r\n  + the burden on new contributors to learn Rust, Conduit, JavaScript, and Ember shouldn't be understated\r\n+ performance\r\n  + the main page takes roughly a second for assets to load & boot, then another second for API requests to finish\r\n  + the API definitely needs to be optimized, but that first second of delay can only be removed with server-side rendering\r\n+ security\r\n  + browser scripting exposes you to risks sometimes as bad as the attacker [gaining local root](https://bugs.chromium.org/p/chromium/issues/detail?id=766253)\r\n\r\n### Which web framework?\r\n\r\nCurrently we're using Conduit. There's a lot of options these days; does anyone have experience with those others, and would they be a better choice if we switch to server-side rendering?\r\n\r\nSimilarly, which Crates.io features might be so complex to hand-roll that it makes this conversion much more difficult? OAuth seems likely."},"comment":{"url":"https://api.github.com/repos/rust-lang/crates.io/issues/comments/430163629","html_url":"https://github.com/rust-lang/crates.io/pull/1173#issuecomment-430163629","issue_url":"https://api.github.com/repos/rust-lang/crates.io/issues/1173","id":430163629,"node_id":"MDEyOklzc3VlQ29tbWVudDQzMDE2MzYyOQ==","user":{"login":"Turbo87","id":141300,"node_id":"MDQ6VXNlcjE0MTMwMA==","avatar_url":"https://avatars2.githubusercontent.com/u/141300?v=4","gravatar_id":"","url":"https://api.github.com/users/Turbo87","html_url":"https://github.com/Turbo87","followers_url":"https://api.github.com/users/Turbo87/followers","following_url":"https://api.github.com/users/Turbo87/following{/other_user}","gists_url":"https://api.github.com/users/Turbo87/gists{/gist_id}","starred_url":"https://api.github.com/users/Turbo87/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Turbo87/subscriptions","organizations_url":"https://api.github.com/users/Turbo87/orgs","repos_url":"https://api.github.com/users/Turbo87/repos","events_url":"https://api.github.com/users/Turbo87/events{/privacy}","received_events_url":"https://api.github.com/users/Turbo87/received_events","type":"User","site_admin":false},"created_at":"2018-10-16T09:16:04Z","updated_at":"2018-10-16T09:16:04Z","author_association":"MEMBER","body":"@nox moving to server-side rendering will not magically solve all a11y problems though. these things can also be solved in the current setup, we just need someone willing to invest time in solving them and it will be the same if we moved to SSR."}}
{"actor":{"display_login":"Turbo87"}}