-
Notifications
You must be signed in to change notification settings - Fork 12k
feature request: single assets in i18n builds #26286
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
Comments
A little update: I just took two different localized builds and compared their |
Hi guys. I see “Needs discussion” badge was added, what does it mean? Will this be done? |
We already discussed this during one of our team meetings but we haven't reached a definitive conclusion on the next steps. However, we reached a consensus that if an action is taken, it's improbable that it will involve a symlink-based approach. |
Spent some time discussing this in the team today. Our immediate reaction is that symlinks in the output might cause some issues for servers. In my experience, servers are typically hesitant to follow symlinks as they can often be the result of a misconfiguration issue and accidentally serve data which wasn't intended to be served. In this case, such symlinks would be internal to the served directory and (probably) safe, but I could see some servers getting this wrong or requiring explicitly enabling symlinks which server admins might not want to do. An alternative proposal which might be better is to just emit an This would definitely be a breaking change for existing applications, so I don't think we can automatically make this change, it would need to be behind a flag. Not sure what the naming for this flag would be, but under i18n options we could include something like |
This sounds like a good solution. I dont think there are many people who use i18n + ssr now, so it won’t break many apps. Maybe make this approach as default and add option like { cloneAssetsForEachLocale: boolean } (which is false by default)? |
This feature request is now candidate for our backlog! In the next phase, the community has 60 days to upvote. If the request receives more than 20 upvotes, we'll move it to our consideration list. You can find more details about the feature request process in our documentation. |
This feature would not only reduce build sizes considerably and improve caching, it also enables to output static files outside of the locale directories ( |
I wish I could upvote this a million times. |
Just a heads up that we kicked off a community voting process for your feature request. There are 20 days until the voting process ends. Find more details about Angular's feature request process in our documentation. |
This comment was marked as outdated.
This comment was marked as outdated.
@dgp1130, have you also considered not copying the global style files to each locale? Those defined in Is there any use case where they can be different depending on the locale? Thanks. |
Hi, is there any chance to reconsider this vote, please? This is vital for new applications and especially containerised ones. I totally agree with @spock123 to upvote it more than one million time. By the way, what is the minimum requirement vote to push it back to the backlog? |
I definitely think that this is something that should be considered again. |
This is still bad DX managing files like robots.txt. It would be nice to have a way to create a single folder for assets out of locales folders |
Command
build
Description
Hi.
Currently angular just copy assets folder to every localized build. This leads to enormous dist size (in my case every locale with assets weigths 180MB, which can be multiplied by 15 locales).
Describe the solution you'd like
My proposal is to put assets folder in root directory, instead of copying it inside every built locale, and symlink it inside every locale. This will give us better build times, and also will fix issues where developers use absolute urls to assets, eg:
My solution will give developers a way to use localized builds in mobile apps development (with capacitor for example; for now it’s strange to publish mobile app which weights over 2gb), better build times (no need to copy assets to every locale), better deploy times (transfer 180mb instead of 2.7GB)
Describe alternatives you've considered
Currently, the only issue i encounter, is absolute path usage (described it in my example with img src). I make symlink to get this working:
/en/assets -> /assets
The text was updated successfully, but these errors were encountered: