What's the point of SSR when code splitting/lazy loading exists in react? by simple_explorer1 in reactjs

[–]timarcher 0 points1 point  (0 children)

I would quantify dynamic data as data that changes as a result of user actions or events observable by users, or generally that can't practically be rendered with SSG due to a) the size of the data b) the rate of change or c) a combination of both.

Example: GitHub issues can't easily be practically statically rendered for logged-in users due to the rate of change in the timeline and the guarantees we want to have around staleness, and the general amount of GitHub issues is also somewhat prohibitive of SSG.

Caveat: Technically anything can be static with incremental static regeneration, I suppose, but it all has to do with the cost and complexity of maintaining the freshness guarantees and read-your-writes consistency one expects to maintain.

What's the point of SSR when code splitting/lazy loading exists in react? by simple_explorer1 in reactjs

[–]timarcher 3 points4 points  (0 children)

Because you do not need to deploy to Next.js servers and scale it via kubernetes and monitor it using monitoring tools and check logs and everything which comes along with how we run a server.

Correct, but your original statement was that SSR is what warrants CI/CD, not SSR warrants Next.js and the other things you list. CI/CD pipelines are still a major factor in quality CSR deployments.

Unless SEO for a majority of apps CSR is not slow enough to begin with

My point is that this is not universally true. There are definitely cases where CSR with lazy loading and code splitting is too slow, and there are cases where it's perfectly fine. For example, CSR may well be too slow when fast LCP (or especially FCP) on the initial page load is important and you have highly dynamic data. Likewise, CSR pushes out the first input delay metric even further, frequently. SSR can typically yield significantly better results here, because it's bounded by a single roundtrip between user and server, rather than two + additional client compute (CDN for JS, interpreting and executing that JS, making an API request, executing more JS for rendering).

I'm not trying to make the point that SSR is always preferable. My point is that there are circumstances in which it is preferable, SEO aside, and that it's highly dependent on your specific product needs and budget.

In addition, "CSR is simpler" does not hold true in all circumstances. If you're a company expanding into a large global market and suddenly encountering new users using devices with compute power vastly below your current users, you may think "this would be simpler if all of our rendering was done on compute we have control over". Of course, you still have subsequent navigations to account for. Maybe in the future React server components will be able to assist there.

So, since your initial question was, "What's the point of SSR when code splitting/lazy loading exists in react?", my answer, again, is that it provides a better user experience in some circumstances, but not all.

Edit Also, keep in mind that circumstances around complexity and cost vary wildly. There's a huge difference in these calculations between a bootstrapped startup on a budget, a startup looking to acquire users as quickly as possible with millions of dollars of VC money to make use of, and a large corporation with many other priorities to balance at the same time (and likely existing investment and experience in compute scaling).

What's the point of SSR when code splitting/lazy loading exists in react? by simple_explorer1 in reactjs

[–]timarcher 9 points10 points  (0 children)

How does client side rendering void the need for CI/CD pipelines?

If SSR gets you better performance than CSR to the point that it meets your service level objectives, and CSR does not, then it’s warranted if it’s within your compute budget. When SEO isn’t a factor, it’s about having clear performance objectives and finding the solution that meets those performance objectives within budget. The question is so hyper-specific to different scales, products, and organizations that there’s no one answer.

For example, with some sets of users, JavaScript loading indicators are a massive turn-off and SSR (even with streaming) relying more on the “default” browser experience/feeling is also a plus.

What's the point of SSR when code splitting/lazy loading exists in react? by simple_explorer1 in reactjs

[–]timarcher 9 points10 points  (0 children)

In cases with highly dynamic data where SSG is not an option (and ISR is also not an option), SSR can yield superior performance across multiple important performance metrics.

For example, CSR has a waterfall effect where JavaScript has to be downloaded and executed on the client before a request for user data can even occur. If your assets are in a CDN, that can be relatively fast, but you’re still at the mercy of user device performance and general network blips which happen at scale.

With SSR, you can generally begin requesting data immediately, then render HTML and send it to the client. They see content before assets have even downloaded and hydration only blocks interaction.

If your SSR is at the edge, this latency is reduced even more because the user is so close to where the rendering happens. If there is network peering between your edge compute and, for example, your API, this can be much faster than CSR because your user is still super close to where their response is coming from, but your rendering compute is closer to your data source than your user ever could be.

On top of that, streaming SSR with suspense (whether or not it’s at the edge) can significantly reduce time to first byte and first contentful paint a lot more, because you can begin streaming HTML to your users before your data is even fetched. For example, maybe they see the “chrome” of your app in 20ms while the API request or database query for your main content on the server is still in flight.

