Skip to content

can.stache will import components it depends on #1387

@justinbmeyer

Description

@justinbmeyer

Related to #1386, can.stache templates should be able to import components and modules they depend on.

For example, if a stache template looks like:

<div><can-slider></can-slider></div>

It will be transpiled to import can-slider.

Also, a template might depend on helpers. These can be imported like:

<import from="my/helpers">

It's possible that a component's name doesn't match it's moduleName. We can also support the following:

<import from="components/slider" as="can-slider">
<can-slider></can-slider>

In this case can-slider will not be imported, only components/slider.

Other

  • This will only happen for templates loaded with the can/view/stache/system extension.
  • It's possible that we eventually support this happening with progressively loaded templates. However, can.view will need to support promises.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions