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

Replace "klassy" with ES6 classes #183

Merged
merged 13 commits into from
Nov 27, 2016
Merged

Replace "klassy" with ES6 classes #183

merged 13 commits into from
Nov 27, 2016

Conversation

Turbo87
Copy link
Member

@Turbo87 Turbo87 commented Nov 22, 2016

@rwjblue
Copy link
Member

rwjblue commented Nov 22, 2016

Will take some time to do a more thorough review, but I definitely approve the effort (and from prior conversations with @dgeb I believe he does as well).

@Turbo87
Copy link
Member Author

Turbo87 commented Nov 22, 2016

💚 ... thanks Travis :)

@dgeb
Copy link
Member

dgeb commented Nov 22, 2016

Yeah, Klassy is a lib I will gladly retire. Thanks @Turbo87.

setupContext() {
this._super({ application: this.createApplication() });
},
super({ application: this.createApplication() });
Copy link
Member

Choose a reason for hiding this comment

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

This should be super.setupContext (bare super is only valid in constructor).


teardownContext() {
Ember.run(() => {
getContext().application.destroy();
});

this._super();
},
super();
Copy link
Member

Choose a reason for hiding this comment

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

Should be super.teardownContext

setupContext: function() {
this._super.call(this);
setupContext() {
super();
Copy link
Member

Choose a reason for hiding this comment

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

bare super is only valid in constructor

@@ -93,7 +95,7 @@ export default AbstractTestModule.extend({
return container.lookupFactory(subjectName);
};

this._super({
super({
Copy link
Member

Choose a reason for hiding this comment

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

bare super is only valid in constructor

var subjectName = this.subjectName;
var container = this.container;

var factory = function() {
return container.lookupFactory(subjectName);
};

this._super({
super({
Copy link
Member

Choose a reason for hiding this comment

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

bare super is only valid in constructor

Copy link
Member Author

Choose a reason for hiding this comment

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

ouch, forgot about that... thanks!

@Turbo87
Copy link
Member Author

Turbo87 commented Nov 25, 2016

@rwjblue done!

Copy link
Member

@rwjblue rwjblue left a comment

Choose a reason for hiding this comment

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

We will need to update ember-cli-qunit / ember-qunit and ember-cli-mocha / ember-mocha to prevent them from erroring (which I think makes this a major version bump, but that seems fine to me).

i.e.:

In the long run, I suspect that we should probably rethink our publishing to make it easier to avoid this sort of silly coupling but that seems fine for a future refactor to me...

@Turbo87
Copy link
Member Author

Turbo87 commented Nov 26, 2016

@rwjblue I do agree that those need updates to remove klassy, but I don't see why they would error? The way I see it we would just include an unnecessary dependency if we didn't update them, but everything should still be running the same way as before.

@Turbo87
Copy link
Member Author

Turbo87 commented Nov 26, 2016

also I tend to say that klassy is an implementation detail and as such private API so no need for a major version bump, but we obviously will have to test whether the new ember-test-helpers version would run smoothly with older testing libs like ember-cli-qunit.

@rwjblue
Copy link
Member

rwjblue commented Nov 26, 2016

I don't see why they would error?

When this PR lands the klassy dep will no longer be present, those calls to resolve.sync('klassy', { baseDir: emberTestHelpersPath }) will begin to error out.

@rwjblue
Copy link
Member

rwjblue commented Nov 26, 2016

I tend to say that klassy is an implementation detail and as such private API

I agree in general.

no need for a major version bump

Disagree, for the reason mentioned above. I believe that existing versions of ember-qunit / ember-cli-qunit will error after a rm -rf node_modules && npm install.

@Turbo87
Copy link
Member Author

Turbo87 commented Nov 26, 2016

I believe that existing versions of ember-qunit / ember-cli-qunit will error after a rm -rf node_modules && npm install.

I just tried it on a fresh app with npm link ember-test-helpers and both testing libs and didn't see any errors

@rwjblue
Copy link
Member

rwjblue commented Nov 26, 2016

I don't this npm link is good enough. You would need to ensure there is no version of klassy present in node_modules (which would not be the case if you installed normally then npm linked).

@Turbo87
Copy link
Member Author

Turbo87 commented Nov 27, 2016

You would need to ensure there is no version of klassy present in node_modules (which would not be the case if you installed normally then npm linked).

you're right, I'm stupid... I see how this would break now. Since klassy was a dependency of ember-test-helpers and not of ember-cli-qunit the resolver call would fail. Since we're sub-1.0 this will only require a minor version bump though to comply with semver.

@rwjblue
Copy link
Member

rwjblue commented Nov 27, 2016

Since we're sub-1.0 this will only require a minor version bump though to comply with semver.

Ya. I was thinking 0.6.0 (I sometimes incorrectly refer to this as a "major" bump when sub 1.0, but what I'm really meaning is that we need to not match for users with ^0.5.x).

@rwjblue rwjblue merged commit da6fa99 into emberjs:master Nov 27, 2016
@Turbo87 Turbo87 deleted the classes branch November 27, 2016 14:27
@Turbo87
Copy link
Member Author

Turbo87 commented Nov 27, 2016

🎉

will adjust the other libs to account for this change later today unless someone else beats me to it 😉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants