Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Design Meeting Notes, 7/10/2020 #39642

Closed
DanielRosenwasser opened this issue Jul 17, 2020 · 0 comments
Closed

Design Meeting Notes, 7/10/2020 #39642

DanielRosenwasser opened this issue Jul 17, 2020 · 0 comments
Labels
Design Notes Notes from our design meetings

Comments

@DanielRosenwasser
Copy link
Member

Making tsserver.js a Library

https://github.com/microsoft/TypeScript/pull/39291/files?w=1

  • 10% of size of a specific Electron-based editor is TypeScript! Oops!
  • Have been looking into producing smaller outputs, but also ways to deduplicate code.
  • Modules would fix this, but that's down the road.
  • tsserver.js is used for general editing, typescript.js is used for aggregating some data in other contexts - kind of want to consolidate.
  • Ideally could use tsserverlibrary.js.
  • Seems like one file can call out to another.

Minifying our Outputs

#25658

/ghexp/dtsminify/typescript_dts-minify/lib$ ls -lh tsserver.*
-rw-rw-r-- 1 acasey acasey 8.5M Jul  1 01:17 tsserver.js
-rw-rw-r-- 1 acasey acasey 1.6M Jul  1 01:17 tsserver.js.gz
-rw-rw-r-- 1 acasey acasey 4.6M Jul  1 01:19 tsserver.min.js
-rw-rw-r-- 1 acasey acasey 917K Jul  1 01:19 tsserver.min.js.gz
  • Should we do this?
  • Can't debug as easily.
  • Have to have some sort of way to map back to source.
  • Does this actually make sense?
  • We really want to fix the "we need to switch to modules" problem.
    • We at least want to reduce download time.
    • We're fine with other people minifying the TypeScript that they ship, but we want to wait on our own infrastructure first.
  • Choosing not to minify at this time.

Abstract Constructors and Construct Signatures

#36392

  • We already have a pattern that supports mixin factory patterns.
  • The problem is that it doesn't work well for abstract classes.
  • Not assignable to constructor functions.
  • There's a hack to write Function & { prototype: Ctor }, but given class Foo<T> {}, trying to infer from a typeof Foo to Ctor will lose the genericity of Foo.
    • Also accepts non-constructor functions, which isn't exactly desirable.
  • Does the output of a mixin function also product an abstract signature?
    • You can manually toggle it with the modifier.
    • But having some sort of class type syntax.
    • Able to model methods that are still marked as abstract.
  • Want to get a sense of whether this is interesting to others.
  • Still in progress.

Recommended Base TSConfigs

tsconfig/bases#15

  • Kind of a DT-like repo that aggregates tsconfigs that we think are good.
  • "You say 'recommended' but it fires the wrong neurons for me and makes me mad. My experience with eslint, tslint - the 'recommended' rules make no sense."
  • useDefineForClassFields - maybe not great because the emit isn't great.
  • skipLibCheck - is that actually good?
  • Diverging between tsc --init and tsconfig/recommended
  • Lots of options in the team chat that are hard!
    • jsx: react? Sure
    • declaration: true? Okay
    • moduleResolution: node? Sure
    • module: esnext? Uh
    • declarationMap: true?: Okay...
    • incremental: true? Ugh, right, yes.
  • recommended might not be a great idea

Default tsc init Options

#39354
#39311

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Design Notes Notes from our design meetings
Projects
None yet
Development

No branches or pull requests

2 participants