Skip to content

Make private modules clearly private #74

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

Merged
merged 9 commits into from
Mar 19, 2021
Merged

Make private modules clearly private #74

merged 9 commits into from
Mar 19, 2021

Conversation

dfreeman
Copy link
Member

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. For ember-loose, this also meant moving the registry module out into the package root, which is a nicer import anyway I think.

@dfreeman dfreeman added the breaking A breaking change label Mar 19, 2021
Copy link
Member

@jamescdavis jamescdavis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💯

@dfreeman dfreeman merged commit c3e3c24 into master Mar 19, 2021
@dfreeman dfreeman deleted the privatize branch March 19, 2021 20:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking A breaking change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants