Closed mydea closed 7 years ago
Hi and thanks for this great addon! Is there any reason why the fingerprinting can't be done by using broccoli-asset-rev directly and adding .json
-files to the extensions
-fingerprint options?
The reason for this is that we load the locale files dynamically via ajax. So we'd need to know the fingerprint at runtime, which, as far as I researched, would only be possible by making ember-cli generate an fingerprint-asset-map.json
file in the public folder, and then fetch that file via ajax, and get the correct path from there. This means that you need to delay loading of the app for after the asset-map file has been loaded, which adds one more request to your app, which feels really unnecessary. This approach here is slightly more complex, but ends up in a slimmer app. And since we provide our own "build process" with ember l10n:convert
anyhow, that is basically hidden away from the developer anyhow - only migrating to this workflow doesn't happen automatically. Once you have done the (small) setup, everything should just work.
ah ok. makes sense. thx for clarifying and thanks again for this addon
This PR changes the default behavior of
ember l10n:convert
to create a fingerprinted locale file. The fingerprint is saved in theapp/utils/l10n-fingerprint-map.js
file, which is then retrieved from thel10n
service.Steps to upgrade to the new behavior:
1.) Upgrade
ember-l10n
2.) Runember g ember-l10n
to generate the basel10n-fingerprint-map.js
file, and make sure to also include the changes from theapp/services/l10n.js
file where the fingerprint map is loaded 3.) Re-runember l10n:convert
for all your locales to create the fingerprinted versions