GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix: provide legacy typings for TS < 4.1 by JLHwung · Pull Request #16638 · babel/babel

Conversation

@JLHwung

@JLHwung JLHwung commented Jul 12, 2024

Copy link
Copy Markdown
Contributor
Q                       A
Fixed Issues? Fixes #16637
Patch: Bug Fix?
Major: Breaking Change?
Minor: New Feature?
Tests Added + Pass? Yes
Documentation PR Link
Any Dependency Changes?
License MIT

In #16570 we improved the typings for getBindingIdentifiers via Key Remapping in Mapped Types, which is a TypeScript 4.1 feature. Note that TypeScript 4.1 was released in November 2020 (almost 4 years ago).

As we already provide legacy typings for TS < 3.7, here we bump the legacy typing condition to TS < 4.1. Hopefully this should address the @babel/types type check errors on TS < 4.1.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@JLHwung
fix: provide legacy typings for TS <= 4.0
8d70a07
@JLHwung JLHwung added the PR: Bug Fix 🐛 A type of pull request used for our changelog categories label Jul 12, 2024
nicolo-ribaudo
nicolo-ribaudo approved these changes Jul 12, 2024
View reviewed changes
@nicolo-ribaudo nicolo-ribaudo added the i: regression label Jul 12, 2024
@babel-bot

babel-bot commented Jul 12, 2024

Copy link
Copy Markdown
Collaborator

Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/57334

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@liuxingbaoyu liuxingbaoyu added the pkg: types label Jul 12, 2024
liuxingbaoyu
liuxingbaoyu approved these changes Jul 12, 2024
View reviewed changes
@JLHwung

JLHwung commented Jul 12, 2024

Copy link
Copy Markdown
Contributor Author

When I paste https://unpkg.com/@babel/[email protected]/lib/index-legacy.d.ts into TypeScript playground with TS 3.6.3, there are parser errors for

// Function implementation is missing or not immediately following the declaration.
export function booleanLiteralTypeAnnotation(value: boolean): BooleanLiteralTypeAnnotation;

Same errors with 3.7 or 4.0

I think we should add a test job for legacy typings.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@nicolo-ribaudo

nicolo-ribaudo commented Jul 12, 2024

Copy link
Copy Markdown
Member

I get no errors -- did you set the language to "TypeScrpt Declaration"?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@JLHwung

JLHwung commented Jul 12, 2024

Copy link
Copy Markdown
Contributor Author

I get no errors -- did you set the language to "TypeScrpt Declaration"?

Indeed, thanks! Merging it as-is.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@JLHwung
JLHwung merged commit de47960 into babel:main Jul 12, 2024
@JLHwung
JLHwung deleted the provide-legacy-typings-for-ts-lte-40 branch July 12, 2024 16:12
@SimenB

SimenB commented Jul 15, 2024

Copy link
Copy Markdown
Contributor

I think we should add a test job for legacy typings.

FWIW, Jest uses tstyche which has good support for type tests using different versions of TS. Dunno if you actually wanna test your types or just ensure they compile, tho

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@X-oss-byte X-oss-byte mentioned this pull request Aug 5, 2024
[Snyk] Upgrade @babel/core from 7.11.6 to 7.24.9 X-oss-byte/gatsby-1#801
Open
@Exkaleburx Exkaleburx mentioned this pull request Aug 5, 2024
[Snyk] Upgrade @babel/core from 7.9.0 to 7.24.9 Exkaleburx/plug-and-klay#12
Open
@ashly1111111 ashly1111111 mentioned this pull request Aug 5, 2024
[Snyk] Upgrade: , , , , ashly1111111/node#117
Open
This was referenced Aug 5, 2024
[Snyk] Upgrade: , tiff-es/js-looping-and-iteration-looping-code-along-dc-web-091619#206
Open
[Snyk] Upgrade: , tiff-es/fewpjs-class-extensions-super-lab-online-web-sp-000#200
Open
[Snyk] Upgrade: , tiff-es/fewpjs-fns-as-first-class-data-do-behavior-dc-web-091619#195
Open
[Snyk] Upgrade: , tiff-es/fewpjs-adding-behavior-with-methods-dc-web-091619#213
Open
[Snyk] Upgrade: , tiff-es/fewpjs-document-onload-dc-web-091619#202
Open
@davidbilling davidbilling mentioned this pull request Aug 6, 2024
[Snyk] Upgrade @babel/core from 7.24.7 to 7.24.9 davidbilling/ember-cli-time-input#109
Closed
@tiff-es tiff-es mentioned this pull request Aug 6, 2024
[Snyk] Upgrade: , tiff-es/js-data-structures-objects-lab-dc-web-091619#195
Open
@hashim21223445 hashim21223445 mentioned this pull request Aug 6, 2024
[Snyk] Upgrade @babel/core from 7.24.7 to 7.24.9 hashim21223445/async#5
Merged
This was referenced Aug 6, 2024
[Snyk] Upgrade: , tiff-es/fewpjs-getter-and-setter-methods-dc-web-091619#215
Open
[Snyk] Upgrade: , tiff-es/fewpjs-acting-on-events-dc-web-091619#198
Open
[Snyk] Upgrade: , tiff-es/fewpjs-fns-as-first-class-data-array-o-functions-dc-web-091619#204
Open
@jamesleesaunders jamesleesaunders mentioned this pull request Aug 6, 2024
[Snyk] Upgrade: , jamesleesaunders/d3-ez#201
Closed
@davidbilling davidbilling mentioned this pull request Aug 6, 2024
[Snyk] Upgrade @babel/core from 7.24.7 to 7.24.9 davidbilling/ember-cli-cloudinary-light#120
Merged
@Mhmonicox Mhmonicox mentioned this pull request Aug 6, 2024
[Snyk] Upgrade: , , , , Mhmonicox/node#137
Open
@Sonic269 Sonic269 mentioned this pull request Oct 4, 2024
[Snyk] Upgrade @babel/core from 7.8.6 to 7.25.2 Sonic269/App6#140
Open
@anandgupta193 anandgupta193 mentioned this pull request Oct 4, 2024
[Snyk] Upgrade @babel/core from 7.10.4 to 7.25.2 anandgupta193/sortNsuffle-react#1138
Open
@DadonStyle DadonStyle mentioned this pull request Oct 4, 2024
[Snyk] Upgrade @babel/core from 7.17.8 to 7.25.2 DadonStyle/Crypto-Tower-FE#28
Open
@blackleadsu blackleadsu mentioned this pull request Oct 4, 2024
[Snyk] Upgrade @babel/core from 7.9.0 to 7.25.2 blackleadsu/PowerBI-visuals-tools#70
Open
@richyhoopd richyhoopd mentioned this pull request Oct 4, 2024
[Snyk] Upgrade @babel/core from 7.9.0 to 7.25.2 richyhoopd/Video-App#1230
Open
@AnushaSalian AnushaSalian mentioned this pull request Oct 4, 2024
[Snyk] Upgrade @babel/core from 7.20.12 to 7.25.2 virtual-labs/ph3-lab-mgmt#547
Open
This was referenced Oct 4, 2024
[Snyk] Upgrade @babel/core from 7.18.2 to 7.25.2 nejidevelops/phase-0-intro-to-js-2-looping-code-along#94
Open
[Snyk] Upgrade @babel/core from 7.18.2 to 7.25.2 nejidevelops/phase-0-javascript-events-acting-on-events-lab#95
Open
[Snyk] Upgrade @babel/core from 7.18.2 to 7.25.2 nejidevelops/phase-0-intro-to-js-2-objects-lab#91
Open
[Snyk] Upgrade @babel/core from 7.4.5 to 7.25.2 nejidevelops/phase-1-domcontentloaded#95
Open
[Snyk] Upgrade @babel/core from 7.4.5 to 7.25.2 nejidevelops/phase-1-destructuring-assignment#93
Open
This was referenced Oct 5, 2024
[Snyk] Upgrade @babel/core from 7.4.5 to 7.25.2 tiff-es/fewpjs-class-extensions-super-lab-online-web-sp-000#242
Open
[Snyk] Upgrade @babel/core from 7.4.5 to 7.25.2 tiff-es/js-data-structures-objects-lab-dc-web-091619#237
Open
[Snyk] Upgrade @babel/core from 7.4.5 to 7.25.2 tiff-es/fewpjs-adding-behavior-with-methods-dc-web-091619#245
Open
[Snyk] Upgrade @babel/core from 7.4.5 to 7.25.2 tiff-es/fewpjs-document-onload-dc-web-091619#247
Open
[Snyk] Upgrade @babel/core from 7.4.5 to 7.25.2 tiff-es/fewpjs-acting-on-events-dc-web-091619#240
Open
[Snyk] Upgrade @babel/core from 7.6.4 to 7.25.2 tiff-es/js-looping-and-iteration-looping-code-along-dc-web-091619#244
Open
@rish2497 rish2497 mentioned this pull request Oct 5, 2024
[Snyk] Upgrade @babel/core from 7.14.3 to 7.25.2 i3-Market-V3-Public-Repository/Support---Deployment-Tools#70
Open
@rawdaymohamed rawdaymohamed mentioned this pull request Oct 5, 2024
[Snyk] Upgrade @babel/core from 7.18.13 to 7.25.2 rawdaymohamed/Hot-Todo#401
Closed
This was referenced Oct 5, 2024
[Snyk] Upgrade @babel/generator from 7.1.3 to 7.25.6 NOUIY/node#490
Open
[Snyk] Upgrade @babel/types from 7.1.3 to 7.25.6 NOUIY/node#491
Open
@richyhoopd richyhoopd mentioned this pull request Oct 6, 2024
[Snyk] Upgrade @babel/core from 7.4.5 to 7.25.2 richyhoopd/RichyFlix#936
Open
@tiff-es tiff-es mentioned this pull request Oct 6, 2024
[Snyk] Upgrade @babel/core from 7.4.5 to 7.25.2 tiff-es/fewpjs-getter-and-setter-methods-dc-web-091619#261
Open
@nejidevelops nejidevelops mentioned this pull request Oct 8, 2024
[Snyk] Upgrade @babel/core from 7.4.5 to 7.25.2 nejidevelops/phase-1-domcontentloaded#97
Open
This was referenced Oct 8, 2024
[Snyk] Upgrade @babel/core from 7.4.5 to 7.25.2 tiff-es/fewpjs-class-extensions-super-lab-online-web-sp-000#244
Open
[Snyk] Upgrade @babel/core from 7.4.5 to 7.25.2 tiff-es/fewpjs-fns-as-first-class-data-array-o-functions-dc-web-091619#246
Open
[Snyk] Upgrade @babel/core from 7.4.5 to 7.25.2 tiff-es/fewpjs-document-onload-dc-web-091619#248
Open
@AnushaSalian AnushaSalian mentioned this pull request Oct 8, 2024
[Snyk] Upgrade @babel/core from 7.20.12 to 7.25.2 virtual-labs/ph3-lab-mgmt#549
Open
@github-actions github-actions Bot added the outdated A closed issue/PR that is archived due to age. Recommended to make a new issue label Oct 15, 2024
@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Oct 15, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Reviewers

@nicolo-ribaudo nicolo-ribaudo nicolo-ribaudo approved these changes
@liuxingbaoyu liuxingbaoyu liuxingbaoyu approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

i: regression outdated A closed issue/PR that is archived due to age. Recommended to make a new issue pkg: types PR: Bug Fix 🐛 A type of pull request used for our changelog categories

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

[Bug]: @babel/types TypeScript error after v7.24.8 publication

Uh oh!

There was an error while loading. Please reload this page.

5 participants

@JLHwung @babel-bot @nicolo-ribaudo @SimenB @liuxingbaoyu
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.