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

[FEATURE] Publish stable types for Ember #20449

Merged
merged 105 commits into from
May 8, 2023
Merged

[FEATURE] Publish stable types for Ember #20449

merged 105 commits into from
May 8, 2023

Commits on Apr 19, 2023

  1. Publish types from source and remove preview types

    Remove *all* preview types, update the publishing script to publish all
    packages from source, and update the publishing tsconfig to include all
    source packages.
    
    **This *does not work* yet.** However, it is a necessary first step in
    the process of switching to publishing stable types: the remaining
    types are too deeply entangled with each other to publish them in
    chunks as we have to date. (If there are exceptions, I have not found
    them, and the overhead of finding them is higher than the cost of just
    doing this switch-over.)
    chriskrycho committed Apr 19, 2023
    Configuration menu
    Copy the full SHA
    90f78e7 View commit details
    Browse the repository at this point in the history
  2. Change how loader's define becomes visiblte to TS

    Previously, this was defined as a global in `ember-template-compiler`.
    This was not really correct; it was a workaround for the way that the
    `loader` package defines it as a global as a side effect of importing
    and executing the module. Here, make it visible specifically *and only*
    to the root `ember` package, where it is needed for defining the type
    of the `Ember.__loader` object.
    chriskrycho committed Apr 19, 2023
    Configuration menu
    Copy the full SHA
    06b7acb View commit details
    Browse the repository at this point in the history
  3. Add ability to manually copy .d.ts type modules

    Some packages in the project supply `.d.ts` files which must be part of
    both the authoring-time types *and* the published types, because they
    represent values which become available at runtime by way of codegen.
    
    For example, the `ember/version` module provides a `VERSION` value
    derived from the package version. Both Ember's internals and the public
    API include this value in various ways, but it does not have a
    corresponding ES module on disk, so we provide a type definition
    representing where it *notionally* lives, and that type definition must
    also appear in the published types.
    
    In these cases, simply copy the file from an input to an output
    location, rather than trying to use `tsc` for them (since `tsc` will
    actually ignore them).
    chriskrycho committed Apr 19, 2023
    Configuration menu
    Copy the full SHA
    22a100b View commit details
    Browse the repository at this point in the history
  4. Provide an owner-ext for @ember/service

    `owner-ext` is a pass-through type definition module which adds the
    `Registry` from `@ember/service` to the `DIRegistry` in `@ember/owner`
    in a way that works for both internal usage within Ember *and* usage by
    end users, given the constraints of our types publishing infrastructure
    and its need to wrap all proper modules in `declare module { }` blocks.
    Since this already *has* a `declare module { }` block, it does not need
    to be wrapped; and since it is simply a `.d.ts` file, we can copy it
    over rather than trying to emit it with `tsc` during build. (This is,
    admittedly, a hack: but a sadly necessary one given our constraints!)
    chriskrycho committed Apr 19, 2023
    Configuration menu
    Copy the full SHA
    5da100d View commit details
    Browse the repository at this point in the history
  5. Import a root without /index in ember-template-compiler

    Instead of working around this in the type publishing infrastructure
    (though we may ultimately want to do that as well), just *fix* it by
    normalizing the import to the more "normal" form without `/index`.
    chriskrycho committed Apr 19, 2023
    Configuration menu
    Copy the full SHA
    6551040 View commit details
    Browse the repository at this point in the history
  6. The router service presently takes a generic

    We should, separately, fix that: it doesn't actually make sense for the
    `RouterService` to be generic over a single route or even a set of
    routes, so we need to go back and undo that type-level plumbing.
    chriskrycho committed Apr 19, 2023
    Configuration menu
    Copy the full SHA
    e034e72 View commit details
    Browse the repository at this point in the history
  7. Update how we compile backburner.js' types

    Use the full package name in both the broccoli build and all imports
    which reference it, so that the types can resolve to them correctly.
    chriskrycho committed Apr 19, 2023
    Configuration menu
    Copy the full SHA
    80b738d View commit details
    Browse the repository at this point in the history
  8. Publishing script: do not wrap passthrough copies

    This makes it so we can write code for things like the `DIRegistry`
    which works correctly at both authoring and publishing time: it means
    the side-effect-type modules can be in "module mode" rather than purely
    ambient mode in both contexts. It also updates the definition of the
    `@ember/service/owner-ext.d.ts` to be in module mode.
    chriskrycho committed Apr 19, 2023
    Configuration menu
    Copy the full SHA
    c1f0073 View commit details
    Browse the repository at this point in the history
  9. Correct the @ember/application type test

    The previous test was overly generous, allowing users to pass anything
    into the `buildInstance()` call and not checking that it worked with
    the actual required arguments. This may technically be true, given how
    the Ember APIs for `.create()` work under the hood (and that is how
    this works, of course), but it's not *useful* to TS users, and it does
    not actually represent the expected public API.
    chriskrycho committed Apr 19, 2023
    Configuration menu
    Copy the full SHA
    4e15f8b View commit details
    Browse the repository at this point in the history
  10. Do not special-case ember-template-compiler/lib/types

    These can go through the normal pipeline by being a `.ts` files instead
    of a `.d.ts` file in the source.
    chriskrycho committed Apr 19, 2023
    Configuration menu
    Copy the full SHA
    edbb768 View commit details
    Browse the repository at this point in the history
  11. Use keyof this in Observable's get, set, etc.

    This makes `this.get('foo')` and friends work in roughly the same cases
    where `get(this, 'foo')` and friends work.
    chriskrycho committed Apr 19, 2023
    Configuration menu
    Copy the full SHA
    3917d20 View commit details
    Browse the repository at this point in the history
  12. Emit named items for built-in components

    The `Input` and `Textarea` components were previously being emitted as
    the direct result of the `opaquify` item, with no name. This made it
    impossible for TS to *automatically* emit them (a) with a useful import
    name or (b) with a nameable type. Introducing an intermediate binding
    and a type defined as the `typeof` the named constant, the combination
    of which becomes the default export, maintains the existing runtime
    behavior exactly while making the types name-able.
    chriskrycho committed Apr 19, 2023
    Configuration menu
    Copy the full SHA
    3940d67 View commit details
    Browse the repository at this point in the history
  13. Correctly handle router registration into service registry

    Use the same pattern for this as for extending the DIRegistry with the
    service registry: create a passthrough copy of a module declaration
    which is valid in both authoring and publishing contexts.
    chriskrycho committed Apr 19, 2023
    Configuration menu
    Copy the full SHA
    31cef6f View commit details
    Browse the repository at this point in the history
  14. Name the return type of (internal) controllerFor

    This prevents us from needing to emit (rewritten) relative paths for
    the return type.
    chriskrycho committed Apr 19, 2023
    Configuration menu
    Copy the full SHA
    632cb35 View commit details
    Browse the repository at this point in the history
  15. Loosen restriction on service registry

    Services can be any object, both in practice for today and in a future
    where Ember services don't have to have an Ember base class.
    chriskrycho committed Apr 19, 2023
    Configuration menu
    Copy the full SHA
    6473757 View commit details
    Browse the repository at this point in the history
  16. Substantially refactor publish.mjs

    Introduce the ability to copy over hand-authored `.d.ts` files; Ember
    has a number of these for things which exist at runtime but have no
    corresponding authoring-time `.js`/`.ts` file, e.g. templates.
    
    Along the way, make a couple significant improvements:
    
    1. Switch to using the async versions of most operations, which mildly
       improves performance.
    2. Extract some of the functionality into well-scoped functions to show
       the flow more clearly, and to handle the common process of writing
       an error to the console and bailing.
    chriskrycho committed Apr 19, 2023
    Configuration menu
    Copy the full SHA
    4408557 View commit details
    Browse the repository at this point in the history
  17. Fix types and type tests for @ember/array

    - `sortBy()` can accept multiple keys to sort on
    - Type tests should not name `EmberArray` as `Array` lest they confuse
      the difference with global (real!) `Array`.
    - Type tests should use public API imports, not private API imports.
    chriskrycho committed Apr 19, 2023
    Configuration menu
    Copy the full SHA
    6e1472e View commit details
    Browse the repository at this point in the history
  18. Correct @ember/object type tests given improved safety

    Previously (i.e. on earlier versions of TS) we did not consistently get
    the type params preserving the underlying types as robustly, but we can
    now preserve this information.
    chriskrycho committed Apr 19, 2023
    Configuration menu
    Copy the full SHA
    6dedf8b View commit details
    Browse the repository at this point in the history
  19. Update @ember/application type tests for DI registry

    Now that the service registry provides a constraint of `object` for the
    entries, rather than no constraint whatsoever, we can update the tests
    to verify this to prevent regression.
    chriskrycho committed Apr 19, 2023
    Configuration menu
    Copy the full SHA
    ee42331 View commit details
    Browse the repository at this point in the history
  20. Handle type (un)safety of some runloop bind

    We can safely type *almost* all variants, but not using Ember's `bind`
    with `this` and a string name. Introduce an appropriate fallback for
    that case; this means that we cannot catch quite as many errors but in
    exchange we get coverage over documented patterns in Ember's code.
    
    (This gives us the same behavior as the preview and DT types always had
    as a fallback.)
    chriskrycho committed Apr 19, 2023
    Configuration menu
    Copy the full SHA
    5d2db7e View commit details
    Browse the repository at this point in the history
  21. Handle declare namespace in types publishing script

    `namespace` and `module` both introduce TS `ModuleDeclaration` types,
    so we distinguish between the two by checking whether it uses a string
    literal (rather than an identifier) when excluding `declare module`
    from the post-processing.
    chriskrycho committed Apr 19, 2023
    Configuration menu
    Copy the full SHA
    e596002 View commit details
    Browse the repository at this point in the history

Commits on Apr 20, 2023

  1. Refactor Ember namespace to be a TS namespace

    While the `namespace` construct is very much to be avoided for new
    code, it is *exactly* correct for the case of the `Ember` namespace,
    which is (precisely!) a namespace. To make this work:
    
    - Combine the existing `const PartialEmber` and `const Ember` object
      bindings into a single `namespace Ember`.
    
    - For the members assigned via `Object.defineProperty`, switch from an
      `interface` to `export declare let` and `export declare const`
      bindings on the `namespace`. Make sure to use `let` or `const` to
      match the readonly or writable semantics of the items defined thus.
    
    Testing this exposed that at some point `Ember.run.later` and similar
    nested namespace access stopped working, almost certainly at the point
    when we dropped support for the namespace access from the module, but
    our type tests still promised it. Noting that no *runtime* tests check
    for this, remove the corresponding type tests.
    chriskrycho committed Apr 20, 2023
    Configuration menu
    Copy the full SHA
    2fdb3f5 View commit details
    Browse the repository at this point in the history
  2. Add top-level safe key list for getProperties

    This already works in the variant where the caller passes in an array,
    but we did not have the overload for where they pass in multiple args.
    chriskrycho committed Apr 20, 2023
    Configuration menu
    Copy the full SHA
    7e5cc1a View commit details
    Browse the repository at this point in the history
  3. Provide a useful type for @computed.meta()

    Useful and *hopefully* accurate, but the implementation is a bit murky
    as to what the intended semantics are, and the commit history is not
    illuminating. This seems to capture the actual tested and documented
    behavior accurately.
    chriskrycho committed Apr 20, 2023
    Configuration menu
    Copy the full SHA
    6385cea View commit details
    Browse the repository at this point in the history
  4. Extract owner and location side effect modules for routing/location

    As with our service registry, we need these to live in separate files
    so they can be copied over without change and so be able to perform
    imports while *also* performing a module merge.
    chriskrycho committed Apr 20, 2023
    Configuration menu
    Copy the full SHA
    abc0c4e View commit details
    Browse the repository at this point in the history
  5. Dramatically simplify routing types, fix its type tests

    Since we have no ability to connect or check, within Ember itself or in
    the things it provides to callers, the relationship between any given
    Route model, Transition, and the overall RouterState, remove those type
    parameters entirely in favor of just passing Ember's `Route` as the
    type directly to `router.js`'s type parameters. This lets us simplify
    the routing layer types considerably.
    
    Also update a number of the type tests for the routing layer to match
    Ember's actual behavior: the preview (and DT) types were simply wrong
    at various points.
    chriskrycho committed Apr 20, 2023
    Configuration menu
    Copy the full SHA
    d48f51e View commit details
    Browse the repository at this point in the history
  6. Make cache-for slightly type-safer

    Add an overload which correctly handles keyof lookups.
    chriskrycho committed Apr 20, 2023
    Configuration menu
    Copy the full SHA
    bdf9fcf View commit details
    Browse the repository at this point in the history
  7. Update types and tests for Ember namespace

    - Give onerror a useful type (the one it has always had).
    - Mark some exported items as private.
    - Update the test suite to reflect the types from source: in some cases
      looser, in other cases somewhat tighter!
    chriskrycho committed Apr 20, 2023
    Configuration menu
    Copy the full SHA
    436d583 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    229eb14 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    afa3d97 View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    9f293e5 View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    ccb1afa View commit details
    Browse the repository at this point in the history
  12. Fix types and type tests for @ember/debug/data-adapter

    - Introduce `Column` type and use it as appropriate.
    - Update type tests for the *actual* API: apparently DT had this wrong
      for many years.
    chriskrycho committed Apr 20, 2023
    Configuration menu
    Copy the full SHA
    09f3b36 View commit details
    Browse the repository at this point in the history

Commits on Apr 24, 2023

  1. Configuration menu
    Copy the full SHA
    cd91172 View commit details
    Browse the repository at this point in the history
  2. Fix types and type tests for @ember/debug

    - `deprecate` and `warn` can be called without args (this is not the
      intended behavior, but it is currently legal in the internals).
    - `assert` needs to be typed correctly in the implementation to be
      `never` when no predicate is passed.
    chriskrycho committed Apr 24, 2023
    Configuration menu
    Copy the full SHA
    5649f39 View commit details
    Browse the repository at this point in the history

Commits on Apr 25, 2023

  1. Configuration menu
    Copy the full SHA
    c203349 View commit details
    Browse the repository at this point in the history
  2. Fix types for assert and (get|set)DebugFunction

    - Update prod `noop` bindings to cast away safety.
    - Update type tests to expect `assert` to `asserts test` or be `never`.
    chriskrycho committed Apr 25, 2023
    Configuration menu
    Copy the full SHA
    1d2e048 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    23da1ea View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    284ea81 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    c9b410a View commit details
    Browse the repository at this point in the history
  6. Add a required as const for Controller QPs type test

    TS helpfully tries to infer a mutually-compatible type when passed more
    than one object in an array (to allow narrowing etc.), but with QPs on
    a Controller, we actually do *not* want that behavior; so when passing
    both `type` and a rename in the same QPs config, use `as const`.
    chriskrycho committed Apr 25, 2023
    Configuration menu
    Copy the full SHA
    fde1a80 View commit details
    Browse the repository at this point in the history
  7. Supply correct internal types for precompileTemplate

    Although this is a build-time-only API, which is ultimately removed
    from the distributed build, it is perfectly legal for Ember users to
    *name*, especially if doing their own build tooling work; as such, it
    needs to provide the types it has when used in the build.
    chriskrycho committed Apr 25, 2023
    Configuration menu
    Copy the full SHA
    9923c7a View commit details
    Browse the repository at this point in the history
  8. Handle edge case in types publishing path mapping

    Without this, some TS-generated `import()` types naming a given item
    where the runtime code simply relies on inference get emitted without
    the top-level `@ember/` namespace. This special case makes sure we do
    not drop that: if we ever find it, we know we *need* to emit it.
    chriskrycho committed Apr 25, 2023
    Configuration menu
    Copy the full SHA
    0c2058d View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    de0f67a View commit details
    Browse the repository at this point in the history
  10. Update types and type tests for CP macros

    - Correctly capture deprecation options.
    - Flag CP syntax we do not expect to work.
    - Make `@sort` less type-safe, to match `Array.prototype.sort`.
    chriskrycho committed Apr 25, 2023
    Configuration menu
    Copy the full SHA
    2a1dd3e View commit details
    Browse the repository at this point in the history
  11. Simplify types for (get|set)Properties

    This fixes many of the incompatibilities from our type tests, and makes
    the resulting code *much* clearer at the same time. The key here is to
    move away from trying to use tuple spread types to just constraining
    the actual args and mapping their types into a `Pick` or `Record`.
    chriskrycho committed Apr 25, 2023
    Configuration menu
    Copy the full SHA
    11f1ecf View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    5d87525 View commit details
    Browse the repository at this point in the history
  13. Eliminate cycle in definition of (Ember) Component

    `Component` uses `ViewSupport`, but `ViewSupport` defined its `this` as
    `Component`. This was a classic form of cycle which blocked supporting
    the `Mixin`-based programming model effectively with TS in the first
    place and was a major motivator for investing in native classes back in
    the early Ember 3.x days! here, the fix is to use `this: CoreView`
    instead so that `ViewSupport` does not need to name `Component`, only
    the chunk of `Component`'s base types it actually uses.
    
    As a bonus, remove a needless `extends FrameworkObject` from the merge
    on the interface of the `CoreView` class, since normal inheritance does
    correctly preserve that.
    chriskrycho committed Apr 25, 2023
    Configuration menu
    Copy the full SHA
    a2e42e1 View commit details
    Browse the repository at this point in the history
  14. Fix/simplify types of create, reopen, and reopenClass

    As described in the RFC, we do not want to attempt to provide the type-
    modifying capabilities of these functions. The result is type safe but
    not especially useful, but that is as we want: using `create` to
    provide values not on the base type *or* to change its values is quite
    undesirable; and using `reopen` and `reopenClass` to dynamically update
    instance and static members of a class has serious (and not obvious!)
    performance downsides and discoverability problems for maintainers, and
    will ultimately be deprecated entirely as part of removing Classic.
    
    A key result is that `.create()` now allows *any* props to be set, but
    does not update the resulting type. This is an unfortunate necessity
    given how Ember *itself* uses `.create()`.
    chriskrycho committed Apr 25, 2023
    Configuration menu
    Copy the full SHA
    341e356 View commit details
    Browse the repository at this point in the history
  15. Configuration menu
    Copy the full SHA
    f70771d View commit details
    Browse the repository at this point in the history
  16. Remove now-defunct types for (add|remove)Listener

    Ember's own types are now less generous about `evented`'s `addListener`
    and `removeListener` functions than the preview/DT types were, because
    Ember's implementation has been simplified and the types had not been
    updated to match.
    chriskrycho committed Apr 25, 2023
    Configuration menu
    Copy the full SHA
    284f6db View commit details
    Browse the repository at this point in the history
  17. Configuration menu
    Copy the full SHA
    b3af348 View commit details
    Browse the repository at this point in the history
  18. Remove extranes extends from EmberObject interface

    Again, this already correctly `extends CoreObject` because the class
    itself does so; we only need to merge in declarations with mixins.
    chriskrycho committed Apr 25, 2023
    Configuration menu
    Copy the full SHA
    35251ec View commit details
    Browse the repository at this point in the history
  19. Configuration menu
    Copy the full SHA
    3b320c0 View commit details
    Browse the repository at this point in the history
  20. Configuration menu
    Copy the full SHA
    b94db2c View commit details
    Browse the repository at this point in the history
  21. Provide type safe get and set in ObjectProxy

    While people should generally move away from this and to native `Proxy`
    this makes it possible for existing code to be well-typed.
    chriskrycho committed Apr 25, 2023
    Configuration menu
    Copy the full SHA
    294e401 View commit details
    Browse the repository at this point in the history
  22. Configuration menu
    Copy the full SHA
    dd37b6c View commit details
    Browse the repository at this point in the history
  23. Fix @ember/object tests for proxy and observable

    Account for both the improved `Proxy` type safety and the removed
    `CoreObject.create` type safety in the type tests.
    chriskrycho committed Apr 25, 2023
    Configuration menu
    Copy the full SHA
    a17d279 View commit details
    Browse the repository at this point in the history
  24. Fix bad import and reference in ember NS type tests

    These referred respectively to imports which existed only in DT/preview
    types and a removed API!
    chriskrycho committed Apr 25, 2023
    Configuration menu
    Copy the full SHA
    6694ed7 View commit details
    Browse the repository at this point in the history
  25. Partially reimplement type-safe .create()

    This gets us a *small* amount of type safety, rather than absolutely
    none: it does not check the types passed into `.create()` match, but
    since there is little reason to directly call this for end user code
    (vs. for internal code, which actually uses this dynamic capability!),
    this gives us the actual runtime behavior: if you smash a property with
    a new type, you... do.
    chriskrycho committed Apr 25, 2023
    Configuration menu
    Copy the full SHA
    86eeaf7 View commit details
    Browse the repository at this point in the history
  26. Correctly export both sides of the opaque LinkTo

    Even though we have an "opaque" class here, we still need to make sure
    both the static type of the class and its runtime type are available
    to callers to name.
    chriskrycho committed Apr 25, 2023
    Configuration menu
    Copy the full SHA
    2fd539a View commit details
    Browse the repository at this point in the history
  27. Update a set() type test: it allows dynamic setting

    This matches the runtime behavior. We do not catch setting things this
    way, as a result, but in a world where native property access works
    everywhere, this is actually somewhat useful: it means you can set
    anything on a target object, and although the type will not be updated
    with that change, it will at least type check in a way that matches the
    dynamic runtime behavior.
    chriskrycho committed Apr 25, 2023
    Configuration menu
    Copy the full SHA
    dd907e9 View commit details
    Browse the repository at this point in the history
  28. Remove a type test which only covered internals

    This was useful to prevent us from regression in the DT/preview types
    era, but these are covered by Ember's internals being required to type
    check as part of CI now, and we have also simplified or removed most of
    this machinery.
    chriskrycho committed Apr 25, 2023
    Configuration menu
    Copy the full SHA
    972a9e1 View commit details
    Browse the repository at this point in the history
  29. Update type tests for improved set/get inference

    The resulting types are just records, where `Pick` preserves some extra
    info because of the dynamic class behavior.
    chriskrycho committed Apr 25, 2023
    Configuration menu
    Copy the full SHA
    ffb0501 View commit details
    Browse the repository at this point in the history
  30. Drop Ember.get from Ember Router tests

    The fact that `Ember.get` gets very confused on deeply mapped types
    combined with `this` types is not surprising, but is also not relevant
    to a test where no one *should* use `get()` instead of normal property
    access.
    chriskrycho committed Apr 25, 2023
    Configuration menu
    Copy the full SHA
    8d80667 View commit details
    Browse the repository at this point in the history
  31. Further remove generic Route param from router

    As with the earlier commit removing some of this, we have no ability to
    check these types, so they are just extraneous overhead.
    chriskrycho committed Apr 25, 2023
    Configuration menu
    Copy the full SHA
    26f16cb View commit details
    Browse the repository at this point in the history
  32. Fix types for internal-test-helpers

    Now that `create` can catch this, it lets us know about our own lies.
    chriskrycho committed Apr 25, 2023
    Configuration menu
    Copy the full SHA
    caf4b1d View commit details
    Browse the repository at this point in the history
  33. Configuration menu
    Copy the full SHA
    4799725 View commit details
    Browse the repository at this point in the history

Commits on Apr 26, 2023

  1. Improve correctness and usability of @ember/modifier types

    - Re-export the relevant types from `@glimmer/interfaces` as well as
      wiring them up to the appropriate points in the exported functions.
    - Add the hooks necessary to make the exported `on` modifier visible to
      Glint, including adding an `Opaque` internal type.
    chriskrycho committed Apr 26, 2023
    Configuration menu
    Copy the full SHA
    be2596f View commit details
    Browse the repository at this point in the history
  2. Improve types and type tests for @ember/test

    - Provide the correct type for the first param for the callback passed
      to `registerHelper()`.
    - Add a cast and an explanation for type test on `TestAdapter`
    chriskrycho committed Apr 26, 2023
    Configuration menu
    Copy the full SHA
    cb8f6fd View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    a0ab50f View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    ad9e569 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    142d5d1 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    06c3a14 View commit details
    Browse the repository at this point in the history
  7. Add static positionalParams type declaration to EmberComponent

    Without this, neither `.extend()`ing `Component` nor the documented
    `reopenClass` pattern works with `positionalParams`.
    chriskrycho committed Apr 26, 2023
    Configuration menu
    Copy the full SHA
    40722d2 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    ef18c84 View commit details
    Browse the repository at this point in the history
  9. Fix types around component templates and TOCs

    - Make `templateOnlyComponent` and associated types usable with Glint
      the same way the preview types were.
    - Fix the way we name the types of `setComponentTemplate` in tests. In
      the real world, the way to get the type is via calling another public
      API; here we just want to make sure the function *requires* the
      correct thing.
    chriskrycho committed Apr 26, 2023
    Configuration menu
    Copy the full SHA
    08296c6 View commit details
    Browse the repository at this point in the history

Commits on Apr 28, 2023

  1. Fix types and type tests for @ember/test

    - Do not emit `| () => never` for functions in `@ember/test`: while it
      is true that those *will* error if `ember-testing` is not included,
      the underlying function type is still correct even there, since the
      immediately-throwing handler is a legitimate function subtype of the
      expected behavior when the library *is* included. Additionally, that
      inclusion is normally a build-time concern.
    
    - Apply some formatting tweaks to the definition of `registerWaiter`'s
      implementation definition and `prettier-ignore` those lines to make
      it more legible.
    
    - Update a `register` call in a type test to use a proper 'full:name'.
    chriskrycho committed Apr 28, 2023
    Configuration menu
    Copy the full SHA
    e57bc26 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    9d65d25 View commit details
    Browse the repository at this point in the history
  3. Make Ember's helper types Glint-compatible

    Provide the same public API as the preview types. This requires lying a
    bit about the return type of `helper()` in particular, but no part of
    Ember's own internals cares about the details: they are relevant *only*
    as the point where they are actually created. The provided type avoids
    a number of possible kinds of errors by providing an opaque item which
    cannot be constructed but which *does* preserve generics. Moreover, the
    actual details of type returned by `helper()` are *not* public API, so
    this correctly avoids exposing those details.
    
    As a bonus, remove a number of extra internal type aliases on both the
    source and that were used in the preview types.
    chriskrycho committed Apr 28, 2023
    Configuration menu
    Copy the full SHA
    911e14c View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    c0f010c View commit details
    Browse the repository at this point in the history
  5. Fix types for template-only components

    - Do not expose Glimmer's private/internal notion of a template-only
      component, even for type tests.
    - Do provide the full *call* API for Glimmer's `templateOnly()`.
    chriskrycho committed Apr 28, 2023
    Configuration menu
    Copy the full SHA
    5b397e1 View commit details
    Browse the repository at this point in the history
  6. Fix re-export of Ember.RSVP as a namespace

    This syntax is namespace-specific: `import` in a namespace is aliasing
    one namespace to another, while `export` marks the item public on the
    namespace (as with the rest of the exported items).
    chriskrycho committed Apr 28, 2023
    Configuration menu
    Copy the full SHA
    40b3a19 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    05acc98 View commit details
    Browse the repository at this point in the history
  8. Fix TS lint errors

    chriskrycho committed Apr 28, 2023
    Configuration menu
    Copy the full SHA
    2f26a2c View commit details
    Browse the repository at this point in the history

Commits on May 1, 2023

  1. Remove assertion from build-owner internal test helper

    At the moment, some *tests* pass no resolver, and expect this to work
    anyway. The fix is to have those tests pass a test-friendly resolver
    and then this will work as expected.
    chriskrycho committed May 1, 2023
    Configuration menu
    Copy the full SHA
    73dc0cd View commit details
    Browse the repository at this point in the history
  2. Fix a missed rename in ember/index.ts

    Supporting the TS `namespace` export for the `Ember` namespace object
    (in 2fdb3f5) required aliasing many of the imports; one of these was
    hidden by having a `@ts-expect-error` on that statement for unrelated
    reasons.
    chriskrycho committed May 1, 2023
    Configuration menu
    Copy the full SHA
    f55cc15 View commit details
    Browse the repository at this point in the history
  3. Update Ember NS reexport test for backburner.js

    The existence of the `_Backburner` re-export is of a private item, and
    this test simply checks that the re-export works as expected; sinc we
    updated the build pipeline not to do the weird renaming shenanigans it
    did previously to make `'backburner'` the import downstream, we can
    update this test to match the actual Node-resolveable location as well
    (see 80b738d for background).
    chriskrycho committed May 1, 2023
    Configuration menu
    Copy the full SHA
    3f54dc7 View commit details
    Browse the repository at this point in the history
  4. Add private runloop backburner re-exports

    `@ember/test-helpers` uses these as they exist in the DT and preview
    types, so to avoid breaking that, re-supply them here. They should not
    be relied upon long-term, but this allows us to migrate the library's
    dependency chain distinctly from the release of these types.
    chriskrycho committed May 1, 2023
    Configuration menu
    Copy the full SHA
    2f826a3 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    544d381 View commit details
    Browse the repository at this point in the history

Commits on May 4, 2023

  1. Fix typo in comment in broccoli/packages.js

    Co-authored-by: Dan Freeman <dfreeman@salsify.com>
    chriskrycho and dfreeman committed May 4, 2023
    Configuration menu
    Copy the full SHA
    9fd1b03 View commit details
    Browse the repository at this point in the history
  2. Do not duplicate work on hand-written .d.ts files

    There are three categories of `.d.ts` files we manually copy over as
    part of our publishing process:
    
    - `*-ext.d.ts` modules, which supply module merge declarations manually
      to allow the regular module to go through the normal postprocessing
      chain while still allowing the imports to work correctly for the
      declaration merge. These must be copied over and left exactly as they
      are, no post-processing.
    
    - Modules which correctly represent a runtime-only location of an API,
      which appear at one point in the source graph, but must be emitted at
      a completely different location for runtime/import. These must be
      copied over and left as they are, no post-processing, but targeting a
      different location to emit them.
    
    - Modules which must be copied over and then post-processed, because
      they represent runtime-only code which must be importable as a normal
      module via a relative path *and* must be wrapped in `declare module`
      to be usable in the emitted types.
    
    Separate those pieces of functionality, extract a module-scope list for
    the latter two, and rename the local functions accordingly.
    chriskrycho committed May 4, 2023
    Configuration menu
    Copy the full SHA
    2287751 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    4bc5d73 View commit details
    Browse the repository at this point in the history
  4. Export built-in components as interfaces for Glint

    Instead of `typeof`, export `interface` types which can be merged with
    by Glint, and which are kept distinct from each other with the `Opaque`
    utility type, while preserving `OpaqueInternalComponentConstructor`.
    chriskrycho committed May 4, 2023
    Configuration menu
    Copy the full SHA
    22276b5 View commit details
    Browse the repository at this point in the history
  5. Mark internal Route details with @internal

    This does not affect type checking, but since theses items will now be
    exposed to consumers, at least explicitly signal via their docs (seen
    on hover etc.) that they should not be used.
    chriskrycho committed May 4, 2023
    Configuration menu
    Copy the full SHA
    b7a7a57 View commit details
    Browse the repository at this point in the history
  6. Fix typo in description of Opaque

    Co-authored-by: Dan Freeman <dfreeman@salsify.com>
    chriskrycho and dfreeman committed May 4, 2023
    Configuration menu
    Copy the full SHA
    ae6d85d View commit details
    Browse the repository at this point in the history
  7. Fix typo in comment explaining abstract class for helper

    Co-authored-by: Dan Freeman <dfreeman@salsify.com>
    chriskrycho and dfreeman committed May 4, 2023
    Configuration menu
    Copy the full SHA
    824a3b6 View commit details
    Browse the repository at this point in the history
  8. Provide default type for Signatures etc. in Ember NS

    Without these, anyone using them directly as a type will get a type
    error reporting that they are missing.
    chriskrycho committed May 4, 2023
    Configuration menu
    Copy the full SHA
    e572863 View commit details
    Browse the repository at this point in the history
  9. Explicitly type test fallback path for runloop bind

    This type test will let us know if we change that behavior, rather than
    indicating that it is the *desired* behavior.
    chriskrycho committed May 4, 2023
    Configuration menu
    Copy the full SHA
    19b31a3 View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    1038406 View commit details
    Browse the repository at this point in the history

Commits on May 5, 2023

  1. Publicly export FunctionBasedHelperInstance

    This abstract class -- specifically, its `protected abstract
    __concrete__` member -- prevents subclasses from doing `class X extends
    helper(..)`, since that is an error at runtime. While it is rare that
    people would type that, it is not impossible and we use this to give
    them early signal via the types for a behavior which will break (and in
    a somewhat inscrutable way!) at runtime.
    
    This is needful because we lie about what this actually is for Glint's
    sake: a function-based helper returns a `Factory<SimpleHelper>`, which
    is designed to be "opaque" from a consumer's POV, i.e. not
    user-callable or constructible but only useable in a template (or via
    `invokeHelper()` which also treats it as a fully opaque `object` from a
    type POV). But Glint needs a `Helper<S>` to make it work the same way
    as class-based helpers. (Note that this does not hold for plain
    functions as helpers, which it can handle distinctly.) This signature
    thus makes it so that the item is usable *as* a `Helper` in Glint, but
    without letting end users treat it as a helper class instance.
    
    Long-term, this entire construct can go away in favor of deprecating
    the `helper()` invocation in favor of using plain functions.
    chriskrycho committed May 5, 2023
    Configuration menu
    Copy the full SHA
    c725cdc View commit details
    Browse the repository at this point in the history
  2. Move @glimmer/* packages to dependencies

    This is one step along the path toward making Ember's `@glimmer/*`
    dependencies work as normal dependencies without pre-building them into
    an Ember distribution, but it is introduced *here* because consumers
    cannot use Ember's types as built from source without types from the
    many `@glimmer` packages Ember uses as part of both its internals and
    its public APIs.
    
    Moving these to `dependencies` will *not* change the build behavior: we
    will continue to pre-build Ember from these dependencies for now, so
    the actual output consumers receive should not be altered by this. The
    only change from a consumer's POV will be that they *do* get all the
    `@glimmer/*` packages as part of their installation of `ember-source`
    and therefore will be able to use the types. Later work can continue to
    tackle the broader build questions.
    chriskrycho committed May 5, 2023
    Configuration menu
    Copy the full SHA
    f3fa810 View commit details
    Browse the repository at this point in the history
  3. Move backburner.js and router_js to dependencies

    As with the `@glimmer/*` packages, these must be present for TS users
    to be able to use Ember's types as published from source, since those
    types explicitly depend on and in some cases directly re-export these.
    chriskrycho committed May 5, 2023
    Configuration menu
    Copy the full SHA
    f0e501d View commit details
    Browse the repository at this point in the history
  4. Move route-recognizer to dependencies

    As with the other packages moved this way (see immediately preceding
    commits), this must be in `dependencies` so that it is present for
    consumers to use its types.
    chriskrycho committed May 5, 2023
    Configuration menu
    Copy the full SHA
    4827457 View commit details
    Browse the repository at this point in the history

Commits on May 8, 2023

  1. Configuration menu
    Copy the full SHA
    164920b View commit details
    Browse the repository at this point in the history