webpack-plugin icon indicating copy to clipboard operation
webpack-plugin copied to clipboard

Webpack + moduleFedrationPlugin + translations of shared components not working

Open DhitiChavda opened this issue 2 years ago • 2 comments

I'm submitting a bug report

  • Library Version: major.minor.patch-pre 5.72.0

Please tell us about your environment:

  • Operating System: macOs Ventura 13.1

  • Node Version: 6.2.0

14.19.3

  • NPM Version: 6.14.7
  • JSPM OR Webpack AND Version webpack 5.72.0
  • Browser: all

  • Language: TypeScript X4.6.3

Current behavior: When used ModuleFedrationPlugin container to share the component from App1 to App2, translations are not been translated and only Keys are visible in App2 UI App1 webpack looks like : Screenshot 2023-05-08 at 5 08 27 PM App2 webpack looks like: Screenshot 2023-05-08 at 5 10 52 PM Components in App2 (from App1) looks like Screenshot 2023-05-08 at 5 12 43 PM Screenshot 2023-05-08 at 5 12 57 PM Screenshot 2023-05-08 at 5 13 08 PM

Expected/desired behavior:

In App2, the shared components should come up with translations and not only key

  • What is the expected behavior? The shared components should come up with translations and not only key

  • What is the motivation / use case for changing the behavior? translationd not coming up

I even tried adding react-i18next to peerDependencies but it didn't worked

DhitiChavda avatar May 08 '23 11:05 DhitiChavda

Current situation: Added a static json file of translations in studio and added them into translations via i18next.addResourceBundle, though key is added and can translate keys in browser console, shared components are not reflecting them. Screenshot 2023-05-08 at 5 24 50 PM

DhitiChavda avatar May 08 '23 11:05 DhitiChavda

Thanks @DhitiChavda , I suspect that this is because the plugin currently doesn't consider modules being exported via the ModuleFederation plugin. I probably can have a look sometime soon, been on my mind recently.

bigopon avatar May 08 '23 12:05 bigopon