Skip to content

feat: vue extractor error reporting#1924

Closed
aseerkt wants to merge 4 commits into
lingui:mainfrom
aseerkt:feat/vue-extractor-errors
Closed

feat: vue extractor error reporting#1924
aseerkt wants to merge 4 commits into
lingui:mainfrom
aseerkt:feat/vue-extractor-errors

Conversation

@aseerkt

@aseerkt aseerkt commented Apr 26, 2024

Copy link
Copy Markdown
Contributor

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)

@vercel

vercel Bot commented Apr 26, 2024

Copy link
Copy Markdown

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

@github-actions

github-actions Bot commented Apr 26, 2024

Copy link
Copy Markdown

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%)

@codecov

codecov Bot commented Apr 26, 2024

Copy link
Copy Markdown

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.


if (parsedErrors.length) {
console.error("Error while parsing:")
throw parsedErrors

@aseerkt aseerkt Apr 26, 2024

Copy link
Copy Markdown
Contributor Author

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 aseerkt marked this pull request as ready for review April 28, 2024 09:32
@aseerkt

aseerkt commented Apr 29, 2024

Copy link
Copy Markdown
Contributor Author

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
Copy Markdown
Contributor

@JSteunou could you please take a look?

@JSteunou

Copy link
Copy Markdown
Contributor

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

@aseerkt

aseerkt commented May 1, 2024

Copy link
Copy Markdown
Contributor Author

@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