aurelia / new

The Aurelia 2 scaffolding repo used by our tools to setup new projects.
MIT License
35 stars 18 forks source link

feat: basic skeleton for Aurelia 2 plugin project #63

Closed 3cp closed 3 years ago

3cp commented 3 years ago

This is ready for early testing. Use:

npx makes aurelia/new#plugin-skeleton

Then either choose a default plugin or customise a plugin. The result project has some explanation in readme file on how to consume the plugin.

Known issue: If plugin project is compiled using non-shadow-dom setup, the style applied to the custom element inside the plugin would NOT work properly in app built with shadow-dom.

For example, in app's my-app.html template, you try to use an custom-element provided by a plugin

<!-- any element html template in the app creates a shadow-dom boundry -->
<!-- if the plugin element has global style (not ShadowDOM style), it would not
get applied to the following element inside a shadow-dom boundry -->
<some-plugin-element-with-style></some-plugin-element-with-style>
3cp commented 3 years ago

@bigopon @EisenbergEffect see the above issue for plugin's css style. Maybe we should recommend plugin authors to always use ShadowDOM mode for plugin? We certainly need to use shadow-dom as the default option for plugin project.

bigopon commented 3 years ago

Let's go with shadow DOM as default recommendation, with some heading that reminds folks this could cause friction, and let folks choose how to distribute/enforce the usage of their plugins.