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(extractor)!: don't use intermediate catalogs #1358

Merged
merged 1 commit into from
Feb 9, 2023

Conversation

thekip
Copy link
Collaborator

@thekip thekip commented Jan 23, 2023

Faster, safer, less code

  • add TS typings
  • remove storing to intermediate catalogs and following traversing fs to build final catalog
  • introduce onMessageExtracted callback in babel-plugin options
  • fix unit tests on the babel plugin side
  • fix test on the extractor side

BREAKING CHANGES:

  • The public type of extractor was changed.
- extract(filename: string, targetDir: string, options?: ExtractOptions): Promise<void> | void
+ extract(filename: string, onMessageExtracted: (msg: ExtractedMessage) => void, options?: ExtractOptions): Promise<void> | void

This should affect only small amount of users, only those who use custom extractors.

  • Also intermidiate catalogs no longer created, but i'm sure no one is using it.

@vercel
Copy link

vercel bot commented Jan 23, 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 9, 2023 at 11:25AM (UTC)

@github-actions
Copy link

github-actions bot commented Jan 23, 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%)

packages/cli/src/api/catalog.ts Outdated Show resolved Hide resolved
packages/conf/index.d.ts Outdated Show resolved Hide resolved
@thekip
Copy link
Collaborator Author

thekip commented Jan 25, 2023

It's probably better to merge it to the "next" branch, or create a new one for the upcomming release.

@andrii-bodnar
Copy link
Contributor

@thekip please assign yourself all the related issues so it will be easier to recognize what issues actually are in progress

@andrii-bodnar
Copy link
Contributor

@Martin005 @thekip from my perspective, we probably need to create a fresh copy of the next branch from the main for such breaking changes and then move forward with pre-releases from the next branch until it is ready for official release and merge to the main.

In this case, the main and v3 will not be blocked for the minor and patch releases.

I'm going to investigate the possible flow in more detail.

@thekip
Copy link
Collaborator Author

thekip commented Feb 8, 2023

rebased

packages/cli/src/api/formats/csv.ts Show resolved Hide resolved
@@ -26,6 +26,7 @@ export default async function command(
config: LinguiConfig,
options: Partial<CliExtractOptions>
): Promise<boolean> {
// todo validate and delete
Copy link
Contributor

Choose a reason for hiding this comment

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

Please remove this comment if it is outdated.

packages/cli/src/api/catalog.ts Outdated Show resolved Hide resolved
@Martin005 Martin005 changed the base branch from main to next February 8, 2023 15:42
@thekip
Copy link
Collaborator Author

thekip commented Feb 8, 2023

Done

@thekip
Copy link
Collaborator Author

thekip commented Feb 8, 2023

Also rebased again onto next branch

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.

None yet

3 participants