Skip to content

Introduce environments #9

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
Jul 31, 2020
Merged

Introduce environments #9

merged 9 commits into from
Jul 31, 2020

Conversation

dfreeman
Copy link
Member

Overview

Up to now, @glint/template contained a kind of hodge-podge of knowledge about keywords and globals available in different contexts (GlimmerX vs Glimmer.js vs Ember etc), while @glint/cli and @glint/tsserver-plugin were both hard-coded to look for @glimmerx/component in a module to determine whether to attempt template transformation.

This PR introduces the notion of an environment that a given project is targeting. An environment specifies information used in transforming templates (such as where to look for tag imports from) as well as exposing signatures for the available keywords/globals and determining how userspace entities (like components and custom helpers) interact with the type system.

Down the line, if we consider things like supporting current Ember idioms, environments may also influence things like whether templates can "see" in-scope identifiers or not.

Notes

  • A .glintrc file is now required in order to determine the active environment for a project
  • Code emitted @glint/transform no longer references @glint/template, but rather the configured environment (which likely re-exports a number of types from @glint/template)
  • The tests for @glint/cli and @glint/tsserver-plugin now stage their test apps under test-packages/ephemeral rather than in system tmp, as package resolution starts to get wonky otherwise (PnP would be the 'real' solution for this... someday 😭)
  • A refactoring of @glint/template (its exports, not its internals) is likely coming, but not something that needs to be tangled up with this
  • Some of the docs in the README are no longer quite accurate with this change, but I have a larger refactoring there (in particular, breaking it out into more consumable chunks) brewing, so I'm leaving it as-is for now

@dfreeman dfreeman added the breaking A breaking change label Jul 31, 2020
@dfreeman dfreeman merged commit e28cbc6 into master Jul 31, 2020
@delete-merged-branch delete-merged-branch bot deleted the environments branch July 31, 2020 17:57
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.

1 participant