René's URL Explorer Experiment


Title: Design Meeting Notes, 8/27/2024 · Issue #59778 · microsoft/TypeScript · GitHub

Open Graph Title: Design Meeting Notes, 8/27/2024 · Issue #59778 · microsoft/TypeScript

X Title: Design Meeting Notes, 8/27/2024 · Issue #59778 · microsoft/TypeScript

Description: Parameterizing TypedArrays #58573 We didn't get the chance to add the es2024 target ArrayBuffer got new members that SharedArrayBuffer does not have. Previously, SharedArrayBuffer just had two members apart from byteLength and slice, mak...

Open Graph Description: Parameterizing TypedArrays #58573 We didn't get the chance to add the es2024 target ArrayBuffer got new members that SharedArrayBuffer does not have. Previously, SharedArrayBuffer just had two memb...

X Description: Parameterizing TypedArrays #58573 We didn't get the chance to add the es2024 target ArrayBuffer got new members that SharedArrayBuffer does not have. Previously, SharedArrayBuffer just had two ...

Opengraph URL: https://github.com/microsoft/TypeScript/issues/59778

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Design Meeting Notes, 8/27/2024","articleBody":"\n# Parameterizing `TypedArray`s\n\nhttps://github.com/microsoft/TypeScript/pull/58573\n\n* We didn't get the chance to add the es2024 target \n* `ArrayBuffer` got new members that `SharedArrayBuffer` does not have.\n* Previously, `SharedArrayBuffer` just had two members apart from `byteLength` and `slice`, making them interchangeable.\n* es2024 has new members for each of these.\n    * Proposed changes make them no longer interchangeable.\n    * `ArrayBufferLike` is the best type to describe both.\n* Why?\n    * The WebCrypto APIs only allow `ArrayBuffer`, and not `SharedArrayBuffer`,\n        * e.g. `crypto.subtle.digest`\n    * Also, `ArrayBuffer` is not a transferable object.\n* Makes it hard when you try to get the underlying buffer via `someUint8Array.buffer`.\n* What is the underlying idea of how these compose?\n    * `ArrayBuffer` is a non-indexable span of memory. You use an \"ArrayBuffer view\" to access the memory.\n        * They're not thread-safe. They're only meant to be read/written from within a single thread. If you want to share memory, you either copy the memory or transfer it entirely.\n    * `SharedArrayBuffer` looks like an `ArrayBuffer` but operates over memory in a shared global heap and has has unordered but sequentially consistent writes.\n* So the idea is to parameterize each of these views over the underlying buffer type.\n\n  ```ts\n  interface Uint8Array\u003cBuffer extends ArrayBufferLike = ArrayBufferLike> {\n    // ...\n    readonly buffer: Buffer;\n\n\n    // Most methods and constructors return a view with a local-only ArrayBuffer\n    new (length: number): Uint8Array\u003cArrayBuffer>;\n\n    // (not this one)\n    new \u003cT extends ArrayBufferLike>(buffer: T, byteOffset?: number, length?: number): Uint8Array\u003cT>;\n    \n    new (array: ArrayLike\u003cnumber> | ArrayBuffer): Uint8Array\u003cArrayBuffer>;\n    // ...\n    filter(predicate: /*...*/): Uint8Array\u003cArrayBuffer>;\n  }\n  ```\n    * **Note the above code is roughly transcribed, don't look at this as precise.**\n* Problems:\n    * `Buffer` subtypes `Uint8Array`.\n        * We say if you extend a base type, that base type has to have a consistent construct signature.\n        * Would have to make `Buffer` generic - and to do that, we would have to start using `typesVersions` because old `UInt8Array` aren't generic.\n            * Workaround: just change the returned type to `Buffer & WithArrayBufferLike\u003c...>` in the retun types of `slice` and `subarray`.\n            * Why not just forward-declare `UInt8Array` as generic with an option type parameter?\n    * Also, return `this` in some cases.\n* What if we fixed up stuff like `crypto.subtle.digest` etc. to accept `SharedArrayBuffer` even though they don't take those?\n    * Fixes the DOM, but doesn't fix everything.\n* Could say the underlying default should be `ArrayBuffer`, not `ArrayBufferLike`.\n    * We created `ArrayBufferLike` and traditionally these have never had a noticeable difference.\n\n# File Extension Rewriting, `--experimental-transform-types`/`--experimental-strip-types`, and Multi-Project Builds\n\nhttps://github.com/microsoft/TypeScript/pull/59767\n\n* Last week, we discussed rewriting relative file extensions. Had concerns, mainly around monorepo-style codebases.\n* In the meantime, we have a prototype PR.\n* Sample project\n\n  ```ts\n  // packages/lib/src/math.ts\n  export function add(a: number, b: number) {\n    return a + b;\n  }\n\n  // packages/lib/src/main.ts\n  export * from \"./math.ts\";\n\n  // packages/app/src/main.ts\n  import { add } from \"@typescript-node/lib\";\n\n  console.log(add(1, 2));\n  ```\n* By default doesn't, work, but...\n\n  ```json5\n  {\n    // ...\n\n    \"exports\": {\n        \".\": {\n            \"typescript\": \"./src/main.ts\",\n            \"import\": \"./dist/main.js\",\n        }\n    }\n  }\n  ```\n    * Works when you run with `node --conditions typescript`.\n* Almost right, but it's not safe to publish TypeScript - if this `exports` map was published to npm and run with `node --conditions typescript`, resolution would fail within the published package.\n* One way is to erase here - but no built-in tooling to do this.\n* @colinhacks suggested namespacing on a per-package basis for publishing.\n\n  ```json5\n  {\n    // ...\n\n    \"exports\": {\n        \".\": {\n            \"@my-special-namespace/source\": \"./src/main.ts\",\n            \"import\": \"./dist/main.js\",\n        }\n    }\n  }\n  ```\n    * Can also erase these, but not sure what tools do that.\n* `moduleSuffixes`\n    * Nothing special needed there, but you can't really take advantage of extension rewriting in certain circumstances.\n        * You can't name something `foo.ts.android.ts`, but you also can't write `foo.ts.ts` anyway.\n        * Probably will be very rare - this is mainly for React Native, and frankly really unhinged to do this.\n* Now what if projects don't take advantage of workspaces and just do a direct relative import?\n* `import { add as _add } from \"../../lib/src/main.ts`\n    * Won't work if `outDir` is `dist` because it needs to be rewritten to `../../lib/dist/main.ts`.\n    * It just doesn't work in some circumstances and we can give an error there.\n* You still *can* use relative imports - everything just needs to end up in the same output folder. This is, for example, how TypeScript's build works! So even we could do this.\n* For clarity: relative imports work for the following...\n\n  ```\n  root/\n  ├── src/\n  │   ├── projA/\n  │   ├── projB/\n  │   └── projC/\n  └── dist/\n      ├── projA/\n      ├── projB/\n      └── projC/\n  ```\n\n  but relative imports *do not* work for the following.\n\n  ```\n  projects/\n  ├── projA/\n  │   ├── src/\n  │   └── dist/\n  ├── projB/\n  │   ├── src/\n  │   └── dist/\n  └── projC/\n      ├── src/\n      └── dist/\n  ```\n* Sample PR to arethetypeswrong that makes everything work with `--experimental-transform-types`: https://github.com/arethetypeswrong/arethetypeswrong.github.io/pull/194\n    * Notable interesting details:\n        * Tests that can work against both the TS source and JS output! One just passes a specific `--conditions`.\n        * Thought you needed tsconfig custom `conditions`- but you don't. TypeScript's project references are smart enough to map output files to input files.\n        * Did a regex replace on relative paths - got one wrong in `#internal/getProbableExports.js` to `#internal/getProbableExports`.\n            * Reinforced the need for good errors.\n* What would all this look like without project references?\n    * Like one big `tsconfig.json`?\n        * Not necessarily.\n    * *Probably* works, just need to break things apart by packages and can't use relative paths.\n* Should Node automatically have a condition?\n    * Interesting long-term, but maybe it's good for people to have a specific level of control.\n* Boilerplate-y to have to write `--conditions @my-namespace/source` and `@my-namespace/source` throughout `exports`/`imports`, but probably worth the control.\n    * It's not just boilerplate though, it's more about not having all these conditions published, and not exposing this to users. Really would be ideal if these conditions could be automatically erased before publishing.\n* otherwise, we feel good about this. It's not 0-config throughout, but it feels like there is a story between the \"I can start a Node server fast\" and \"I can break my projects apart into multiple pieces\"/\"I want to publish stuff to npm\" that we feel good about.\n\n","author":{"url":"https://github.com/DanielRosenwasser","@type":"Person","name":"DanielRosenwasser"},"datePublished":"2024-08-27T23:13:25Z","url":"https://github.com/microsoft/TypeScript/issues/59778"}

react-profiling0
react-import-mapreact,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-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:d8878f36-e883-ae22-e2f4-5bf30730b18d
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-id8528:1F2D:4EFED0:63AD9C:6B010B69
html-safe-nonce3394161e40c6d0e6d647bb4e383198ad071f7b473c4425d5d2f1d31253df0c27
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4NTI4OjFGMkQ6NEVGRUQwOjYzQUQ5Qzo2QjAxMEI2OSIsInZpc2l0b3JfaWQiOiIxODMzMTU1MzIxNDgxMjAyNTM3IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmac2b30fb16dc5ccd4cca67548c7aba4ac5a2bbdaeabbd96e13ea3e6935eb6c7dd8
hovercard-subject-tagissue:2490524792
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/microsoft/TypeScript/59778/issue_layout
twitter:imagehttps://opengraph.githubassets.com/4c93f00e491def35ef5c27731e934db367dd5e43f0410e84e0d9346535c16f47/microsoft/TypeScript/issues/59778
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/4c93f00e491def35ef5c27731e934db367dd5e43f0410e84e0d9346535c16f47/microsoft/TypeScript/issues/59778
og:image:altParameterizing TypedArrays #58573 We didn't get the chance to add the es2024 target ArrayBuffer got new members that SharedArrayBuffer does not have. Previously, SharedArrayBuffer just had two memb...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameDanielRosenwasser
hostnamegithub.com
expected-hostnamegithub.com
Nonecb7fa109eca7d4156c889f474306b0e91336055e9adf8fd4684b61e49094d124
turbo-cache-controlno-preview
go-importgithub.com/microsoft/TypeScript git https://github.com/microsoft/TypeScript.git
octolytics-dimension-user_id6154722
octolytics-dimension-user_loginmicrosoft
octolytics-dimension-repository_id20929025
octolytics-dimension-repository_nwomicrosoft/TypeScript
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id20929025
octolytics-dimension-repository_network_root_nwomicrosoft/TypeScript
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release2b59d31a4e44f08b7af67a4b67f8fd0af3befe2a
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/microsoft/TypeScript/issues/59778#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmicrosoft%2FTypeScript%2Fissues%2F59778
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmicrosoft%2FTypeScript%2Fissues%2F59778
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=microsoft%2FTypeScript
Reloadhttps://github.com/microsoft/TypeScript/issues/59778
Reloadhttps://github.com/microsoft/TypeScript/issues/59778
Reloadhttps://github.com/microsoft/TypeScript/issues/59778
microsofthttps://github.com/microsoft
TypeScripthttps://github.com/microsoft/TypeScript
Codehttps://github.com/microsoft/TypeScript
Issues5k (5k)https://github.com/microsoft/TypeScript/issues
Pull requests310 (310)https://github.com/microsoft/TypeScript/pulls
Actionshttps://github.com/microsoft/TypeScript/actions
Projectshttps://github.com/microsoft/TypeScript/projects
Wikihttps://github.com/microsoft/TypeScript/wiki
Security and qualityhttps://github.com/microsoft/TypeScript/security
Insightshttps://github.com/microsoft/TypeScript/insights
https://github.com/microsoft/TypeScript
New issuehttps://github.com/login?return_to=https://github.com/microsoft/TypeScript/issues/59778
New issuehttps://github.com/login?return_to=https://github.com/microsoft/TypeScript/issues/59778
Design Meeting Notes, 8/27/2024https://github.com/microsoft/TypeScript/issues/59778#top
Design NotesNotes from our design meetingshttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Design%20Notes%22
https://github.com/DanielRosenwasser
Daniel Rosenwasser (DanielRosenwasser)https://github.com/DanielRosenwasser
on Aug 27, 2024https://github.com/microsoft/TypeScript/issues/59778#issue-2490524792
#58573https://github.com/microsoft/TypeScript/pull/58573
#59767https://github.com/microsoft/TypeScript/pull/59767
Colin McDonnell (@colinhacks)https://github.com/colinhacks
Use --experimental-transform-types arethetypeswrong/arethetypeswrong.github.io#194https://github.com/arethetypeswrong/arethetypeswrong.github.io/pull/194
Daniel Rosenwasser (DanielRosenwasser)https://github.com/DanielRosenwasser
Design NotesNotes from our design meetingshttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Design%20Notes%22
on Aug 27, 2024https://github.com/microsoft/TypeScript/issues/59778#event-14036343792
Ryan Cavanaugh (RyanCavanaugh)https://github.com/RyanCavanaugh
completedhttps://github.com/microsoft/TypeScript/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
on Oct 23, 2025https://github.com/microsoft/TypeScript/issues/59778#event-20459748384
Sign up for freehttps://github.com/signup?return_to=https://github.com/microsoft/TypeScript/issues/59778
Sign in to commenthttps://github.com/login?return_to=https://github.com/microsoft/TypeScript/issues/59778
Design NotesNotes from our design meetingshttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Design%20Notes%22
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.