You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We've also provided a core package that has the same API as the full `react-intl` package but without our parser. What this means is that you would have to pre-parse all messages into `AST` using [`intl-messageformat-parser`](https://www.npmjs.com/package/intl-messageformat-parser) and pass that into `IntlProvider`.
16
-
17
-
This is especially faster since it saves us time parsing `string` into `AST`. The use cases for this support are:
15
+
You can also pre-parse all messages into `AST` using [`intl-messageformat-parser`](https://www.npmjs.com/package/intl-messageformat-parser) and pass that into `IntlProvider`. This is especially faster since it saves us time parsing `string` into `AST`. The use cases for this support are:
18
16
19
17
1. Server-side rendering or pre-parsing where you can cache the AST and don't have to pay compilation costs multiple time.
20
18
2. Desktop apps using Electron or CEF where you can preload/precompile things in advanced before runtime.
|`react-intl/core`|||
50
-
51
42
### Caveats
52
43
53
44
- Since this approach uses `AST` as the data source, changes to `intl-messageformat-parser`'s `AST` will require cache invalidation
54
45
-`AST` is also larger in size than regular `string` messages but can be efficiently compressed
55
-
- Since `react-intl/core` does not have a parser, it will not be able to process string-based `defaultMessage` (will render the string as is w/o any token value replacement).
0 commit comments