Closed
Conversation
f41d653 to
aaf69bd
Compare
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).
This lets each config specify *only* how it actually does a build (or not!), while sharing the config explicitly.
aaf69bd to
2580235
Compare
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>
Contributor
Author
|
The remaining emit error is blocked on #20175. There are at least two other issues flagged up by CI here:
|
- Add `.gitattributes` so GH will syntax highlight it correctly. - Improve the naming, so: `tsconfig/compiler-options.json` etc.
07ffa17 to
cabeb32
Compare
Contributor
Author
|
Superseded by the actual implementation at #20275, which used the ideas from this but basically none of its implementation! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This isn't quite ready for prime time yet, 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:
OWNERfrom@glimmer/owner.generate-tsconfigs.mjsscript somewhere besides the root, expand its capabilities to include wrapping generated modules in adeclare modulestatement and running Prettier on the result, and rename it accordingly.emberpackage to TS so we can publish types for it, which will unblock some of the other Ember packages as well.An open question: do we want to try to properly exclude the private and internal parts of Ember's APIs? Publishing them may actually be preferable and even to some degree necessary for (officially-maintained) "collaborator" libraries which use private APIs.