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

feat: remove withI18n #1503

Merged
merged 3 commits into from
Mar 13, 2023
Merged

feat: remove withI18n #1503

merged 3 commits into from
Mar 13, 2023

Conversation

vonovak
Copy link
Collaborator

@vonovak vonovak commented Mar 11, 2023

Description

Feel free to close this, but since there will be a new major I thought withI18n could be removed

For new projects, having a HOC doesn't make much sense

For old project, they can add the HOC to their code base

For the library, it means one less thing to worry about (for example I remember typing HOCs was a pain, although that was a looong time ago), smaller api surface.

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

Fixes # (issue)

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 necessary documentation (if appropriate)

@vercel
Copy link

vercel bot commented Mar 11, 2023

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

Name Status Preview Comments Updated
js-lingui ✅ Ready (Inspect) Visit Preview 💬 Add your feedback Mar 12, 2023 at 1:50PM (UTC)

@github-actions
Copy link

github-actions bot commented Mar 11, 2023

size-limit report 📦

Path Size
./packages/core/build/esm/index.js 1.56 KB (0%)
./packages/detect-locale/build/esm/index.js 812 B (0%)
./packages/react/build/esm/index.js 1.79 KB (0%)
./packages/remote-loader/build/esm/index.js 7.25 KB (0%)

@codecov
Copy link

codecov bot commented Mar 11, 2023

Codecov Report

Patch coverage has no change and project coverage change: +0.06 🎉

Comparison is base (32c7f91) 73.93% compared to head (7a344a4) 73.99%.

Additional details and impacted files
@@            Coverage Diff             @@
##             next    #1503      +/-   ##
==========================================
+ Coverage   73.93%   73.99%   +0.06%     
==========================================
  Files          67       67              
  Lines        1872     1865       -7     
  Branches      493      491       -2     
==========================================
- Hits         1384     1380       -4     
+ Misses        383      382       -1     
+ Partials      105      103       -2     
Impacted Files Coverage Δ
packages/react/src/I18nProvider.tsx 92.00% <ø> (+7.62%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@timofei-iatsenko
Copy link
Collaborator

Totally agree with you. Also thought about that, but working on tooling was my first priority, because there were more pain points.

I think it's something very old and in new projects it's just enough to use useLingui hook to subscribe component for the locale changes.

@timofei-iatsenko
Copy link
Collaborator

@vonovak could you also add a note in the migration guide (website/docs/releases/migration-4.md) about this removal and delete this from the doc https://lingui.dev/guides/optimized-components#optimized-component-wrapped-in-withi18n?

@andrii-bodnar
Copy link
Contributor

@vonovak thank you for the contribution!

@andrii-bodnar andrii-bodnar merged commit 580e702 into lingui:next Mar 13, 2023
@vonovak vonovak deleted the feat/remove-hoc branch March 13, 2023 08:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants