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

Convert packages/ember to TS #20175

Merged
merged 2 commits into from
Oct 28, 2022
Merged

Conversation

wagenet
Copy link
Member

@wagenet wagenet commented Aug 30, 2022

No description provided.

@chriskrycho chriskrycho self-assigned this Sep 15, 2022
@chriskrycho chriskrycho added the TypeScript Work on Ember’s types label Sep 15, 2022
@chriskrycho
Copy link
Contributor

When I look to repro locally, I don't even get as far as the failures which show up in CI; it fails on @ember/debug. In fish:

$ env TEST_SUITE=package PACKAGE="@ember/debug" yarn test

chriskrycho added a commit that referenced this pull request Oct 26, 2022
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

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 added a commit that referenced this pull request Oct 26, 2022
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 added a commit that referenced this pull request Oct 26, 2022
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).
While we might be able to make the change over to using native getters
and setters in a future PR, we want this change to be exactly and only
a type conversion, exactly preserving the previous behavior. Switching
back to using `Object.defineProperty()` for the getters and setters
defined on the `Ember` namespace preserves the previous behavior, which
our tests correctly caught for us!
@chriskrycho chriskrycho merged commit ccb5d40 into emberjs:master Oct 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
TypeScript Work on Ember’s types
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants