Skip to content

Remove getSymbolDisplayBuilder from the public API #22195

Closed

Description

Along with it's backing code, since we don't use it internally. It has been deprecated since 2.7, and once 2.8 ships it should have a tolerable replacements for all functions in the form of the new node builder methods for the refactored declaration emitter, along with the XToString methods provided in 2.7. I'd target this for either 2.9 or later (3.0?), depending on the timeframe. Our audit of usage (on github) only really showed TS forks and angular depending on it, so this should give them plenty of time to migrate off of it. (ping Martin Probst (@mprobst) Rado Kirov (@rkirov) to remind you that we're going to remove this API)

Activity

  1. added this to the milestone on Feb 26, 2018
  2. rkirov commented on Feb 27, 2018

    @rkirov
    Contributor

    Thanks for the heads up!

    It's been awhile, but I see we have some comments on why other approaches didn't work for us here - https://github.com/angular/tsickle/blob/d57d40dd049fc074d25efb4b5bca69e2af280a06/src/type-translator.ts#L171

    Any comment on using typeToString or symbolToString as alternative?

  3. weswigham commented on Feb 27, 2018

    @weswigham
    MemberAuthor

    checker.typeToTypeNode, checker.symbolToEntityName, and checker.symbolToExpression should be more powerful/configurable than checker.typeToString, checker.symbolToString, or checker.getSymbolDisplayBuilder().buildSymbolDisplay were. (You just need to use createPrinter and print the resulting node if you need a string)

  4. weswigham commented on Feb 27, 2018

    @weswigham
    MemberAuthor

    Specifically, the TypeFormatFlags.WriteArrayAsGenericType and/or NodeBuilderFlags.WriteArrayAsGenericType flag controls the array format thing. typeToString can actually be configured in that respect, too; so the initial premise that you had to use the symbol display builder may be a bit off.

  5. weswigham commented on Jul 20, 2018

    @weswigham
    MemberAuthor

    Fixed by #25331

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Breaking ChangeWould introduce errors in existing codeDomain: APIRelates to the public API for TypeScript

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions