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: clarify the order by messageId in v4 and support order by message #1515

Merged
merged 3 commits into from
Mar 14, 2023

Conversation

taozhou-glean
Copy link
Contributor

@taozhou-glean taozhou-glean commented Mar 14, 2023

Description

SInce the hash id support is in, the messageId now becomes the linguiId when custom id is absent. This is a change of behavior compared to v3, so its worth clarifying in the doc.

And to preserve the v3 behavior as much as we can, I am adding a new orderBy (message), so when no custom id is used, the order by message should match what messageId is expected in v3.

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) #1514

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 14, 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 14, 2023 at 3:07PM (UTC)

@@ -37,7 +37,7 @@ export type CatalogFormatOptions = {
disableSelectWarning?: boolean
}

export type OrderBy = "messageId" | "origin"
export type OrderBy = "messageId" | "message" | "origin"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I thought about renaming or adding linguiId as an option, but feel like it may be misleading itself, as we do use custom message id as messageId if exists. And support purely order by linguiId seems not that helpful at the moment. So only adding the message here.

@github-actions
Copy link

github-actions bot commented Mar 14, 2023

size-limit report 📦

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

@codecov
Copy link

codecov bot commented Mar 14, 2023

Codecov Report

Patch coverage: 100.00% and project coverage change: +0.14 🎉

Comparison is base (580e702) 74.04% compared to head (8a90b3e) 74.19%.

Additional details and impacted files
@@            Coverage Diff             @@
##             next    #1515      +/-   ##
==========================================
+ Coverage   74.04%   74.19%   +0.14%     
==========================================
  Files          67       67              
  Lines        1865     1868       +3     
  Branches      491      494       +3     
==========================================
+ Hits         1381     1386       +5     
+ Misses        382      380       -2     
  Partials      102      102              
Impacted Files Coverage Δ
packages/cli/src/api/catalog.ts 90.81% <100.00%> (+0.59%) ⬆️

... and 2 files with indirect coverage changes

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.

Copy link
Contributor

@andrii-bodnar andrii-bodnar left a comment

Choose a reason for hiding this comment

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

@taozhou-glean thank you!

Copy link
Collaborator

@timofei-iatsenko timofei-iatsenko left a comment

Choose a reason for hiding this comment

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

Thanks for contribution. I also thinks that sort by message should be a default one. Because this would be less breaking for most supported usecase.

For those who uses explicit ids there always an option to enable "messageId" sort manually

website/docs/ref/conf.md Outdated Show resolved Hide resolved
packages/cli/src/api/catalog.ts Outdated Show resolved Hide resolved
packages/cli/src/api/catalog.test.ts Outdated Show resolved Hide resolved
packages/cli/src/api/catalog.test.ts Outdated Show resolved Hide resolved
packages/cli/src/api/catalog.test.ts Outdated Show resolved Hide resolved
@taozhou-glean
Copy link
Contributor Author

Thanks for contribution. I also thinks that sort by message should be a default one. Because this would be less breaking for most supported usecase.

For those who uses explicit ids there always an option to enable "messageId" sort manually

I would +1 on that, can do that in a follow up if @andrii-bodnar also agrees on this.

@andrii-bodnar
Copy link
Contributor

@taozhou-glean sounds good to me

@taozhou-glean
Copy link
Contributor Author

taozhou-glean commented Mar 14, 2023

@taozhou-glean sounds good to me

@andrii-bodnar cool, will change the default orderBy in #1519, less change than expected, gonna rebase once this is merged, not including it in this PR just to make change more readable from commit perspective.

@andrii-bodnar andrii-bodnar merged commit 6a5a5f0 into lingui:next Mar 14, 2023
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.

[v4] order by messageId is now ordering by js-lingui-id
3 participants