question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Feature Request] separate `translations` from vendor.js to app.js

See original GitHub issue

Hi, @jasonmit , i have a new building problem after instead of ember-i18n:

in i18n addon, the translations texts is bundled to app.js, not vendor.js, so, i have a stable vendor file hash in a long dev iteration cycle; and , i can produce bundles for different locale ,with same vendor output file.

in intl addon, translations is merge to addon tree by treeForAddon, vendor will be changed once locales file edited , and now , i can’t get output with same vendor , btw, i don’t perfer to make load lazy.

it not seems to be a necessary requirement for classic ember app building, but can we discuss for a solution ? thanks

one choice is : like ember-i18n, we can merge translations files to app ; and in addon/translations.js, it can get locales by requirejs.entries, or use ember inject api .

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
jasonmitcommented, Jun 10, 2020

@houfeng0923 ya require() with modulePrefix or another option I’ve been considering is programmatically creating an initializer with the translations inlined. It would then lookup the service and addTranslations.

Unsure if the initializer approach would complicate the unit testing story or not. I truthfully don’t use Ember anymore (though I wish I was…), so I’m all ears on newer/other approaches that I’m may not be considering.

Why I dislike walking entries is because I believe it’s private and we should be able to look it up at a fixed/known location since we’re the ones writing the translations into the bundle for those that choose that translation loading strategy.

0reactions
houfeng0923commented, Jul 2, 2020

hi @sandstrom i am not sure How and when can use Embroider in production . i need to pay attention to it later .

and , for a util addon, i prefer intl addon can ·realize this vision· 🤝

Read more comments on GitHub >

github_iconTop Results From Across the Web

Feature request: separate app and vendor bundles #1601
Is there any way to have angular cli webpack produce different minified js for third party and app libraries? Running on OSX El...
Read more >
How do I properly separate my app.js and vendor.js bundles ...
I should be able to use app.js, with its various require('module') statements and attach rendered HTML to the DOM (I'm using React) -->...
Read more >
How to choose a localization approach for your React ...
In this guide we explore different approaches to adding localization to your React application and the tradeoffs of each approach, ...
Read more >
The Ultimate Guide to JavaScript Localization | Phrase
As our app grows, we'd probably want to split our translations into separate, per-locale files. The translation file corresponding to the active ...
Read more >
Translate Your Node.js App with Transifex
Translate Your Node.js App with Transifex. For more information about localization and translation, contact Transifex at 1-855-418-5000 or ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found