react: migrate to vite - #34656
Merged
Merged
Conversation
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Webpack's HtmlWebpackPlugin injected <base href="/">; Vite does not, so
document.querySelector('base') in app.tsx was null and the app crashed on boot.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Vite applies resolve.alias before any plugin, so the 'app' alias rewrote the app/* modules listed in module-federation.config.ts shared before @module-federation/vite could match them, bypassing sharing. Remotes then used their own store instance and the gateway state lacked their reducers. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@module-federation/vite cannot proxy app-local modules to the host: it only detects named exports of installed packages, so app/* share mappings always resolve to the remote's own copy. The remote injected its reducers into its own store while selectors read the host store. - entities routes use useStore() from the shared react-redux package - drop app/* share mappings (unsupported) and the app alias plugin Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…deration/vite @module-federation/vite only proxies shared modules to the host when it can detect named exports of an installed package, application modules always resolved to the remote's own copy. Apply the upstream fix (https://github.com/mshima/vite/tree/fix/app-local-shared-import) through patch-package and restore the app/* share mappings and the app alias plugin. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…app modules to their source Replace the custom alias plugin with vite-tsconfig-paths registered after the federation plugin, tsconfig.json is the single source of truth for the 'app/*' paths. Application modules listed in module-federation.config.ts shared are not installed packages, set 'import' to the source file so the federation plugin can inspect them and proxy the host instance. This removes the need for the @module-federation/vite patch. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@module-federation/vite does not share @module-federation/runtime, so the microservice's copy of the locale thunk called loadRemote on its own runtime instance where the remote is not registered, leaving the remote entity pages untranslated. A microservice only provides its own translations, import them directly; the gateway keeps using loadRemote on the host runtime for language switches. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Translate components only update when their parent re-renders. On a direct visit of a remote entity page the list re-renders once when the api responds, usually before the microfrontend translations finished registering, leaving the page with untranslated keys. Subscribe the app root to locale.lastChange. Also skip sharing sonar-scanner, a node cli added to dependencies by skipServer applications. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Replace resolve.alias and vite-tsconfig-paths with resolve.tsconfigPaths. Vite honors the tsconfig include, reference tsconfig.vitest.json from tsconfig.json so spec files resolve 'app/*' paths under vitest. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This reverts commit 2c9aed5.
…18n modules The microfrontend entities menu registers the translations bundled with the microfrontend for the host's current locale and re-registers on locale change, the host no longer loads remote i18n modules through module federation. Remove the i18n-<lang> exposes and simplify the locale reducer to a single loadedKeys bookkeeping. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
mshima
marked this pull request as ready for review
August 25, 2026 15:36
mshima
marked this pull request as draft
August 25, 2026 16:03
Load the application translations before the initial render and register the microfrontend translations when the exposed menu and routes modules are loaded, so the host never renders remote pages with untranslated keys. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Member
Author
|
I saw translation issues in module-federation videos. Still needs adjusts. |
Concurrent callers of registerTranslations (remote menu and routes modules loading in parallel) resolved immediately once the locale was marked as registered, rendering pages before the i18n chunk arrived.
The ribbon (z-index 99999) painted over react-toastify's container (9999) and hid part of the toast message.
mshima
marked this pull request as ready for review
August 25, 2026 20:50
Member
Author
Looks resolved. |
qmonmert
reviewed
Aug 26, 2026
Contributor
There was a problem hiding this comment.
path-browserify can be removed
qmonmert
reviewed
Aug 26, 2026
qmonmert
reviewed
Aug 26, 2026
DanielFran
approved these changes
Aug 27, 2026
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.
Fixes #25856
Please make sure the below checklist is followed for Pull Requests.
Co-authored-by:trailer in the commit(s)When you are still working on the PR, consider converting it to Draft (below reviewers) and adding
skip-cilabel, you can still see CI build result at your branch.