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

refactor(macro): more accurate typings for macro + testing #1340

Merged
merged 2 commits into from
Feb 14, 2023

Conversation

timofei-iatsenko
Copy link
Collaborator

@timofei-iatsenko timofei-iatsenko commented Jan 15, 2023

This one without explicit braking changes. Separating js / jsx macro typings would do in next iterations.

Changing public typings would definitely affect some users because they become stricter and would catch more misusages and possible errors.

Fixes:
#1324
#1323
#1288

  1. Added tsd to the main test suite WF.
  2. Wrote a comprehesive test suite for macro typings
  3. Make typings much stronger, so they would catch more errors early
  4. Added documentation for Jsx macro

@vercel
Copy link

vercel bot commented Jan 15, 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 Feb 14, 2023 at 9:07AM (UTC)

@timofei-iatsenko
Copy link
Collaborator Author

@Martin005 @andrii-bodnar Guys i need your reaction & feedback

@Martin005
Copy link
Contributor

@thekip
Thank you for pointing out the problem and showing how we can prevent erroneous typings!
I agree with you that this should be fixed. And after all issues are fixed, we should add the validation to CI/CD workflow.

@andrii-bodnar
Copy link
Contributor

We'd like to postpone any breaking changes for a while, but your suggestion is fair

@timofei-iatsenko timofei-iatsenko mentioned this pull request Jan 23, 2023
8 tasks
@Martin005 Martin005 added the v4 label Feb 8, 2023
@andrii-bodnar andrii-bodnar modified the milestone: v4 Feb 13, 2023
@timofei-iatsenko timofei-iatsenko changed the base branch from main to next February 13, 2023 15:41
@github-actions
Copy link

github-actions bot commented Feb 13, 2023

size-limit report 📦

Path Size
./packages/core/build/esm/index.js 1.76 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.29 KB (0%)

@timofei-iatsenko timofei-iatsenko changed the title chore(macro): lint macro typings refactor(macro): more accurate typings for macro + testing Feb 13, 2023
@timofei-iatsenko timofei-iatsenko marked this pull request as ready for review February 13, 2023 20:09
@timofei-iatsenko timofei-iatsenko changed the title refactor(macro): more accurate typings for macro + testing refactor(macro): more accurate typings for macro + testing Feb 13, 2023
@codecov
Copy link

codecov bot commented Feb 14, 2023

Codecov Report

Base: 69.49% // Head: 69.79% // Increases project coverage by +0.30% 🎉

Coverage data is based on head (b29ffe5) compared to base (d87a211).
Patch has no changes to coverable lines.

Additional details and impacted files
@@            Coverage Diff             @@
##             next    #1340      +/-   ##
==========================================
+ Coverage   69.49%   69.79%   +0.30%     
==========================================
  Files          77       76       -1     
  Lines        2016     1980      -36     
  Branches      542      541       -1     
==========================================
- Hits         1401     1382      -19     
+ Misses        496      479      -17     
  Partials      119      119              
Impacted Files Coverage Δ
packages/macro/test/jsx-select.ts 100.00% <ø> (ø)
packages/cli/src/api/formats/po.ts 89.58% <0.00%> (-6.17%) ⬇️
packages/cli/src/api/utils.ts 70.96% <0.00%> (-0.47%) ⬇️
packages/macro/src/macroJsx.ts 90.97% <0.00%> (+0.69%) ⬆️
packages/cli/src/api/formats/po-gettext.ts 84.00% <0.00%> (+1.46%) ⬆️

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 at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

packages/macro/index.d.ts Outdated Show resolved Hide resolved
packages/macro/index.test-d.tsx Outdated Show resolved Hide resolved
packages/macro/index.test-d.tsx Outdated Show resolved Hide resolved
packages/macro/index.test-d.tsx Outdated Show resolved Hide resolved
packages/macro/index.test-d.tsx Outdated Show resolved Hide resolved
packages/macro/index.test-d.tsx Outdated Show resolved Hide resolved
Co-authored-by: Martin Chrástek <chrastek12@gmail.com>
@andrii-bodnar andrii-bodnar merged commit f6655ec into lingui:next Feb 14, 2023
@timofei-iatsenko timofei-iatsenko deleted the chore/tsd-linting branch February 14, 2023 13:57
Martin005 added a commit that referenced this pull request Feb 14, 2023
* refactor(macro): more accurate typings for macro + testing

* Apply suggestions from code review

Co-authored-by: Martin Chrástek <chrastek12@gmail.com>
Martin005 added a commit that referenced this pull request Feb 14, 2023
* refactor(macro): more accurate typings for macro + testing

* Apply suggestions from code review

Co-authored-by: Martin Chrástek <chrastek12@gmail.com>
andrii-bodnar pushed a commit that referenced this pull request Feb 20, 2023
* refactor(macro): more accurate typings for macro + testing

* Apply suggestions from code review

Co-authored-by: Martin Chrástek <chrastek12@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Mess in exported Macro Typescript Typings Ability to use elements within Select values
3 participants