Skip to content

Draft: [react] Add jsx autoComplete types from the DOM - #66982

Closed
yanndinendal wants to merge 2 commits into
DefinitelyTyped:masterfrom
yanndinendal:jsx-input-autocomplete
Closed

Draft: [react] Add jsx autoComplete types from the DOM#66982
yanndinendal wants to merge 2 commits into
DefinitelyTyped:masterfrom
yanndinendal:jsx-input-autocomplete

Conversation

@yanndinendal

Copy link
Copy Markdown

See microsoft/TypeScript-DOM-lib-generator#1467

Please fill in this template.

Select one of these and delete the others:

If changing an existing definition:


Hi, this is just a first draft because I'm pretty sure this is not the right way to do this but I would love some input to know if you think this would be feasible?

The issues I have are:

  • HTMLAttributes are defined in the react package, not react-dom, do we don't have the 'dom'` lib
    • Property 'autocomplete' does not exist on type **'HTMLInputElement'.ts(2339)**
  • In react-dom, there are some overwrites, but not for Elements or Attributes; maybe this could be done that way?
  • Is it possible to have a test that only runs for TypeScript >= 5.2?
    • It tells me about specifying the version for a whole definition file but I don't know how to just run the tests for one version
    • (lower versions would just get the previous type, which existed but was less precise)
Error: /home/yanndinendal/www/DefinitelyTyped/types/react-dom/test/react-dom-tests.tsx:102:9
ERROR: 102:9  expect  Compile error in typescript@5.1 but not in typescript@5.2.
Fix with a comment '// Minimum TypeScript Version: 5.2' just under the header.
Unused '@ts-expect-error' directive.

(tests pass in react-dom in TypeScript 5.2, but types are broken in react itself in this branch).

@typescript-bot

typescript-bot commented Oct 9, 2023

Copy link
Copy Markdown
Contributor

@yanndinendal Thank you for submitting this PR! I see this is your first time submitting to DefinitelyTyped 👋 — I'm the local bot who will help you through the process of getting things through.

This is a live comment which I will keep updated.

2 packages in this PR

Code Reviews

Because this is a widely-used package, a DT maintainer will need to review it before it can be merged.

You can test the changes of this PR in the Playground.

Status

  • ✅ No merge conflicts
  • ❌ Continuous integration tests have failed
  • 🕐 A DT maintainer needs to approve changes which affect more than one package

Once every item on this list is checked, I'll ask you for permission to merge and publish the changes.

Inactive

This PR has been inactive for 31 days — it is considered abandoned, and therefore closed!


Diagnostic Information: What the bot saw about this PR
{
  "type": "info",
  "now": "-",
  "pr_number": 66982,
  "author": "yanndinendal",
  "headCommitOid": "ec91ab78cc4ec7b5c6257567f86a46ad02fd930c",
  "mergeBaseOid": "29922e5da1baf2c5e9b7ccc8c596876cd399dc49",
  "lastPushDate": "2023-10-09T10:49:20.000Z",
  "lastActivityDate": "2023-10-09T16:45:38.000Z",
  "hasMergeConflict": false,
  "isFirstContribution": true,
  "tooManyFiles": false,
  "hugeChange": false,
  "popularityLevel": "Critical",
  "pkgInfo": [
    {
      "name": "react-dom",
      "kind": "edit",
      "files": [
        {
          "path": "types/react-dom/test/react-dom-tests.tsx",
          "kind": "test"
        }
      ],
      "owners": [
        "MartynasZilinskas",
        "theruther4d",
        "Jessidhia",
        "eps1lon"
      ],
      "addedOwners": [],
      "deletedOwners": [],
      "popularityLevel": "Critical"
    },
    {
      "name": "react",
      "kind": "edit",
      "files": [
        {
          "path": "types/react/index.d.ts",
          "kind": "definition"
        },
        {
          "path": "types/react/test/elementAttributes.tsx",
          "kind": "test"
        }
      ],
      "owners": [
        "johnnyreilly",
        "bbenezech",
        "pzavolinsky",
        "ericanderson",
        "DovydasNavickas",
        "theruther4d",
        "guilhermehubner",
        "ferdaber",
        "jrakotoharisoa",
        "pascaloliv",
        "hotell",
        "franklixuefei",
        "Jessidhia",
        "saranshkataria",
        "lukyth",
        "eps1lon",
        "zieka",
        "dancerphil",
        "dimitropoulos",
        "disjukr",
        "vhfmag",
        "hellatan",
        "priyanshurav",
        "Semigradsky"
      ],
      "addedOwners": [],
      "deletedOwners": [],
      "popularityLevel": "Critical"
    }
  ],
  "reviews": [],
  "mainBotCommentID": 1752777520,
  "ciResult": "fail",
  "ciUrl": "https://github.com/DefinitelyTyped/DefinitelyTyped/commit/ec91ab78cc4ec7b5c6257567f86a46ad02fd930c/checks?check_suite_id=17026740361"
}

@typescript-bot

Copy link
Copy Markdown
Contributor

@typescript-bot

Copy link
Copy Markdown
Contributor

@yanndinendal The CI build failed! Please review the logs for more information.

Once you've pushed the fixes, the build will automatically re-run. Thanks!

Note: builds which are failing do not end up on the list of PRs for the DT maintainers to review.

@eps1lon eps1lon left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I love the change but it requires some more effort to work around some technical debt on our side.

Comment thread types/react/index.d.ts
as?: string | undefined;
async?: boolean | undefined;
autoComplete?: string | undefined;
autoComplete?: HTMLInputElement["autocomplete"];

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tests are run without DOM typings since React is not tied to react-dom. It's unfortunate since these types should really live in @types/react-dom. You'd have to adjust types/react/global.d.ts so that it works with and without lib.dom.d.ts

@typescript-bot typescript-bot added No Other Owners This DT module only has one owner, so we can't have someone verify the change. and removed No Other Owners This DT module only has one owner, so we can't have someone verify the change. labels Oct 18, 2023
@typescript-bot

Copy link
Copy Markdown
Contributor

@yanndinendal I haven't seen any activity on this PR in more than three weeks, and it still has problems that prevent it from being merged. The PR will be closed on Nov 8th (in a week) if the issues aren't addressed.

@typescript-bot typescript-bot added the Abandoned This PR had no activity for a long time, and is considered abandoned label Nov 1, 2023
@typescript-bot

Copy link
Copy Markdown
Contributor

@yanndinendal To keep things tidy, we have to close PRs that aren't mergeable and don't have activity in the last month. No worries, though — please open a new PR if you'd like to continue with this change. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Abandoned This PR had no activity for a long time, and is considered abandoned Critical package Edits multiple packages The CI failed When GH Actions fails

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants