Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Track2] Add downlevel types to all track2 packages #8275

Closed
9 of 25 tasks
chradek opened this issue Apr 8, 2020 · 1 comment
Closed
9 of 25 tasks

[Track2] Add downlevel types to all track2 packages #8275

chradek opened this issue Apr 8, 2020 · 1 comment
Labels
Client This issue points to a problem in the data-plane of the library. EngSys This issue is impacting the engineering system. help wanted This issue is tracking work for which community contributions would be welcomed and appreciated
Milestone

Comments

@chradek
Copy link
Contributor

chradek commented Apr 8, 2020

This issue is to track adding downleveled types to our track2 packages to ensure we support older versions of TypeScript, targeting 3.1 where possible.

What is downleveling?

Just like we can use the TypeScript compiler to downlevel JavaScript code for older runtimes, we can also generate 'down-leveled' types that will work with older versions of TypeScript than the SDK packages use.

Changes

  1. Add "downlevel-dts": "~0.4.0", as a devDependency.
  2. Update api-extractor.json config so that the dtsRollup.publicTrimmedFilePath points to the new location for the current types.
    E.g. "./types/core-auth.d.ts" -> "./types/latest/core-auth.d.ts"
  3. Add the following build:types script to the package.json and update the build script to run it as the last step.
    "build:types": "downlevel-dts types/latest types/3.1"
  4. Update the package.json types field to point to the new location from step 2.
    E.g. "types": "./types/core-auth.d.ts" -> "types": "./types/latest/core-auth.d.ts"
  5. Add a typesVersions field to the package.json file. This is used to map type declarations based on the version of TypeScript the user is using. Example from core-auth:
"typesVersions": {
    "<3.6": {
      "types/latest/*": [
        "types/3.1/*"
      ]
    }
  },
  1. Update the package.json files entry to include types/latest/ and types/3.1/.

Example

Here's an example of making the above changes to the event-hubs SDK:
#8654

Packages to update

Core packages:

  • abort-controller
  • core-amqp
  • core-arm
  • core-asynciterator-polyfill
  • core-auth
  • core-http
  • core-lro
  • core-paging
  • core-tracing
  • identity
  • logger

Client packages:

  • ai-text-analytics
  • app-configuration
  • event-hubs
  • eventhubs-checkpointstore-blob
  • cosmos
  • keyvault-certificates
  • keyvault-keys
  • keyvault-secrets
  • search-documents
  • service-bus
  • storage-blob
  • storage-file-datalake
  • storage-file-share
  • storage-queue
@chradek chradek added the Client This issue points to a problem in the data-plane of the library. label Apr 8, 2020
@KarishmaGhiya KarishmaGhiya added this to the [2021] April milestone Feb 24, 2021
@KarishmaGhiya KarishmaGhiya self-assigned this Feb 24, 2021
@KarishmaGhiya KarishmaGhiya modified the milestones: [2021] April, 2021 May Mar 30, 2021
@ramya-rao-a ramya-rao-a modified the milestones: 2021 May, [2021] May Mar 31, 2021
@KarishmaGhiya KarishmaGhiya modified the milestones: [2021] May, [2021] July May 18, 2021
@ramya-rao-a ramya-rao-a modified the milestones: [2021] July, Backlog Jun 15, 2021
@ramya-rao-a ramya-rao-a added EngSys This issue is impacting the engineering system. help wanted This issue is tracking work for which community contributions would be welcomed and appreciated labels Jun 15, 2021
@ramya-rao-a ramya-rao-a modified the milestones: Backlog, [2021] December Jul 26, 2021
@deyaaeldeen
Copy link
Member

Closing in favor of #19843

@github-actions github-actions bot locked and limited conversation to collaborators Apr 12, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Client This issue points to a problem in the data-plane of the library. EngSys This issue is impacting the engineering system. help wanted This issue is tracking work for which community contributions would be welcomed and appreciated
Projects
None yet
Development

No branches or pull requests

4 participants