Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Macro docs lack examples of arg() macro #1320

Closed
timofei-iatsenko opened this issue Jan 4, 2023 · 7 comments · Fixed by #1581
Closed

Macro docs lack examples of arg() macro #1320

timofei-iatsenko opened this issue Jan 4, 2023 · 7 comments · Fixed by #1581

Comments

@timofei-iatsenko
Copy link
Collaborator

While writing SWC Macro plugin and reading babel macro source code found this in tests:

export default [
  {
    name: "Arg macro should be exluded from values",
    input: `
        import { t, arg } from '@lingui/macro';
        const a = t\`Hello $\{arg('name')\}\`;
    `,
    expected: `
        import { i18n } from "@lingui/core";
        const a = 
          /*i18n*/
          i18n._("Hello {name}")
    `,
  },
]

Which is not described anywhere. Or if it's outdated - should be removed from codebase.

@timofei-iatsenko
Copy link
Collaborator Author

Looks like it's something old and outdated because typings also not exporting it. So it's better to remove it from codebase to avoid confusion.

@timofei-iatsenko
Copy link
Collaborator Author

@Martin005 @andrii-bodnar i'm going to delete this from codebase, the value of this feature is not clear, and it was not public anyway.

@andrii-bodnar
Copy link
Contributor

andrii-bodnar commented Feb 14, 2023

@thekip let's first ask @tricoder42 for more details, maybe there is some point here

@timofei-iatsenko
Copy link
Collaborator Author

It looks like an ad-hoc solution to avoid problems with escaping which we fixed recently.

@timofei-iatsenko
Copy link
Collaborator Author

i'm going to delete this from codebase.

@andrii-bodnar
Copy link
Contributor

@thekip agree with you

@tricoder42
Copy link
Contributor

Hey guys, sorry for late response. I honestly don't recall the reason behind this feature, so feel free to remove it. Especially if it's obsolete.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants