Title: Module conversion work · Issue #46744 · microsoft/TypeScript · GitHub
Open Graph Title: Module conversion work · Issue #46744 · microsoft/TypeScript
X Title: Module conversion work · Issue #46744 · microsoft/TypeScript
Description: This issue is to keep track of the module conversion work, which is ongoing at #46567: Update the old conversion script to working state. Done, keep track of the code in a new fork to working state. Script the generation so it can be con...
Open Graph Description: This issue is to keep track of the module conversion work, which is ongoing at #46567: Update the old conversion script to working state. Done, keep track of the code in a new fork to working state...
X Description: This issue is to keep track of the module conversion work, which is ongoing at #46567: Update the old conversion script to working state. Done, keep track of the code in a new fork to working state...
Opengraph URL: https://github.com/microsoft/TypeScript/issues/46744
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Module conversion work","articleBody":"This issue is to keep track of the module conversion work, which is ongoing at #46567:\r\n\r\n- [x] Update the [old conversion script](https://github.com/weswigham/typeformer) to working state. \\\r\n Done, keep track of the code in [a new fork](https://github.com/elibarzilay/typeformer) to working state.\r\n- [x] Script the generation so it can be continuously rebased on the tip: done in the [run-transform](https://github.com/elibarzilay/typeformer/blob/master/run-transform) script.\r\n- [x] Make the tests run, similar to [1c3944343ee8](https://github.com/weswigham/TypeScript/commit/1c39443) in Wesley's PR: included in the current PR, and generated via the script.\r\n- [x] Fix treatment of newlines, mainly a bug that changes CRLF to LF if running on linux.\r\n- [ ] Make the diff more readable\r\n - [x] [Pre-script](https://github.com/elibarzilay/typeformer/blob/master/src/unindent.ts) that unindents the code in a separate commit, which avoids a huge mass of mostly no-op changes.\r\n - [x] Drop the many empty-line removals from the conversion diff. Done by [another script](https://github.com/elibarzilay/typeformer/blob/master/src/filter-patch.ts) that filters the resulting patch before applying it.\r\n - [ ] Possibly re-implement the conversion using [ts-morph](https://github.com/dsherret/ts-morph) to make it more well-behaved wrt unnecessary changes (adding/removing newlines, still some comments get dropped, minor issues like changing `,`s to `;`s or dropping a suffix `,` in argument lists).\r\n- [ ] Bundle results\r\n - [x] Decide on a bundler: most likely [esbuild](https://esbuild.github.io/), since it fast enough to make multiple bundles (eg, for testing and for distributing) possible.\r\n - [ ] Need to decide how to use it:\r\n - Can run on the generated JS: will probably be sensitive to the generated format. \\\r\n Main problem: the modules are expressed indirectly which is more likely to cause problems.\r\n - A possibly better option is to run directly from the TS sources. This has a big issue of not dog-fooding `tsc`, but that could possibly still be used for testing (but see below).\r\n - [ ] Should also re-do the `src/tsserverlibrary` and `src/typescriptServices` stubs.\r\n - [ ] Some other files that need to be sorted out:\r\n - `src/instrumenter` (including `src/loggedIO/tsconfig-tsc-instrumented.json`)\r\n - `src/services/exportAsModule.ts`\r\n- [ ] Running the tests takes around 1.5x more time with the modules.\r\n - This might be resolved if running from a bundle, but if this and the actual bundles are done with esbuild then there's no dogfooding at all.\r\n- [ ] There are a few tests that still fail (12) -- should be resolved when there are bundles.\r\n- [ ] Make the parallel tests work. (This depends on the resolution of the above, since it's an issue with how the tests are implemented wrt the global `describe` binding.)\r\n- [ ] API extractor.\r\n- [ ] Make the linter happy.\r\n- [ ] Possibly a cleanup step, like getting rid of re-exporting modules\r\n for direct imports, and related (like `*Impl.ts` files).\r\n","author":{"url":"https://github.com/elibarzilay","@type":"Person","name":"elibarzilay"},"datePublished":"2021-11-09T13:08:11Z","url":"https://github.com/microsoft/TypeScript/issues/46744"}
| 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:75fe9e7a-8bc2-21b4-55f1-affd6d6bc391 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | ABDC:36A3E:1ACE455:23B2985:6B015CD9 |
| html-safe-nonce | ba33b9900d6434c78f34738414141dbe9e0ad208a031cdea38b6357dc9b65625 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBQkRDOjM2QTNFOjFBQ0U0NTU6MjNCMjk4NTo2QjAxNUNEOSIsInZpc2l0b3JfaWQiOiI0MzAxMTE3MTU4Mzg3MTc4NzEzIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 07a5a488c55d08b812e924699a58a906ce3eabc5de82373999c96713a9572f21 |
| hovercard-subject-tag | issue:1048586677 |
| 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/46744/issue_layout |
| twitter:image | https://opengraph.githubassets.com/a6296ddc896e1521029c6b77df3933a4b4c27de9ff9367b21eed27396996df0d/microsoft/TypeScript/issues/46744 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/a6296ddc896e1521029c6b77df3933a4b4c27de9ff9367b21eed27396996df0d/microsoft/TypeScript/issues/46744 |
| og:image:alt | This issue is to keep track of the module conversion work, which is ongoing at #46567: Update the old conversion script to working state. Done, keep track of the code in a new fork to working state... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | elibarzilay |
| 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