-
Notifications
You must be signed in to change notification settings - Fork 27.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add example with react-i18next #14978
Conversation
Stats from current PRDefault Server Mode (Decrease detected ✓)General
Page Load Tests Overall decrease
|
vercel/next.js canary | cseas/next.js canary | Change | |
---|---|---|---|
/ failed reqs | 0 | 0 | ✓ |
/ total time (seconds) | 2.152 | 2.19 | |
/ avg req/sec | 1161.76 | 1141.44 | |
/error-in-render failed reqs | 0 | 0 | ✓ |
/error-in-render total time (seconds) | 1.409 | 1.48 | |
/error-in-render avg req/sec | 1774.38 | 1688.67 |
Client Bundles (main, webpack, commons)
vercel/next.js canary | cseas/next.js canary | Change | |
---|---|---|---|
main-HASH.js gzip | 6.63 kB | 6.63 kB | ✓ |
webpack-HASH.js gzip | 751 B | 751 B | ✓ |
19b7e98f51cc..c646.js gzip | 10.7 kB | 10.7 kB | ✓ |
framework.HASH.js gzip | 39.1 kB | 39.1 kB | ✓ |
Overall change | 57.2 kB | 57.2 kB | ✓ |
Client Bundles (main, webpack, commons) Modern
vercel/next.js canary | cseas/next.js canary | Change | |
---|---|---|---|
main-HASH.module.js gzip | 5.71 kB | 5.71 kB | ✓ |
webpack-HASH..dule.js gzip | 751 B | 751 B | ✓ |
19b7e98f51cc..dule.js gzip | 7.1 kB | 7.1 kB | ✓ |
framework.HA..dule.js gzip | 39.1 kB | 39.1 kB | ✓ |
Overall change | 52.7 kB | 52.7 kB | ✓ |
Legacy Client Bundles (polyfills)
vercel/next.js canary | cseas/next.js canary | Change | |
---|---|---|---|
polyfills-HASH.js gzip | 26.4 kB | 26.4 kB | ✓ |
Overall change | 26.4 kB | 26.4 kB | ✓ |
Client Build Manifests
vercel/next.js canary | cseas/next.js canary | Change | |
---|---|---|---|
_buildManifest.js gzip | 268 B | 268 B | ✓ |
_buildManife..dule.js gzip | 272 B | 272 B | ✓ |
Overall change | 540 B | 540 B | ✓ |
Rendered Page Sizes
vercel/next.js canary | cseas/next.js canary | Change | |
---|---|---|---|
index.html gzip | 954 B | 954 B | ✓ |
link.html gzip | 960 B | 960 B | ✓ |
withRouter.html gzip | 946 B | 946 B | ✓ |
Overall change | 2.86 kB | 2.86 kB | ✓ |
Serverless Mode
General
vercel/next.js canary | cseas/next.js canary | Change | |
---|---|---|---|
buildDuration | 13.2s | 13.4s | |
nodeModulesSize | 65.9 MB | 65.9 MB | ✓ |
Client Bundles (main, webpack, commons)
vercel/next.js canary | cseas/next.js canary | Change | |
---|---|---|---|
main-HASH.js gzip | 6.63 kB | 6.63 kB | ✓ |
webpack-HASH.js gzip | 751 B | 751 B | ✓ |
19b7e98f51cc..c646.js gzip | 10.7 kB | 10.7 kB | ✓ |
framework.HASH.js gzip | 39.1 kB | 39.1 kB | ✓ |
Overall change | 57.2 kB | 57.2 kB | ✓ |
Client Bundles (main, webpack, commons) Modern
vercel/next.js canary | cseas/next.js canary | Change | |
---|---|---|---|
main-HASH.module.js gzip | 5.71 kB | 5.71 kB | ✓ |
webpack-HASH..dule.js gzip | 751 B | 751 B | ✓ |
19b7e98f51cc..dule.js gzip | 7.1 kB | 7.1 kB | ✓ |
framework.HA..dule.js gzip | 39.1 kB | 39.1 kB | ✓ |
Overall change | 52.7 kB | 52.7 kB | ✓ |
Legacy Client Bundles (polyfills)
vercel/next.js canary | cseas/next.js canary | Change | |
---|---|---|---|
polyfills-HASH.js gzip | 26.4 kB | 26.4 kB | ✓ |
Overall change | 26.4 kB | 26.4 kB | ✓ |
Client Build Manifests
vercel/next.js canary | cseas/next.js canary | Change | |
---|---|---|---|
_buildManifest.js gzip | 268 B | 268 B | ✓ |
_buildManife..dule.js gzip | 272 B | 272 B | ✓ |
Overall change | 540 B | 540 B | ✓ |
Serverless bundles
vercel/next.js canary | cseas/next.js canary | Change | |
---|---|---|---|
_error.js | 876 kB | 876 kB | ✓ |
404.html | 4.17 kB | 4.17 kB | ✓ |
hooks.html | 3.79 kB | 3.79 kB | ✓ |
index.js | 877 kB | 877 kB | ✓ |
link.js | 915 kB | 915 kB | ✓ |
routerDirect.js | 909 kB | 909 kB | ✓ |
withRouter.js | 909 kB | 909 kB | ✓ |
Overall change | 4.49 MB | 4.49 MB | ✓ |
As far as I can tell, this will load all translations into every client side app. |
Stats from current PRDefault Server Mode (Increase detected
|
vercel/next.js canary | cseas/next.js canary | Change | |
---|---|---|---|
buildDuration | 12.5s | 12.3s | -105ms |
nodeModulesSize | 65.9 MB | 65.9 MB | ✓ |
Page Load Tests Overall increase ✓
vercel/next.js canary | cseas/next.js canary | Change | |
---|---|---|---|
/ failed reqs | 0 | 0 | ✓ |
/ total time (seconds) | 2.226 | 2.131 | -0.1 |
/ avg req/sec | 1123.29 | 1173.06 | +49.77 |
/error-in-render failed reqs | 0 | 0 | ✓ |
/error-in-render total time (seconds) | 1.455 | 1.482 | |
/error-in-render avg req/sec | 1718.42 | 1686.49 |
Client Bundles (main, webpack, commons)
vercel/next.js canary | cseas/next.js canary | Change | |
---|---|---|---|
main-HASH.js gzip | 6.63 kB | 6.63 kB | ✓ |
webpack-HASH.js gzip | 751 B | 751 B | ✓ |
19b7e98f51cc..c646.js gzip | 10.7 kB | 10.7 kB | ✓ |
framework.HASH.js gzip | 39.1 kB | 39.1 kB | ✓ |
Overall change | 57.2 kB | 57.2 kB | ✓ |
Client Bundles (main, webpack, commons) Modern
vercel/next.js canary | cseas/next.js canary | Change | |
---|---|---|---|
main-HASH.module.js gzip | 5.71 kB | 5.71 kB | ✓ |
webpack-HASH..dule.js gzip | 751 B | 751 B | ✓ |
19b7e98f51cc..dule.js gzip | 7.1 kB | 7.1 kB | ✓ |
framework.HA..dule.js gzip | 39.1 kB | 39.1 kB | ✓ |
Overall change | 52.7 kB | 52.7 kB | ✓ |
Legacy Client Bundles (polyfills)
vercel/next.js canary | cseas/next.js canary | Change | |
---|---|---|---|
polyfills-HASH.js gzip | 26.4 kB | 26.4 kB | ✓ |
Overall change | 26.4 kB | 26.4 kB | ✓ |
Client Build Manifests
vercel/next.js canary | cseas/next.js canary | Change | |
---|---|---|---|
_buildManifest.js gzip | 268 B | 268 B | ✓ |
_buildManife..dule.js gzip | 272 B | 272 B | ✓ |
Overall change | 540 B | 540 B | ✓ |
Rendered Page Sizes
vercel/next.js canary | cseas/next.js canary | Change | |
---|---|---|---|
index.html gzip | 954 B | 954 B | ✓ |
link.html gzip | 960 B | 960 B | ✓ |
withRouter.html gzip | 946 B | 946 B | ✓ |
Overall change | 2.86 kB | 2.86 kB | ✓ |
Serverless Mode
General
vercel/next.js canary | cseas/next.js canary | Change | |
---|---|---|---|
buildDuration | 13.6s | 14.8s | |
nodeModulesSize | 65.9 MB | 65.9 MB | ✓ |
Client Bundles (main, webpack, commons)
vercel/next.js canary | cseas/next.js canary | Change | |
---|---|---|---|
main-HASH.js gzip | 6.63 kB | 6.63 kB | ✓ |
webpack-HASH.js gzip | 751 B | 751 B | ✓ |
19b7e98f51cc..c646.js gzip | 10.7 kB | 10.7 kB | ✓ |
framework.HASH.js gzip | 39.1 kB | 39.1 kB | ✓ |
Overall change | 57.2 kB | 57.2 kB | ✓ |
Client Bundles (main, webpack, commons) Modern
vercel/next.js canary | cseas/next.js canary | Change | |
---|---|---|---|
main-HASH.module.js gzip | 5.71 kB | 5.71 kB | ✓ |
webpack-HASH..dule.js gzip | 751 B | 751 B | ✓ |
19b7e98f51cc..dule.js gzip | 7.1 kB | 7.1 kB | ✓ |
framework.HA..dule.js gzip | 39.1 kB | 39.1 kB | ✓ |
Overall change | 52.7 kB | 52.7 kB | ✓ |
Legacy Client Bundles (polyfills)
vercel/next.js canary | cseas/next.js canary | Change | |
---|---|---|---|
polyfills-HASH.js gzip | 26.4 kB | 26.4 kB | ✓ |
Overall change | 26.4 kB | 26.4 kB | ✓ |
Client Build Manifests
vercel/next.js canary | cseas/next.js canary | Change | |
---|---|---|---|
_buildManifest.js gzip | 268 B | 268 B | ✓ |
_buildManife..dule.js gzip | 272 B | 272 B | ✓ |
Overall change | 540 B | 540 B | ✓ |
Serverless bundles
vercel/next.js canary | cseas/next.js canary | Change | |
---|---|---|---|
_error.js | 876 kB | 876 kB | ✓ |
404.html | 4.17 kB | 4.17 kB | ✓ |
hooks.html | 3.79 kB | 3.79 kB | ✓ |
index.js | 877 kB | 877 kB | ✓ |
link.js | 915 kB | 915 kB | ✓ |
routerDirect.js | 909 kB | 909 kB | ✓ |
withRouter.js | 909 kB | 909 kB | ✓ |
Overall change | 4.49 MB | 4.49 MB | ✓ |
@isaachinman Wouldn't using namespaces solve that? Anyway, here's my use case for context:
It took me several days to figure out Please let me know if this adds any caveats that I need to mention in the readme. But for my particular use case, this is the exact example I was looking for. Just straightforward translations with |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Blocking per @isaachinman review. This should follow the official example:
https://github.com/isaachinman/next-i18next-vercel
@Timer That example uses the experimental My whole idea of coming up with this example was so Avoiding experimental features was the reason I didn't want to follow the rosetta example in the first place. Would the Next.js team recommend using experimental features in production? |
Stats from current PRDefault Server Mode (Increase detected
|
vercel/next.js canary | cseas/next.js canary | Change | |
---|---|---|---|
buildDuration | 12.9s | 12.8s | -158ms |
nodeModulesSize | 66 MB | 66 MB | ✓ |
Page Load Tests Overall increase ✓
vercel/next.js canary | cseas/next.js canary | Change | |
---|---|---|---|
/ failed reqs | 0 | 0 | ✓ |
/ total time (seconds) | 2.16 | 2.088 | -0.07 |
/ avg req/sec | 1157.44 | 1197.12 | +39.68 |
/error-in-render failed reqs | 0 | 0 | ✓ |
/error-in-render total time (seconds) | 1.337 | 1.339 | 0 |
/error-in-render avg req/sec | 1869.22 | 1866.43 |
Client Bundles (main, webpack, commons)
vercel/next.js canary | cseas/next.js canary | Change | |
---|---|---|---|
main-HASH.js gzip | 6.63 kB | 6.63 kB | ✓ |
webpack-HASH.js gzip | 751 B | 751 B | ✓ |
19b7e98f51cc..c646.js gzip | 10.7 kB | 10.7 kB | ✓ |
framework.HASH.js gzip | 39.1 kB | 39.1 kB | ✓ |
Overall change | 57.2 kB | 57.2 kB | ✓ |
Client Bundles (main, webpack, commons) Modern
vercel/next.js canary | cseas/next.js canary | Change | |
---|---|---|---|
main-HASH.module.js gzip | 5.71 kB | 5.71 kB | ✓ |
webpack-HASH..dule.js gzip | 751 B | 751 B | ✓ |
19b7e98f51cc..dule.js gzip | 7.1 kB | 7.1 kB | ✓ |
framework.HA..dule.js gzip | 39.1 kB | 39.1 kB | ✓ |
Overall change | 52.7 kB | 52.7 kB | ✓ |
Legacy Client Bundles (polyfills)
vercel/next.js canary | cseas/next.js canary | Change | |
---|---|---|---|
polyfills-HASH.js gzip | 26.4 kB | 26.4 kB | ✓ |
Overall change | 26.4 kB | 26.4 kB | ✓ |
Client Build Manifests
vercel/next.js canary | cseas/next.js canary | Change | |
---|---|---|---|
_buildManifest.js gzip | 268 B | 268 B | ✓ |
_buildManife..dule.js gzip | 272 B | 272 B | ✓ |
Overall change | 540 B | 540 B | ✓ |
Rendered Page Sizes
vercel/next.js canary | cseas/next.js canary | Change | |
---|---|---|---|
index.html gzip | 954 B | 954 B | ✓ |
link.html gzip | 960 B | 960 B | ✓ |
withRouter.html gzip | 946 B | 946 B | ✓ |
Overall change | 2.86 kB | 2.86 kB | ✓ |
Serverless Mode
General
vercel/next.js canary | cseas/next.js canary | Change | |
---|---|---|---|
buildDuration | 14.1s | 13.9s | -238ms |
nodeModulesSize | 66 MB | 66 MB | ✓ |
Client Bundles (main, webpack, commons)
vercel/next.js canary | cseas/next.js canary | Change | |
---|---|---|---|
main-HASH.js gzip | 6.63 kB | 6.63 kB | ✓ |
webpack-HASH.js gzip | 751 B | 751 B | ✓ |
19b7e98f51cc..c646.js gzip | 10.7 kB | 10.7 kB | ✓ |
framework.HASH.js gzip | 39.1 kB | 39.1 kB | ✓ |
Overall change | 57.2 kB | 57.2 kB | ✓ |
Client Bundles (main, webpack, commons) Modern
vercel/next.js canary | cseas/next.js canary | Change | |
---|---|---|---|
main-HASH.module.js gzip | 5.71 kB | 5.71 kB | ✓ |
webpack-HASH..dule.js gzip | 751 B | 751 B | ✓ |
19b7e98f51cc..dule.js gzip | 7.1 kB | 7.1 kB | ✓ |
framework.HA..dule.js gzip | 39.1 kB | 39.1 kB | ✓ |
Overall change | 52.7 kB | 52.7 kB | ✓ |
Legacy Client Bundles (polyfills)
vercel/next.js canary | cseas/next.js canary | Change | |
---|---|---|---|
polyfills-HASH.js gzip | 26.4 kB | 26.4 kB | ✓ |
Overall change | 26.4 kB | 26.4 kB | ✓ |
Client Build Manifests
vercel/next.js canary | cseas/next.js canary | Change | |
---|---|---|---|
_buildManifest.js gzip | 268 B | 268 B | ✓ |
_buildManife..dule.js gzip | 272 B | 272 B | ✓ |
Overall change | 540 B | 540 B | ✓ |
Serverless bundles
vercel/next.js canary | cseas/next.js canary | Change | |
---|---|---|---|
_error.js | 876 kB | 876 kB | ✓ |
404.html | 4.17 kB | 4.17 kB | ✓ |
hooks.html | 3.79 kB | 3.79 kB | ✓ |
index.js | 877 kB | 877 kB | ✓ |
link.js | 915 kB | 915 kB | ✓ |
routerDirect.js | 909 kB | 909 kB | ✓ |
withRouter.js | 909 kB | 909 kB | ✓ |
Overall change | 4.49 MB | 4.49 MB | ✓ |
Hey @cseas - I can assure you that within a couple weeks, serverless with |
@isaachinman That sounds awesome! I've been waiting for Regarding This was the case with me. Searched for translations with React, found Regarding |
Stats from current PRDefault Server Mode (Increase detected
|
vercel/next.js canary | cseas/next.js canary | Change | |
---|---|---|---|
buildDuration | 11.5s | 11.5s | |
nodeModulesSize | 66.1 MB | 66.1 MB | ✓ |
Page Load Tests Overall increase ✓
vercel/next.js canary | cseas/next.js canary | Change | |
---|---|---|---|
/ failed reqs | 0 | 0 | ✓ |
/ total time (seconds) | 2.025 | 2.04 | |
/ avg req/sec | 1234.87 | 1225.63 | |
/error-in-render failed reqs | 0 | 0 | ✓ |
/error-in-render total time (seconds) | 1.391 | 1.378 | -0.01 |
/error-in-render avg req/sec | 1796.99 | 1813.7 | +16.71 |
Client Bundles (main, webpack, commons)
vercel/next.js canary | cseas/next.js canary | Change | |
---|---|---|---|
main-HASH.js gzip | 6.63 kB | 6.63 kB | ✓ |
webpack-HASH.js gzip | 751 B | 751 B | ✓ |
19b7e98f51cc..e4a8.js gzip | 10.7 kB | 10.7 kB | ✓ |
framework.HASH.js gzip | 39.1 kB | 39.1 kB | ✓ |
Overall change | 57.2 kB | 57.2 kB | ✓ |
Client Bundles (main, webpack, commons) Modern
vercel/next.js canary | cseas/next.js canary | Change | |
---|---|---|---|
main-HASH.module.js gzip | 5.71 kB | 5.71 kB | ✓ |
webpack-HASH..dule.js gzip | 751 B | 751 B | ✓ |
19b7e98f51cc..dule.js gzip | 7.1 kB | 7.1 kB | ✓ |
framework.HA..dule.js gzip | 39.1 kB | 39.1 kB | ✓ |
Overall change | 52.7 kB | 52.7 kB | ✓ |
Legacy Client Bundles (polyfills)
vercel/next.js canary | cseas/next.js canary | Change | |
---|---|---|---|
polyfills-HASH.js gzip | 26.4 kB | 26.4 kB | ✓ |
Overall change | 26.4 kB | 26.4 kB | ✓ |
Client Build Manifests
vercel/next.js canary | cseas/next.js canary | Change | |
---|---|---|---|
_buildManifest.js gzip | 268 B | 268 B | ✓ |
_buildManife..dule.js gzip | 272 B | 272 B | ✓ |
Overall change | 540 B | 540 B | ✓ |
Rendered Page Sizes
vercel/next.js canary | cseas/next.js canary | Change | |
---|---|---|---|
index.html gzip | 954 B | 954 B | ✓ |
link.html gzip | 962 B | 962 B | ✓ |
withRouter.html gzip | 946 B | 946 B | ✓ |
Overall change | 2.86 kB | 2.86 kB | ✓ |
Serverless Mode
General
vercel/next.js canary | cseas/next.js canary | Change | |
---|---|---|---|
buildDuration | 12.6s | 12.6s | |
nodeModulesSize | 66.1 MB | 66.1 MB | ✓ |
Client Bundles (main, webpack, commons)
vercel/next.js canary | cseas/next.js canary | Change | |
---|---|---|---|
main-HASH.js gzip | 6.63 kB | 6.63 kB | ✓ |
webpack-HASH.js gzip | 751 B | 751 B | ✓ |
19b7e98f51cc..e4a8.js gzip | 10.7 kB | 10.7 kB | ✓ |
framework.HASH.js gzip | 39.1 kB | 39.1 kB | ✓ |
Overall change | 57.2 kB | 57.2 kB | ✓ |
Client Bundles (main, webpack, commons) Modern
vercel/next.js canary | cseas/next.js canary | Change | |
---|---|---|---|
main-HASH.module.js gzip | 5.71 kB | 5.71 kB | ✓ |
webpack-HASH..dule.js gzip | 751 B | 751 B | ✓ |
19b7e98f51cc..dule.js gzip | 7.1 kB | 7.1 kB | ✓ |
framework.HA..dule.js gzip | 39.1 kB | 39.1 kB | ✓ |
Overall change | 52.7 kB | 52.7 kB | ✓ |
Legacy Client Bundles (polyfills)
vercel/next.js canary | cseas/next.js canary | Change | |
---|---|---|---|
polyfills-HASH.js gzip | 26.4 kB | 26.4 kB | ✓ |
Overall change | 26.4 kB | 26.4 kB | ✓ |
Client Build Manifests
vercel/next.js canary | cseas/next.js canary | Change | |
---|---|---|---|
_buildManifest.js gzip | 268 B | 268 B | ✓ |
_buildManife..dule.js gzip | 272 B | 272 B | ✓ |
Overall change | 540 B | 540 B | ✓ |
Serverless bundles
vercel/next.js canary | cseas/next.js canary | Change | |
---|---|---|---|
_error.js | 876 kB | 876 kB | ✓ |
404.html | 4.17 kB | 4.17 kB | ✓ |
hooks.html | 3.79 kB | 3.79 kB | ✓ |
index.js | 877 kB | 877 kB | ✓ |
link.js | 916 kB | 916 kB | ✓ |
routerDirect.js | 909 kB | 909 kB | ✓ |
withRouter.js | 910 kB | 910 kB | ✓ |
Overall change | 4.5 MB | 4.5 MB | ✓ |
Stats from current PRDefault Server Mode (Increase detected
|
vercel/next.js canary | cseas/next.js canary | Change | |
---|---|---|---|
buildDuration | 12.9s | 12.9s | -19ms |
nodeModulesSize | 66.1 MB | 66.1 MB | ✓ |
Page Load Tests Overall increase ✓
vercel/next.js canary | cseas/next.js canary | Change | |
---|---|---|---|
/ failed reqs | 0 | 0 | ✓ |
/ total time (seconds) | 2.069 | 2.043 | -0.03 |
/ avg req/sec | 1208.2 | 1223.45 | +15.25 |
/error-in-render failed reqs | 0 | 0 | ✓ |
/error-in-render total time (seconds) | 1.274 | 1.262 | -0.01 |
/error-in-render avg req/sec | 1962.96 | 1981.25 | +18.29 |
Client Bundles (main, webpack, commons)
vercel/next.js canary | cseas/next.js canary | Change | |
---|---|---|---|
main-HASH.js gzip | 6.63 kB | 6.63 kB | ✓ |
webpack-HASH.js gzip | 751 B | 751 B | ✓ |
19b7e98f51cc..e4a8.js gzip | 10.7 kB | 10.7 kB | ✓ |
framework.HASH.js gzip | 39.1 kB | 39.1 kB | ✓ |
Overall change | 57.2 kB | 57.2 kB | ✓ |
Client Bundles (main, webpack, commons) Modern
vercel/next.js canary | cseas/next.js canary | Change | |
---|---|---|---|
main-HASH.module.js gzip | 5.72 kB | 5.72 kB | ✓ |
webpack-HASH..dule.js gzip | 751 B | 751 B | ✓ |
19b7e98f51cc..dule.js gzip | 7.1 kB | 7.1 kB | ✓ |
framework.HA..dule.js gzip | 39.1 kB | 39.1 kB | ✓ |
Overall change | 52.7 kB | 52.7 kB | ✓ |
Legacy Client Bundles (polyfills)
vercel/next.js canary | cseas/next.js canary | Change | |
---|---|---|---|
polyfills-HASH.js gzip | 26.4 kB | 26.4 kB | ✓ |
Overall change | 26.4 kB | 26.4 kB | ✓ |
Client Build Manifests
vercel/next.js canary | cseas/next.js canary | Change | |
---|---|---|---|
_buildManifest.js gzip | 268 B | 268 B | ✓ |
_buildManife..dule.js gzip | 272 B | 272 B | ✓ |
Overall change | 540 B | 540 B | ✓ |
Rendered Page Sizes
vercel/next.js canary | cseas/next.js canary | Change | |
---|---|---|---|
index.html gzip | 953 B | 953 B | ✓ |
link.html gzip | 961 B | 961 B | ✓ |
withRouter.html gzip | 946 B | 946 B | ✓ |
Overall change | 2.86 kB | 2.86 kB | ✓ |
Serverless Mode
General
vercel/next.js canary | cseas/next.js canary | Change | |
---|---|---|---|
buildDuration | 13.5s | 13.7s | |
nodeModulesSize | 66.1 MB | 66.1 MB | ✓ |
Client Bundles (main, webpack, commons)
vercel/next.js canary | cseas/next.js canary | Change | |
---|---|---|---|
main-HASH.js gzip | 6.63 kB | 6.63 kB | ✓ |
webpack-HASH.js gzip | 751 B | 751 B | ✓ |
19b7e98f51cc..e4a8.js gzip | 10.7 kB | 10.7 kB | ✓ |
framework.HASH.js gzip | 39.1 kB | 39.1 kB | ✓ |
Overall change | 57.2 kB | 57.2 kB | ✓ |
Client Bundles (main, webpack, commons) Modern
vercel/next.js canary | cseas/next.js canary | Change | |
---|---|---|---|
main-HASH.module.js gzip | 5.72 kB | 5.72 kB | ✓ |
webpack-HASH..dule.js gzip | 751 B | 751 B | ✓ |
19b7e98f51cc..dule.js gzip | 7.1 kB | 7.1 kB | ✓ |
framework.HA..dule.js gzip | 39.1 kB | 39.1 kB | ✓ |
Overall change | 52.7 kB | 52.7 kB | ✓ |
Legacy Client Bundles (polyfills)
vercel/next.js canary | cseas/next.js canary | Change | |
---|---|---|---|
polyfills-HASH.js gzip | 26.4 kB | 26.4 kB | ✓ |
Overall change | 26.4 kB | 26.4 kB | ✓ |
Client Build Manifests
vercel/next.js canary | cseas/next.js canary | Change | |
---|---|---|---|
_buildManifest.js gzip | 268 B | 268 B | ✓ |
_buildManife..dule.js gzip | 272 B | 272 B | ✓ |
Overall change | 540 B | 540 B | ✓ |
Serverless bundles
vercel/next.js canary | cseas/next.js canary | Change | |
---|---|---|---|
_error.js | 876 kB | 876 kB | ✓ |
404.html | 4.17 kB | 4.17 kB | ✓ |
hooks.html | 3.79 kB | 3.79 kB | ✓ |
index.js | 877 kB | 877 kB | ✓ |
link.js | 916 kB | 916 kB | ✓ |
routerDirect.js | 909 kB | 909 kB | ✓ |
withRouter.js | 910 kB | 910 kB | ✓ |
Overall change | 4.5 MB | 4.5 MB | ✓ |
@cseas The example you've submitted with this PR is not something which people should take guidance from, in my opinion. It works, yes, but there are many antipatterns that will cause serious issues for projects of any reasonable size. As you have found out, it is indeed possible to use Just one example – in your example app here, an English user would end up downloading all German translations, despite never needing them. In fact, it looks like every user would download every language, and every namespace. |
@isaachinman Ah, got it. Would that be because of using the I didn't really understand what benefits the http backend gives to i18n over just importing the json files. Is there any documentation available that would cover this explanation? |
Correct. The docs are on the repo. We need some kind of resource backend to fetch assets per language and per namespace, as needed. In a NextJs context, we may introduce new language or namespace requirements on the client side after a new component mounts, or the route changes. You can see logic to cover the route change case in To summarise my view on i18n in NextJs: unless you are a large org that has the desire and capacity to roll your own solution, you should probably just grab an off-the-shelf solution, as it will save you a lot of time and headache in the long run. I think that promoting these "simple i18n" examples is actually a disservice to new devs, and I have seen this same pattern play out countless times in the past couple years. |
@cseas Okay with closing the PR based on @isaachinman comments? I agree with him and the current state of the example is not ideal. |
@lfades Yeah that sounds alright. I still wish I like the features of Next and wish I could promote it where I work. But the concept of "use only Next libraries for everything" feels too restrictive as a developer. I might give Razzle a try, still exploring options for a new project. |
This is a simple example for setting up translations in a Next.js project using
react-i18next
.No additional server setup or packages are required hence this should retain all features offered by Next.js, unlike other translation examples. Details for usage are in example's readme.