Replies: 1 comment 1 reply
-
Interesting question! So at this point, there's no practical difference in terms of performance between the two approaches you've illustrated. However, there's this idea that we could automatically tree-shake messages (see #1). This is less relevant in Server Components, but on the client side we could benefit from this. Since you're using the same messages in both examples, the required messages would be the same though. So long story short, approach number 1 is definitely what I'd recommend since it has better ergonomics! Btw. I've opened #411 to discuss how different developers structure their messages, would be curious about your perspective! |
Beta Was this translation helpful? Give feedback.
-
If I have the message file as below:
And I want to use
A.B.C
andA.G.H
, what's the better approach in terms of data transmitted and performance?1
2
My assumption is that
useTranslations()
could possibly grab whatever given as the argument (A.B
,A.G
) in 2, so if I haveA.S
,A.Z
and so on, 1 wil still transmit the aforementioned, but 2 won't.Beta Was this translation helpful? Give feedback.
All reactions