Skip to content

fix: Only write Vite config files when they have changed - #17433

Merged
Artur- merged 3 commits into
mainfrom
prevent-vite-restart
Aug 14, 2023
Merged

Artur- merged 3 commits into
mainfrom
prevent-vite-restart

Conversation

@Artur-

@Artur- Artur- commented Aug 14, 2023

Copy link
Copy Markdown
Member

Prevents Vite from restarting when not needed

Fixes vaadin/hilla#1134

Prevents Vite from restarting when not needed

Fixes vaadin/hilla#1134
@Artur-
Artur- requested a review from caalador August 14, 2023 07:02
@Artur-

Artur- commented Aug 14, 2023

Copy link
Copy Markdown
Member Author

The problem is clearly seen in Hilla+React projects as any Java change results in

2023-08-14T10:03:22.761+03:00  INFO 72515 --- [v-server-output] c.v.b.devserver.DevServerOutputTracker   : [vite] target/plugins/application-theme-plugin/theme-generator.js changed, restarting server...
2023-08-14T10:03:22.762+03:00  INFO 72515 --- [v-server-output] c.v.b.devserver.DevServerOutputTracker   : [vite] target/plugins/application-theme-plugin/theme-copy.js changed, restarting server...
2023-08-14T10:03:22.763+03:00  INFO 72515 --- [v-server-output] c.v.b.devserver.DevServerOutputTracker   : [vite] target/plugins/application-theme-plugin/theme-handle.js changed, restarting server...
2023-08-14T10:03:22.763+03:00  INFO 72515 --- [v-server-output] c.v.b.devserver.DevServerOutputTracker   : [vite] target/plugins/theme-loader/theme-loader-utils.js changed, restarting server...
2023-08-14T10:03:22.763+03:00  INFO 72515 --- [v-server-output] c.v.b.devserver.DevServerOutputTracker   : [vite] target/plugins/rollup-plugin-postcss-lit-custom/rollup-plugin-postcss-lit.js changed, restarting server...
2023-08-14T10:03:22.817+03:00  INFO 72515 --- [v-server-output] c.v.b.devserver.DevServerOutputTracker   : [vite] server restarted.

followed by

2023-08-14T10:03:23.166+03:00  INFO 72515 --- [v-server-output] c.v.b.devserver.DevServerOutputTracker   : [vite] target/vaadin-dev-server-settings.json changed, restarting server...
2023-08-14T10:03:23.166+03:00  INFO 72515 --- [v-server-output] c.v.b.devserver.DevServerOutputTracker   : [vite] vite.generated.ts changed, restarting server...

@Artur-

Artur- commented Aug 14, 2023

Copy link
Copy Markdown
Member Author

This has not been a problem in earlier version as there was a bug in Vite preventing it from correctly watching all its config files for changes. Now that Vite works, it is an issue

@github-actions

github-actions Bot commented Aug 14, 2023 •

Copy link
Copy Markdown
Contributor

Test Results

1 001 files  ±0  1 001 suites  ±0   59m 44s ⏱️ - 1m 17s
6 388 tests ±0  6 347 ✔️ +1  41 💤 ±0  0 ❌  - 1 
6 644 runs  +8  6 596 ✔️ +9  48 💤 ±0  0 ❌  - 1 

Results for commit a0e3aa2. ± Comparison against base commit 69ce63c.

♻️ This comment has been updated with latest results.

@sonarqubecloud

Copy link
Copy Markdown

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@Artur-
Artur- enabled auto-merge (squash) August 14, 2023 10:13
@Artur-
Artur- merged commit 30aca73 into main Aug 14, 2023
@Artur-
Artur- deleted the prevent-vite-restart branch August 14, 2023 10:19
vaadin-bot pushed a commit that referenced this pull request Aug 14, 2023
vaadin-bot added a commit that referenced this pull request Aug 14, 2023
…7437)

Prevents Vite from restarting when not needed

Fixes vaadin/hilla#1134

Co-authored-by: Artur <artur@vaadin.com>
@vaadin-bot

Copy link
Copy Markdown
Collaborator

This ticket/PR has been released with Vaadin 24.2.0.alpha7 and is also targeting the upcoming stable 24.2.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.

Dev mode reloads TS changes twice, leaving the user with an empty screen

3 participants