-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
Turn asset-map:compile into a cache-warmer #59072
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
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
I think it is quite popular to have the assets & asset map compiled into a docker image. If this command was a cache warmer instead of a separate command, you would have to warm up cache when building the image. If you're using anything but file cache – would it work? As you don't have all the runtime infrastructure available during build 🤔 |
I would keep both ways: the command and the cache warmer. The former for standalone usage, the latter for integrated usage with Symfony apps. |
As long as it's not enabled by default or can be disabled, I can see the reasoning. However, this approach is more than just destructive for the cache—it affects more than that. This is why it’s a compiler, not just a warmer: it relies on having all sources available. Back-and-forth workflows are indeed common, but this change would force anyone using SASS, TypeScript, or custom assets to rebuild them every time they install the project or refresh their cache. I’m not sure this is an improvement. To me, this doesn’t seem like the right solution. Webpack has faced similar challenges, but they haven’t been significant issues for most users. Building "prod" assets locally also feels like a niche use case to begin with, and I honestly doubt this is a workflow for the majority of users. That makes me question whether we’re addressing a real, widespread issue here. The potential cost and impact on everyone else seem disproportionately high. |
We should optimize for the no-build stack. The path forward for asset mapper is certainly not to become yet another compiler stack. If one wants true compilation, then fine, use Webpack Encore or any alternatives. The current DX is not as good at it should be. Having to learn/remember about running And also having to remember undoing what |
I agree on all this. I dont want to break anyone workflow or make it impossible to adapt. For now it does. And for now, even if you or me or anyone dont like it, the class and command are using the word Compile for a good reason! And i’m not saying you’re the only one. I’m saying this will break a lot more usage of AssetMapper users than you think. And this feels to me a big BC and not the best way to lead and convince people to the « no-build word ». |
Let me come back later on this topic. |
Uh oh!
There was an error while loading. Please reload this page.
At the moment, deploying an asset-mapper enabled app requires knowning about the
asset-map:compile
command.And switching back and forth from the dev to the prod env requires knowing how to undo what this command did to get a working dev env back from prod (and running the command in the opposite direction.)
This creates DX issues like #59065.
I was thinking about changing the command to remove the assets files in debug mode. This would enable adding it to the default composer.json.
But it wouldn't fix DX for the back-n-forth between dev/prod. A cache-warmer would.
Is there any reasons why we didn't go with a cache-warmer? I checked #50112 but didn't find any rationale for/against this.
The text was updated successfully, but these errors were encountered: