When one uses the Versioning, it creates a new js file each time it is compiled.
They multiply like rabbits.
Suggestion
- Either increase the version only if the code is run
- Or delete the previous js file before compiling the new one.
When one uses the Versioning, it creates a new js file each time it is compiled.
They multiply like rabbits.
Suggestion
We will reflect on this
Related suggestions.
Another blog post for you There's a section on Version Information showing one way to get the TMS WEB Core version into your project so you can use it.
I need to use the renaming of the js file, otherwise there are caching issues.
Another suggestion.
Yes, keeping the JS files and their constant revisions is important to ensure that nothing is cached unless nothing changes. Reporting the version number where users can see it (if they want) is a way to help ensure that things are updating. PWAs for example are notorious for not updating even when you think you've done everything right.
I usually have a script of some kind that I use to copy the compiled project for deployment, and in that script I delete all the extras. Likewise on the deployment side, another script is run which optimizes things a bit more and deletes the revisions. It is a process for sure.
Having the different build versions each time is a bit tedious. I'm not entirely sure why TMS didn't reuse the normal Delphi build numbers so we could do a "rebuild all" and get a new number, but it is likely because even in development, having the JS change numbers every time makes debugging them a lot easier due to the same caching issue.
Maybe having TMS build in an option to keep the last three or five or some configurable number would help, but even then you still have to deal with this when you deploy it as the renamed copies will just end up multiplying there if you're not careful.