Skip to content

Design Meeting Notes, 7/31/2020 #39852

Closed
Closed
@DanielRosenwasser

Description

@DanielRosenwasser

Make Direct Assignments to CommonJS Exports Considered Literal Contexts

#39816

  • In JavaScript, module.exports.yadda = ... is considered read-only already.
  • What about module.exports = { yadda: ... }?
  • This PR makes it so we consider that when we decide the types are literals or unique symbols.
  • Technically a breaking change.
    • At earliest, 4.1
  • This would be the only place where we infer an object literal to have readonly properties.
  • Let's see how the user code suite works with this.
  • Because it's only CommonJS, maybe we should just leave it alone.
  • Probably merits no breakage if we see any.
  • Merge otherwise.

Variadic Tuples in Promise.all

#39796

  • With Promise.all, we have like 8 overloads.
  • They don't handle functions with optional members or with rest elements.
    • Means you end up with a weakly typed result from Promise.all.
  • Variadics can handle all these great cases that overloads can't!
  • Technically a breaking change because people could give explicit type arguments.
  • Sounds rare
    • 2 instances in VS Code
  • This also brings up a question about the awaited type.
    • How many levels should the approximated Awaited type in the PR handle?
  • We want T | Promise<T> to ensure that T is not a Promise.
    • But Promise itself can be constructed with an unconstrained type parameter.
  • Will we ever solve this?
  • Would be willing to try in 4.1.

Auto-Imports Slowdown

#38923

  • We should always keep in mind that when these auto-magic features are supposed to make things really good, but then turn everything to crap.
  • We could have a threshold of packages that are not already imported. If you have more than N packages, we don't do the work.
  • We have a flag to turn things off: auto, off, and on.
    • Technically it's off, dependencies, devDependencies.
  • We could do a low threshold - like 10 packages.
  • Can we have editors communicate more than "loading JS/TS language features"?
    • Signaling exactly what we're working on to communicate that something can be turned on.
  • Have to discuss some sort of mitigation plan

Metadata

Metadata

Assignees

No one assigned

    Labels

    Design NotesNotes from our design meetings

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions