-
Notifications
You must be signed in to change notification settings - Fork 5
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
Embroider optimized support #964
Conversation
042d14c
to
aa569af
Compare
import { Node as PNode } from 'prosemirror-model'; | ||
|
||
const emberNodeConfig: EmberNodeConfig = { | ||
name: 'image', | ||
componentPath: 'plugins/image/node', | ||
component: Image as unknown as ComponentLike, |
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 seems there are type conflicts between our components and the ComponentLike
type from @glint/template
. Not sure what is up exactly, maybe outdated type packages. More investigation is needed. I used this workaround for now since TS isn't my forte 😬.
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.
I read through this issue and it does sound like we are doing the right thing with using ComponentLike<any>
but I might be misunderstanding things.
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.
(I also asked in the discord, but haven't received a response yet.)
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.
Is the @glint/template
package only added for the ComponentLike type?
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 could be possible that the types included with ember 5.0 are compatible with the glint types?
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.
Is the @glint/template package only added for the ComponentLike type?
Yes, that seemed to be the recommended way to type use-cases like that.
It could be possible that the types included with ember 5.0 are compatible with the glint types?
Yea, possibly, I haven't tried, but those are also not available on older versions so I don't think we can use them yet?
c5f529d
to
053d6ae
Compare
Should I enable the |
ember-velcro uses the "nested" component structure where an index.js are located in the `app/components/velcro/` folder. This no longer seems to work for v2 addons. As a workaround we can import the component and invoke it directly. This is also a transition path to .gts files.
The component was renamed a while ago but there were still some remnants around that caused issues under Embroider.
This replaces the `componentPath` with a `component` argument. Users need to provide the component class instead of the path which makes the setup Embroider compatible.
053d6ae
to
e2324a3
Compare
We're still figuring out how we're gonna manage the ember-try scenarios with woodpecker, so leave it off for now |
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.
`Everything seems to work nicely, the embroider-optimized scenario succeeds. The API changes to ember-nodes are sensible :)
Overview
This should fix the remaining issues in #945 and make the addon fully Embroider "optimized" compatible.
connected issues and PRs:
Closes #945
Setup
How to test/reproduce
Run the embroider optimized scenario:
npx ember-cli try:one embroider-optimized
and the build should pass and the tests should succeed.If you want to run the dummy app you could run
npx ember-cli try:one embroider-optimized --skip-cleanup
instead and runEMBROIDER_TEST_SETUP_OPTIONS=optimized npm start
afterwards.Challenges/uncertainties
Checks PR readiness