Skip to content

Design Meeting Notes, 7/28/2021 #45226

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

Closed
DanielRosenwasser opened this issue Jul 28, 2021 · 0 comments
Closed

Design Meeting Notes, 7/28/2021 #45226

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

Comments

@DanielRosenwasser
Copy link
Member

DanielRosenwasser commented Jul 28, 2021

Overriding libs and @types/web

#44795

  • Underlying idea here is to take parts of the DOM API and put them into @types
    • Have already started shipping @types/web.
    • Enables you to avoid breaking changes around the DOM when upgrading TypeScript versions.
  • But now we need to give a way to disable the DOM types.
    • You can already remove dom from the lib field in tsconfig.json.
    • However, packages can have a /// <reference lib="dom">
  • One solution is a pragma of some sort - tell the compiler "no no, it's over here."
  • Another is a tsconfig.json option that overrides.
  • Pragma has implications
    • Have to watch for its addition/removal and that can modify the current project. Means that you have to load/unload files.
    • Global "pollution" along the same lines of
    • Can do tsconfig.json first and then do a pragma; easy path there. Pragma is undoable.
  • Already have to modify the tsconfig.json if you need to remove the DOM - seems like you should just put all of this in the tsconfig.json.
  • Have the full picture of the world, seems like it's doable.
  • MSBuild context with no tsconfig?
    • Can add a specific MSBuild option.
  • Seems like we're leaning with a tsconfig flag.
  • [[Bike-shedding tsconfig options]]
  • Big cliff in your configuration
    • Everything works
    • User installs @types/web
    • "OH NO ERRORS" 😭
    • User removes lib: dom
    • 😊👍
  • How do we expect people to do dependency management?
    • peerDependency?
      • Really don't want people to declare it as a dependency.
  • What if someone /// <reference types="web"> or /// <reference types="@types/web">
    • Can stop people from doing it in DefinitelyTyped
    • Can also give an error in TypeScript itself.
  • Can also use Node.js policies to override.
  • Do we see people doing this beyond just @types/web?
    • People may want their own "strict" version of the standard libraries.
    • People may want some subset of libraries like for SES.
    • Globals that conflict between libraries
  • Conclusions
    • Ship as tsconfig setting first.
    • Iterate on the prototype.
@DanielRosenwasser DanielRosenwasser added the Design Notes Notes from our design meetings label Jul 28, 2021
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

1 participant