Skip to content

Introduce @glint/environment-ember-loose #34

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 8 commits into from
Dec 9, 2020
Merged

Conversation

dfreeman
Copy link
Member

@dfreeman dfreeman commented Dec 9, 2020

This PR begins to address #23. While this isn't yet a complete implementation, it provides a core we can use to develop against while building out support for standalone template files elsewhere in glint.

Points of interest:

  • Environments can now specify information about how to handle standalone .hbs files, including what types module applies to them and how to map between templates and their backing scripts
  • An initial pass at mapping templates to backing scripts for this environment supports co-located and pod-based components, as those are trivial to map.
  • @glint/environment-ember-loose includes signatures for Glimmer components, Ember components and helpers, and ember-modifier modifiers. It doesn't handle controllers/routes yet (there are some potentially interesting design questions there), but those are an important aspect of today's Ember programming model, so eventually that needs to be accounted for.
  • Class-based helpers currently can't implement compute in a typesafe way without clashing with the upstream definition in @types/ember__component. This is similar to the problem we have in Figure out the shape of component type parameters #25 where we want to capture more type information than the base class is currently interested in. One short-term option might be for the environment to include re-exports of the upstream base classes cast to the appropriate types, but for now we just have @ts-expect-error
  • A handful of Ember-specific intrinsics are currently set up (action, each-in, link-to, log), as well as the core keywords defined in @glint/template, but many more remain to be added.

@dfreeman dfreeman added the enhancement New feature or request label Dec 9, 2020
@dfreeman dfreeman merged commit af7a72d into master Dec 9, 2020
@dfreeman dfreeman deleted the environment-ember-loose branch December 9, 2020 18:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant