Typescript: Suggestion Backlog Slog, 8/22/2018

Created on 23 Aug 2018  路  2Comments  路  Source: microsoft/TypeScript

  • #25172 Narrowing unknown with === or friends
  • #24193 null should be an allowable discriminant value
  • #26075 Should type.isLiteral() return true for boolean literals?
  • #22631 Named type arguments
  • #26572 Destructuring computed private class property names
  • #10178 Access UMD globals from modules
  • #14951 Index signatures on fresh object literals
  • #26015 Even stricter class property initialization
  • #26404 Scrape MDN for DOM/core documentation comments
  • #26193 esModuleInterop should enable allowSyntheticDefaultImports
  • #7481 "soft" type assertion operator
  • #24350 Should array literals be tuples?
  • #23689 "invalid" type
Design Notes

Most helpful comment

  • #25172 Narrowng unknown with === or friends

    • OP is not super compelling



      • If you have a known RHS, why aren't you using the RHS?



    • Last case with Response is more compelling



      • Reminder that minimal examples often lose their compellingness



    • :+1: assuming no bad side effects

  • #24193 null should be an allowable discriminant value

    • Comes up with node packages a lot

    • Didn't we do something here recently?



      • Allowing mixed-unit-type discriminants?



    • Treat null as a primitive for the purpose of detecting discriminated unions

    • :+1:

  • #26075 Should type.isLiteral() return true for boolean literals?

    • Yes!

  • #22631 Named type arguments

    • No

  • #26572 Destructuring computed private class property names

    • :+1: stop the madness, Won't Fix this bug

    • Daniel will add a testcase

  • #10178 Access UMD globals from modules

    • Open question: If you import from that module, is it poisoned then ?



      • NOBODY CARES



    • No satisfactory workaround because there's no namespace import

    • What do we call this flag?



      • Bikesheeeeeed



    • :+1:

  • #14951 Index signatures on fresh object literals

    • It's clever? Or is it. Definitely!

    • Proposal: Fresh object literals get an index signature that widens away



      • Kind of expensive and weird



    • Proposal: Do something special when indexing an object literal



      • Walk through numeric/string names as appropriate and make a union with undefined


      • Cheap and targeted



    • :+1:

  • #26015 Even stricter class property initialization

    • Can't break the world - yet another flag

    • Effectively a syntactic enforcement

    • The control flow checker is kind of half-off in this case

    • :-1:

  • #26404 Scrape MDN for DOM/core documentation comments

    • :+1: Community

  • #26193 esModuleInterop should enable allowSyntheticDefaultImports

    • :+1: sure

  • #7481 "soft" type assertion operator

    • Desired: "as" with one-way assignability semantics but still have contextual typing

    • What terrible operator name would we come up with?

    • We could use Flow's type assertion syntax - it's reserved

    • We want it but all available syntax (cough) is terrible

    • Needs a super clever syntactic insertion point

    • Related: Block-syntax type assertion



      • Speculating on how to make this happen in a performant way



    • Keep noodling on it

  • #24350 Should array literals be tuples?

    • Is the breakage not as bad as we thought?

    • General literal-assertion problem



      • Literal types are really problematic today


      • What would a smarter world look like?



    • ! should be the "do the other thing" operator?



      • ... no



    • We shouldn't hurt non-tuple-users to help tuple users, arguably

    • Keep noodling on it

All 2 comments

  • #25172 Narrowng unknown with === or friends

    • OP is not super compelling



      • If you have a known RHS, why aren't you using the RHS?



    • Last case with Response is more compelling



      • Reminder that minimal examples often lose their compellingness



    • :+1: assuming no bad side effects

  • #24193 null should be an allowable discriminant value

    • Comes up with node packages a lot

    • Didn't we do something here recently?



      • Allowing mixed-unit-type discriminants?



    • Treat null as a primitive for the purpose of detecting discriminated unions

    • :+1:

  • #26075 Should type.isLiteral() return true for boolean literals?

    • Yes!

  • #22631 Named type arguments

    • No

  • #26572 Destructuring computed private class property names

    • :+1: stop the madness, Won't Fix this bug

    • Daniel will add a testcase

  • #10178 Access UMD globals from modules

    • Open question: If you import from that module, is it poisoned then ?



      • NOBODY CARES



    • No satisfactory workaround because there's no namespace import

    • What do we call this flag?



      • Bikesheeeeeed



    • :+1:

  • #14951 Index signatures on fresh object literals

    • It's clever? Or is it. Definitely!

    • Proposal: Fresh object literals get an index signature that widens away



      • Kind of expensive and weird



    • Proposal: Do something special when indexing an object literal



      • Walk through numeric/string names as appropriate and make a union with undefined


      • Cheap and targeted



    • :+1:

  • #26015 Even stricter class property initialization

    • Can't break the world - yet another flag

    • Effectively a syntactic enforcement

    • The control flow checker is kind of half-off in this case

    • :-1:

  • #26404 Scrape MDN for DOM/core documentation comments

    • :+1: Community

  • #26193 esModuleInterop should enable allowSyntheticDefaultImports

    • :+1: sure

  • #7481 "soft" type assertion operator

    • Desired: "as" with one-way assignability semantics but still have contextual typing

    • What terrible operator name would we come up with?

    • We could use Flow's type assertion syntax - it's reserved

    • We want it but all available syntax (cough) is terrible

    • Needs a super clever syntactic insertion point

    • Related: Block-syntax type assertion



      • Speculating on how to make this happen in a performant way



    • Keep noodling on it

  • #24350 Should array literals be tuples?

    • Is the breakage not as bad as we thought?

    • General literal-assertion problem



      • Literal types are really problematic today


      • What would a smarter world look like?



    • ! should be the "do the other thing" operator?



      • ... no



    • We shouldn't hurt non-tuple-users to help tuple users, arguably

    • Keep noodling on it

@RyanCavanaugh what about https://github.com/Microsoft/TypeScript/issues/23689?? There doesn't seem to be a 馃憤 or 馃憥 for it (very much hoping for 馃憤)!

Was this page helpful?
0 / 5 - 0 ratings