prysmex / ember-eui

Ember Components for Elastic Eui
https://ember-eui.vercel.app
53 stars 11 forks source link

Compatibility with ember 4.4+ #162

Closed nanuxbe closed 2 years ago

nanuxbe commented 2 years ago

Hello and thanks for the great work.

The unique-id helper was introduced in ember 4.4.0. As a result, trying to use @ember-eui/core produces the following error:

index.js:181 Uncaught Error: Assertion Failed: You attempted to overwrite the built-in helper "unique-id" which is not allowed. Please rename the helper.
    at assert (index.js:181:1)

I have tried to take a look and simply remove the helper but it would appear it is an integral aprt of the project.

Any idea on how to fix this?

betocantu93 commented 2 years ago

Hello! Good catch and question, I think we could add the unique id polyfill so people with say 3.28 stills gets the helper through it, but if I remember correctly we also use it on JS. Not sure if the RFC included an import from JS, if it doesn't we should rename ours and move it to utils, something like eui-unique-id and replace JS usage with this

nanuxbe commented 2 years ago

Yes, polyfill sounds like a good idea if possible. If not possible at all, another option would be to have a breaking release and keep 5.10 for 3.28 and 6.x for 4.4+ but I'm not sure it's a good idea.

I'll try to take a bit of time to look at the native unique-id and see how/if it can be imported directly in js.

betocantu93 commented 2 years ago

Yea that should be another way, a breaking release, the problem would be to keep backporting any fixes or features in further versions, so until 3.28 is no longer LTS I would favor polyfill IMHO

betocantu93 commented 2 years ago

@nanuxbe I end up pushing this commit forward, using guidFor for JS and also the polyfill, it should be fixed in v5.10.2

betocantu93 commented 2 years ago

Please let me know if anything else is stopping you, thanks for reporting!

nanuxbe commented 2 years ago

Thanks. I'm not sure I will have time to test it this week but I'll try. Next week I'll be attending a conference, s it might be next month that you hear back from me

betocantu93 commented 2 years ago

@nanuxbe have a great time on the conference!