Repository navigation
docs: cover the runtime macro and default variables - #14
Merged
Merged
Conversation
Lingui 6.10.0 added an experimental runtime macro
(@lingui/core/runtime-macro) for code with no build step, and default
message variables (i18n.setVariables / setupI18n({ variables })).
lingui-best-practices mentioned neither.
- The macro decision tree now says it assumes a build-time transform
and points code with no build step to a new integration recipe: the
runtime macro, with the rules that differ from the compile-time
macros (named placeholders, choice helpers inside msg, nested msg for
option placeholders, i18n._ to resolve, experimental.runtimeMacro for
extraction).
- Common Patterns gains "App-wide Values in Messages": register a value
once, write the placeholder bare, plus precedence, the silent empty
render for unset names, and re-render behavior.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Lingui 6.10.0 added two features that
lingui-best-practicesdidn't mention: the experimental runtime macro (@lingui/core/runtime-macro) for code with no build step, and default message variables (i18n.setVariables).plural/selectinsidemsg, nestedmsgfor option placeholders,i18n._to resolve, andexperimental.runtimeMacrofor extraction. It is marked experimental.Tested:
claude plugin validate .andclaude plugin validate skills --strict. Ran every runtime macro example and the default-variable behavior in Node against@lingui/core6.10, and the bare-placeholder forms through the Babel macro plugin.