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

Add full embroider compatibility #1463

Merged
merged 5 commits into from
Dec 6, 2021

Conversation

mydea
Copy link
Contributor

@mydea mydea commented Aug 18, 2021

This PR hopefully makes this addon fully embroider compatible.

Note that this relies on embroider-build/embroider#922 (or something along these lines) to be merged - see embroider-build/embroider#921 (in order for embroider compatibility to really work).

This is based on #1419 in many ways, but there have been a bunch of changes in the meanwhile, so it was somewhat easier to reproduce the changes than to deal with merge conflicts etc.

I also added some tests to ensure we keep supporting overwriting the default components (which would break with certain implementations, e.g. if we imported the default components in JS-land).

@mydea mydea force-pushed the fn/embroider-compatibility branch 3 times, most recently from 8ecbb5b to 16a0094 Compare August 20, 2021 07:37
@roomman
Copy link

roomman commented Nov 16, 2021

Would love to see this progress. 👍🏻

I was using this Webpack workaround but one of our projects uses power-select-multiple and that relies on dynamically setting @triggerComponent. 🤦🏻‍♂️

@mydea
Copy link
Contributor Author

mydea commented Dec 3, 2021

I rebased this on current master and resolved any new conflicts, should be "good" again!

@cibernox
Copy link
Owner

cibernox commented Dec 3, 2021

I managed to make CI a week ago, so if CI fails now I believe this time should be legitimate failures.

@mydea
Copy link
Contributor Author

mydea commented Dec 6, 2021

OK, I think the failing tests should be fixed now 🤞

@cibernox
Copy link
Owner

cibernox commented Dec 6, 2021

@mydea I see, so in embroider-land one can't pass a component name to the select and have the select call {{component @compName}} on it. It has to be passed in as a component from the outside from the beginning.

I assume that this is not a breaking change as it's a requirement for embroider.

CI is green now! Merging it

@cibernox
Copy link
Owner

cibernox commented Dec 6, 2021

I noticed that CI is not running embroider scenarios. I had to comment them because CI wouldn't pass. Can you add them back to ember-try.js and .github/workflows/ci.yml?

@mydea
Copy link
Contributor Author

mydea commented Dec 6, 2021

@mydea I see, so in embroider-land one can't pass a component name to the select and have the select call {{component @compName}} on it. It has to be passed in as a component from the outside from the beginning.

I assume that this is not a breaking change as it's a requirement for embroider.

CI is green now! Merging it

Yes, when passing something through like this you need to use {{component (ensure-safe-component @arg)}}, and it should be used by the user as @arg={{component 'my-component'}} instead of @arg='my-component'. The latter will still work in non-embroider land, so it should not be breaking (and I actually added a bunch of tests covering both scenarios). I'll need to see how I can make some of the tests optional in embroider, but that should be doable!

@cibernox
Copy link
Owner

cibernox commented Dec 6, 2021

Great! Merged!

@cibernox cibernox merged commit 3231bb2 into cibernox:master Dec 6, 2021
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

Successfully merging this pull request may close these issues.

3 participants