6 ms·
GitHub is replacing Rails front end rendering with React
- mirekrusin 4y agoFunny to read this because since couple of days I've noticed github is loading noticably slower for me. I thought something may be off with my internet connection (I'm on 400 Mbps in Switzerland, M1 16GB, FF).
- dombesz 4y agoI second this, this week was noticeably slow.
- StreamBright 4y agoIt is noticeably slower. I do not have the data to back up this claim though.
- rocketbop 4y agoHad the same experience since Thursday or Friday.
- pacifika 4y agoGitHub probably is more of a webapp than a webpage at this point, so makes sense.
- superkuh 4y agoYeah, supporting people who use older software and older computers doesn't make financial sense for Microsoft. Plus now it's a lot harder to index the pages so it's more lock-in. Web apps have so many advantages for for-profit corporations in filtering out the unprofitables.
- lghh 4y ago> Plus now it's a lot harder to index the pages Why does using react mean it is harder to index pages? You can certainly write something that's difficult to index in React, but using React does not mean it is inherently more difficult to index. This is especially true if you're using SSR + modern react features with a meta-framework like Next.js > supporting people who use older software and older computers doesn't make financial sense for Microsoft Pretty much the same point here. Fundamental misunderstanding of React.
- 1123581321 4y agoYou just said it: if your HTML delivers a react app that hasn’t taken the extra steps to be SSR, then the crawler has to run the JS in order to index the content instead of just parsing the HTML response.
- shadowgovt 4y agoModern component libraries make it harder to write the site in a non-indexable way than to just make it easy to index.
- 1123581321 4y agoOnly as a user of Next and similar renderers. The default in the larger web application world is to ship an empty target element and a JS bundle.
- saila 4y agoI just disabled JS in my browser and most stuff still works, although there's a few things that don't, like loading commit data and dropdown menus. I would guess they're doing server side rendering and progressive enhancement so that at least the core functionality still works okay.
- eyelidlessness 4y agoGuillermo (Twitter OP) replied in the thread saying it will be server rendered. Other replies point out it’s not enabled for all users, so this (and presumably the UI changes it brings with it) isn’t final. I do see the changes, but I also opt into most if not all preview features and I wouldn’t mind if I’m part of an A/B test or whatever. I wouldn’t be so paranoid to think this is some nefarious plot, it’s probably just incomplete. Whatever their “lock in” strategy, it’s more about building and extending a feature moat that users don’t want to leave than restrictive dark patterns. Harming searchability is more damaging to GitHub (which thrives on being highly ranked in Google/etc searches) than it could possibly be to would-be defectors who are almost certainly capable of using their API either directly or by using any number of tools to do that for them. If anything, shipping this widely as-is would probably drive users away not lock them in. Judging by the timing of adoption of React/Next for their Blocks landing page (also mentioned in the Twitter replies), I wouldn’t be surprised if this is intended to be rolled out alongside further stabilization of React Server Components, or otherwise integrated with existing internal SSR implementation. (Leaning towards the former given it’s a Vercel person speaking confidently about GH’s plans for server rendering)
- davzie 4y agoI have to say, the notion you can only build webpages with Rails and not webapps did make me chuckle. If Rails can take a company such as GitHub this far then it, along with other traditional server side rendered frameworks like Django and Laravel, should more seriously be considered when starting new projects and apps.
- threatofrain 4y agoIf you've already mastered a system, then the n+1 case is going to be much more timely and cost-effective. So if you know RoR and you've got a similar team then go for it. But for greenfield projects I'm not sure one should go with Ruby on Rails, and this is coming from someone who used Ruby before Rails. If I'm not mistaken, even 37 Signals made a new framework for their new Hey app. https://hotwired.dev https://hotwired.dev
- mnutt 4y agoHotwired is a ruby gem that sits on top of Rails' existing Turbo approach: start with a regular server-rendered ERB page, layer on Turbo to allow for page updates without page refreshes (via XHR-fetched html fragments) and layer on Hotwire to sync state with websockets.
- systemicdanna 4y agoI absolutely love Django and used it for many many years for all my new projects. Nowadays I only use it in a very limited set of use cases. Having an instant admin UI is a huge advantage for some business cases, flexible auth is great, very fast prototyping is still amazing, etc. Wouldn’t choose it for any front end heavy app.
- scrollaway 4y agoHave you looked into Django Ninja? I use FastAPI exactly because of the reasons you point out... but damn do I miss the Django ORM and admin. Django-Ninja is an acknowledgement of the realities of that.
- nells 4y ago
- Kiro 4y agoThis type of useless reddit snark is the reason I wish I could filter out green names. Low effort bait has no place on HN.
- Naga 4y agoWhat do the green names mean? I've seen them before but have had no idea.
- threatofrain 4y agoNew accounts.
- revskill 4y agoI thought green name means some kinds of VIP account.
- eyelidlessness 4y agoVery Introductory Poster
- Cu3PO42 4y agoGreen names indicate recently created accounts. I'm unsure of the exact cutoff, but it should be around two weeks.
- telman17 4y agoUnfortunately these type of posts aren’t limited to new accounts but I agree with you about the Reddit snark.
- pvg 4y agoJust flag bad comments and bad posts.
- trey-jones 4y agoI can't believe they were still running a rails frontend til now, to be honest. I thought rails had fallen out of favor at least 5 years ago (deservedly in my biased estimation). We'll see what happens with Github. I don't have any use for the new bells and whistles like editing the repo directly from the webpage (scary!), or deeper VS Code integration. I'm not interested in Co-Pilot, though a co-worker told me the other day that it had saved him hours in a particular instance. I just hope they don't kill the parts that I think are useful, and the things that made GH so valuable in the first place. It's a worrying trend that software seems to get worse for users in the name of making more money.
- cientifico 4y agoWhy can't you believe they were using rails?
- trey-jones 4y agoI didn't say I couldn't believe they were using rails. I knew very well that Github was originally written on Rails. I was surprised to learn today that the frontend was still rails. The narrative in my head was that, like Twitter, which started as a rails app and eventually outgrew it, Github had abandoned Rails some years ago.
- CharlesW 4y ago> I thought rails had fallen out of favor at least 5 years ago (deservedly in my biased estimation). For the folks downvoting, GitHub said basically this in 2018: https://www.theregister.com/2018/08/16/github_rails_microsoft/ https://www.theregister.com/2018/08/16/github_rails_microsof... "GitHub is about a third of the way through an architectural change that began last year. The company is moving away from Ruby on Rails toward a more heterogeneous, composable infrastructure." This doesn't mean that they're rewriting Rails infrastructure for the sake of it, so legacy Ruby/Rails software will presumably power big chunks of GitHub for many years to come.
- deergomoo 4y agoThis seems like a good move. GitHub worked great using server rendering for a highly interactive app, but it was quite easy to end up in a situation where two UI elements would show different things for the same piece of information, because one was updating live and the other wasn't.
- agos 4y agoEasy way to make the UI end in an inconsistent state: when somebody asked you to review a PR, you’ll see an “add your review” banner and CTA. If from that same page you add yourself as a reviewer the banner won’t appear unless you reload
- cntainer 4y agoHonestly github always felt snappy and intuitive to me, more so than many "cool" react fronts I've seen. It would be great if they wrote an article about this switch to understand some of the challenges they were facing. I would also be curious if they considered other approaches and stacks.
- ronnier 4y agoI don't have any data to back this up, just my opinion, but I prefer backend rendered sites with Javascript augmentation for the parts that need it. Just feels faster. These JavaScript UIs feel clunky and slow IMO. Maybe it's the (sometimes) dozens of calls the UI make back to the server to get data whereas if it was all rendered in the backend the round trip time would be a lot faster since the server is closer to the data, but my browser needs to make a call across the internet to the server and then to the database or whatever. Also for tools websites at companies I work at, as a backend dev, building those tools in react is huge overhead. Webpack and react and redux etc. It's a lot to deal with for some simple tool. I'm wondering how much internal tool websites built in react slow down the development process at corps.
- deleted 4y ago[deleted]
- 323 4y agoIn theory React websites should transfer less data since you just send a JSON model instead of one annotated in full HTML markup. The React runtime would be cached after the first visit.
- coffeefirst 4y agoThat’s the theory, but every time I measure it the combined data and JS needed to render it wind up being more than plain HTML both in bytes transferred and milliseconds to render. There will be exceptions of course, but I haven’t found them.
- martinald 4y ago
- jakub_jo 4y agoNot sure how I should feel about this. GitHub always felt snappy to me. It's a joy to use and I always admired their approach sending html over the wire. Let's see how this unfolds in the future.
- z9znz 4y agoI'm not a frontend guy, so maybe someone else here knows how to effectively benchmark the current system. I would be very curious to see how the current system performed versus a new React FE. Surely MS will do this themselves, but I don't know if they will publish it (especially if it shows the net result of the change was negative).
- systemicdanna 4y agoThere is also a very big difference in dev experience/toolset and dev velocity between RoR templates and React. Large apps that use RoR or Django templates become very messy and unenjoyable to work with over time. Plus being able to reuse parts of the state on the client is a big productivity boost. For me personally API+front end is a much cleaner and productive paradigm than having to pass massive dictionaries from a controller to a template. This separation of concerns allows to focus on and optimize data sources/retrieval and UI/rendering independently. Really nice!
- DoesntMatter22 4y agoApi + a fe framework is easier than all backend? .... Ohhhh kay
- systemicdanna 4y ago"Easier" is a difficult word to describe and agree on. Building rich UI is incomparably faster and more enjoyable in React than it is in Django or RoR (hence why most rich web UIs are built using JS frameworks). Deploying API and FE separately can also be more efficient, as these services likely require a different tech stack, a different scaling/load balancing setup, and have a different release cycle.
- ianbutler 4y agoI wonder if they're just replacing the parts of the site that needs to be dynamic with React, since you can mount a react app on any page. It seems overkill to replace even the relatively static parts as well.
- systemicdanna 4y agoThey will probably start with that and progressively replace all parts. Having a mixed front end framework is a very inefficient setup and a bad dev experience. Much easier to just SSR those static-ish pages and cache them until content changes.
- gedy 4y agoNot involved with this project but FYI (some) React sites can be rendered server side as well. This doesn't have to be some slow SPA load.
- colin353 4y agoWe're not using server side rendering extensively at GitHub (yet) but are experimenting with it on some React pages. Hoping to make the pages even faster than the previous Rails/ERB pages
- eyelidlessness 4y agoSo, this seems to be at least partly related to early introduction of Blocks[1] features. If so, and assuming that several of Blocks features are implemented with React, it makes some sense that they’d broaden adoption of React overall. You can use React for smaller isolated parts of a mostly client-static/server-rendered page, but it’s not typical on a page which is already as highly interactive as GH repos are (even if that interactivity is not immediately obvious). I personally wouldn’t pick React for, well, anything under my personal control. But it’s a sensible choice for the features they describe at their scale, and a sensible choice for their repo experience generally. I’ve seen some comments about bugginess in navigation etc, but none that don’t sound familiar from their Rails implementation. Hopefully with some bugs ironed out this will be bug compatible or better. 1: https://blocks.githubnext.com/ https://blocks.githubnext.com/
- mhoad 4y agoGenuinely confused why someone would reach for React in a 2022 rewrite scenario. It is on a bad path in terms of integrating with the web platform and doesn’t seem to have any clear signs to resolving that technical debt.
- randomguy0 4y agoWhat would your suggestions be in place of React?
- Existenceblinks 4y agoSolid. It will be a smooth transition DX-wise. And it's better in every angle. Except of course so called "big community", "lots of library", "easier to hire" .. poor excuse for technology advancement.
- StreamBright 4y agoScaling development efforts is a challenge. Reaching for the most popular thing out there is a solution.
- azemetre 4y agoDoes "most" popular thing actually matter? Or is it mostly choosing X because everyone else choose X as well? I mean we aren't talking about a rewrite in Mithril.js here. It's not hard to find people that want to work in vue, svelte, or solid. These three also seem to beat react at every benchmark (also nearly everything is better than react performance wise it seems). https://krausest.github.io/js-framework-benchmark/current.html https://krausest.github.io/js-framework-benchmark/current.ht... I honestly wonder how much bloat and loss of performance we're wasting on hundreds of millions of clients because companies and teams and orgs are no longer opting for better experiences thru experimentation or choosing better tools but simply chasing after wrong KPIs set by people that don't care about tech.
- nvllsvm 4y agoSo what would you recommend instead?
- weinzierl 4y ago"Repositories" and "Activities" on the Dashboard are not loading for me anymore. All I get are two endlessly turning spinners. Never had this issue before and looks like these two components can't load their data.
- 100k 4y ago(I worked on the backend for this, not the frontend.) Yes, the new code search and navigation experience is powered by React for the frontend. We decided to use that because we wanted to build a stateful, rich navigation experience. If you want to try it, please sign up for our beta https://github.com/features/code-search https://github.com/features/code-search (we have been clearing the waitlist daily.)
- rad_gruchalski 4y agoAnd yet, the two things I cared for as a user, are gone: scroll position no longer preserved on mobile devices, swiping back doesn’t work reliably.
- warpech 4y agoGitHub is a great example of mostly server-side generated HTML. Their output HTML is very stable: the structure rarely changes, is semantic, logical, and self-documenting. This has helped hundreds of browser extensions (e.g. Refined GitHub, ZenHub) and userscripts, including dozens of my own. Of course, treating HTML as API/data exchange format is fragile and might be seen as hindering progress by some of the GitHub staff. However, it has been like that for many years and was beneficial for the community. Perhaps not that beneficial for GitHub, who would prefer integrations over the official API. If GitHub's HTML changes to a dynamic React-powered div-soup, that might be the end of browser extensions and userscripts. And another reason for power users to flock to other platforms. Edit: React does not necessarily mean div-soup, but I have seen too many React-powered div-soups to expect GitHub's HTML to stay the same.
- solarkraft 4y ago> If GitHub's HTML changes to a dynamic React-powered div-soup, that might be the end of browser extensions and userscripts. But that feels more like a failure of user script developers (myself included). Why don't we have great tooling for modifying React apps (or do we but I don't know about it?)? The amount of them is already high and only going to increase. For modifying the Tidal UI I had to use MutationObservers, tied to how the components will render. It's bad, I'd rather modify the React app more directly, but hey, it does work reliably (albeit only because the app doesn't change much): https://gist.github.com/solarkraft/edd9d49bcf0f548b1aa285da7a8bf3ae https://gist.github.com/solarkraft/edd9d49bcf0f548b1aa285da7... Can we do better?
- warpech 4y ago> Can we do better? I hope yes! Some people are interested in this field. I think, we would need more mor flexible, adaptive scrapers based on content not the HTML structure. This week alone, I had interactions about "AI assisted web scraping" with two people: - https://twitter.com/geoffreylitt/status/1589677131873021953 https://twitter.com/geoffreylitt/status/1589677131873021953 - https://news.ycombinator.com/item?id=33555426 https://news.ycombinator.com/item?id=33555426
- colin353 4y agoI'm one of the engineers at GitHub who was behind this new UI, let me know if you have any questions. We chose React for this code search/code view because it has a lot of interactivity, and it has worked well so far. And we do intend to write a blog post with more details in the coming weeks.
- the_lonely_road 4y agoAre you going to switch to API mode for Rails as part of this process?
- deleted 4y ago[deleted]
- colin353 4y agoThis is just the first step of using React within GitHub.com, so we still use a lot of traditional Rails/ERB, even on the React pages (e.g. for the header/footer).
- rad_gruchalski 4y agoI was not expecting to see this comment at the top of this thread but since it is here… this UI really sucks on mobile (at least on iOS). A couple of immediate problems: 1) I am no longer able to visually distinguish folders from files, where did the folder icon disappear? 2) Swiping back is weird, sometimes it does work, sometimes it doesn’t. When it doesn’t, it either leaves me with a blank screen, or loads back what I just swiped away. 3) This really aggravates me, swipe back doesn’t preserve scroll position on long file listings, it renders the contents and scrolls to the top. This is really bad. 4) Where’s the footer?! 5) The whole thing just feels slow. GitHub ui is getting worse on mobile as time goes. For example, why can’t I fork a repo from the mobile page? I don’t know how you measure how your UI is used but I don’t think me browsing the code while sitting on the throne, or looking up a piece of code while laying in bed is so unusual. Maybe some of you should try that before such half baked stuff is released with much fanfare. Because the way I read it is “we’re excited to announce that we have broken your GitHub experience”.
- lossolo 4y agoRendered HTML on backend was faster for me and now seeing that last commit header to load and not just show instantly feels weird and slowish, whole site feels heavier for me now.
- deleted 4y ago[deleted]
- hrbf 4y agoIs this intended as satire or actually a serious statement? I increasingly cannot seem to make a confident distinction nowadays.
- deleted 4y ago[deleted]
- fellellor 4y agoI always wanted my phone and tablet devices to serve as mini heaters/hand warmers. Thanks!
- Existenceblinks 4y agoGraphQL has been downgrading their API product for a long while, now React will also downgrade their front pages product. I saw a html/custom-elements advocate engineer left a year ago, .. my speculation just kicks in.
- eurasiantiger 4y agoGraphQL is a language.
- 0xblinq 4y agoI really hope this does not end up like Reddit. Or that at least they keep an old.github.com that’s usable.
- johhhnnalin9773 4y agoUse angular
- johhhnnalin9773 4y agoUse Angular, much better!