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, 3/31/2018 #23045

Closed
mhegazy opened this issue Mar 31, 2018 · 0 comments
Closed

Design Meeting Notes, 3/31/2018 #23045

mhegazy opened this issue Mar 31, 2018 · 0 comments
Labels
Design Notes Notes from our design meetings

Comments

@mhegazy
Copy link
Contributor

mhegazy commented Mar 31, 2018

global

Issue comes in the context of recognizing assignments to properties on this or window as global declarations.
We need way to refer to the global type, e.g. declare var window: Window & global; for DOM.
We have a precedence in the declare global { .. } support.

Some options:

// use new `import("module")` syntax with `global` instead
var window: Window & import(global);

// or no operand at all
var nan: typeof import().NAN;

// import.meta?
import.meta.global

// C++ anyone?
var x: global::NaN

// call it `global` or just `Global`
var x1: Global;
var x1: typeof Global;
var x1: Global.Array<number>

var x1: Global["NaN"];

var x1: typeof Global.NaN;

TC39 has been looking into a name for the value side of global https://github.com/tc39/proposal-global, the proposal is at stage 3.
The proposal has stalled on the choice of the variable name, global seems to be already in use.

@rbuckton contacted the proposal champion (@ljharb), and the proposal is still active. there are few names proposed at this point.

Conclusion, wait for TC39 to pick a name, and then use that in both type and value positions.

Resolving .json files

Allow infer types in expression type argument positions

  • PR: WIP - Allow infer types in expression type argument positions #22368

  • @weswigham, this is probably too much power, not clear what use cases require that.

  • the change is simple, relatively, thought

  • practically gives you associated types

  • We still need named type parameters, what to do when you wnat to specify the fifth type parameter and get everything inferred

  • we already have a proposal here, no need for another proposal

Array.isArray and ReadonlyArray

  • PR: Add support for ReadonlyArray to Array.isArray #22942
  • it is a breaking change, we are just trading one set of problems with another
  • should not change it
  • the core issue is that Array and ReadonlyArray are two distinct types. we need to think about a readonly modifier again

Variadic types

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

No branches or pull requests

1 participant