Skip to content

Conversation

@joshkel
Copy link
Contributor

@joshkel joshkel commented Dec 1, 2025

Why am I submitting this PR

esbuild is a large dependency, and pinning to a specific version makes it less likely that it can be shared across other dependencies. To make i18next-parser lighter:

  • Dynamically import esbuild if needed. Change esbuild to an optional peer dependency.
  • Update the version range.
  • Try loading .ts files using Node.js support for stripping TypeScript types (enabled by default in current Node.js versions), to potentially remove having to import ESBuild at all.
  • Allow loading .mts as well as .ts.

This is a potentially breaking change: if a someone uses a .ts i18next-parser configuration, doesn't have type stripping enabled (or has a configuration file that's incompatible with Node.js's type stripping), and doesn't otherwise have esbuild installed, then they'll have to install it.

Does it fix an existing ticket?

No

Checklist

  • only relevant code is changed (make a diff before you submit the PR)
  • do no modify the version in package.json or CHANGELOG.md
  • tests are included and pass: yarn test (see details here) (Preexisting .ts functionality didn't have tests - if you want me to see about adding these, let me know.)
  • documentation is changed or added (I don't believe any updates to the documentation are needed)

esbuild is a large dependency, and pinning to a specific version makes it less likely that it can be shared across other dependencies. To make i18next-parser lighter:

- Dynamically import esbuild if needed. Change esbuild to an optional peer dependency.
- Update the version range.
- Try loading .ts files using Node.js support for stripping TypeScript types (enabled by default in current Node.js versions), to potentially remove having to import ESBuild at all.
- Allow loading .mts as well as .ts.

This is a potentially breaking change: if a someone uses a .ts i18next-parser configuration, doesn't have type stripping enabled (or has a configuration file that's incompatible with Node.js's type stripping), and doesn't otherwise have esbuild installed, then they'll have to install it.
@codecov-commenter
Copy link

Codecov Report

❌ Patch coverage is 0% with 15 lines in your changes missing coverage. Please review.
✅ Project coverage is 94.57%. Comparing base (398b9ce) to head (c725eda).
⚠️ Report is 44 commits behind head on master.

Files with missing lines Patch % Lines
src/helpers.js 0.00% 15 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1150      +/-   ##
==========================================
- Coverage   95.35%   94.57%   -0.79%     
==========================================
  Files          10       10              
  Lines        1918     1990      +72     
==========================================
+ Hits         1829     1882      +53     
- Misses         89      108      +19     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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