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

docs: various changes #1870

Merged
merged 3 commits into from
Mar 6, 2024
Merged

docs: various changes #1870

merged 3 commits into from
Mar 6, 2024

Conversation

andrii-bodnar
Copy link
Contributor

@andrii-bodnar andrii-bodnar commented Mar 1, 2024

Description

  • Remove the Create React App article since it was almost duplicating the React project article.
  • Prettify the React project article a bit.
  • Hide the TypeScript article from the sidebar (Cannot find type definition file for './node_modules/@lingui/macro/global'. #1869). It probably will be completely removed in the future.
  • Move the Vue extractor article to the API Reference section.
  • Move the ICU MessageFormat article to the Guides section.
  • Added the Babel<>SWC tabs switcher to the installation instructions.
  • Sidebar reorder.

Types of changes

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Examples update

Checklist

  • I have read the CONTRIBUTING and CODE_OF_CONDUCT docs
  • I have added tests that prove my fix is effective or that my feature works
  • I have added the necessary documentation (if appropriate)

Copy link

vercel bot commented Mar 1, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
js-lingui ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 5, 2024 2:32pm

Copy link

github-actions bot commented Mar 1, 2024

size-limit report 📦

Path Size
./packages/core/dist/index.mjs 2.86 KB (0%)
./packages/detect-locale/dist/index.mjs 723 B (0%)
./packages/react/dist/index.mjs 1.67 KB (0%)
./packages/remote-loader/dist/index.mjs 7.26 KB (0%)

Copy link

codecov bot commented Mar 1, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 76.66%. Comparing base (dd43fb0) to head (e14cb2a).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1870   +/-   ##
=======================================
  Coverage   76.66%   76.66%           
=======================================
  Files          81       81           
  Lines        2083     2083           
  Branches      532      532           
=======================================
  Hits         1597     1597           
  Misses        375      375           
  Partials      111      111           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

};
```
:::info
For those who prefer not to use Babel, Lingui offers the [SWC Plugin](/docs/ref/swc-plugin.md) as an alternative.
Copy link
Collaborator

@vonovak vonovak Mar 4, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Many projects, such as those using newer versions of NextJS, do not use babel, and so I think we should have a "fork" all the way at the top that leads to separate installation instructions for SWC and for babel. Maybe using Tabs: https://docusaurus.io/docs/markdown-features/tabs)

I have been trying to set up a nextJS app with the pages router and RSC and I'd love to write docs for that at some point if it works :D. I'm not sure if that's going to be a separate guide (probably yes). Either way, I think we should warn people as soon as possible that installing babel macros doesn't make sense if you're using SWC. And we should probably also say clearly that we don't yet have a clear supported path for RSC.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vonovak thank you for pointing, a separate Next.js article would be the best!

Copy link
Contributor Author

@andrii-bodnar andrii-bodnar Mar 5, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was thinking about RSC support and probably we can document the current PoC with the @lingui/react/server approach until we have a clearer approach.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vonovak added the MDX tabs as you suggested

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be really nice, to have that article. I also would like to warn people in that article that using global t macro would be harmful in the hybrid applications such as NextJs. And thanks to new useLingui macro-hook now we have a much better alternative. I also think if we don't need a global instance of i18n configured, we could simplify a lot initialization in nextjs to something like that: #1339 (comment)

website/docs/tutorials/setup-react.md Outdated Show resolved Hide resolved
website/docs/tutorials/setup-vite.md Outdated Show resolved Hide resolved
Co-authored-by: Vojtech Novak <vonovak@gmail.com>
@andrii-bodnar andrii-bodnar merged commit 80eb8fd into main Mar 6, 2024
17 checks passed
@andrii-bodnar andrii-bodnar deleted the docs/various-changes branch March 6, 2024 07:57
@andrii-bodnar andrii-bodnar mentioned this pull request Mar 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants