feat(FR-2610): Vite dev-reload plugin for i18n / theme / config.toml file changes#6872
Merged
graphite-app[bot] merged 1 commit intomainfrom Apr 30, 2026
Conversation
3 tasks
Contributor
Author
This was referenced Apr 22, 2026
Merged
5c37f96 to
5b738cf
Compare
1d2a0d7 to
311b4a9
Compare
This was referenced Apr 27, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a custom Vite dev-server plugin to force full-page reloads when runtime-fetched, project-root assets change on disk (i18n JSONs, theme.json, config.toml, root index.html), matching the legacy Craco fs.watch behavior so dev edits are picked up even though these files aren’t in Vite’s module graph.
Changes:
- Introduce
devAssetsReloadPluginto watch specific project-root paths and trigger a debouncedfull-reloadover Vite WS. - Update
server.watch.ignoredto ensureconfig.tomlis not excluded from watching. - Document the migration/landing of the dev-reload behavior in
VITE_POC_NOTES.md.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| react/vite.config.ts | Adds a Vite dev plugin to watch runtime-fetched assets and emit debounced full reloads; adjusts watch ignore list and plugin ordering. |
| react/VITE_POC_NOTES.md | Updates PoC notes to reflect that the fs.watch-equivalent reload behavior has landed under FR-2610. |
5b738cf to
3a0179a
Compare
311b4a9 to
119ae4c
Compare
3a0179a to
b404929
Compare
119ae4c to
8a8cdbd
Compare
b404929 to
d068319
Compare
8a8cdbd to
77461db
Compare
d068319 to
2c4b344
Compare
77461db to
f304a41
Compare
2c4b344 to
a2b2a81
Compare
This was referenced Apr 30, 2026
Merge activity
|
…file changes (#6872) Resolves #6813(FR-2610) ## Summary Custom Vite plugin (`devAssetsReloadPlugin`) that triggers a full page reload whenever project-root, runtime-fetched assets change on disk. Mirrors the `fs.watch` / `fs.watchFile` setup in the old `craco.config.cjs` devServer block. **Why needed**: `i18next-http-backend` fetches `resources/i18n/*.json` at runtime — those JSONs are NOT part of the Vite module graph, so Vite would never HMR them. A full reload is the only way to pick up an edit. `config.toml`, `resources/theme.json`, and the project-root `index.html` fall in the same category. **Watch targets**: - `config.toml` - `index.html` - `resources/i18n/*` - `resources/theme.json` **Debounce**: 300ms (matches craco). FSEvents on macOS can fire multiple watcher events for a single save; editors that use atomic-save (write temp → rename) produce two events. Debouncing collapses both into one reload signal. ## Test plan - [x] Edit `resources/i18n/ko.json` during `vite:dev` → page reloads within 300ms - [x] Edit `config.toml` → page reloads - [x] Edit `resources/theme.json` → page reloads - [x] Rapid double-save produces ONE reload, not two ## Stack Builds on FR-2607.
f304a41 to
d7e4e36
Compare
a2b2a81 to
19e4114
Compare
Base automatically changed from
04-20-feat_fr-2607_vite_spike_answer_es6___electron_publicpath_works_via_renderbuilturl
to
main
April 30, 2026 12:26
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Resolves #6813(FR-2610)
Summary
Custom Vite plugin (
devAssetsReloadPlugin) that triggers a full page reload whenever project-root, runtime-fetched assets change on disk. Mirrors thefs.watch/fs.watchFilesetup in the oldcraco.config.cjsdevServer block.Why needed:
i18next-http-backendfetchesresources/i18n/*.jsonat runtime — those JSONs are NOT part of the Vite module graph, so Vite would never HMR them. A full reload is the only way to pick up an edit.config.toml,resources/theme.json, and the project-rootindex.htmlfall in the same category.Watch targets:
config.tomlindex.htmlresources/i18n/*resources/theme.jsonDebounce: 300ms (matches craco). FSEvents on macOS can fire multiple watcher events for a single save; editors that use atomic-save (write temp → rename) produce two events. Debouncing collapses both into one reload signal.
Test plan
resources/i18n/ko.jsonduringvite:dev→ page reloads within 300msconfig.toml→ page reloadsresources/theme.json→ page reloadsStack
Builds on FR-2607.