Title: 1.8 breaks use of third-party promise libraries · Issue #6737 · microsoft/TypeScript · GitHub
Open Graph Title: 1.8 breaks use of third-party promise libraries · Issue #6737 · microsoft/TypeScript
X Title: 1.8 breaks use of third-party promise libraries · Issue #6737 · microsoft/TypeScript
Description: I'm currently developing in TS 1.7, compiling to ES6, and transpiling with Babel to ES5. I use Angular 1.x for my frontend development currently. I am able to leverage async functions by returning a custom type, QPromise, for which I've ...
Open Graph Description: I'm currently developing in TS 1.7, compiling to ES6, and transpiling with Babel to ES5. I use Angular 1.x for my frontend development currently. I am able to leverage async functions by returning ...
X Description: I'm currently developing in TS 1.7, compiling to ES6, and transpiling with Babel to ES5. I use Angular 1.x for my frontend development currently. I am able to leverage async functions by return...
Opengraph URL: https://github.com/microsoft/TypeScript/issues/6737
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"1.8 breaks use of third-party promise libraries","articleBody":"I'm currently developing in TS 1.7, compiling to ES6, and transpiling with Babel to ES5. I use Angular 1.x for my frontend development currently.\n\nI am able to leverage async functions by returning a custom type, `QPromise`, for which I've written a definition like this:\n\n```\ndeclare class QPromise\u003cT> implements angular.IPromise\u003cT> {\n constructor(resolver: (resolve: angular.IQResolveReject\u003cT>, reject: angular.IQResolveReject\u003cany>) => any);\n then\u003cTResult>(successCallback: (promiseValue: T) => angular.IPromise\u003cTResult>|TResult, errorCallback?: (reason: any) => any, notifyCallback?: (state: any) => any): angular.IPromise\u003cTResult>;\n catch\u003cTResult>(onRejected: (reason: any) => angular.IPromise\u003cTResult>|TResult): angular.IPromise\u003cTResult>;\n finally(finallyCallback: () => any): angular.IPromise\u003cT>;\n}\n```\n\nI then create a JavaScript file with a definition QPromise:\n\n```\nfunction QPromise(resolver) {\n var $q = angular.injector(['ng']).get(\"$q\");\n return new $q(resolver);\n};\n```\n\nWhile less than elegant, this has been an acceptable shim for now so that I can use async while still using Angular's $q library, which is needed to get Angular digest to occur automatically.\n\nTS 1.8 no longer lets me return a `QPromise\u003cT>`, complaining: `error TS1064: The return type of an async function or method must be the global Promise\u003cT> type.`\n\nThis all but breaks my ability to work with Angular 1 and still use TS async functions.\n","author":{"url":"https://github.com/bytenik","@type":"Person","name":"bytenik"},"datePublished":"2016-01-29T21:50:30Z","url":"https://github.com/microsoft/TypeScript/issues/6737"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:bbec6df3-3c80-5545-38e7-118eedf0efc4 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | ACBA:2DBB21:4AAD45:658023:6B00CE23 |
| html-safe-nonce | d118e7a9c35069ca6960af8e02cbaac770a11d545f25803c5ed953df061f804b |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBQ0JBOjJEQkIyMTo0QUFENDU6NjU4MDIzOjZCMDBDRTIzIiwidmlzaXRvcl9pZCI6IjM1ODI2MzYzMjQ1Mjk2ODgwOTkiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | d0a034e1dafa04ea94ce3a5f95416b7ff3e485d7ef6f0ef169fec8a89ec8002d |
| hovercard-subject-tag | issue:129892118 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/microsoft/TypeScript/6737/issue_layout |
| twitter:image | https://opengraph.githubassets.com/048764d604b326678e8eb2e081cd523be28af28f0a63b622643f3e3436dc6b56/microsoft/TypeScript/issues/6737 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/048764d604b326678e8eb2e081cd523be28af28f0a63b622643f3e3436dc6b56/microsoft/TypeScript/issues/6737 |
| og:image:alt | I'm currently developing in TS 1.7, compiling to ES6, and transpiling with Babel to ES5. I use Angular 1.x for my frontend development currently. I am able to leverage async functions by returning ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | bytenik |
| hostname | github.com |
| expected-hostname | github.com |
| None | 85bbdfe2b6ba16e234513bc6ceff5d848ef8449820c900692a2b4e67061931e5 |
| turbo-cache-control | no-preview |
| go-import | github.com/microsoft/TypeScript git https://github.com/microsoft/TypeScript.git |
| octolytics-dimension-user_id | 6154722 |
| octolytics-dimension-user_login | microsoft |
| octolytics-dimension-repository_id | 20929025 |
| octolytics-dimension-repository_nwo | microsoft/TypeScript |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 20929025 |
| octolytics-dimension-repository_network_root_nwo | microsoft/TypeScript |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 4943239a6d2c591325dad6e5c313e1cafda877f6 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width