Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(nf): Angular i18n support #627

Open
wants to merge 22 commits into
base: main
Choose a base branch
from

Conversation

refactorTractor
Copy link

closes #413

Angular i18n support in native federation

This is how i18n support could play out in my opinion:

  • Shared entries/packages build just as they used to.
  • Exposed entries are built by the angular application internal builder
  • index.html-s are found in the build output, and each transformed
  • remoteEntries are copied next to index.html-s found, and transformed for the new directory structure
  • a remoteEntry is created in the top directory that has the references to each language bundle's exports as well
  • to match physical paths with urls in basehref-s you can provide pathMappings that will do the transformation in dev server mode.

There is no need to modify the nf-core project (or the runtime)

@refactorTractor refactorTractor changed the title I18n support feat(nf): Angular i18n support Aug 23, 2024
@aramirezj
Copy link

Hey! Would you be able to provide steps to try your fix?

I have tried:

  1. Cloning and installing your branch
  2. Generate the bundles
  3. Clone the native module federation from manfred at 17.2 version, and install the dependency from your forked branch
  4. I have tried to add i18n and generate the locales with the builder @angular-devkit/build-angular:extract-i18n but it does not go through for some old error An unhandled exception occurred: The "paths[1]" argument must be of type string.

If not, if you could provide a repository with your solution applied so it can be tested it would be amazing

@Ooi-Jun-Xiang
Copy link

Ooi-Jun-Xiang commented Dec 5, 2024

Hey @aramirezj

I think the issue regarding i18n he meant is when building the whole project that has i18n, not when compiling i18n only(extract-i18n). As for the error you get on 4, you can change the buildTarget to <project>:esbuild instead of <project>:build, although I am not sure why there will be error in the <project>:build. Anyways, I hope that this PR get merged, as I also need it in my project.

 "architect": {
     "build": {
         "builder": "@fork-fork/native-federation:build",
         ...
     },
     "extract-i18n": {
         "builder": "@angular-devkit/build-angular:extract-i18n",
         "options": {
-            "buildTarget": "<project>:build"
+            "buildTarget": "<project>:esbuild"
         }
     },
     "esbuild": {
         "builder": "@angular-devkit/build-angular:application",
         ...
     }
 }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Native federation: support Angular i18n (partially)
3 participants