Title: Compiled .d.ts output for `Omit` is verbose and semantically inconsistent · Issue #34793 · microsoft/TypeScript · GitHub
Open Graph Title: Compiled .d.ts output for `Omit` is verbose and semantically inconsistent · Issue #34793 · microsoft/TypeScript
X Title: Compiled .d.ts output for `Omit` is verbose and semantically inconsistent · Issue #34793 · microsoft/TypeScript
Description: TypeScript Version: 3.7.1-rc (but not appreciably different in 3.5.1) Search Terms: Omit, Pick, verbose, long Code // HtmlAttrs.ts export type InputAttrs = React.InputHTMLAttributes
Open Graph Description: TypeScript Version: 3.7.1-rc (but not appreciably different in 3.5.1) Search Terms: Omit, Pick, verbose, long Code // HtmlAttrs.ts export type InputAttrs = React.InputHTMLAttributes X Description: TypeScript Version: 3.7.1-rc (but not appreciably different in 3.5.1) Search Terms: Omit, Pick, verbose, long Code // HtmlAttrs.ts export type InputAttrs = React.InputHTMLAttributes<HTMLInputEle...
Opengraph URL: https://github.com/microsoft/TypeScript/issues/34793
X: @github
Domain: github.com
Links:
Viewport: width=device-width
Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Compiled .d.ts output for `Omit` is verbose and semantically inconsistent","articleBody":"**TypeScript Version:** 3.7.1-rc (but not appreciably different in 3.5.1)\r\n\r\n**Search Terms:** Omit, Pick, verbose, long\r\n\r\n**Code**\r\n```tsx\r\n// HtmlAttrs.ts\r\nexport type InputAttrs = React.InputHTMLAttributes\u003cHTMLInputElement>;\r\n\r\n// TextFieldWidget.tsx\r\nimport { InputAttrs } from '../../utils/HtmlAttrs';\r\nexport interface TextFieldProps {\r\n onChange?: (e: React.ChangeEvent\u003cHTMLInputElement> & { isComposing: boolean }) => void;\r\n}\r\nexport const TextFieldWidget = React.forwardRef\u003cHTMLInputElement, TextFieldProps & Omit\u003cInputAttrs, 'onChange'>>((props, ref) => {};\r\n\r\n// Output in TextFieldWidget.d.ts\r\nexport declare const TextFieldWidget: React.ForwardRefExoticComponent\u003cTextFieldProps & Pick\u003cInputAttrs, \"children\" | \"dir\" | \"form\" | \"slot\" | \"style\" | \"title\" | \"hidden\" | \"pattern\" | \"disabled\" | \"defaultChecked\" | \"defaultValue\" | \"suppressContentEditableWarning\" | \"suppressHydrationWarning\" | \"accessKey\" | \"className\" | \"contentEditable\" | \"contextMenu\" | \"draggable\" | \"id\" | \"lang\" | \"placeholder\" | \"spellCheck\" | \"tabIndex\" | \"inputMode\" | \"is\" | \"radioGroup\" | \"role\" | \"about\" | \"datatype\" | \"inlist\" | \"prefix\" | \"property\" | \"resource\" | \"typeof\" | \"vocab\" | \"autoCapitalize\" | \"autoCorrect\" | \"autoSave\" | \"color\" | \"itemProp\" | \"itemScope\" | \"itemType\" | \"itemID\" | \"itemRef\" | \"results\" | \"security\" | \"unselectable\" | \"aria-activedescendant\" | \"aria-atomic\" | \"aria-autocomplete\" | \"aria-busy\" | \"aria-checked\" | \"aria-colcount\" | \"aria-colindex\" | \"aria-colspan\" | \"aria-controls\" | \"aria-current\" | \"aria-describedby\" | \"aria-details\" | \"aria-disabled\" | \"aria-dropeffect\" | \"aria-errormessage\" | \"aria-expanded\" | \"aria-flowto\" | \"aria-grabbed\" | \"aria-haspopup\" | \"aria-hidden\" | \"aria-invalid\" | \"aria-keyshortcuts\" | \"aria-label\" | \"aria-labelledby\" | \"aria-level\" | \"aria-live\" | \"aria-modal\" | \"aria-multiline\" | \"aria-multiselectable\" | \"aria-orientation\" | \"aria-owns\" | \"aria-placeholder\" | \"aria-posinset\" | \"aria-pressed\" | \"aria-readonly\" | \"aria-relevant\" | \"aria-required\" | \"aria-roledescription\" | \"aria-rowcount\" | \"aria-rowindex\" | \"aria-rowspan\" | \"aria-selected\" | \"aria-setsize\" | \"aria-sort\" | \"aria-valuemax\" | \"aria-valuemin\" | \"aria-valuenow\" | \"aria-valuetext\" | \"dangerouslySetInnerHTML\" | \"onCopy\" | \"onCopyCapture\" | \"onCut\" | \"onCutCapture\" | \"onPaste\" | \"onPasteCapture\" | \"onCompositionEnd\" | \"onCompositionEndCapture\" | \"onCompositionStart\" | \"onCompositionStartCapture\" | \"onCompositionUpdate\" | \"onCompositionUpdateCapture\" | \"onFocus\" | \"onFocusCapture\" | \"onBlur\" | \"onBlurCapture\" | \"onChangeCapture\" | \"onBeforeInput\" | \"onBeforeInputCapture\" | \"onInput\" | \"onInputCapture\" | \"onReset\" | \"onResetCapture\" | \"onSubmit\" | \"onSubmitCapture\" | \"onInvalid\" | \"onInvalidCapture\" | \"onLoad\" | \"onLoadCapture\" | \"onError\" | \"onErrorCapture\" | \"onKeyDown\" | \"onKeyDownCapture\" | \"onKeyPress\" | \"onKeyPressCapture\" | \"onKeyUp\" | \"onKeyUpCapture\" | \"onAbort\" | \"onAbortCapture\" | \"onCanPlay\" | \"onCanPlayCapture\" | \"onCanPlayThrough\" | \"onCanPlayThroughCapture\" | \"onDurationChange\" | \"onDurationChangeCapture\" | \"onEmptied\" | \"onEmptiedCapture\" | \"onEncrypted\" | \"onEncryptedCapture\" | \"onEnded\" | \"onEndedCapture\" | \"onLoadedData\" | \"onLoadedDataCapture\" | \"onLoadedMetadata\" | \"onLoadedMetadataCapture\" | \"onLoadStart\" | \"onLoadStartCapture\" | \"onPause\" | \"onPauseCapture\" | \"onPlay\" | \"onPlayCapture\" | \"onPlaying\" | \"onPlayingCapture\" | \"onProgress\" | \"onProgressCapture\" | \"onRateChange\" | \"onRateChangeCapture\" | \"onSeeked\" | \"onSeekedCapture\" | \"onSeeking\" | \"onSeekingCapture\" | \"onStalled\" | \"onStalledCapture\" | \"onSuspend\" | \"onSuspendCapture\" | \"onTimeUpdate\" | \"onTimeUpdateCapture\" | \"onVolumeChange\" | \"onVolumeChangeCapture\" | \"onWaiting\" | \"onWaitingCapture\" | \"onAuxClick\" | \"onAuxClickCapture\" | \"onClick\" | \"onClickCapture\" | \"onContextMenu\" | \"onContextMenuCapture\" | \"onDoubleClick\" | \"onDoubleClickCapture\" | \"onDrag\" | \"onDragCapture\" | \"onDragEnd\" | \"onDragEndCapture\" | \"onDragEnter\" | \"onDragEnterCapture\" | \"onDragExit\" | \"onDragExitCapture\" | \"onDragLeave\" | \"onDragLeaveCapture\" | \"onDragOver\" | \"onDragOverCapture\" | \"onDragStart\" | \"onDragStartCapture\" | \"onDrop\" | \"onDropCapture\" | \"onMouseDown\" | \"onMouseDownCapture\" | \"onMouseEnter\" | \"onMouseLeave\" | \"onMouseMove\" | \"onMouseMoveCapture\" | \"onMouseOut\" | \"onMouseOutCapture\" | \"onMouseOver\" | \"onMouseOverCapture\" | \"onMouseUp\" | \"onMouseUpCapture\" | \"onSelect\" | \"onSelectCapture\" | \"onTouchCancel\" | \"onTouchCancelCapture\" | \"onTouchEnd\" | \"onTouchEndCapture\" | \"onTouchMove\" | \"onTouchMoveCapture\" | \"onTouchStart\" | \"onTouchStartCapture\" | \"onPointerDown\" | \"onPointerDownCapture\" | \"onPointerMove\" | \"onPointerMoveCapture\" | \"onPointerUp\" | \"onPointerUpCapture\" | \"onPointerCancel\" | \"onPointerCancelCapture\" | \"onPointerEnter\" | \"onPointerEnterCapture\" | \"onPointerLeave\" | \"onPointerLeaveCapture\" | \"onPointerOver\" | \"onPointerOverCapture\" | \"onPointerOut\" | \"onPointerOutCapture\" | \"onGotPointerCapture\" | \"onGotPointerCaptureCapture\" | \"onLostPointerCapture\" | \"onLostPointerCaptureCapture\" | \"onScroll\" | \"onScrollCapture\" | \"onWheel\" | \"onWheelCapture\" | \"onAnimationStart\" | \"onAnimationStartCapture\" | \"onAnimationEnd\" | \"onAnimationEndCapture\" | \"onAnimationIteration\" | \"onAnimationIterationCapture\" | \"onTransitionEnd\" | \"onTransitionEndCapture\" | \"size\" | \"multiple\" | \"list\" | \"step\" | \"autoFocus\" | \"type\" | \"height\" | \"formAction\" | \"formEncType\" | \"formMethod\" | \"formNoValidate\" | \"formTarget\" | \"name\" | \"value\" | \"width\" | \"alt\" | \"crossOrigin\" | \"src\" | \"checked\" | \"maxLength\" | \"readOnly\" | \"accept\" | \"autoComplete\" | \"capture\" | \"max\" | \"min\" | \"minLength\" | \"required\"> & React.RefAttributes\u003cHTMLInputElement>>;\r\n```\r\n\r\n**Expected behavior:**\r\nI expect the .d.ts definition to mimic the structure of the original definition, i.e. to use `Omit` rather than `Pick`. In particular, this changes the self-documenting semantic of using `Omit`. The original definition is intended to make it obvious that the signature of the `onChange` event is not the standard definition from React, but an augmented type.\r\n\r\nBTW -- there are more `TextFieldProps` in the real code. The point of defining them in a separate interface that *doesn't* extend the React props, and then combining the types in the component definition, is to make it easy to document, browse, and create objects containing the component-scope props, without them getting lost in the noise of 260+ native HTML props.\r\n\r\n**Actual behavior:**\r\nInstead, the `Omit` definition is replaced by the compile-time equivalent as a `Pick` statement. This defeats the self-documenting semantic that is intended by using `Omit`. It is very confusing to library consumers -- \"why is there such a gigantic `Pick` type with 200+ entries???\" And it actually changes the intended semantic, as the meaning of the `Omit`-based type is intended to be evaluated by the typescript compiler *when the user of the library compiles*, not when the library itself is compiled. e.g. if a new version of `@types/react` includes a new event type, I should not have to recompile/redistribute my library to support it.\r\n\r\nI don't-know-I-don't-know WAY MORE about compilers than I know, so I am certainly open to education on this, but both of the issues raised here do seem like (subtle) bugs to me.","author":{"url":"https://github.com/craigkovatch","@type":"Person","name":"craigkovatch"},"datePublished":"2019-10-29T03:32:56Z","url":"https://github.com/microsoft/TypeScript/issues/34793"}
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:b6a51a53-08e2-88f1-a806-e803a3b9d777 current-catalog-service-hash 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 request-id 910E:34CAB:26807DC:31370A7:6B019DA3 html-safe-nonce cfaf6ef66f0fda7ab71b1b25fe89119a5b11591bff429b6e6feb3c28230a6742 visitor-payload eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5MTBFOjM0Q0FCOjI2ODA3REM6MzEzNzBBNzo2QjAxOURBMyIsInZpc2l0b3JfaWQiOiI4NzgwOTg0OTM0MzUxMjUxNTUiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== visitor-hmac 0bec8109ca4cd4baab2e549d78afae395cd126d91167f3a3ff04da90698ef7b3 hovercard-subject-tag issue:513672880 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/34793/issue_layout twitter:image https://opengraph.githubassets.com/473ddbde25bc51fae3e71786ad4816fc649710464e93036643fcf1e751076d68/microsoft/TypeScript/issues/34793 twitter:card summary_large_image og:image https://opengraph.githubassets.com/473ddbde25bc51fae3e71786ad4816fc649710464e93036643fcf1e751076d68/microsoft/TypeScript/issues/34793 og:image:alt TypeScript Version: 3.7.1-rc (but not appreciably different in 3.5.1) Search Terms: Omit, Pick, verbose, long Code // HtmlAttrs.ts export type InputAttrs = React.InputHTMLAttributes og:image:width 1200 og:image:height 600 og:site_name GitHub og:type object og:author:username craigkovatch 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
URLs of crawlers that visited me.