Skip to content
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

concatenateCss , concatenateJs, dev server mode not refreshing, hot reload not working #234

Open
kszymukowicz opened this issue Nov 21, 2024 · 1 comment

Comments

@kszymukowicz
Copy link

kszymukowicz commented Nov 21, 2024

hi,

we have a base starter TYPO3 where by default we have:

 config {
    compressCss = 1
    concatenateCss = 1
    compressJs = 1
    concatenateJs = 1
 }

[like(applicationContext, "Development/*/*")]
  config {
    compressCss = 0
    concatenateCss = 0
    compressJs = 0
    concatenateJs = 0
  }
[global]

In one of the TYPO3 we have there was no this part with TypoScript condition to clean the compressJs=0, concatenateCss=0 etc on development mode. On this TYPO3 instance on encore dev server mode the auto refresh (hot reload) of changes were not working and also developer needed to refresh page few times to have updated value of css/js. Additional issue was that the phpstorm core load was high after some work on project.

For some time I thought this behaviour is because of very big scss / js at this project and multi entry encore config.
But finally I found time to figure out that the reason is only concatenate being done by TYPO3 on dev server resources.

TYPO3 reads all external JS/CSS of local encore dev resources, made concatenate and instead of:

<link rel="stylesheet" href="https://t3base12.ddev.site:8080/assets/frontend/build/main.css" media="all">

<script src="https://t3base12.ddev.site:8080/assets/frontend/build/runtime.js" async="1"></script>
<script src="https://t3base12.ddev.site:8080/assets/frontend/build/vendors-node_modules_core-js_modules_es_parse-int_js-node_modules_core-js_modules_es_string_e-4327fc.js" async="1"></script>
<script src="https://t3base12.ddev.site:8080/assets/frontend/build/main.js" async="1"></script>

there is:


<link rel="stylesheet" href="/typo3temp/assets/compressed/merged-b400b1d5c86e5f610bca77d2f572a7c8.css?1732208085" media="all">
<script src="/typo3temp/assets/compressed/merged-d30ba841b54f84a326cd09360224c558.js?1732208085" type="text/javascript" async="async"></script>

Additional drawback of this is that with time there are lot of such concatenate files (like GBs) and those files needs to be synced to docker and it slows down working experience (high core loads)

I am thinking now how many developers there are working like that with typo3_encore?
How many of them think this is how it should work.

Maybe we should update documentation at least or make some additional warning when concatenate is active on development mode? I am not sure.

What do you think?

@sabbelasichon
Copy link
Owner

Interesting. I am not using concatenate nor compress since ages. Feel free to add a warning. Could be very useful for others sure.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants