-
-
Notifications
You must be signed in to change notification settings - Fork 237
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Lazy init message formatter for improved tree shaking in case `u…
…seTranslations` is only used in Server Components (#1279) Fixes a regression of #1193. In case you're only using `useTranslations` in Server Components, this will no longer bundle `intl-messageformat` on the client side (even if you're using other functionality like `useFormatter` there).
- Loading branch information
Showing
21 changed files
with
803 additions
and
258 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
import type {SizeLimitConfig} from 'size-limit'; | ||
|
||
const config: SizeLimitConfig = [ | ||
{ | ||
path: 'dist/production/index.react-client.js', | ||
limit: '14.084 KB' | ||
}, | ||
{ | ||
path: 'dist/production/index.react-server.js', | ||
limit: '14.665 KB' | ||
}, | ||
{ | ||
path: 'dist/production/navigation.react-client.js', | ||
limit: '3.155 KB' | ||
}, | ||
{ | ||
path: 'dist/production/navigation.react-server.js', | ||
limit: '15.975 KB' | ||
}, | ||
{ | ||
path: 'dist/production/server.react-client.js', | ||
limit: '1 KB' | ||
}, | ||
{ | ||
path: 'dist/production/server.react-server.js', | ||
limit: '13.975 KB' | ||
}, | ||
{ | ||
path: 'dist/production/middleware.js', | ||
limit: '9.535 KB' | ||
}, | ||
{ | ||
path: 'dist/production/routing.js', | ||
limit: '0 KB' | ||
}, | ||
{ | ||
path: 'dist/esm/index.react-client.js', | ||
import: '*', | ||
limit: '14.265 kB' | ||
}, | ||
{ | ||
path: 'dist/esm/index.react-client.js', | ||
import: '{NextIntlClientProvider}', | ||
limit: '1.425 kB' | ||
} | ||
]; | ||
|
||
module.exports = config; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import type {SizeLimitConfig} from 'size-limit'; | ||
|
||
const config: SizeLimitConfig = [ | ||
{ | ||
name: './ (ESM)', | ||
import: '*', | ||
path: 'dist/esm/index.js', | ||
limit: '14.065 kB' | ||
}, | ||
{ | ||
name: './ (no useTranslations, ESM)', | ||
path: 'dist/esm/index.js', | ||
import: | ||
'{IntlProvider, useLocale, useNow, useTimeZone, useMessages, useFormatter}', | ||
limit: '2.865 kB' | ||
}, | ||
{ | ||
name: './ (CJS)', | ||
path: 'dist/production/index.js', | ||
limit: '15.65 kB' | ||
} | ||
]; | ||
|
||
module.exports = config; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.