-
Notifications
You must be signed in to change notification settings - Fork 142
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
Creating v2 addon guide #1107
Creating v2 addon guide #1107
Conversation
["@babel/plugin-proposal-decorators", { "legacy": true }], | ||
"@babel/plugin-proposal-class-properties" | ||
] | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why or why shouldn't we also ship compiled templates?
(for example: https://github.com/NullVoxPopuli/ember-addon-v2-typescript-demo/blob/main/my-addon/babel.config.cjs#L34-L39 )
const { precompile } = require('@glimmer/compiler');
// ...
resolve('babel-plugin-ember-template-compilation'),
{
precompile,
enableLegacyModules: ['ember-cli-htmlbars'],
},
],
by not compiling away the templates, apps have more work to do, yea?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because the compiled format is deeply tied to the exact ember version that's going to consume it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
gotchya, so this is probably only useful if you can guarantee that addons have the same ember version as apps 🤔
could be tricky
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be possible to make the wire format (the thing that you'd have if you use babel-plugin-ember-template-compilation) a stable public API, but somebody with knowhow would need to prioritize a little design work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! this is very detailed!
Please try it and give more feedback, but I'm merging so we have a starting point for more PRs. |
…ed to exact ember version, see: embroider-build/embroider#1107 (comment)
in ADDON-AUTHOR-GUIDE.md |
Yes, this is the same thing tested by the embroider-safe scenario provide by |
Maybe this makes it sound like there is a difference between |
This is the start of a guide on porting addons to v2 format.