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
How to use publicOnly: true
in Embroider apps
#1829
Comments
There's some more context in this thread Compatibility with broccoli-asset-rev functionality (asset fingerprinting, assetMap.json manifest |
I've just run into this as well w/ embroider. Ember Version: 4.12.3 |
@amk221 I didn't fully understand the problem that you had encountered. Without seeing how your project is set up (conversely, your seeing mine), I think it may be hard to discuss the issue. What I can show at the moment is, setting The screenshots below show an Embroider app with Afterward, by calling
|
Thanks. The problem (for me, and presumably @veelci) is... The output of a classic app is:
...and the JSON can be loaded becuse we can interogate the asset-map to find the URL for
But the output of an embroider app is:
The translation files are not part of the webpack app (so we can't do |
@amk221 yes, that is my problem as well. |
Hi 👋 Is there anything I can do to help move this along? Or, even just to get confirmation that my issue is legit? I'm sure more and more people will hit this as they try to move to Embroider. Thanks for any info! |
Hi, @amk221. Can you help with creating an Embroider app (#1868) so that we can start somewhere? If you leave a comment in that issue, I can assign it to you. I wasn't sure which configuration steps an end-developer usually takes to use |
Here is a reproduction app Currently, it works, because it's a classic app. Set The gist is, lack of fingerprinting on the translated files, incombination with no way to know how to load them if they were fingerprinted. |
@amk221 I created 2 apps in the
I looked at the diff that your had provided. Unfortunately, I still don't quite understand how to reproduce the issue that you had described. Can you fork the repo and create a branch, then update one (or both) of the apps above to recreate the issue? If there are files in |
I've had a look, but there is nothing for me to do. It's as I mentioned here
To clarify, the translations are not in webpacks module graph. Which means there is no embroider equivelant of the classic config to migrate to. |
Hi, just checking in, does this make sense? |
@amk221 Sort of. I haven't had time to look more into using Yesterday, someone asked Glime about fingerprinting on Discord. Maybe the answer there could help you get started. https://discord.com/channels/480462759797063690/1157084708442755102/1242146088023232636 |
Good idea.
I'm not sure how, I would have done a PR if I knew :) The part that I'm unsure of is: With webpack, ususally you're dealing with assets that exist on disk already (images, css and whatnot) But, with these translations, the build process has started already, so how does webpack get informed of files that didn't exist when it starting building, but do exist later on in the build phase
Glime's answer seemed a bit hacky, I would expect fingerprinting to come for free if the tranaslation files were part of the graph. Also, There is no need for the asset map in an embroider world |
In a classic app, it's possible to use the instructions here to produce JSON files in a translations directory. The app knows the name of the fingerprinted file to load, because it can read the assetMap.
But in an Embroider build, the
translations/*.json
files no longer get processed by broccolli-asset-rev, and as such they are not fingerprinted. And since there is no longer an assetMap, there doesn't seem to be a way to load the translation files into the app. I thought perhaps I could leavepublicOnly
as false, and somehow use Webpack to produce the json files, but I'm not sure that's possible.Could the guidance in the asynchronously-loading-translations.md be updated?
Environment
The text was updated successfully, but these errors were encountered: