Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Ahead-of-time compilation of messages #962

Open
amannn opened this issue Mar 28, 2024 · 0 comments · May be fixed by #705
Open

Ahead-of-time compilation of messages #962

amannn opened this issue Mar 28, 2024 · 0 comments · May be fixed by #705
Labels
area: performance enhancement New feature or request

Comments

@amannn
Copy link
Owner

amannn commented Mar 28, 2024

Is your feature request related to a problem? Please describe.

First results from icu-to-json show, that messages can be compiled to an ultra-slim AST (or even just a plain string—in the case of plain strings) that has very little overhead in comparison to passing raw messages to the client side.

The benefits are:

  • Faster message formatting at runtime
  • No parsing on the client side / at runtime

Describe the solution you'd like

Switch out intl-messageformat for icu-to-json and make sure the parser only runs on the server side (potentially cached) / at compile time.

Describe alternatives you've considered

Sticking with intl-messageformat.

Also related: adobe/react-spectrum#3294. However, I think this pattern won't work well with RSC since functions can't be serialized.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
area: performance enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant