fix(plugin-chart-echarts): use echarts 5.6.0 i18n export path for locale import - #42055
Conversation
…ale import echarts 5.6.0 added a package.json exports field. The catch-all "./*": "./*" entry maps "./lib/i18n" to itself with no .js extension. webpack 5's enhanced-resolve with fullySpecified=true then fails to resolve the file, producing a build warning. Fix by switching to the top-level `i18n/` export path (`./i18n/*`) which is an explicit entry in the echarts 5.6.0 exports field, and adding the explicit `.js` extension so enhanced-resolve can find the file under fullySpecified mode. The locale files (langEN.js, langZH.js, etc.) exist in echarts' i18n/ directory at the package root. Co-Authored-By: Claude <noreply@anthropic.com>
Code Review Agent Run #f344caActionable Suggestions - 0Additional Suggestions - 1
Review Details
Bito Usage GuideCommands Type the following command in the pull request comment and save the comment.
Refer to the documentation for additional commands. Configuration This repository uses Documentation & Help |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #42055 +/- ##
=======================================
Coverage 64.49% 64.49%
=======================================
Files 2747 2747
Lines 153843 153843
Branches 35268 35268
=======================================
Hits 99221 99221
Misses 52712 52712
Partials 1910 1910
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
aminghadersohi
left a comment
There was a problem hiding this comment.
Verified against the pinned echarts 6.1.0 exports map and a real Node resolution test: the old echarts/lib/i18n/* path has no matching export entry (hard resolution failure), the new echarts/i18n/*.js path matches "./i18n/*": "./i18n/*" and resolves correctly. No other call sites use the old path. Clean fix.
…ale import (apache#42055) Co-authored-by: Claude <noreply@anthropic.com>
Summary
Fixes a webpack build warning introduced when echarts 5.6.0 added a
package.jsonexportsfield.Root cause
echarts 5.6.0 added
exportsto itspackage.json. The catch-all entry"./*": "./*"mapsecharts/lib/i18n→./lib/i18n(no.jsextension). webpack 5'senhanced-resolvewithfullySpecified: truethen fails to find the file because it requires an exact match (no extension guessing), producing:Fix
Switch the dynamic locale import from
echarts/lib/i18n/lang${locale}toecharts/i18n/lang${locale}.js.echarts/i18n/is an explicit export pattern in echarts 5.6.0:"./i18n/*": "./i18n/*"i18n/langEN.js,i18n/langZH.js, etc.) exist at the package rooti18n/directory.jsextension satisfiesenhanced-resolve'sfullySpecifiedmodeTesting
cd superset-frontend && npm run buildcompletes without thelib/i18nwarning