-
-
Notifications
You must be signed in to change notification settings - Fork 165
Improve how the ide-twig.json
file is generated
#8200
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
base: 5.x
Are you sure you want to change the base?
Conversation
I think a mandatory cache warmer is probably still the best "injection point": a kernel event listener would run too often (every request, waste of resources) and the There is probably never any difference between prod and dev and the file is not used as a cached resource, so that's why I would not like to have it in |
Btw., it's a mandatory cache warmer, so it won't run at |
The only autogenerated non-cache files of Symfony (I know of) are the |
A custom command to generate the file in |
As discussed we want to stick with a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As discussed in Slack, the IDE
namespace and the DumpTwigIDEFileCommand
and DumpTwigIDEFileCommandTest
classes should be in camel case:
Contao\CoreBundle\Twig\Ide\…
DumpTwigIdeFileCommand
DumpTwigIdeFileCommandTest
Implements #8051
This PR improves the way the
ide-twig.json
IDE helper file is generated. Currently we are only creating the file during cache warmup in the dev environment in an optional cache warmer. This is unfortunate because you typically do not explicitly warm the dev cache. We also dumped the file tovar/cache
which is semantically wrong.Now the file gets dumped to
var/contao-twig
in a mandatory cache warmer (still only in dev). In order to 8000 use it you can un-exclude the above directory in your IDE.I also added a new command
contao:dump-twig-ide-file
that dumps the file to a given location in your project dir. This way it will be included by default and can be checked in to version control. In this case, you own the file, so in order to update it, you must manually re-run the command./cc @bytehead