-
Notifications
You must be signed in to change notification settings - Fork 39
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: ensure Electron.Utility property exists #247
fix: ensure Electron.Utility property exists #247
Conversation
Should that line be guarded with a check that |
Ah thanks for checking that. I see the declaration merging only works when the namespace doesn't have any values because otherwise it's trying to merge two variables. Added a check to only set the property if the Utility namespace doesn't have any values: 3091893 |
@MarshallOfSound friendly bump when you're able to review 🙏 |
Added in electron#246, the Utility namespace currently has no concrete values in it on electron/electron@main. This change ensures Electron.Utility is available as a property even when the namespace has no values.
If the Utility namespace has concrete values and the const Utility property is set it causes `error TS2300: Duplicate identifier 'Utility'.` This tracks whether any values are added to the Utility namespace and only sets the property workaround if there are none.
3091893
to
89617c3
Compare
Awesome, thanks @dsanders11! Conflict resolved. Once merged and published, I'll update electron/electron#40264 |
🎉 This PR is included in version 8.15.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Upgrades docs-parser and typescript-definitions to add new 'electron/utility' namespace added in: - electron/docs-parser#95 - electron/typescript-definitions#246 - electron/typescript-definitions#247
…ons (#40264) * feat: add utility process typescript namespace Upgrades docs-parser and typescript-definitions to add new 'electron/utility' namespace added in: - electron/docs-parser#95 - electron/typescript-definitions#246 - electron/typescript-definitions#247 * build: update yarn.lock --------- Co-authored-by: David Sanders <[email protected]>
…ons (electron#40264) * feat: add utility process typescript namespace Upgrades docs-parser and typescript-definitions to add new 'electron/utility' namespace added in: - electron/docs-parser#95 - electron/typescript-definitions#246 - electron/typescript-definitions#247 * build: update yarn.lock --------- Co-authored-by: David Sanders <[email protected]>
Added in #246, the Utility namespace currently has no concrete values in it on electron/electron@main. This change ensures Electron.Utility is available as a property even when the namespace has no values.
Takes advantage of declaration merging: https://www.typescriptlang.org/docs/handbook/declaration-merging.html
Other approaches considered:
Tested with
node spec/ts-smoke/runner.js
on electron/electron@mainShould unblock electron/electron#40264 to ultimately be used (and made not empty) in electron/electron#40017