Skip to content

webpack 4 merge - #5660

Merged
sokra merged 757 commits into
masterfrom
next
Feb 13, 2018
Merged

sokra merged 757 commits into
masterfrom
next

Conversation

@sokra

@sokra sokra commented Sep 11, 2017

Copy link
Copy Markdown
Member

No description provided.

Comment thread examples/side-effects/README.md Outdated
``` javascript
{
"name": "big-module-with-flag",
"side-effects": false

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

it seems odd to use "side-effects" kebab case inside of package.json which is typically camelCased (e.g. devDependencies)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

(not a big deal, just an observation. I love this change!)

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.

I think this is a good idea @sokra, we probably want to normalize.

Unless we are wanting to call out this is a webpack specific item.

@TheLarkInn

Copy link
Copy Markdown
Member

Alright this is looking much closer then it was initially.

@sokra:
* what remaining issues do we have (if you have their issues) remaining to cut a RC for 4.

@d3viant0ne: We should get a quick and dirty interop map for v4 and what plugins and loaders break via use.

@andreicek: We are pretty darn close to being able to use webpack-canary. I wonder if we can strap up canary for v4 against all loaders and plugins in webpack-contrib.

@andreicek

Copy link
Copy Markdown

We are pretty darn close to being able to use webpack-canary. I wonder if we can strap up canary for v4 against all loaders and plugins in webpack-contrib.

As discussed over slack - @DarkoKukovec and myself will start on adding webpack-canary to the webpack core and start testing contrib packages that have an exmaple folder first, afterwards we'll either open an issue or add an example folder ourselves on contrib repos that are not yet eligible.

@dzearing

dzearing commented Sep 29, 2017 •

Copy link
Copy Markdown

Found a pretty bad bug with the tree shaking using side-effects: false and slimmed down the repro. The repro occurs when a file is blank or only contains comments, and is exported using * export from the index of a library.

Here's a basic setup that I got reproing. I'm not completely sure i can distill a simpler repro. both app and my-library are "side-effects": false.

If you comment out the blank.js export from my-library / index.js, then the foo module shows up in the final bundle. But when it's included a bunch of the modules don't show up in the bundle! There are references to them, but they're missing.

app / index.js:

import { foo } from './MyLibrary';
console.log(foo);

app / MyLibrary.js

import * from 'my-library';

my-library / index.js:

export * from './foo.js'
export * from './blank.js'

my-library / foo.js:

export const foo = 'i am foo';

my-library / blank.js:

// Blank

When I comment out the blank.js export, I see the "i am foo" string in the output:

([
/* 0 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
/* harmony import */ var _TestLibrary__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1);

console.log(_TestLibrary__WEBPACK_IMPORTED_MODULE_0__["a" /* foo */]);


/***/ }),
/* 1 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return foo; });
const foo = 'i am foo';


/***/ })
/******/ ]);

When blank.js is exported, I see this:

([
/* 0 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
/* harmony import */ var _TestLibrary__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1);

console.log(_TestLibrary__WEBPACK_IMPORTED_MODULE_0__["foo"]);


/***/ }),
/* 1 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony import */ var test_library__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2);
/* harmony reexport (checked) */ if(__webpack_require__.o(test_library__WEBPACK_IMPORTED_MODULE_0__, "foo")) __webpack_require__.d(__webpack_exports__, "foo", function() { return test_library__WEBPACK_IMPORTED_MODULE_0__["foo"]; });




/***/ })
/******/ ]);

@joshwiens

joshwiens commented Sep 29, 2017 •

Copy link
Copy Markdown
Contributor

@TheLarkInn - All of the repos that have already been converted to defaults ( all the heavy use libs ) run a canary test suite on NodeJS v8 on the webpack master branch.

We can switch that to a convention that doesn't require the code to land in the master branch as long as we can come up with some sort of convention we are all going to stick to.

I'd personally leave it on this branch & start publishing to an @next tag for a few weeks so the community has ample time to upgrade & beat on it for a while before it's in master & makes 3.x maintenance more complicated.

what remaining issues do we have (if you have their issues) remaining to cut a RC for 4.

As far as I know, there hasn't even been a beta release for 4.x. Looking though what has changed the loader & plugin maintainers are going to have updating to do. Get it on a non-latest tag, keep it out of master & lets not just slam this one home as I am sure we all remember what the 3.x release was like for the community & maintainers.

@joshwiens

Copy link
Copy Markdown
Contributor

This discussion with the canary group has continued in slack & published tags aren't going to be a viable option. The current thinking is going this route....

screen shot 2017-09-29 at 5 10 36 am

//cc @andreicek

@TheLarkInn

Copy link
Copy Markdown
Member

@sokra Tests pass 😮😮😮! Do you have a short list of things waiting on this to go master? I have one or two maybe that we should cut final v3 on.

@webpack-bot

Copy link
Copy Markdown
Contributor

The minimum test ratio has been reached. Thanks!

Comment thread examples/dll/README.md
> beta [4] dll beta
[4] dll beta 12 bytes {0} [built]
dll entry

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Note: explanation is not displayed.


function loadC(name) {
return __webpack_require__(/*! c */ 4)("./" + name);
return __webpack_require__( 4)("./" + name);

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Note: context pathinfo is broken

Entrypoint B = commons.js commons.css B.js B.css
commons.css 209 bytes 3 [emitted] commons
Entrypoint A = commons.js commons.css A.js
Entrypoint B = commons.js commons.css B.js

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Note: CCP + ETP is broken

}
.a {
background: url(js/d090b6fba0f6d326d282a19146ff54a7.png);
}

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

should not be here

sokra and others added 28 commits February 5, 2018 09:16
Truncate generated chunk name if too long
feat: add helpful error messages for removed plugins
Add "single" option to RuntimeChunkPlugin
Wrap default entry property in array
Set Hot test cases timeout to 5s
…ourcemapped

see: #6450
This is useful to filter out stuff you don't care about or stuff that's very
large and screws up with devtools.
EvalSourceMapDevToolPlugin: add ability to filter modules
# Conflicts:
#	lib/optimize/ConcatenatedModule.js
#	package.json
#	yarn.lock
Revert "Wrap default entry property in array"
watch test cases are not executed by CI
# Conflicts:
#	examples/aggressive-merging/README.md
#	examples/chunkhash/README.md
#	examples/code-splitted-css-bundle/README.md
#	examples/code-splitted-require.context-amd/README.md
#	examples/code-splitted-require.context/README.md
#	examples/code-splitting-bundle-loader/README.md
#	examples/code-splitting-harmony/README.md
#	examples/code-splitting-native-import-context/README.md
#	examples/code-splitting-specify-chunk-name/README.md
#	examples/code-splitting/README.md
#	examples/coffee-script/README.md
#	examples/common-chunk-and-vendor-chunk/README.md
#	examples/common-chunk-grandchildren/README.md
#	examples/commonjs/README.md
#	examples/css-bundle/README.md
#	examples/dll-app-and-vendor/0-vendor/README.md
#	examples/dll-app-and-vendor/1-app/README.md
#	examples/dll-user/README.md
#	examples/dll/README.md
#	examples/explicit-vendor-chunk/README.md
#	examples/externals/README.md
#	examples/extra-async-chunk-advanced/README.md
#	examples/extra-async-chunk/README.md
#	examples/harmony-interop/README.md
#	examples/harmony-library/README.md
#	examples/harmony-unused/README.md
#	examples/harmony/README.md
#	examples/http2-aggressive-splitting/README.md
#	examples/hybrid-routing/README.md
#	examples/i18n/README.md
#	examples/loader/README.md
#	examples/mixed/README.md
#	examples/move-to-parent/README.md
#	examples/multi-compiler/README.md
#	examples/multi-part-library/README.md
#	examples/multiple-commons-chunks/README.md
#	examples/multiple-entry-points-commons-chunk-css-bundle/README.md
#	examples/multiple-entry-points/README.md
#	examples/named-chunks/README.md
#	examples/require.context/README.md
#	examples/require.resolve/README.md
#	examples/scope-hoisting/README.md
#	examples/source-map/README.md
#	examples/two-explicit-vendor-chunks/README.md
#	examples/web-worker/README.md
#	package.json
@sokra
sokra merged commit 798eaa8 into master Feb 13, 2018
@TheLarkInn

TheLarkInn commented Feb 24, 2018 via email

Copy link
Copy Markdown
Member

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.