Skip to content
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

Document Addon authoring under v2 spec #191

Open
mehulkar opened this issue Jul 21, 2020 · 4 comments
Open

Document Addon authoring under v2 spec #191

mehulkar opened this issue Jul 21, 2020 · 4 comments

Comments

@mehulkar
Copy link
Contributor

As mentioned by @ef4 in emberjs/rfcs#578 (comment), one of the next steps towards modernizing Ember CLI's build system is teaching Addon authors how to convert their addons to be in native v2 spec.

Some of this is described here: https://github.com/embroider-build/embroider/blob/v0.19.0/ADDON-AUTHOR-GUIDE.md#support-level-embroider-native, but we need this documentation in the CLI Guides in a more official format.

@rwjblue
Copy link
Contributor

rwjblue commented Jul 22, 2020

I think the main blocker here is providing a shim layer that addon authors can use in order to author their addons that can be consumed by both Embroider and classic Ember CLI build pipeline. I believe that the Embroider folks (I have spoken to both @ef4 and @thoov about this fairly recently) are planning this work, but I'm not sure of the timeline. Once that shim layer exists (and is tested) ember-cli will make ember addon foo emit an addon in that format.

In the meantime, we could totally document (for addon authors) how to test their addons with Embroider (to ensure they are generally compatible). @kiwiupover recently mentioned this in a FastBoot meeting, and referenced this PR where he added some Embroider tests evoactivity/ember-svg-jar#160. Documenting that kind of thing in the addon author section of these guides seems like a reasonable next step.

@mehulkar
Copy link
Contributor Author

Yeah I saw that @simonihmig had gotten it running in ember-bootstrap as well: ember-bootstrap/ember-bootstrap#930.

I think the main blocker here is providing a shim layer that addon authors can use in order to author their addons that can be consumed by both Embroider and classic Ember CLI build pipeline.

So is it correct to say that addons can not be written in v2 until this shim is ready?

In the meantime, we could totally document (for addon authors) how to test their addons with Embroider

I'll get this started! @jenweber, I noticed there's a blank testing.md page (added in #40): https://github.com/ember-learn/cli-guides/blob/master/guides/writing-addons/testing.md. It seems kind of hidden away, but is that a good place to put this content?

@rwjblue
Copy link
Contributor

rwjblue commented Jul 22, 2020

So is it correct to say that addons can not be written in v2 until this shim is ready?

Yes, that is essentially true, though concretely it is probably possible to author an addon that only works with Embroider (e.g. is not compatible with apps that use the classic build system) but I don't think any of us really think it is a good idea to bifurcate (especially when we legitimately think the shim layer will be straight forward and fully compatible).

@ef4
Copy link

ef4 commented Jul 22, 2020

though concretely it is probably possible to author an addon that only works with Embroider

Yeah, in practice even this is hard, because you're always going to have some v1 addons in the build, and those addons want to see the traditional instance of EmberApp, and the EmberApp wants to see traditional instances of all the addons, so at that point your v2 addon really needs to be able to present itself as v1.

I have time booked this afternoon to work on writing down the remaining TODOs for getting this working.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants