Title: `resolution-mode` Feedback · Issue #49055 · microsoft/TypeScript · GitHub
Open Graph Title: `resolution-mode` Feedback · Issue #49055 · microsoft/TypeScript
X Title: `resolution-mode` Feedback · Issue #49055 · microsoft/TypeScript
Description: For TypeScript 4.7, we pulled back the resolution-mode import assertion from import type syntax. This was based in part on feedback around the feature being a bit outside the spirit of import assertion syntax (#48644); however, we also j...
Open Graph Description: For TypeScript 4.7, we pulled back the resolution-mode import assertion from import type syntax. This was based in part on feedback around the feature being a bit outside the spirit of import asser...
X Description: For TypeScript 4.7, we pulled back the resolution-mode import assertion from import type syntax. This was based in part on feedback around the feature being a bit outside the spirit of import asser...
Opengraph URL: https://github.com/microsoft/TypeScript/issues/49055
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"`resolution-mode` Feedback","articleBody":"For TypeScript 4.7, we pulled back the `resolution-mode` import assertion from `import type` syntax. This was based in part on feedback around the feature being a bit outside the spirit of import assertion syntax (https://github.com/microsoft/TypeScript/issues/48644); however, we also just don't want to add features if we're not 100% convinced that they're going to be used. This was discussed a bit at https://github.com/microsoft/TypeScript/issues/48686.\r\n\r\nSo if you try to use `resolution-mode` as follows\r\n\r\n```ts\r\n// Resolve `pkg` as if we were importing with a CommonJS `require()`\r\nimport type { TypeFromRequire } from \"pkg\" assert {\r\n \"resolution-mode\": \"require\"\r\n};\r\n\r\n// Resolve `pkg` as if we were importing with an ES module `import`\r\nimport type { TypeFromImport } from \"pkg\" assert {\r\n \"resolution-mode\": \"import\"\r\n};\r\n\r\nexport interface MergedType extends TypeFromRequire, TypeFromImport {}\r\n```\r\n\r\nyou'll get the following error:\r\n\r\n```\r\nResolution mode assertions are unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'.\r\n```\r\n\r\nMaybe you're using this because you're trying to bridge a CJS/ESM codebase, or maybe you're trying to provide some sort of meta-library that does that. We're not entirely sure!\r\n\r\nSo if you run into this error, what are you trying to do? What do you need it for? Is there a syntax you'd prefer to use, or is it fine as-is?","author":{"url":"https://github.com/DanielRosenwasser","@type":"Person","name":"DanielRosenwasser"},"datePublished":"2022-05-10T22:03:15Z","url":"https://github.com/microsoft/TypeScript/issues/49055"}
| 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:3895898f-1cc5-b7a0-4c8a-cf32c801f237 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E704:96DDF:A89EBC:D69B72:6B00F24D |
| html-safe-nonce | 87cd456d49d32ac1becaf025a37b66d08329a26f664e773f6b89f989ea0abc1c |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFNzA0Ojk2RERGOkE4OUVCQzpENjlCNzI6NkIwMEYyNEQiLCJ2aXNpdG9yX2lkIjoiNTQ1MTU1MzUwMDQyNzI1MjMwMSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 4c2aef8f881856c5191e3d48a3d7a78436b49143ad990867c8d2e9c96b840dc1 |
| hovercard-subject-tag | issue:1231749170 |
| 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/49055/issue_layout |
| twitter:image | https://opengraph.githubassets.com/70c7e6e0a324038ccd0d04b7e826d07207104c9dd56f95bd034d22047c523ce9/microsoft/TypeScript/issues/49055 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/70c7e6e0a324038ccd0d04b7e826d07207104c9dd56f95bd034d22047c523ce9/microsoft/TypeScript/issues/49055 |
| og:image:alt | For TypeScript 4.7, we pulled back the resolution-mode import assertion from import type syntax. This was based in part on feedback around the feature being a bit outside the spirit of import asser... |
| 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 | 4ef498cbabcbe3c50befc7a5b743e7072ee770b4daf0e15e54801180d1fa91fc |
| 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 | 9983dd5da06943f833c971dd5b6bc988e2858be5 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width