Repository navigation
Document how asset versioning works with the AssetMapper - #1668
Conversation
The page covered the query string of framework.assets.version and the Encore manifest, but AssetMapper puts the version in the file name, so neither of them applies and the page read as if nothing had to be done. Says what actually happens: the compiled files are in the public directory in production, while in development they only exist in their source directory, which is what the asset_mapper data loader is for. Also lengthens the title underline of that loader page, which was one character short of its title.
dbu
left a comment
There was a problem hiding this comment.
i guess this only works for images that exist at container build time and that are referenced statically, not for any dynamic image loading. what happens when the asset mapper is active and we have dynamic images?
|
Thanks for looking at it @dbu! It is not tied to build time: Dynamic images, like uploads, are not AssetMapper assets at all: they live outside its paths, never get a hash in their name, and keep being served by the |
dbu
left a comment
There was a problem hiding this comment.
finally getting back to this. thanks a lot!
@dbu you said on #1608 that you were glad if somebody sorted it out and proposed fixes or documentation updates. Checking first, the code half is already done:
AssetMapperLocatorlanded in 2.17.0 with #1645. What is left is the documentation, and it is what produced the confusion in the first place.The reporter went to Asset Versioning because it promises the bundle handles versioning. That page covers
framework.assets.version, which puts the version in a query string, andjson_manifest_path, which puts it in a manifest. AssetMapper puts it in the file name, so neither integration applies to it and the page reads as if nothing had to be done.What actually happens, as
AssetMapperLocator's own docblock describes:asset-map:compilewrites the versioned files into the public directory, so thefilesystemloader finds them like any other file. That is why running that command works around the problem, as @Schyzophrenic found in the thread;Source image for path could not be foundcomes from, and what theasset_mapperdata loader is for.The page now says both, and links to the loader page.
While linking to it I noticed its title underline is one character shorter than the title, which makes Sphinx warn about it, so that is fixed here too.