-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
[TS migration] Migrate 'Setup' files to TypeScript #35473
Changes from 16 commits
21e645d
8a9c61b
43e8533
1e865fe
3554f0b
16b54e7
22ed83b
e74b34f
ee4d63f
343a578
b62f841
fa1e9cf
70f6d7a
1437b78
050c367
b865932
2ea6f2a
c21f140
b14ea7e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export default () => {}; |
Original file line number | Diff line number | Diff line change | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
@@ -21,23 +21,25 @@ function webUpdate() { | |||||||||
|
||||||||||
if (!Visibility.isVisible()) { | ||||||||||
// Page is hidden, refresh immediately | ||||||||||
window.location.reload(true); | ||||||||||
window.location.reload(); | ||||||||||
return; | ||||||||||
} | ||||||||||
|
||||||||||
// Prompt user to refresh the page | ||||||||||
if (window.confirm('Refresh the page to get the latest updates!')) { | ||||||||||
window.location.reload(true); | ||||||||||
window.location.reload(); | ||||||||||
} | ||||||||||
}); | ||||||||||
} | ||||||||||
|
||||||||||
type WebUpdater = () => { | ||||||||||
init: () => void; | ||||||||||
update: () => void; | ||||||||||
}; | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not a blocker but could we not reuse App/src/libs/checkForUpdates.ts Lines 3 to 6 in b865932
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think we can create a Should i do that? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I feel like it would be a little cleaner that way, in that we wouldn't have this duplicate type definition. But in a way, it also feels a little over-complicated for just this simple type... In the end I don't have a strong opinion, @parasharrajat I'm curious what you'd recommend here. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think we will be fine with types.ts file. There is no runtime differences. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So I have moved |
||||||||||
/** | ||||||||||
* Create an object whose shape reflects the callbacks used in checkForUpdates. | ||||||||||
* | ||||||||||
* @returns {Object} | ||||||||||
*/ | ||||||||||
const webUpdater = () => ({ | ||||||||||
const webUpdater: WebUpdater = () => ({ | ||||||||||
init: () => { | ||||||||||
// We want to check for updates and refresh the page if necessary when the app is backgrounded. | ||||||||||
// That way, it will auto-update silently when they minimize the page, | ||||||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This caused a regression #36522. After changing the export syntax from CommonJS to ESM we had to check the files that depend on that module and update them accordingly.