Skip to content

Add missing class member initializations found by TypeScript - #6910

Merged
sokra merged 1 commit into
webpack:masterfrom
mohsen1:more-inits
Apr 12, 2018
Merged

sokra merged 1 commit into
webpack:masterfrom
mohsen1:more-inits

Conversation

@mohsen1

@mohsen1 mohsen1 commented Mar 30, 2018

Copy link
Copy Markdown
Contributor

What kind of change does this PR introduce?
refactor

Did you add tests for your changes?
no

If relevant, link to documentation update:
n/a

Summary

As part of #6862 I'm adding class member initializers for properties that were added to class instances

Does this PR introduce a breaking change?

Other information

@webpack-bot

Copy link
Copy Markdown
Contributor

Thank you for your pull request! The most important CI builds succeeded, we’ll review the pull request soon.

@mohsen1

mohsen1 commented Mar 31, 2018

Copy link
Copy Markdown
Contributor Author

is that Codacy/PR Quality Review something I should look into?

@mohsen1

mohsen1 commented Apr 4, 2018 •

Copy link
Copy Markdown
Contributor Author

ping @sokra

Comment thread lib/Chunk.js Outdated
this.ids = null;
this.debugId = debugId++;
this.name = name;
this.removedModules = undefined;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This is not correct. A Chunk doesn't have this probably.

You probably found this in the HMR code. The template takes a Chunk | { id, modules, removedModules }. This is a kind of fake Chunk with this extra info.

super(options);
this.range = range;
this.valueRange = valueRange;
this.critical = undefined;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Can be removes as it's inherited from ContextDependency

class ChunkModuleIdRangePlugin {
constructor(options) {
this.options = options;
this.chunks = undefined;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This is incorrect.

Actually the usage of this.chunks below is incorrect. It should be compilation.chunks instead.

This happend probably while the migration from function to arrow function.

Better do a separate PR here, as we should also add tests for this.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Funny. I was doing a PR (#6954) while your comment popped 😅

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Great. @mohsen1 you can remove this from your PR.

@TheLarkInn

Copy link
Copy Markdown
Member

@mohsen1 since you have a bunch of these smaller PR's do you have any opposition to anyone taking them if they have small corrections? Happy to find some folks to help out here!

@mohsen1

mohsen1 commented Apr 9, 2018

Copy link
Copy Markdown
Contributor Author

@TheLarkInn I love to get help for this. Having all those initializations in one PR is not ideal. I like to have a pull request per class so we can discuss what's going on and why those initializations are necessary.

@TheLarkInn

TheLarkInn commented Apr 9, 2018 via email

Copy link
Copy Markdown
Member

@webpack-bot

Copy link
Copy Markdown
Contributor

@mohsen1 Thanks for your update.

I labeled the Pull Request so reviewers will review it again.

@sokra Please review the new changes.

@sokra sokra left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Rebased

@sokra
sokra merged commit eca7bad into webpack:master Apr 12, 2018
@sokra

sokra commented Apr 12, 2018

Copy link
Copy Markdown
Member

Thanks

mhegazy added a commit to mhegazy/webpack that referenced this pull request Apr 23, 2018
mhegazy added a commit to mhegazy/webpack that referenced this pull request Apr 23, 2018
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