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

fix: delete only unnecessary generated files #19037

Merged
merged 7 commits into from
Apr 25, 2024

Conversation

mcollovati
Copy link
Collaborator

Prevents built tool plugins to to delete all frontend genreated files as first step in the prepare-frontend task, moving the login in BuildFrontendUtil and changing it to only delete files that are no longer created by node tasks.

Part of #18907

@mcollovati mcollovati force-pushed the issues/18907_track_and_clean_generated_files branch from 13e2fc6 to bac4b7a Compare March 25, 2024 17:43
Copy link

github-actions bot commented Mar 25, 2024

Test Results

1 099 files  + 2  1 099 suites  +2   1h 21m 50s ⏱️ +3s
6 991 tests +11  6 941 ✅ +11  50 💤 ±0  0 ❌ ±0 
7 355 runs  +25  7 293 ✅ +25  62 💤 ±0  0 ❌ ±0 

Results for commit 421b7ec. ± Comparison against base commit be65806.

♻️ This comment has been updated with latest results.

@mcollovati
Copy link
Collaborator Author

This change prevents the Vite restarts caused, for example, by the of deletion and creation of files like vaadin.ts, but it does not avoid all the typescript errors.
This happens because some preserved files, like Flow.ts or vaadin.ts, import other sources that will be deleted because prepare-frontend does not handle it; examples are generated-flow-imports.js and theme.js

@mcollovati
Copy link
Collaborator Author

mcollovati commented Mar 26, 2024

File causing typescript errors on deletion

src/main/frontend/generated/flow/generated-flow-imports.js
src/main/frontend/generated/theme.js
src/main/frontend/generated/theme.d.ts
src/main/frontend/generated/theme-flowex.generated.js
src/main/frontend/generated/flow/generated-flow-imports.d.ts
src/main/frontend/generated/theme-flowex.components.generated.js
src/main/frontend/generated/theme-flowex.global.generated.js"
src/main/frontend/generated/views.ts

If exclude those from deletion, there are no typescript errors anymore, the browser page is reloaded, but I see a JavaScript error in the console and the page is blank.

Uncaught TypeError: Cannot read properties of undefined (reading 'push') at copilot-CAmK1KnO.js:4320:20

@mshabarov mshabarov requested a review from caalador April 3, 2024 10:11
@mcollovati mcollovati force-pushed the issues/18907_track_and_clean_generated_files branch from dae982b to e684f1d Compare April 5, 2024 12:02
caalador
caalador previously approved these changes Apr 18, 2024
@mcollovati mcollovati marked this pull request as ready for review April 22, 2024 11:53
Prevents built tool plugins to to delete all frontend genreated files as
first step in the prepare-frontend task, moving the login in
BuildFrontendUtil and changing it to only delete files that are no
longer created by node tasks.

Part of #18907
@mcollovati mcollovati force-pushed the issues/18907_track_and_clean_generated_files branch from ffdaa9f to 421b7ec Compare April 24, 2024 13:51
Copy link

Quality Gate Passed Quality Gate passed

Issues
11 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

@mshabarov mshabarov merged commit 38805eb into main Apr 25, 2024
26 checks passed
@mshabarov mshabarov deleted the issues/18907_track_and_clean_generated_files branch April 25, 2024 05:57
@vaadin-bot
Copy link
Collaborator

This ticket/PR has been released with Vaadin 24.4.0.alpha25 and is also targeting the upcoming stable 24.4.0 version.

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

Successfully merging this pull request may close these issues.

4 participants