Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Update ember-cli-babel to v7.x and use native Error instead of EmberError #433

Merged
merged 4 commits into from Mar 3, 2019
Merged

Update ember-cli-babel to v7.x and use native Error instead of EmberError #433

merged 4 commits into from Mar 3, 2019

Conversation

boris-petrov
Copy link
Contributor

Fixes #431.

Copy link
Member

@Turbo87 Turbo87 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

due to the modified Ember CLI version requirement and the base class change this should be considered a breaking change and requires a major version bump

@alexlafroscia please confirm that this is okay with you. I would merge, but I don't have the necessary npm permissions so I wouldn't be able to release anyway 😉

import EmberError from '@ember/error';

export class AjaxError extends EmberError {
export class AjaxError extends Error {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

to be a bit more verbose here: Ember 3.8 changed EmberError to no longer be an Error subclass, but instead reexport Error. Babel 6 can't deal with extending native classes, but Babel 7 can. Babel 7 does not detect that it needs to do that though because of the reexport.

Since the bump to ember-cli-babel@7 and the corresponding change in the minimum Ember CLI requirements require a major version bump anyway it seems fine to change the base class here to a regular Error too.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you just solved why we couldn't figure out subclassing with that change properly in ember-data (not detecting the native class due to re-export)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

happy to help 😉

@Turbo87
Copy link
Member

Turbo87 commented Mar 3, 2019

merging now as it will fix the CI issues and unblock the other PRs

@alexlafroscia if you don't have time for it right now, I'm happy to handle the release, just need the npm permissions 😉

@Turbo87 Turbo87 merged commit 1f83ff6 into ember-cli:master Mar 3, 2019
@Turbo87 Turbo87 changed the title Update ember-cli-babel to version 7 Update ember-cli-babel to v7.x and use native Error instead of EmberError Mar 3, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants