Make private modules clearly private #74
Merged
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.
Overview
This change looks large but is mainly moving blocks of text between files. The primary goal is to make it explicit in
@glint/template
and the environment packages when a module is meant to be considered an implementation detail.Details
In the case of
@glint/template
I also took this as an opportunity to rationalize the layout and prune some long-outdated comments, as the contents of that package have evolved in a very piecemeal way over time.While every module in
@glint/template
is now nested under-private
, there are three main entrypoints for other Glint packages:@glint/template/-private/dsl
contains the translated template DSL used by the output of@glint/transform
that environment packages re-export with their own additions/tweaks@glint/template/-private/keywords
contains the definition of shared keywords like{{#let}}
that are relevant to any environment@glint/template/-private/integration
contains the types necessary to declare how a class or other entity integrates with Glint's template layer (previously these types were scattered throughout, making such declarations a rat's nest of random imports)For the environment packages, I shifted their DSL types and the environment definitions themselves under
-private
. Forember-loose
, this also meant moving theregistry
module out into the package root, which is a nicer import anyway I think.