Title: Design Meeting Notes, 3/31/2018 · Issue #23045 · microsoft/TypeScript · GitHub
Open Graph Title: Design Meeting Notes, 3/31/2018 · Issue #23045 · microsoft/TypeScript
X Title: Design Meeting Notes, 3/31/2018 · Issue #23045 · microsoft/TypeScript
Description: global JS PR: #22891 issues: type: #19816 value (TC39): #12902 namespace: #983 Issue comes in the context of recognizing assignments to properties on this or window as global declarations. We need way to refer to the global type, e.g. de...
Open Graph Description: global JS PR: #22891 issues: type: #19816 value (TC39): #12902 namespace: #983 Issue comes in the context of recognizing assignments to properties on this or window as global declarations. We need ...
X Description: global JS PR: #22891 issues: type: #19816 value (TC39): #12902 namespace: #983 Issue comes in the context of recognizing assignments to properties on this or window as global declarations. We need ...
Opengraph URL: https://github.com/microsoft/TypeScript/issues/23045
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Design Meeting Notes, 3/31/2018","articleBody":"\r\n# global\r\n* JS\r\n * PR: https://github.com/Microsoft/TypeScript/pull/22891\r\n* issues:\r\n * type: https://github.com/Microsoft/TypeScript/issues/19816\r\n * value (TC39): https://github.com/Microsoft/TypeScript/issues/12902\r\n * namespace: https://github.com/Microsoft/TypeScript/issues/983\r\n\r\nIssue comes in the context of recognizing assignments to properties on `this` or `window` as global declarations.\r\nWe need way to refer to the global type, e.g. `declare var window: Window & global;` for DOM.\r\nWe have a precedence in the `declare global { .. }` support.\r\n\r\nSome options:\r\n```ts\r\n// use new `import(\"module\")` syntax with `global` instead\r\nvar window: Window & import(global);\r\n\r\n// or no operand at all\r\nvar nan: typeof import().NAN;\r\n\r\n// import.meta?\r\nimport.meta.global\r\n\r\n// C++ anyone?\r\nvar x: global::NaN\r\n\r\n// call it `global` or just `Global`\r\nvar x1: Global;\r\nvar x1: typeof Global;\r\nvar x1: Global.Array\u003cnumber>\r\n\r\nvar x1: Global[\"NaN\"];\r\n\r\nvar x1: typeof Global.NaN;\r\n```\r\n\r\nTC39 has been looking into a name for the value side of global https://github.com/tc39/proposal-global, the proposal is at stage 3.\r\nThe proposal has stalled on the choice of the variable name, `global` seems to be already in use.\r\n\r\n@rbuckton contacted the proposal champion (@ljharb), and the proposal is still active. there are few names proposed at this point.\r\n\r\nConclusion, wait for TC39 to pick a name, and then use that in both type and value positions.\r\n\r\n# Resolving .json files\r\n\r\n* PR: https://github.com/Microsoft/TypeScript/pull/22167\r\n* issue: https://github.com/Microsoft/TypeScript/issues/7071\r\n\r\n* Concerns:\r\n * .json files can be large, this can impact performance of a compilation\r\n * should we put it under a switch?\r\n * probably\r\n * limit the file size, and if larger than limt, return any.. implicit any maybe\r\n * does not seem right\r\n * files can be huge\r\n * many of them\r\n * but it is useful for completions..\r\n * it is good for language service, and for .js file experience\r\n* no contextual type here, do we need a way to \"impose\" a type on the .json file?\r\n * seems like an orthogonal issue\r\n* taking the discussion offline until we address the concerns above\r\n\r\n# Allow `infer` types in expression type argument positions\r\n\r\n* PR: https://github.com/Microsoft/TypeScript/pull/22368\r\n\r\n* @weswigham, this is probably too much power, not clear what use cases require that.\r\n* the change is simple, relatively, thought\r\n* practically gives you associated types\r\n\r\n* We still need named type parameters, what to do when you wnat to specify the fifth type parameter and get everything inferred\r\n* we already have a proposal here, no need for another proposal\r\n\r\n# `Array.isArray` and `ReadonlyArray`\r\n\r\n* PR: https://github.com/Microsoft/TypeScript/pull/22942\r\n* it is a breaking change, we are just trading one set of problems with another\r\n* should not change it\r\n* the core issue is that `Array` and `ReadonlyArray` are two distinct types. we need to think about a `readonly` modifier again\r\n\r\n# Variadic types\r\n\r\n* look at `bindCallback` in https://github.com/Microsoft/TypeScript/issues/22952#issuecomment-377338534\r\n* we need:\r\n * a concept of an infinite tuple\r\n * a way to declare optional members in a tuple\r\n * a grand unified theory of tuples and function parameters\r\n * make all of that work in higher order","author":{"url":"https://github.com/mhegazy","@type":"Person","name":"mhegazy"},"datePublished":"2018-03-31T18:58:03Z","url":"https://github.com/microsoft/TypeScript/issues/23045"}
| 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:e95b4679-2a38-d09c-07d1-bbd9badc44a9 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 970A:21BD98:1F0CB9F:2765D95:6B01A21B |
| html-safe-nonce | 372d1e53d1c1ef693642665d53c4e27117dc02515d244ed77b4228d6723d33fd |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5NzBBOjIxQkQ5ODoxRjBDQjlGOjI3NjVEOTU6NkIwMUEyMUIiLCJ2aXNpdG9yX2lkIjoiODk2MTA1NDUyMzA0NTAyODM3OSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 379cd1f2c72fe3443eed7079d3d881f7f3a9632e30fcd3a100c1218aca2b79f4 |
| hovercard-subject-tag | issue:310263623 |
| 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/23045/issue_layout |
| twitter:image | https://opengraph.githubassets.com/4ee95ba767fc8136ae6fffc6c38849cbe44a1f090e1cb684d67174abac02009f/microsoft/TypeScript/issues/23045 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/4ee95ba767fc8136ae6fffc6c38849cbe44a1f090e1cb684d67174abac02009f/microsoft/TypeScript/issues/23045 |
| og:image:alt | global JS PR: #22891 issues: type: #19816 value (TC39): #12902 namespace: #983 Issue comes in the context of recognizing assignments to properties on this or window as global declarations. We need ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | mhegazy |
| hostname | github.com |
| expected-hostname | github.com |
| None | cc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c |
| 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 | 8c77c9e8439031ad54c75a250694842892f693e1 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width