Projects
Services
Migration
Blog
Alt textAlt text

Our 2024 takeaways with Sanity & Next.js

Reading Time

6 min read

Published on

December 31, 2024

What a year it's been. We've seen multiple new models from Open AI, Anthropic and Facebook. We've seen integrations of co-pilot throughout more and more of GitHub, and we've been first in line to speak about how we've started shipping faster with v0

We want to avoid the clichés of a typical 'end of year' listicle. Instead, we intend to compile how things have fundamentally changed this year, and how you can align yourself to ensure you're ready for the future.

Start using AI

This particular point goes out to both developers, and everybody else.

If you are a developer, do not follow the contrarian route of dismissing the usage of AI, you are actively compromising your learning and productivity. That being said, do not overly rely on AI, but use it for mundane tasks, like creating large chunks of repeatable boilerplate.

If you haven't used it already, and you're building a Sanity & Next.js website - download Cursor, steal our prompt and turn on the latest version of Sonnet (claude-3-5-sonnet-20241022). Just spend half a day looking at how to use composer. It's going to be a game-changer. It's not hyperbole.

For everybody else, you can, and you should be using AI today. The barrier is rapidly dropping, day by day, for being able to build primitive components for websites.

If you are a project manager without coding knowledge, you can use something like v0 to generate components for your frontend team. If you're a marketer, go generate some calculators, some infographics, you can even build an interactive landing page with v0.

You're going to single-handedly reduce the turnaround for your team, and you can pretend it's entirely down to your newly discovered development skills...

DDoS attacks are inevitable

We have always known DDoS attacks are relatively common, but we didn't know how common.

Take a couple of seconds out to see how many DDoS attacks are happening right now. Let that sink in for a second.

Here's an example of a real-life website. The graph shows 322k Web visits, 845 DDoS mitigation challenges, 55 DDoS denied. If you haven't noticed already, this in the past day, not in the last month.

image-e24c34088b7d5547e4779d0383c216cfe042d5cb-2919x1856-png

Just in the last day alone, Vercel has blocked 55 DDoS attacks to this website.

There's an inevitability that somebody will want to break your website, the more you scale, the more likely it's going to be. You need the infrastructure built-in to protect yourself from this.

Just use Vercel

In the example above, there's a tremendous amount of traffic pouring into the website daily. You would think that this would cost a fortune in hosting, to keep it up and running, especially seeing all the attempts to knock it down.

Truth be told, the above website runs on the Vercel pro plan. Better yet, because of our optimisation changes, it doesn't even exceed Vercel pro plan quotas. Yes, you read that right.

If you are on the fence about where to host your website, just use Vercel.

Now, you might be wondering why we have such strong opinions about this. To elaborate:

  1. The majority of our business is migrations from legacy systems
  2. The majority of legacy systems have been custom-built
  3. We have never encountered a custom-built solution that has worked correctly

If you're reading this, and suddenly, you've got cold-sweats thinking about when your custom-built architecture stops working, please don't hesitate to reach out. We have migrated websites with 600k+ pages to Vercel, I'm sure we can manage yours.

Presentation & Live Content API

If you have been following Sanity CMS changelogs, you may have noticed two massive updates in 2024 - Live Content API & Presentation.

Why have we grouped them together? Because this should be table-stakes for building a website with Sanity. Why? Because they're such a significant improvement to the whole editorial experience, along with being relatively easy to implement on a greenfield project.

a

Presentation allows for a user to go to a website, click the text they want to edit, and immediately jump into that field. Drag and drop by default, with the ability to zoom out to get a perspective of the whole page.

With Live Content API you don't have to worry about caching or server-side rendering, or even some of the older methods of firing a webhook when your content changes.

In other words, if you change something on your website, it reflects instantly. Whether that is changing a product from out-of-stock, to in-stock, or changing the inevitable typo's in your blog posts, it's live by default.

Both of these make the whole process of updating websites or changing content so much easier. There's no excuse to not implement it.

Performance is the #1 feature

Performance is pivotal to user experience. It's easy to optimise for it at the beginning, but becomes much harder as the website scales.

Instead of going through all the reasons why you should improve performance, we are going to drop the common culprits of a slow website and how to fix them.

  • Too many analytics packages
    • Assess what analytics packages you actually use, drop the rest. Make it a quarterly check-up to see if you're still using that Hotjar library, or LinkedIn tracking pixel.
  • Material UI
  • Font Awesome
    • If you're using this package with Next.js, make sure to run Next.js bundle analyser. We used to use this, and it made up half the size of our entire website. We always advise using Lucide instead.
  • Google Analytics, YouTube, Google Tag Manager
    • Most devs we have spoken to are not aware that Next.js third-party libraries exist. They are set and forget versions, with optimal loading strategies. Just swap them out and never look back.
  • Huge DOM size
    • This often happens with large chunks of data. Check to see if you can offset some of this with lazy loading and dynamic imports. If you're building page builders, this is especially important.

With all of the above, here is some advice regarding lighthouse tests and their respective performance in different environments.

a

If you're struggling to optimise your website, feel free to get in touch.

The year ahead for Roboto Studio

As with every year, we want to thank everybody who took the time out to actually read this far, the folks that trusted in our ability to build some of the best editorial experiences on the web and especially the incredible team that makes all of this possible.

We're excited to make progress towards our ISO 27001 certification, we'll continue to share the discoveries along the way with bleeding-edge tech and enterprise grade security.

Alongside this, we’re also expanding our team. We will be working with folks who share the same drive to design, develop and continue delivering the exceptional work you expect from us.

We're looking forward to a year filled with growth, fresh challenges, and even better results for our clients. Here's to an exciting and successful year ahead!

Get in touch

Here's to another one

Happy New Year! I'm hoping that, at the time of reading this, you're doing something far more exciting than Jools Holland and the hootenanny. We'd love to hear your plans for the future. Get in touch

Logo

Services

Legal

Like what you see?

Sign up for our newsletter to stay up to date with our latest projects and insights.

© 2024 Roboto Studio Ltd - 11126043

Roboto Studio Ltd,

71-75 Shelton Street,

Covent Garden,

London, WC2H 9JQ

Registered in England and Wales | VAT Number 426637679