alexlafroscia / ember-cli-stencil

Automatic discovery of Stencil.js components for your Ember application
26 stars 7 forks source link

Import Stencil packages through ESM #6

Closed alexlafroscia closed 5 years ago

alexlafroscia commented 6 years ago

Importing the packages through ESM will leverage ember-auto-import under the hood, although that addon can be "hidden" from the user by importing the right Babel config through the addon to enable dynamic imports.

This does mean that the user will need to import the package themselves, for example:

import { defineCustomElements } from 'whatever-stencil-bundle';
defineCustomElements(window);

I tend to like it when Ember addons can abstract away behavior like this, but on the other hand, I also like keeping it explicit -- especially if things change for Stencil in the future and the definition behavior is different later on. ember-cli-stencil would be totally decoupled from that, which might be a benefit.

Closes #5


There are currently a few issues blocking this PR: