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

[DRAFT/WIP] Publish stable types #20234

Closed
wants to merge 5 commits into from
Closed

Commits on Oct 26, 2022

  1. Prove out basic stable type generation

    This isn't remotely ready for primetime, but it does prove out the
    basic viability of @chadhietala's suggestion that we may not need to
    fix all the circularities before we can publish. We in fact can just
    publish as is: none of the circularities are *hard* blockers, at least
    for *this* part of the effort (though they will be for getting docs
    published with these as the source of truth).
    
    The things we will need to do to be able to execute the rest of the way
    on this, given our goals:
    
    - Fix a couple cases where we are using private names in public types,
      specifically around the `OWNER` from `@glimmer/owner`.
    
    - Put the hacky `generate-tsconfigs.mjs` script somewhere besides the
      root, expand its capabilities to include wrapping generated modules
      in a `declare module` statement and running Prettier on the result,
      and rename it accordingly.
    
    - Land @wagenet's in-progress PR (#20175) to convert the `ember`
      package to TS so we can publish types for it, which will unblock some
      of the other Ember packages as well.
    
    - Properly exclude the parts of Ember's APIs we *don't* want to be
      publishing (all the purely-internal and private stuff).
    chriskrycho committed Oct 26, 2022
    Configuration menu
    Copy the full SHA
    b2deb48 View commit details
    Browse the repository at this point in the history
  2. Refactor tsconfigs to share compiler options

    This lets each config specify *only* how it actually does a build (or
    not!), while sharing the config explicitly.
    chriskrycho committed Oct 26, 2022
    Configuration menu
    Copy the full SHA
    2580235 View commit details
    Browse the repository at this point in the history

Commits on Oct 27, 2022

  1. Avoid exposing OWNER from @glimmer/owner

    There are pre-existing runtime shenanigans in `@ember/object/internals`
    to add debug-only errors to the class in dev builds. Those runtime
    shenanigans produce the need for type-level shenanigans to match: TS
    gets stuck here because the runtime shenanigans declare
    `FrameworkObject` with a class expression (rather than the usual class
    declaration form). That in turn means TS needs to be able to fully name
    the type produced by the clsas expression, which includes the `OWNER`
    symbol from `@glimmer/owner`.
    
    By explicitly giving the declaration a type when assigning it the class
    expression, instead of relying on inference, TS no longer needs to name
    the `OWNER` property key from the super class, eliminating the private
    name shenanigans.
    
    Co-authored-by: Dan Freeman <dfreeman@salsify.com>
    chriskrycho and dfreeman committed Oct 27, 2022
    Configuration menu
    Copy the full SHA
    98677d5 View commit details
    Browse the repository at this point in the history
  2. Introduce tsconfig dir for shared/non-root configs

    - Add `.gitattributes` so GH will syntax highlight it correctly.
    - Improve the naming, so: `tsconfig/compiler-options.json` etc.
    chriskrycho committed Oct 27, 2022
    Configuration menu
    Copy the full SHA
    cabeb32 View commit details
    Browse the repository at this point in the history

Commits on Oct 28, 2022

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