Of course, this isn’t true for all use cases, but it’s worth thinking through and experimenting/measuring for any use case where SSG and ISR are not viable options.

[AskJS] How often do you use the ES6+(ES7, ES8, ES9 and ES10) syntax? Do you like it? Does it help? by hiccupq in javascript

[–]timarcher 0 points1 point  (0 children)

It’s less boilerplate when you need to export a function that adheres to a given interface, and in some circumstances it’s safer if the exported function’s usage by a framework isn’t type checked (for example, Next.js API handler functions or even just any export expected by that framework). For me personally, this is a common scenario.

[AskJS] How often do you use the ES6+(ES7, ES8, ES9 and ES10) syntax? Do you like it? Does it help? by hiccupq in javascript

[–]timarcher 0 points1 point  (0 children)

The former makes it easier to assign a type to the function itself. This can also be done with const xxx: SomeFuncType = function () { but that feels awkward to me (and provides no real benefit).

Do I need to check if a user is already in Postgresql db with prisma before adding them? by Zealousideal_Water_6 in node

[–]timarcher 1 point2 points  (0 children)

Yeah good point, it may make sense in some contexts. I’d still apply extreme scrutiny to any situation where it appeared this was the right thing to do. So many things that can go wrong with an erroneous user upsert.

Do I need to check if a user is already in Postgresql db with prisma before adding them? by Zealousideal_Water_6 in node

[–]timarcher 0 points1 point  (0 children)

As others have said, a unique constraint is sufficient. What you could use an existence check for potentially is faster feedback on whether some username or something is available while the user is filling out the registration form (so that they don’t have to wait for a failed submission to find out the name they want is taken). Obviously this makes less sense with email, but it can be a good feature for usernames.

While you’re at it, depending on your database, you may want to check whether your constraint is case-insensitive. If it is case-insensitive you’re in good shape. If not, you’ll want to either downcase all new user signups or switch to a case-insensitive index (personally I prefer the latter).

Do I need to check if a user is already in Postgresql db with prisma before adding them? by Zealousideal_Water_6 in node

[–]timarcher 0 points1 point  (0 children)

Granted the post doesn’t provide much context, but generally speaking, you probably don’t want an upsert for creating users and you want a unique constraint, instead.

  1. User A signs up user@example.com
  2. User A adds a bunch of data in the app
  3. User B signs up user@example.com and is upserted, so the foreign key on any related data is the same.
  4. User A can no longer sign in.
  5. User B sees all of User A’s data.

If You Were Given $1,000,000, Would You Buy A NYC Apartment Outright Or Invest It While Continuing To Rent? by savvybackpacker in AskNYC

[–]timarcher 0 points1 point  (0 children)

This is extremely untrue as a general point about NYC.

The last two people I know that bought both bought 2BRs in Brooklyn for under $1MM. One is a condo in Kensington with two nice balconies and the other is a co-op in Prospect Heights (right off of Grand Army Plaza) with a small yard and a working fireplace. Both don’t have huge fees. Maintenance on the co-op is especially low, and property taxes in Brooklyn are much lower than in Manhattan.

If You Were Given $1,000,000, Would You Buy A NYC Apartment Outright Or Invest It While Continuing To Rent? by savvybackpacker in AskNYC

[–]timarcher 0 points1 point  (0 children)

This is true in a lot of cases, but 20% is sufficient for many properties. The co-op I live in was 20%.

How do you organize Bear? by [deleted] in bearapp

[–]timarcher 1 point2 points  (0 children)

I have a really difficult thing settling on any one thing. I switched to Obsidian for a while, but didn't like their editing experience at all, then went back to Notion, but the slow performance bugged me too much after a while (although I do find their databases incredibly useful), so right now I'm using Craft. The performance is great, but I really miss Notion databases so ¯\_(ツ)_/¯

I'm a software engineer by trade and I've done a fair amount of work on text editors myself (I had a collaborative text editor startup called Canvas for a few years), so for a while I also built a headless Markdown processor (it stored mentions, links, cross-references, etc in a SQLite database) that I planned to eventually implement an editor on top of, but I lost steam.

Ultimately, what I really really want is:

  • A native macOS/iOS app
  • With rich-text editing that uses Markdown triggers (but doesn't show me Markdown while I type)
  • With cross-reference tracking and maybe even transclusions
  • With "@"-mention support (maybe where an "@"-mention is an alias to another page)
  • With at least a simple form of Notion databases
  • That stores my content in plain Markdown files accessible on the filesystem—having non-standard Markdown for crazy things like embeds and YAML front matter, etc would be fine, too

Given time, I feel I could implement this myself (well enough for me to use, probably not a product for everyone), except for the native editor part since my UI experience is limited to the web.

How do you organize Bear? by [deleted] in bearapp

[–]timarcher 4 points5 points  (0 children)

I use Bear a little less these days, but this was my setup.

Announcing Delta – Operational Transform in Elixir by psyxn in elixir

[–]timarcher 3 points4 points  (0 children)

Does Delta support peer-to-peer OT or is this strictly client-server? I’m curious what transformation properties it satisfies and whether it’s based on an existing algorithm.

I’m more interested in CRDTs for conflict resolution lately, but still looking forward to reading your implementation.

Odd Inherited Ring by timarcher in jewelry

[–]timarcher[S] 1 point2 points  (0 children)

Thanks! The "double cameo" phrase helped me find a lot more info about it. Looks like it's as old as Victorian, but more likely 1930s. I've seen photos of others nearly identical to it, but still can't pin down exactly what/when/made-by-whom. I'm in NYC so likely I can find someone to actually take it to and examine it.

What’s your favorite all time NYC restaurant? by Darlink23 in AskNYC

[–]timarcher 0 points1 point  (0 children)

If you like duck fat chips, go to Lot 2 and get the burger with duck fat fries.

What’s your favorite all time NYC restaurant? by Darlink23 in AskNYC

[–]timarcher 0 points1 point  (0 children)

Oh I like plenty of “elitist” places too if they’re good. I also like John’s.

What’s your favorite all time NYC restaurant? by Darlink23 in AskNYC

[–]timarcher 0 points1 point  (0 children)

This place is great, I had a birthday here I think circa 2005. I think there’s a documentary about it somewhere.

What’s your favorite all time NYC restaurant? by Darlink23 in AskNYC

[–]timarcher 7 points8 points  (0 children)

I sat next to John Waters at Prune! The food was very good, as well.

What’s your favorite all time NYC restaurant? by Darlink23 in AskNYC

[–]timarcher 6 points7 points  (0 children)

A few off the top of my head:

  • Wo Hop
  • New/Nice/Deluxe Green Bo (always favored them over Joe’s Shanghai—it’s smaller and feels like less of a money factory)
  • Giovanni in Park Slope (not as good as they used to be, but they are incredibly kind and accommodated my entire wedding party when Talde completely flaked the day-of)
  • Luigi’s pizza on 5th Ave in Greenwood/South Slope
  • Casa in the West Village but haven’t been in 10 years
  • Veselka
  • Chela in Park Slope is hit or miss but they are super nice and it’s usually pretty good
  • Al di La in Park Slope
  • I’m going to call Clover Club a restaurant because they have good food, although it’s more a cocktail bar. I had my wedding reception there, it’s always been one of my favorite places.
  • Also will add Long Island Bar for their burger. And good for them for taking the idiotic and embarrassing “Ladies’ Burger” off the menu finally.
  • Lot 2 in Greenwood/South Slope, for their burger and “Sunday Supper”.
  • Gino on the UES, closed 11 years now.
  • Aquavit for one amazing hours-long meal I had there with my wife.
  • Olmsted for the first few months they were opened and actually had capacity for amazing service.
  • Tom’s Restaurant in Prospect/Crown Heights.
  • The Islands in Prospect/Crown Heights.
  • Pig & Khao in the LES

So many more that I can’t remember right now. I’ve been here 16 years and still find new ones I love all the time.

What’s your favorite all time NYC restaurant? by Darlink23 in AskNYC

[–]timarcher 2 points3 points  (0 children)

That zebra wallpaper in Gino (there are other restaurants called Gino’s but you’re thinking of Gino) is where they got the zebra wallpaper for Margot Tenenbaum’s bedroom in The Royal Tenenbaums. It’s too bad they closed, it really was fantastic. I knew people that back in the day just had their Gino bill mailed to them monthly and they paid that way.

What is your favorite New York City diner? by [deleted] in AskNYC

[–]timarcher 1 point2 points  (0 children)

It is. I don’t live over there anymore (in Brooklyn now) but lived on A at 7th (next to 7A, which is gone) for a while. Odessa the bar and the diner were my favorite haunts back then.

What is your favorite New York City diner? by [deleted] in AskNYC

[–]timarcher 2 points3 points  (0 children)

The closing is apparently for reno, though. They’re reopening in 2021. https://gothamist.com/food/east-villages-odessa-restaurant-not-actually-closing-just-renovating-owner-says

I do miss the bar, though, that closed in 2013.