Skip to content
This repository has been archived by the owner on May 29, 2019. It is now read-only.

Conversation

joshwiens
Copy link
Member

@joshwiens joshwiens commented Jun 12, 2017

  • Apply webpack-defaults tooling updates
  • Apply webpack-defaults grammar updates
  • Apply webpack-defaults style updates
  • Convert existing tests to Jest from Mocha

The desired effect here is to update style & grammar without changing the way etwp works.

Note, this is being merged into #540 making this refactoring etwp & webpack v3 only

Closes #477

@codecov
Copy link

codecov bot commented Jun 12, 2017

Codecov Report

Merging #542 into feature/webpack3 will decrease coverage by 2.59%.
The diff coverage is 87.37%.

Impacted file tree graph

@@                 Coverage Diff                 @@
##           feature/webpack3     #542     +/-   ##
===================================================
- Coverage             89.97%   87.37%   -2.6%     
===================================================
  Files                     4        7      +3     
  Lines                   349      301     -48     
  Branches                 73       68      -5     
===================================================
- Hits                    314      263     -51     
- Misses                   35       36      +1     
- Partials                  0        2      +2
Impacted Files Coverage Δ
src/cjs.js 0% <0%> (ø)
src/lib/OrderUndefinedError.js 14.28% <14.28%> (ø)
src/lib/ExtractedModule.js 88.57% <88.57%> (ø)
src/loader.js 88.7% <88.7%> (ø)
src/index.js 89.62% <89.62%> (ø)
src/lib/helpers.js 89.74% <89.74%> (ø)
src/lib/ExtractTextPluginCompilation.js 90.9% <90.9%> (ø)
... and 4 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 92e4349...decd7b9. Read the comment docs.

@joshwiens joshwiens force-pushed the d3viant0ne/feature/webpack3/webpack-defaults branch from ae7168b to 960bc93 Compare June 12, 2017 12:01
src/index.js Outdated
before = [before];
}
options = mergeOptions({ omit: before.length, remove: true }, options);
delete options.loader;
Copy link
Member

@michael-ciniawsky michael-ciniawsky Jun 12, 2017

Choose a reason for hiding this comment

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

src/index.js Outdated
delete options.loader;
delete options.use;
delete options.fallback;
delete options.fallbackLoader;
Copy link
Member

Choose a reason for hiding this comment

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

*

src/index.js Outdated
} else {
validateOptions(path.resolve(__dirname, './schema/loader.json'), options, 'Extract Text Plugin (Loader)');
}
let loader = options.use || options.loader;
Copy link
Member

Choose a reason for hiding this comment

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

*

+ options.use
- options.use || options.loader

src/index.js Outdated
validateOptions(path.resolve(__dirname, './schema/loader.json'), options, 'Extract Text Plugin (Loader)');
}
let loader = options.use || options.loader;
let before = options.fallback || options.fallbackLoader || [];
Copy link
Member

Choose a reason for hiding this comment

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

*

+ options.fallback || []
- options.fallback || options.fallbackLoader || []

src/index.js Outdated
' fallback: string | object | loader[]\n' +
' publicPath: string\n');
}
if (options.fallbackLoader) {
Copy link
Member

Choose a reason for hiding this comment

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

*

-   if (options.fallbackLoader) {
-      console.warn('fallbackLoader option has been deprecated - replace with "fallback"');
-   }

src/index.js Outdated
if (options.fallbackLoader) {
console.warn('fallbackLoader option has been deprecated - replace with "fallback"');
}
if (options.loader) {
Copy link
Member

Choose a reason for hiding this comment

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

*

-   if (options.loader) {
-      console.warn('loader option has been deprecated - replace with "use"');
-   }

Copy link
Contributor

@bebraw bebraw left a comment

Choose a reason for hiding this comment

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

Check module.exports. Apart from that looks ok to me.

src/index.js Outdated

export default ExtractTextPlugin;

ExtractTextPlugin.prototype.mergeNonInitialChunks = function (chunk, intoChunk, checkedChunks) { // eslint-disable-line func-names
Copy link
Member

Choose a reason for hiding this comment

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

Why ain't this methods in the class with class method syntax?

src/index.js Outdated
return source;
};

ExtractTextPlugin.extract = ExtractTextPlugin.prototype.extract.bind(ExtractTextPlugin);
Copy link
Member

Choose a reason for hiding this comment

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

This can be a static method. This way it's also correct but difficult to understand

}

export function isFunction(a) {
return isType('Function', a);
Copy link
Member

Choose a reason for hiding this comment

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

why not typeof a === "function"?


var cases = process.env.CASES ? process.env.CASES.split(",") : fs.readdirSync(path.join(__dirname, "cases"));

describe("TestCases", function() {
describe("Webpack Integration Tests", function() {
cases.forEach(function(testCase) {
Copy link
Member

Choose a reason for hiding this comment

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

spacing in this file is inconsistent

@joshwiens
Copy link
Member Author

Thanks Tobias, I'll get everything updated this evening.

@joshwiens joshwiens force-pushed the d3viant0ne/feature/webpack3/webpack-defaults branch from 26c5949 to 9262804 Compare June 20, 2017 21:47
@joshwiens joshwiens merged commit 3e78452 into webpack-contrib:feature/webpack3 Jun 21, 2017
@joshwiens joshwiens deleted the d3viant0ne/feature/webpack3/webpack-defaults branch June 21, 2017 01:40
joshwiens added a commit that referenced this pull request Jun 23, 2017
- refactor: Migrate extracted module to lib
- refactor: Migrate order undefined to lib
- refactor: Extract etwp helper functions
- refactor: Extract compilation to stand alone class
- refactor: Proxy plugin module from cjs.js

- refactor: Modernize loader syntax
  - Convert to ES6+ Class
  - Convert to ES6+ default export
  - Convert to const / let
  - Uses import syntax
  - Convert errors to templates

- refactor: Convert tests & configs to import syntax
- refactor: Use indexOf in helpers

- refactor: Modernize plugin syntax
  - Convert to ES6+ Class
  - Convert to ES6+ default export
  - Convert to const / let
  - Uses import syntax
  - Convert errors to templates

- refactor: Modernize ExtractedModule syntax
  - Convert to ES6+ Class
  - Convert to ES6+ default export
  - Convert to const / let
  - Uses import syntax
  - Convert errors to templates

- refactor: Removes fallbackLoader & loader deprecation warnings

- refactor: Removes single option deprecation warning

- refactor: Removes options.loader & options.fallbackLoader

 BREAKING CHANGE: Enforces `peerDependencies` of `"webpack": ">= 3.0.0-rc.0 || ^3.0.0"`.

 BREAKING CHANGE: Enforces `engines` of `"node": ">=4.3.0 < 5.0.0 || >= 5.10`
joshwiens added a commit that referenced this pull request Jul 10, 2017
- refactor: Pass a unique compiler name to get child compilation [483](#483)
- refactor: Apply webpack-defaults [542](#542)

BREAKING CHANGE: Enforces `engines` of `"node": ">=4.3.0 < 5.0.0 || >= 5.10`

- refactor: DeprecationWarning: Chunk.modules [543](#543)

BREAKING CHANGE: Updates to `Chunk.mapModules`. This release is not backwards compatible with `Webpack 2.x` due to breaking changes in webpack/webpack#4764

- fix: css generation order issue see: webpack/webpack#5225

BREAKING CHANGE: Enforces `peerDependencies` of `"webpack": "^3.1.0"`.
@joshwiens joshwiens self-assigned this Aug 13, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants