Steve Sewell Profile picture
Mar 16 7 tweets 2 min read
Performance tip: did you know you can make a fast function for relative time strings with ~30 lines of code and 0 dependencies?

Code in 🧵:
Steal the code, or let me know how to improve it!

Github gist: gist.github.com/steve8708/ada9…
The key here is Intl.RelativeTimeFormat

Learn more about Intl.RelativeTimeFormat: developer.mozilla.org/en-US/docs/Web…
Fun video representation:
Btw, if you want to test your site's performance to see if shedding JS dependencies with techniques like the above will help your load time, this tool may be helpful: builder.io/c/performance-…

• • •

Missing some Tweet in this thread? You can try to force a refresh
 

Keep Current with Steve Sewell

Steve Sewell Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

PDF

Twitter may remove this content at anytime! Save it as PDF for later use!

Try unrolling a thread yourself!

how to unroll video
  1. Follow @ThreadReaderApp to mention us!

  2. From a Twitter thread mention us with a keyword "unroll"
@threadreaderapp unroll

Practice here first or read more on our help page!

More from @Steve8708

Mar 5
Loving how this perf tool we're making is coming along

Most tools show what *could* improve, but poorly quantify what will make a real difference

Spoiler alert: excessive JS is more of an issue than you think

More examples and how it works in 🧵:
How does it work? We ingest the page, modify the code, and then run the new page through @____lighthouse to test the impact of each possible optimization

We are seeing the same clear patterns among sites large and small: loading up your site with JS is crushing your performance
So what do you do about it? You need to free yourself from this heavy JS dependency

This is why we are making Partytown and @QwikDev

Partytown: moves third party scripts to a web worker

Qwik: removes all first party JS until absolutely needed

Results are exactly as hoped:
Read 9 tweets
Feb 17
I've been digging into React Server Components via @ShopifyDevs Hydrogen, and I'm very impressed & excited

Here is a visual explanation of my understanding of RSC and what it means for you 🧵: Image
First, how do you author server components?

In short, they are just React components! With all the latest goodies of concurrent mode, such as elegantly fetching data via hooks

Server components can even fetch private data and are denoted by a file ending in *.server.js Image
Next, how do you load these components?

For Hydrogen, the top level is always a server component.

But, with some caveats, you can mix server components, client (aka traditional) components, and shared components (components that can render on server OR client), in one tree Image
Read 9 tweets
Jan 25
Innovation in web performance has been 🔥 lately. Here are the projects you need to watch in 2022: 🧵
for extreme rendering performance, @solid_js is the obvious winner. you cannot beat their combination of crushing benchmarks + having an amazing DX and community
for having a huge community and adoption, @react + @nextjs is still the no brainer. the support, ecosystem, and talent in this community is unbeatable
Read 11 tweets

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3/month or $30/year) and get exclusive features!

Become Premium

Don't want to be a Premium member but still want to support us?

Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal

Or Donate anonymously using crypto!

Ethereum

0xfe58350B80634f60Fa6Dc149a72b4DFbc17D341E copy

Bitcoin

3ATGMxNzCUFzxpMCHL5sWSt4DVtS8UqXpi copy

Thank you for your support!

Follow Us on Twitter!

:(