-
Notifications
You must be signed in to change notification settings - Fork 603
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
feat: import @ember/polyfills assign conditionally #2538
Conversation
try { | ||
assign = importSync('@ember/polyfills').assign; | ||
} catch (error) { | ||
// Couldn't import @ember/polyfills | ||
// Doesn't exist in v5 | ||
} |
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 wraps importSync in try catch becasue dependencySatisfies
macro can't reliably work if the dependency isn't a direct dependency or a peer dependency.
Seems like ember-source
matching in addons misbehaves especially
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.
ember-source needs to be a peerDependency of this addon, I think. That should make it 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.
Thanks for the pointer 👍 , I also realized this later on but I did get some breakage under fastboot while working on mainmatter/ember-cookies#782
d830196
to
cb12c0f
Compare
I would recommend dropping |
I opened a PR to use Object.assign directly. I could add some documentation on how to add an Object.assign polyfill for IE11 if you'd like, but I think we're pretty safe not supporting IE11 at all. #2542 |
@RobbieTheWagner Ember as a framework dropped IE11 support with v4. And I'd intend do to the same. I'll try to resolve this in the coming days. Also I've been working on ember-cookies recently for the same reasons, since ESA uses it internally https://github.com/mainmatter/ember-cookies. Personally I'm also excited about the macros and resolving things this way, however mainmatter/ember-cookies#782 showed me that embroider/macros seem to not be working as I expected. |
I would argue that dropping older Ember versions isn't bad. They can always use older versions of this library. Supporting older Ember really holds a lot of addons back. |
@embroider/macros
to conditionally importassign
polyfill to support older and the newest ember versions.Should become obsolete once we decide to support only v4 and onwards where IE11 support is dropped.
Should go first #2537
Inspired by #2534