lingui / lingui/js-lingui

Docs - Clarify limitations and gotchas for jsxPlaceholderDefaults

Open Beginner friendly
#2,640 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

📖 documentation good first issue
Dominant language
TypeScript
Stars
5.9k
Forks
457
Avg merge
1d 23h
Merged PRs (30d)
16

Description

Page

https://lingui.dev/ref/conf#macrojsxplaceholderdefaults

Type of Issue

Missing information

Description

Context: https://github.com/lingui/js-lingui/issues/2631#issuecomment-5131146335

The jsxPlaceholderDefaults configuration can define a placeholder for a tag so that <a> becomes <link> instead of <0> for example. This is can be interpreted as multiple <a> generating <link1>...<linkN> etc. However, this is not the case and instead we get an error stating there is a placeholder collision because 2 tags tried to take the name <link>.

Suggested Improvement

Although I would wish the tags incrementally use a counter for <link1>...<linkN>. The library owners preferred not to. Meaning that if I want to have incremental placeholders or whatever, then I should manually tag them.

Fair. I think that's valid, but I think it should be explicitly documented as such rather than being only found out during extraction 😅

I can open a PR, likely later this week for this.

Contribution
  • I'd be willing to open a pull request for this.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the referenced https://lingui.dev/ref/conf#macrojsxplaceholderdefaults page and compare its current description with the behavior described in the issue. Document that repeated tags using the same configured placeholder cause a collision rather than automatic incremental names, and note that incremental or distinct placeholders must be added manually.

Written by the indexing model from the issue text.

Assessment

Domain
documentation, internationalization
Issue type
Documentation
Difficulty
1/5
Estimated time
Under an hour
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
84/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.