Skip to content

Bug that kill TypeScript build timeΒ #57075

Closed
@nisimjoseph

Description

@nisimjoseph

πŸ”Ž Search Terms

"long time", "stuck build"

πŸ•— Version & Regression Information

  • Occur on all versions.

⏯ Playground Link

No response

πŸ’» Code

export type HtmlAnchorTarget = '_self' | '_blank' | '_parent' | '_top';

type CssAbsoluteUnit = 'cm' | 'mm' | 'in' | 'px' | 'pt' | 'pc';
type CssRelativeUnit = 'em' | 'ex' | 'ch' | 'rem' | 'vw' | 'vh' | 'vmin' | 'vmax' | '%';

export type CssLength = `${number}${CssAbsoluteUnit | CssRelativeUnit}`;
export type CssMargin = CssLength | `${CssLength} ${CssLength}` | `${CssLength} ${CssLength} ${CssLength} ${CssLength}`;

πŸ™ Actual behavior

the build time grow exponential because of the amount of permutations we have and it Stuck the IDE completely and make the TSC to take 4-5x more build time.

πŸ™‚ Expected behavior

run faster

Additional information about the issue

just change the line:

export type CssMargin = CssLength | `${CssLength} ${CssLength}` | `${CssLength} ${CssLength} ${CssLength} ${CssLength}`;

to:

export type CssMargin = CssLength | string;

and all run fast.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Not a DefectThis behavior is one of several equally-correct options

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions