vaadin / flow

Vaadin Flow is a Java framework binding Vaadin web components to Java. This is part of Vaadin 10+.
Apache License 2.0
622 stars 166 forks source link

Combine the generated files of the dev bundle #16874

Closed jcgueriaud1 closed 1 year ago

jcgueriaud1 commented 1 year ago

Describe your motivation

When a javascript file is updated in the project the dev-bundle is regenerated and a lot of files are removed and recreated (with a different unique name). So the git status contains multiple updated files and 26 files added and 26 files removed. That also happen when the Vaadin version is updated.

Describe the solution you'd like

I'd propose to also combine the generated files into one, so that it wouldn't look so massive change now whenever one updates a Vaadin version or fixes a typo in a javascript file.

See here also: https://github.com/vaadin/flow/issues/16028#issuecomment-1459690490

Artur- commented 1 year ago

Does it matter in any way how they are combined or just that it would be one file that always has the same name?

jcgueriaud1 commented 1 year ago

It doesn't matter to me. I'm not planning to check what's in the file (if I need to debug I will use the frontend hotdeploy).

Maybe @mstahv has another opinion.

mstahv commented 1 year ago

I have exactly the same opinion. So far I haven't looked into those files either.

But a perfect solution would be that the file is not stored in source code management system at all. It is a generated file, so kind of against the best practices. If only there was a cloud service that would store the bundles and share them with other who have the same front-end resources 🤪

Artur- commented 1 year ago

This could probably be done so that instead of using a dev bundle from src/main/dev-bundle (and storing a new one in the same place) we would use target/dev-bundle for that. When creating a new bundle we would also compress it (e.g. tar or whatever is fast) as src/main/dev-bundle/dev.bundle. When using the bundle and target/dev-bundle does not exist, we would decompress src/main/dev-bundle/dev.bundle, if it exists.

There is probably no need to change how we handle the default dev bundle as compressing it inside a jar sounds unnecessary

mshabarov commented 1 year ago

Acceptance Criteria: