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(vue-extractor): fix default export burden with /api/extractors/babel #1626

Merged
merged 1 commit into from
Apr 28, 2023

Conversation

timofei-iatsenko
Copy link
Collaborator

@timofei-iatsenko timofei-iatsenko commented Apr 27, 2023

Description

#1623 (comment)

If you have a ESM project and will try to use vue-extractor the import inside vue-extractor:

import babel from "@lingui/cli/api/extractors/babel"

Will fail. This is happened because @lingui/vue-extractor is a dual package code.

In ESM context nodejs picking .mjs file (following import condition in package.json) which tries to import @lingui/cli/api/extractors/babel which is cjs downleveld from ESM and the way how typescript compiles to cjs is not compatible with native ESM modules (additional .default appears)

This all is a big non-solvable headache, which simply could be avoided by banning export default

@vercel
Copy link

vercel bot commented Apr 27, 2023

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 27, 2023 3:08pm

@github-actions
Copy link

github-actions bot commented Apr 27, 2023

size-limit report 📦

Path Size
./packages/core/dist/index.mjs 1.43 KB (0%)
./packages/detect-locale/dist/index.mjs 721 B (0%)
./packages/react/dist/index.mjs 1.6 KB (0%)
./packages/remote-loader/dist/index.mjs 7.24 KB (0%)

@codecov
Copy link

codecov bot commented Apr 27, 2023

Codecov Report

Patch coverage: 66.66% and project coverage change: -0.04 ⚠️

Comparison is base (9e6ea70) 75.46% compared to head (683c982) 75.42%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1626      +/-   ##
==========================================
- Coverage   75.46%   75.42%   -0.04%     
==========================================
  Files          77       77              
  Lines        1989     1990       +1     
  Branches      518      519       +1     
==========================================
  Hits         1501     1501              
  Misses        374      374              
- Partials      114      115       +1     
Impacted Files Coverage Δ
packages/extractor-vue/src/vue-extractor.ts 75.00% <66.66%> (-6.82%) ⬇️

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@andrii-bodnar andrii-bodnar merged commit 045eb21 into lingui:main Apr 28, 2023
@timofei-iatsenko timofei-iatsenko deleted the i-hate-default-exports branch May 8, 2023 07:49
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