Skip to content

Conversation

@sandersn
Copy link
Contributor

TS 4.2 improves the way it handles type aliases. This means that some tests now need to $ExpectType both the de-aliased type, for old versions, as well as the type alias, for new versions.

This PR touches a lot of files, but it's all test files.

TS 4.2 improves the way it handles type aliases. This means that some tests
now need to $ExpectType both the de-aliased type, for old versions, as
well as the type alias, for new versions.
textOptions.content;
if (textOptions.direction !== undefined) {
// $ExpectType TextDirection
// $ExpectType TextDirection || "top" | "right" | "bottom" | "left" | "center"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

note that because of microsoft/TypeScript#42304, a few type aliases actually get de-aliased more. I'm making this change now because we're not sure whether it's easily fixable.

@sandersn
Copy link
Contributor Author

3 failures from tests:

  1. jquery overload resolution. This is in a file I didn't edit. I'll investigate this separately.
  2. styled-components. This is a known failure, which I'll look at separately as well.
  3. raphael has a line that is too long. I added a tslint ignore since there's no alternate way to format $ExpectType.

@typescript-bot
Copy link
Contributor

typescript-bot commented Jan 13, 2021

@sandersn Thank you for submitting this PR!

This is a live comment which I will keep updated.

31 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.

Status

  • ✅ No merge conflicts
  • ❌ Continuous integration tests have passed
  • ❌ 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.


Diagnostic Information: What the bot saw about this PR
{
  "type": "info",
  "now": "-",
  "pr_number": 50566,
  "author": "sandersn",
  "headCommitOid": "a0b897e90dbf3f6c3f7dea8170329eb23c0b9336",
  "lastPushDate": "2021-01-13T16:21:36.000Z",
  "lastActivityDate": "2021-01-13T17:12:51.000Z",
  "maintainerBlessed": false,
  "hasMergeConflict": false,
  "isFirstContribution": false,
  "popularityLevel": "Critical",
  "pkgInfo": [
    {
      "name": "amap-js-api-place-search",
      "kind": "edit",
      "files": [
        {
          "path": "types/amap-js-api-place-search/amap-js-api-place-search-tests.ts",
          "kind": "test"
        }
      ],
      "owners": [
        "breeze9527"
      ],
      "addedOwners": [],
      "deletedOwners": [],
      "popularityLevel": "Well-liked by everyone"
    },
    {
      "name": "amap-js-api",
      "kind": "edit",
      "files": [
        {
          "path": "types/amap-js-api/amap-js-api-tests.ts",
          "kind": "test"
        }
      ],
      "owners": [
        "breeze9527"
      ],
      "addedOwners": [],
      "deletedOwners": [],
      "popularityLevel": "Well-liked by everyone"
    },
    {
      "name": "conventional-commits-parser",
      "kind": "edit",
      "files": [
        {
          "path": "types/conventional-commits-parser/conventional-commits-parser-tests.ts",
          "kind": "test"
        }
      ],
      "owners": [
        "JasonHK"
      ],
      "addedOwners": [],
      "deletedOwners": [],
      "popularityLevel": "Well-liked by everyone"
    },
    {
      "name": "conventional-recommended-bump",
      "kind": "edit",
      "files": [
        {
          "path": "types/conventional-recommended-bump/conventional-recommended-bump-tests.ts",
          "kind": "test"
        }
      ],
      "owners": [
        "JasonHK"
      ],
      "addedOwners": [],
      "deletedOwners": [],
      "popularityLevel": "Well-liked by everyone"
    },
    {
      "name": "core-object",
      "kind": "edit",
      "files": [
        {
          "path": "types/core-object/core-object-tests.ts",
          "kind": "test"
        }
      ],
      "owners": [
        "dfreeman"
      ],
      "addedOwners": [],
      "deletedOwners": [],
      "popularityLevel": "Well-liked by everyone"
    },
    {
      "name": "googlemaps",
      "kind": "edit",
      "files": [
        {
          "path": "types/googlemaps/test/reference/marker-tests.ts",
          "kind": "test"
        }
      ],
      "owners": [
        "cgwrench",
        "Silver-Connection",
        "nertzy",
        "xaolas",
        "mrmcnerd",
        "martincostello",
        "svenkreiss",
        "bolatovumar",
        "gauthierm",
        "captain-igloo",
        "demensky",
        "life777",
        "simonhaenisch",
        "gshigeto",
        "Bat-Orshikh",
        "jpoehnelt",
        "skrylnikov"
      ],
      "addedOwners": [],
      "deletedOwners": [],
      "popularityLevel": "Popular"
    },
    {
      "name": "jquery",
      "kind": "edit",
      "files": [
        {
          "path": "types/jquery/jquery-tests.ts",
          "kind": "test"
        }
      ],
      "owners": [
        "leonard-thieu",
        "borisyankov",
        "choffmeister",
        "Steve-Fenton",
        "Diullei",
        "tasoili",
        "jasons-novaleaf",
        "seanski",
        "Guuz",
        "ksummerlin",
        "basarat",
        "nwolverson",
        "derekcicerone",
        "AndrewGaspar",
        "seikichi",
        "benjaminjackman",
        "s093294",
        "JoshStrobl",
        "johnnyreilly",
        "DickvdBrink",
        "King2500",
        "terrymun",
        "martin-badin"
      ],
      "addedOwners": [],
      "deletedOwners": [],
      "popularityLevel": "Critical"
    },
    {
      "name": "lodash",
      "kind": "edit",
      "files": [
        {
          "path": "types/lodash/lodash-tests.ts",
          "kind": "test"
        }
      ],
      "owners": [
        "bczengel",
        "chrootsu",
        "stepancar",
        "aj-r",
        "e-cloud",
        "thorn0",
        "jtmthf",
        "DomiR",
        "WilliamChelman"
      ],
      "addedOwners": [],
      "deletedOwners": [],
      "popularityLevel": "Critical"
    },
    {
      "name": "metaget",
      "kind": "edit",
      "files": [
        {
          "path": "types/metaget/metaget-tests.ts",
          "kind": "test"
        }
      ],
      "owners": [
        "ffflorian"
      ],
      "addedOwners": [],
      "deletedOwners": [],
      "popularityLevel": "Well-liked by everyone"
    },
    {
      "name": "mime-db",
      "kind": "edit",
      "files": [
        {
          "path": "types/mime-db/mime-db-tests.ts",
          "kind": "test"
        }
      ],
      "owners": [
        "AJamesPhillips",
        "LinusU",
        "peterblazejewicz"
      ],
      "addedOwners": [],
      "deletedOwners": [],
      "popularityLevel": "Popular"
    },
    {
      "name": "nearley",
      "kind": "edit",
      "files": [
        {
          "path": "types/nearley/nearley-tests.ts",
          "kind": "test"
        }
      ],
      "owners": [
        "deltaidea",
        "BendingBender"
      ],
      "addedOwners": [],
      "deletedOwners": [],
      "popularityLevel": "Well-liked by everyone"
    },
    {
      "name": "numeric",
      "kind": "edit",
      "files": [
        {
          "path": "types/numeric/numeric-tests.ts",
          "kind": "test"
        }
      ],
      "owners": [
        "tup1tsa"
      ],
      "addedOwners": [],
      "deletedOwners": [],
      "popularityLevel": "Well-liked by everyone"
    },
    {
      "name": "parse5",
      "kind": "edit",
      "files": [
        {
          "path": "types/parse5/parse5-tests.ts",
          "kind": "test"
        }
      ],
      "owners": [
        "inikulin",
        "ExE-Boss",
        "43081j"
      ],
      "addedOwners": [],
      "deletedOwners": [],
      "popularityLevel": "Popular"
    },
    {
      "name": "plurals-cldr",
      "kind": "edit",
      "files": [
        {
          "path": "types/plurals-cldr/plurals-cldr-tests.ts",
          "kind": "test"
        }
      ],
      "owners": [
        "ChaosinaCan"
      ],
      "addedOwners": [],
      "deletedOwners": [],
      "popularityLevel": "Well-liked by everyone"
    },
    {
      "name": "puppeteer",
      "kind": "edit",
      "files": [
        {
          "path": "types/puppeteer/puppeteer-tests.ts",
          "kind": "test"
        }
      ],
      "owners": [
        "marvinhagemeister",
        "cdeutsch",
        "ksm2",
        "SimonSchick",
        "SerbanGhita",
        "JasonKaz",
        "davecardwell",
        "angrykoala",
        "peterblazejewicz",
        "cameronhunter",
        "1pete"
      ],
      "addedOwners": [],
      "deletedOwners": [],
      "popularityLevel": "Popular"
    },
    {
      "name": "quicksettings",
      "kind": "edit",
      "files": [
        {
          "path": "types/quicksettings/quicksettings-tests.ts",
          "kind": "test"
        }
      ],
      "owners": [
        "janizde"
      ],
      "addedOwners": [],
      "deletedOwners": [],
      "popularityLevel": "Well-liked by everyone"
    },
    {
      "name": "raphael",
      "kind": "edit",
      "files": [
        {
          "path": "types/raphael/test/raphael-tests-api.ts",
          "kind": "test"
        }
      ],
      "owners": [
        "CheCoxshall",
        "blutorange"
      ],
      "addedOwners": [],
      "deletedOwners": [],
      "popularityLevel": "Well-liked by everyone"
    },
    {
      "name": "react-native",
      "kind": "edit",
      "files": [
        {
          "path": "types/react-native/test/animated.tsx",
          "kind": "test"
        }
      ],
      "owners": [
        "alloy",
        "huhuanming",
        "iRoachie",
        "timwangdev",
        "kamal",
        "alexdunne",
        "swissmanu",
        "bm-software",
        "a-tarasyuk",
        "mvdam",
        "esemesek",
        "mrnickel",
        "souvik-ghosh",
        "nossbigg",
        "saranshkataria",
        "franzmoro",
        "tykus160",
        "jakebloom",
        "ceyhun",
        "mcmar",
        "theohdv",
        "TheSavior",
        "romain-faust",
        "bebebebebe",
        "Naturalclar",
        "chinesedfan",
        "vtolochk",
        "SychevSP",
        "RageBill",
        "sasurau4",
        "256hz",
        "doumart",
        "drmas",
        "akrger",
        "jeremybarbet",
        "ca057",
        "ds300",
        "natsathorn",
        "connectdotz",
        "TheWirv",
        "alexeymolchan",
        "alexbrazier",
        "kuasha420"
      ],
      "addedOwners": [],
      "deletedOwners": [],
      "popularityLevel": "Popular"
    },
    {
      "name": "react-reconciler",
      "kind": "edit",
      "files": [
        {
          "path": "types/react-reconciler/test/react-reconciler-tests.ts",
          "kind": "test"
        }
      ],
      "owners": [
        "Methuselah96"
      ],
      "addedOwners": [],
      "deletedOwners": [],
      "popularityLevel": "Well-liked by everyone"
    },
    {
      "name": "redux-first-router",
      "kind": "edit",
      "files": [
        {
          "path": "types/redux-first-router/redux-first-router-tests.ts",
          "kind": "test"
        }
      ],
      "owners": [
        "Valbrand",
        "viggyfresh",
        "janb87",
        "corydeppen",
        "jscinoz",
        "surgeboris",
        "geirsagberg",
        "hedgerh",
        "adam1658",
        "macobo"
      ],
      "addedOwners": [],
      "deletedOwners": [],
      "popularityLevel": "Well-liked by everyone"
    },
    {
      "name": "redux-orm",
      "kind": "edit",
      "files": [
        {
          "path": "types/redux-orm/redux-orm-tests.ts",
          "kind": "test"
        }
      ],
      "owners": [
        "keenondrums",
        "tomasz-zablocki"
      ],
      "addedOwners": [],
      "deletedOwners": [],
      "popularityLevel": "Well-liked by everyone"
    },
    {
      "name": "rsvp",
      "kind": "edit",
      "files": [
        {
          "path": "types/rsvp/rsvp-tests.ts",
          "kind": "test"
        }
      ],
      "owners": [
        "chriskrycho",
        "mike-north"
      ],
      "addedOwners": [],
      "deletedOwners": [],
      "popularityLevel": "Popular"
    },
    {
      "name": "sane",
      "kind": "edit",
      "files": [
        {
          "path": "types/sane/sane-tests.ts",
          "kind": "test"
        }
      ],
      "owners": [
        "BendingBender"
      ],
      "addedOwners": [],
      "deletedOwners": [],
      "popularityLevel": "Popular"
    },
    {
      "name": "tablesorter",
      "kind": "edit",
      "files": [
        {
          "path": "types/tablesorter/test/Methods.ts",
          "kind": "test"
        }
      ],
      "owners": [
        "manuth"
      ],
      "addedOwners": [],
      "deletedOwners": [],
      "popularityLevel": "Well-liked by everyone"
    },
    {
      "name": "underscore",
      "kind": "edit",
      "files": [
        {
          "path": "types/underscore/underscore-tests.ts",
          "kind": "test"
        }
      ],
      "owners": [
        "borisyankov",
        "jbaldwin",
        "ccurrens",
        "confususs",
        "jgonggrijp",
        "ffflorian",
        "regevbr",
        "peterblazejewicz",
        "reubenrybnik"
      ],
      "addedOwners": [],
      "deletedOwners": [],
      "popularityLevel": "Popular"
    },
    {
      "name": "web-resource-inliner",
      "kind": "edit",
      "files": [
        {
          "path": "types/web-resource-inliner/web-resource-inliner-tests.ts",
          "kind": "test"
        }
      ],
      "owners": [
        "BendingBender"
      ],
      "addedOwners": [],
      "deletedOwners": [],
      "popularityLevel": "Well-liked by everyone"
    },
    {
      "name": "webidl2",
      "kind": "edit",
      "files": [
        {
          "path": "types/webidl2/webidl2-tests.ts",
          "kind": "test"
        }
      ],
      "owners": [
        "saschanaz",
        "ExE-Boss"
      ],
      "addedOwners": [],
      "deletedOwners": [],
      "popularityLevel": "Well-liked by everyone"
    },
    {
      "name": "wordpress__data",
      "kind": "edit",
      "files": [
        {
          "path": "types/wordpress__data/wordpress__data-tests.tsx",
          "kind": "test"
        }
      ],
      "owners": [
        "dsifford",
        "sirreal"
      ],
      "addedOwners": [],
      "deletedOwners": [],
      "popularityLevel": "Well-liked by everyone"
    },
    {
      "name": "wordpress__editor",
      "kind": "edit",
      "files": [
        {
          "path": "types/wordpress__editor/wordpress__editor-tests.tsx",
          "kind": "test"
        }
      ],
      "owners": [
        "dsifford"
      ],
      "addedOwners": [],
      "deletedOwners": [],
      "popularityLevel": "Well-liked by everyone"
    },
    {
      "name": "yargs",
      "kind": "edit",
      "files": [
        {
          "path": "types/yargs/v12/yargs-tests.ts",
          "kind": "test"
        },
        {
          "path": "types/yargs/v13/yargs-tests.ts",
          "kind": "test"
        },
        {
          "path": "types/yargs/yargs-tests.ts",
          "kind": "test"
        }
      ],
      "owners": [
        "poelstra",
        "mizunashi-mana",
        "pushplay",
        "JimiC",
        "steffenvv",
        "forivall",
        "ExE-Boss",
        "Aankhen"
      ],
      "addedOwners": [],
      "deletedOwners": [],
      "popularityLevel": "Critical"
    },
    {
      "name": "yesql",
      "kind": "edit",
      "files": [
        {
          "path": "types/yesql/yesql-tests.ts",
          "kind": "test"
        }
      ],
      "owners": [
        "Sumolari"
      ],
      "addedOwners": [],
      "deletedOwners": [],
      "popularityLevel": "Well-liked by everyone"
    }
  ],
  "reviews": [
    {
      "type": "stale",
      "reviewer": "johnnyreilly",
      "date": "2021-01-13T06:40:07.000Z",
      "abbrOid": "d935ed1"
    }
  ],
  "ciResult": "fail",
  "ciUrl": "https://github.com/DefinitelyTyped/DefinitelyTyped/commit/a0b897e90dbf3f6c3f7dea8170329eb23c0b9336/checks?check_suite_id=1822771301"
}

@typescript-bot
Copy link
Contributor

typescript-bot commented Jan 13, 2021

⚠️ There are too many reviewers for this PR change (152). Merging can only be handled by a DT maintainer.

People who would have been pinged breeze9527 JasonHK dfreeman cgwrench Silver-Connection nertzy xaolas mrmcnerd martincostello svenkreiss bolatovumar gauthierm captain-igloo demensky life777 simonhaenisch gshigeto Bat-Orshikh jpoehnelt skrylnikov leonard-thieu borisyankov choffmeister Steve-Fenton Diullei tasoili jasons-novaleaf seanski Guuz ksummerlin basarat nwolverson derekcicerone AndrewGaspar seikichi benjaminjackman s093294 JoshStrobl johnnyreilly DickvdBrink King2500 terrymun martin-badin bczengel chrootsu stepancar aj-r e-cloud thorn0 jtmthf DomiR WilliamChelman ffflorian AJamesPhillips LinusU peterblazejewicz deltaidea BendingBender tup1tsa inikulin ExE-Boss 43081j ChaosinaCan marvinhagemeister cdeutsch ksm2 SimonSchick SerbanGhita JasonKaz davecardwell angrykoala cameronhunter 1pete janizde CheCoxshall blutorange alloy huhuanming iRoachie timwangdev kamal alexdunne swissmanu bm-software a-tarasyuk mvdam esemesek mrnickel souvik-ghosh nossbigg saranshkataria franzmoro tykus160 jakebloom ceyhun mcmar theohdv TheSavior romain-faust bebebebebe Naturalclar chinesedfan vtolochk SychevSP RageBill sasurau4 256hz doumart drmas akrger jeremybarbet ca057 ds300 natsathorn connectdotz TheWirv alexeymolchan alexbrazier kuasha420 Methuselah96 Valbrand viggyfresh janb87 corydeppen jscinoz surgeboris geirsagberg hedgerh adam1658 macobo keenondrums tomasz-zablocki chriskrycho mike-north manuth jbaldwin ccurrens confususs jgonggrijp regevbr reubenrybnik saschanaz dsifford sirreal poelstra mizunashi-mana pushplay JimiC steffenvv forivall Aankhen Sumolari

@typescript-bot
Copy link
Contributor

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

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

@typescript-bot
Copy link
Contributor

👋 Hi there! I’ve run some quick measurements against master and your PR. These metrics should help the humans reviewing this PR gauge whether it might negatively affect compile times or editor responsiveness for users who install these typings.

Let’s review the numbers, shall we?

amap-js-api-place-search/v1.4

Comparison details for amap-js-api-place-search/1.4 📊
master #50566 diff
Batch compilation
Memory usage (MiB) 80.5 80.9 +0.5%
Type count 13781 13781 0%
Assignability cache size 4558 4558 0%
Language service
Samples taken 459 459 0%
Identifiers in tests 459 459 0%
getCompletionsAtPosition
    Mean duration (ms) 365.7 369.9 +1.2%
    Mean CV 8.7% 8.6%
    Worst duration (ms) 472.5 476.5 +0.9%
    Worst identifier health_rating hotel
getQuickInfoAtPosition
    Mean duration (ms) 380.1 384.3 +1.1%
    Mean CV 10.4% 9.8%
    Worst duration (ms) 461.3 488.2 +5.8%
    Worst identifier faci_rating id

It looks like nothing changed too much. I won’t post performance data again unless it gets worse.

amap-js-api/v1.4

Comparison details for amap-js-api/1.4 📊
master #50566 diff
Batch compilation
Memory usage (MiB) 86.7 97.8 +12.8%
Type count 16594 16594 0%
Assignability cache size 5678 5678 0%
Language service
Samples taken 3466 3466 0%
Identifiers in tests 3466 3466 0%
getCompletionsAtPosition
    Mean duration (ms) 386.9 390.8 +1.0%
    Mean CV 6.7% 6.6%
    Worst duration (ms) 642.7 707.9 +10.2%
    Worst identifier on on
getQuickInfoAtPosition
    Mean duration (ms) 400.2 403.2 +0.8%
    Mean CV 6.9% 6.7%
    Worst duration (ms) 635.2 718.7 +13.1%
    Worst identifier testGeoJSON zoom

It looks like nothing changed too much. I won’t post performance data again unless it gets worse.

@typescript-bot typescript-bot added the Perf: Same typescript-bot determined that this PR will not significantly impact compilation performance. label Jan 13, 2021
Copy link
Member

@johnnyreilly johnnyreilly left a comment

Choose a reason for hiding this comment

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

Looks good to me - there's failing tests though (as you know I'm sure)

@ExE-Boss
Copy link
Contributor

I’ve extracted the es‑abstract fixes into #50574 along with some additional $ExpectType fixes that were missed in this PR.

@typescript-bot
Copy link
Contributor

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

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

@sandersn
Copy link
Contributor Author

One additional failure in sequelize. I'll investigate that separately, too, since it's not related to the test changes I made.

@sandersn sandersn merged commit 17e6d24 into master Jan 13, 2021
@sandersn sandersn deleted the update-ExpectType-representations branch January 13, 2021 17:14
kaznovac pushed a commit to kaznovac/DefinitelyTyped that referenced this pull request Mar 2, 2021
* Update $ExpectType representation for TS 4.2

TS 4.2 improves the way it handles type aliases. This means that some tests
now need to $ExpectType both the de-aliased type, for old versions, as
well as the type alias, for new versions.

* Ignore max-line-length in raphael tests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Critical package Edits multiple packages Perf: Same typescript-bot determined that this PR will not significantly impact compilation performance. The CI failed When GH Actions fails Too Many Owners

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants