Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Improve the type definition of path.isX#15661

Merged
JLHwung merged 4 commits into
babel:mainfrom
liuxingbaoyu:isX2
Jul 31, 2023
Merged

Improve the type definition of path.isX#15661
JLHwung merged 4 commits into
babel:mainfrom
liuxingbaoyu:isX2

Conversation

@liuxingbaoyu
Copy link
Copy Markdown
Member

@liuxingbaoyu liuxingbaoyu commented May 26, 2023

Q                       A
Fixed Issues? Fixes #1, Fixes #2
Patch: Bug Fix?
Major: Breaking Change?
Minor: New Feature?
Tests Added + Pass? Yes
Documentation PR Link
Any Dependency Changes?
License MIT

Ref: #15549

@liuxingbaoyu liuxingbaoyu added pkg: traverse PR: Polish 💅 A type of pull request used for our changelog categories area: typescript labels May 26, 2023
@babel-bot
Copy link
Copy Markdown
Collaborator

babel-bot commented May 26, 2023

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

// TODO: Remove in Babel 8
export function isExistentialTypeParam(this: NodePath): void {
throw new Error(
"`path.isExistentialTypeParam` has been renamed to `path.isExistsTypeAnnotation()` in Babel 7.",
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Let's remove it now?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Yeah we can use something like

if (!process.env.BABEL_8_BREAKING) {
// For easier backward-compatibility, provide an API like the one we exposed in Babel 6.
if (!USE_ESM) {
// eslint-disable-next-line no-restricted-globals
exports.OptionManager = class OptionManager {

const { isCompatTag } = react;
import type { VirtualTypeAliases } from "./virtual-types";

type Opts<Object> = Partial<{
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nit, can you call this Obj to avoid confusion with the global Object constructor?


type Opts<Object> = Partial<{
[Prop in keyof Object]: Object[Prop] extends t.Node
? t.Node | Object[Prop]
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

If Object[Prop] extends t.Node, isn't this union just t.Node?

@JLHwung JLHwung merged commit 078d59a into babel:main Jul 31, 2023
@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 31, 2023
@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Oct 31, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area: typescript outdated A closed issue/PR that is archived due to age. Recommended to make a new issue pkg: traverse PR: Polish 💅 A type of pull request used for our changelog categories

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants