Title: Design Meeting Notes, 8/13/2024 · Issue #59624 · microsoft/TypeScript · GitHub
Open Graph Title: Design Meeting Notes, 8/13/2024 · Issue #59624 · microsoft/TypeScript
X Title: Design Meeting Notes, 8/13/2024 · Issue #59624 · microsoft/TypeScript
Description: Ordering Parameter Properties and Class Fields #45995 When we adjusted our class field emit (with useDefineForClassFields), we also adjusted the relative ordering of class fields and parameter properties. Under JS, class fields run befor...
Open Graph Description: Ordering Parameter Properties and Class Fields #45995 When we adjusted our class field emit (with useDefineForClassFields), we also adjusted the relative ordering of class fields and parameter prop...
X Description: Ordering Parameter Properties and Class Fields #45995 When we adjusted our class field emit (with useDefineForClassFields), we also adjusted the relative ordering of class fields and parameter prop...
Opengraph URL: https://github.com/microsoft/TypeScript/issues/59624
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Design Meeting Notes, 8/13/2024","articleBody":"\n# Ordering Parameter Properties and Class Fields\n\nhttps://github.com/microsoft/TypeScript/issues/45995\n\n* When we adjusted our class field emit (with `useDefineForClassFields`), we also adjusted the relative ordering of class fields and parameter properties.\n* Under JS, class fields run before the body of the constructor.\n* Under TS, previously, class fields ran *after* parameter properties, but before the body of the constructor.\n* Under `useDefineForClassFields` we error on any access to parameter properties, but otherwise it's fine.\n* Should we adjust the ordering to be consistent?\n* `useDefineForClassFields` was introduced as a legacy behavior to avoid breaks, why break people?\n * Could deprecate setting it to false.\n* We could run a PR where it always errors, see what breaks.\n * Is there an argument for making things more spec-compliant over time?\n* Is there something clever we could do with emit?\n * Witnessable side-effects.\n* The tough part is that most codebases that would be affected by running on GitHub won't be uncovered. Typically these are more mature codebases.\n* Could always do a codemod. We typically rely on quick fixes here.\n\n ```ts\n // Before\n class A {\n x = 1;\n constructor(public y: number) {\n console.log(this.y);\n }\n }\n ```\n\n ```ts\n // After\n class A {\n declare x;\n constructor(public y: number) {\n this.x = 1;\n console.log(this.y);\n }\n }\n ```\n* Some of us feel like it's a good idea to get consistent emit. Picking a date in the future to deprecate and eventually remove is the proposed plan. But need to experiment first.\n* Maybe 6.0 deprecation is the plan.\n* This has only been available since ES2022 though!\n* 6.0 deprecation = 6.5 removal, which is just over 2 years from now.\n* Aside: we should investigate parameter properties in ECMAScript.\n","author":{"url":"https://github.com/DanielRosenwasser","@type":"Person","name":"DanielRosenwasser"},"datePublished":"2024-08-13T22:39:15Z","url":"https://github.com/microsoft/TypeScript/issues/59624"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react-reconciler,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@d5750093facf |
| 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:31bc409e-5a0b-fe37-f461-6f872cd8325a |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | ECD2:55AC6:8BC29D:B5A86B:6AED388E |
| html-safe-nonce | 4a45ee23c9dc877591a23e9ecb6c6a2f659092ffe232eda15b7688b4bc1d77ef |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFQ0QyOjU1QUM2OjhCQzI5RDpCNUE4NkI6NkFFRDM4OEUiLCJ2aXNpdG9yX2lkIjoiNzg5MDg1MDY0ODI4ODk5OTU2NiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | a99f282bfa53844efe547c2c85b1dcb541d5a399e5e4fb95504c5ed4d880607c |
| hovercard-subject-tag | issue:2464373781 |
| 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/59624/issue_layout |
| twitter:image | https://opengraph.githubassets.com/293e6f311c2897fe8102c937aa367615b7658099fa69a76fbad2bc06ffa443dd/microsoft/TypeScript/issues/59624 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/293e6f311c2897fe8102c937aa367615b7658099fa69a76fbad2bc06ffa443dd/microsoft/TypeScript/issues/59624 |
| og:image:alt | Ordering Parameter Properties and Class Fields #45995 When we adjusted our class field emit (with useDefineForClassFields), we also adjusted the relative ordering of class fields and parameter prop... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | DanielRosenwasser |
| hostname | github.com |
| expected-hostname | github.com |
| None | 26c92a9388ddfad3fa88d132b5d5f0b4747030233dcc4e5efb05f1cbae152184 |
| 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 | c629ad99c254d306375fc8354d04321c2c362236 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width