rusackas opened a new pull request, #42154:
URL: https://github.com/apache/superset/pull/42154

   ### SUMMARY
   
   Two reliability fixes for issues that repeatedly broke the local dev stack 
while iterating on the frontend, both diagnosed from a live environment:
   
   **1. Flaky echarts locale resolution breaks webpack incremental rebuilds**
   
   `plugin-chart-echarts` loads chart locales with a template-literal dynamic 
import (``import(`echarts/i18n/lang${locale}.js`)``). A computed import forces 
the bundler to build a *context module* over the whole `echarts/i18n` 
directory, and resolving that directory through the echarts package `exports` 
map fails intermittently on webpack incremental rebuilds:
   
   ```
   Module not found: Error: Package path ./i18n is exported from package 
.../echarts,
   but no valid target file was found (see exports field in 
.../echarts/package.json)
   ```
   
   When it hits, the emitted dev bundle is broken (in our case the login page 
stopped rendering) until a full rebuild. The fix replaces the computed import 
with an explicit per-locale loader map — no context module, deterministic 
resolution in every bundler, and code-splitting covers exactly the locales 
listed. Behavior is unchanged: unknown locales still fall back to English.
   
   **2. Config reloads can silently apply stale content**
   
   werkzeug's auto-reloader re-imports `superset_config` when the file changes. 
On some filesystems (notably macOS Docker VirtioFS mounts) the re-read can race 
a concurrent write and observe *stale* file content while still logging `Loaded 
your LOCAL configuration at [...]` — we caught a live instance where a feature 
flag silently reverted to its old value after a reload. With only the path 
logged, that skew is invisible.
   
   This adds a short md5 fingerprint of the config bytes *as actually read* to 
the existing log line:
   
   ```
   Loaded your LOCAL configuration at 
[/app/docker/pythonpath_dev/superset_config.py] (md5:1f2e3d4c5b6a)
   ```
   
   Comparing it against `md5 <path>` on the host turns an hour of archaeology 
into a one-line diagnosis.
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   
   N/A (build/logging behavior).
   
   ### TESTING INSTRUCTIONS
   
   1. `npm run test -- 
plugins/plugin-chart-echarts/test/components/Echart.test.tsx` — passes (4/4).
   2. `npm run type` — clean.
   3. Run the dev stack, switch Superset to a non-English locale, open any 
ECharts chart, and confirm axis/toolbox strings are localized (locale chunk 
loads on demand).
   4. Start the backend and confirm the config log line now includes the 
`(md5:...)` suffix; compare with `md5 docker/pythonpath_dev/superset_config.py`.
   
   ### ADDITIONAL INFORMATION
   - [ ] Has associated issue:
   - [ ] Required feature flags:
   - [ ] Changes UI
   - [ ] Includes DB Migration (follow approval process in 
[SIP-59](https://github.com/apache/superset/issues/13351))
   - [ ] Introduces new feature or API
   - [ ] Removes existing feature or API
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to