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

Updates SDK tsconfig to enable the incremental #1931

Merged
merged 6 commits into from
Apr 3, 2024
Merged

Conversation

infomiho
Copy link
Contributor

@infomiho infomiho commented Apr 2, 2024

We had an issue with Vite hot module reload (HMR) not working properly: the HRM would happen, React would keep the state and it seemed good. But then the SDK would be rebuilt, trigger full-page reload, losing the React state. This completely defeats the purpose of HMR!

Adding incremental: true helps with Vite HMR working properly. The SDK wouldn't be rebuilt unless necessary and wouldn't trigger full-page related ✅

This also has some nice side-effects:

Closes #1829

infomiho added 2 commits April 2, 2024 15:00
Signed-off-by: Mihovil Ilakovac <[email protected]>
@@ -96,7 +96,8 @@ runGoldenTest goldenTest = do
"dev.db-journal",
"package-lock.json",
".gitignore",
".DS_Store"
".DS_Store",
"tsconfig.tsbuildinfo"
Copy link
Contributor Author

@infomiho infomiho Apr 2, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a internal file written by TSC when using the incremental option. There is no need to keep track of the changes to that file IMHO

@infomiho infomiho mentioned this pull request Apr 2, 2024
Copy link
Contributor

@sodic sodic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As good looking to me as it gets 😄

@@ -28,6 +28,7 @@
// about missing types e.g. when using `toBeInTheDocument` and other matchers.
"@testing-library/jest-dom"
],
"incremental": true,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great find!

Wondering why this isn't the default option 🤔

@infomiho infomiho merged commit 2b3bbf9 into main Apr 3, 2024
6 checks passed
@infomiho infomiho deleted the miho-tsc-incremental branch April 3, 2024 13:11
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

Successfully merging this pull request may close these issues.

Fix Vite HMR
2 participants