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

fix(webpack-loader): support json catalogs. Improve coverage #1525

Merged

Conversation

timofei-iatsenko
Copy link
Collaborator

Description

Using json catalogs with webpack loader was broken. Fixed that and added that case to a tests

Details overview:

  • When webpack encounter a json file it automatically set a json content type for that module. Despite the fact the loader may return a different type of file. There is no way (except of dirty hacks involving executing private internals of webpack) to tell to webpack that this loader will perform a transformation from json to js. So intstead i just compile catalog in json format and feed it to webpack.

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 16, 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 17, 2023 at 9:58AM (UTC)

@github-actions
Copy link

github-actions bot commented Mar 16, 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%)

@timofei-iatsenko

This comment was marked as outdated.

@timofei-iatsenko
Copy link
Collaborator Author

Ready. Windows WF failed yesterday because of no binary for the latest node was precompiled. It seems today they fixed it.

@codecov
Copy link

codecov bot commented Mar 17, 2023

Codecov Report

Patch coverage: 83.33% and project coverage change: +0.23 🎉

Comparison is base (4f1d30e) 75.75% compared to head (8658981) 75.98%.

Additional details and impacted files
@@            Coverage Diff             @@
##             next    #1525      +/-   ##
==========================================
+ Coverage   75.75%   75.98%   +0.23%     
==========================================
  Files          79       79              
  Lines        1980     1970      -10     
  Branches      516      517       +1     
==========================================
- Hits         1500     1497       -3     
+ Misses        360      355       -5     
+ Partials      120      118       -2     
Impacted Files Coverage Δ
packages/cli/src/api/utils.ts 66.66% <ø> (ø)
packages/loader/test/compiler.ts 66.66% <ø> (ø)
packages/loader/src/webpackLoader.ts 88.88% <75.00%> (+28.88%) ⬆️
packages/cli/src/api/compile.ts 96.29% <100.00%> (+0.29%) ⬆️

... and 1 file 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.

website/docs/ref/loader.md Outdated Show resolved Hide resolved
website/docs/ref/loader.md Outdated Show resolved Hide resolved
website/docs/ref/loader.md Outdated Show resolved Hide resolved
website/docs/ref/loader.md Outdated Show resolved Hide resolved
Co-authored-by: Andrii Bodnar <andrii.bodnar@crowdin.com>
@andrii-bodnar andrii-bodnar merged commit b4db627 into lingui:next Mar 17, 2023
@timofei-iatsenko timofei-iatsenko deleted the fix/webpack-loader-json-support branch August 15, 2023 09:39
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.

2 participants