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

refactor(es6): refactor PrefetchPlugin to ES6 class #3665

Merged
merged 4 commits into from
Jan 1, 2017
Merged

refactor(es6): refactor PrefetchPlugin to ES6 class #3665

merged 4 commits into from
Jan 1, 2017

Conversation

naknode
Copy link

@naknode naknode commented Jan 1, 2017

What kind of change does this PR introduce?

Refactor (ES5 => ES6)

Did you add tests for your changes?

No functionality was edited. Tested with webpack@2.2.0-rc.3!

If relevant, link to documentation update:

N/A

Summary

This is my first OSS contribution ever. Saw that this dependency needed some ES6 care... so I gave it some.

Does this PR introduce a breaking change?

Nope.

@jsf-clabot
Copy link

jsf-clabot commented Jan 1, 2017

CLA assistant check
All committers have signed the CLA.

});
compiler.plugin("make", (compilation, callback) => {
compilation.prefetch(this.context || compiler.context, new PrefetchDependency(this.request), callback);
}.bind(this));
Copy link
Member

Choose a reason for hiding this comment

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

I think bind(this) is unnecessary.

Copy link
Author

Choose a reason for hiding this comment

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

Thanks. Glad you caught that.

forgot to take out the params at the top of the class
class PrefetchPlugin {

constructor(context, request) {
if(!this.request) {
Copy link
Member

Choose a reason for hiding this comment

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

This is always true

Copy link
Author

Choose a reason for hiding this comment

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

@Kovensky What was your procedure to check?

Copy link
Member

Choose a reason for hiding this comment

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

Nothing, really; I just noticed while reading the code.

Looking at the original also shows it was request instead of this.request :)

Copy link
Author

Choose a reason for hiding this comment

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

I made my first commit at 4AM :-) May be why! Thank you

@TheLarkInn TheLarkInn merged commit 9c5b6c5 into webpack:master Jan 1, 2017
@TheLarkInn
Copy link
Member

Thanks. Congrats on first PR. :-D 😍 🤗

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.

6 participants