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: vue extractor error reporting #1924

Closed
wants to merge 4 commits into from

Conversation

aseerkt
Copy link
Contributor

@aseerkt aseerkt commented Apr 26, 2024

Description

Report errors from parse and compileTemplate in Vue Extractor.

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
  • Examples update

Fixes #1627

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

Copy link

vercel bot commented Apr 26, 2024

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

Name Status Preview Comments Updated (UTC)
js-lingui ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 30, 2024 8:22am

Copy link

github-actions bot commented Apr 26, 2024

size-limit report 📦

Path Size
./packages/core/dist/index.mjs 2.86 KB (0%)
./packages/detect-locale/dist/index.mjs 723 B (0%)
./packages/react/dist/index.mjs 1.67 KB (0%)
./packages/remote-loader/dist/index.mjs 7.26 KB (0%)

Copy link

codecov bot commented Apr 26, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 76.11%. Comparing base (d6b9698) to head (9000961).
Report is 16 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1924      +/-   ##
==========================================
- Coverage   76.65%   76.11%   -0.54%     
==========================================
  Files          81       85       +4     
  Lines        2090     2114      +24     
  Branches      533      539       +6     
==========================================
+ Hits         1602     1609       +7     
- Misses        375      393      +18     
+ Partials      113      112       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

sourceMap: true,
filename,
ignoreEmpty: true,
})

if (parsedErrors.length) {
console.error("Error while parsing:")
throw parsedErrors
Copy link
Contributor Author

@aseerkt aseerkt Apr 26, 2024

Choose a reason for hiding this comment

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

Not sure if throwing errors is the right approach. Should I simply log these errors and proceed with extraction?

@aseerkt aseerkt marked this pull request as draft April 28, 2024 08:53
@aseerkt
Copy link
Contributor Author

aseerkt commented Apr 29, 2024

The errors are not logged properly. It doesn't contain proper context or stack trace as of now.
Screenshot from 2024-04-29 12-56-14

@andrii-bodnar
Copy link
Contributor

@JSteunou could you please take a look?

@JSteunou
Copy link
Contributor

This would make stop at the 1st error. Is this the behavior we want? Just logging and throw?

@aseerkt
Copy link
Contributor Author

aseerkt commented May 1, 2024

@andrii-bodnar I think we can close this PR in favor of #1925, since we are planning to deprecate @lingui/extractor-vue anyway.

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.

Vue Extractor should report errors if not able to parse/compile file
3 participants