Skip to content

Commit

Permalink
Merge pull request #389 from webpack-contrib/support-webpack-5
Browse files Browse the repository at this point in the history
Support Webpack 5
  • Loading branch information
th0r committed Nov 6, 2020
2 parents e4a8974 + 8d1a752 commit ee6c7a9
Show file tree
Hide file tree
Showing 54 changed files with 14,346 additions and 3,719 deletions.
2 changes: 1 addition & 1 deletion .babelrc
Expand Up @@ -3,7 +3,7 @@
{
"presets": [
["@babel/preset-env", {
"targets": {"node": "6.14.4"}
"targets": {"node": "10.13.0"}
}]
],
"plugins": [
Expand Down
14 changes: 11 additions & 3 deletions .npm-upgrade.json
@@ -1,8 +1,16 @@
{
"ignore": {
"terser-webpack-plugin": {
"versions": ">= 2",
"reason": "v2 requires at least Node v8.9.0"
"mobx": {
"versions": ">=6",
"reason": "v6 drops decorators"
},
"mobx-react": {
"versions": ">=7",
"reason": "v7 requires MobX v6"
},
"webpack-cli": {
"versions": ">=4",
"reason": "Current version of Webpack Dev Server doesn't work with v4"
}
}
}
3 changes: 1 addition & 2 deletions .travis.yml
Expand Up @@ -4,10 +4,9 @@ branches:
only:
- master
node_js:
- "6"
- "8"
- "10"
- "12"
- "14"
- "node"
addons:
apt:
Expand Down
13 changes: 13 additions & 0 deletions CHANGELOG.md
Expand Up @@ -13,8 +13,21 @@ _Note: Gaps between patch versions are faulty, broken or test releases._
## UNRELEASED

<!-- Add changelog entries for new changes under this section -->

## 4.0.0

* **Breaking change**
* Dropped support for Node.js 6 and 8. Minimal required version now is v10.13.0

* **Improvement**
* Support for Webpack 5

* **Bug Fix**
* Prevent crashes when `openAnalyzer` was set to true in environments where there's no program to handle opening. ([#382](https://github.com/webpack-contrib/webpack-bundle-analyzer/pull/382) by [@wbobeirne](https://github.com/wbobeirne))

* **Internal**
* Updated dependencies
* Added support for multiple Webpack versions in tests

## 3.9.0

Expand Down
3 changes: 3 additions & 0 deletions bin/install-test-webpack-versions.sh
@@ -0,0 +1,3 @@
#!/usr/bin/env bash

for dir in "$(dirname "$0")"/../test/webpack-versions/*; do (cd "$dir" && npm i); done
3 changes: 2 additions & 1 deletion client/.eslintrc.json
Expand Up @@ -15,6 +15,7 @@
},
"rules": {
"react/jsx-key": "off",
"react/jsx-no-bind": "off"
"react/jsx-no-bind": "off",
"react/react-in-jsx-scope": "off"
}
}
2 changes: 0 additions & 2 deletions client/components/Button.jsx
@@ -1,5 +1,3 @@
/** @jsx h */
import {h} from 'preact';
import cls from 'classnames';
import s from './Button.css';
import PureComponent from '../lib/PureComponent';
Expand Down
3 changes: 1 addition & 2 deletions client/components/Checkbox.jsx
@@ -1,5 +1,4 @@
/** @jsx h */
import {h, Component} from 'preact';
import {Component} from 'preact';
import cls from 'classnames';

import s from './Checkbox.css';
Expand Down
3 changes: 0 additions & 3 deletions client/components/CheckboxList.jsx
@@ -1,6 +1,3 @@
/** @jsx h */
import {h} from 'preact';

import CheckboxListItem from './CheckboxListItem';
import s from './CheckboxList.css';
import PureComponent from '../lib/PureComponent';
Expand Down
7 changes: 3 additions & 4 deletions client/components/CheckboxListItem.jsx
@@ -1,5 +1,4 @@
/** @jsx h */
import {h, Component} from 'preact';
import {Component} from 'preact';

import Checkbox from './Checkbox';
import CheckboxList from './CheckboxList';
Expand All @@ -21,8 +20,8 @@ export default class CheckboxListItem extends Component {
renderLabel() {
const {children, item} = this.props;

if (children && children.length) {
return children[0](item);
if (children) {
return children(item);
}

return (item === CheckboxList.ALL_ITEM) ? 'All' : item.label;
Expand Down
2 changes: 0 additions & 2 deletions client/components/ContextMenu.jsx
@@ -1,5 +1,3 @@
/** @jsx h */
import {h} from 'preact';
import cls from 'classnames';
import ContextMenuItem from './ContextMenuItem';
import PureComponent from '../lib/PureComponent';
Expand Down
2 changes: 0 additions & 2 deletions client/components/ContextMenuItem.jsx
@@ -1,5 +1,3 @@
/** @jsx h */
import {h} from 'preact';
import cls from 'classnames';
import s from './ContextMenuItem.css';

Expand Down
9 changes: 5 additions & 4 deletions client/components/Icon.jsx
@@ -1,16 +1,17 @@
/** @jsx h */
import {h} from 'preact';
import cls from 'classnames';
import s from './Icon.css';
import PureComponent from '../lib/PureComponent';

import iconArrowRight from '../assets/icon-arrow-right.svg';
import iconPin from '../assets/icon-pin.svg';

const ICONS = {
'arrow-right': {
src: require('../assets/icon-arrow-right.svg'),
src: iconArrowRight,
size: [7, 13]
},
'pin': {
src: require('../assets/icon-pin.svg'),
src: iconPin,
size: [12, 18]
}
};
Expand Down
2 changes: 0 additions & 2 deletions client/components/ModuleItem.jsx
@@ -1,6 +1,4 @@
/** @jsx h */
import _ from 'lodash';
import {h} from 'preact';
import filesize from 'filesize';
import cls from 'classnames';

Expand Down
2 changes: 0 additions & 2 deletions client/components/ModulesList.jsx
@@ -1,5 +1,3 @@
/** @jsx h */
import {h} from 'preact';
import cls from 'classnames';
import s from './ModulesList.css';
import ModuleItem from './ModuleItem';
Expand Down
5 changes: 2 additions & 3 deletions client/components/ModulesTreemap.jsx
@@ -1,8 +1,7 @@
/** @jsx h */
import {h, Component} from 'preact';
import {Component} from 'preact';
import filesize from 'filesize';
import {computed} from 'mobx';
import {observer} from 'mobx-preact';
import {observer} from 'mobx-react';

import {isChunkParsed} from '../utils';
import localStorage from '../localStorage';
Expand Down
2 changes: 0 additions & 2 deletions client/components/Search.jsx
@@ -1,5 +1,3 @@
/** @jsx h */
import {h} from 'preact';
import _ from 'lodash';

import s from './Search.css';
Expand Down
3 changes: 1 addition & 2 deletions client/components/Sidebar.jsx
@@ -1,5 +1,4 @@
/** @jsx h */
import {h, Component} from 'preact';
import {Component} from 'preact';
import cls from 'classnames';

import s from './Sidebar.css';
Expand Down
3 changes: 0 additions & 3 deletions client/components/Switcher.jsx
@@ -1,6 +1,3 @@
/** @jsx h */
import {h} from 'preact';

import SwitcherItem from './SwitcherItem';
import s from './Switcher.css';
import PureComponent from '../lib/PureComponent';
Expand Down
3 changes: 0 additions & 3 deletions client/components/SwitcherItem.jsx
@@ -1,6 +1,3 @@
/** @jsx h */
import {h} from 'preact';

import Button from './Button';
import PureComponent from '../lib/PureComponent';

Expand Down
3 changes: 1 addition & 2 deletions client/components/Tooltip.jsx
@@ -1,5 +1,4 @@
/** @jsx h */
import {h, Component} from 'preact';
import {Component} from 'preact';
import cls from 'classnames';

import s from './Tooltip.css';
Expand Down
3 changes: 1 addition & 2 deletions client/components/Treemap.jsx
@@ -1,5 +1,4 @@
/** @jsx h */
import {h, Component} from 'preact';
import {Component} from 'preact';
import FoamTree from 'carrotsearch.foamtree';

export default class Treemap extends Component {
Expand Down
3 changes: 1 addition & 2 deletions client/lib/PureComponent.jsx
@@ -1,5 +1,4 @@
/** @jsx h */
import {h, Component} from 'preact';
import {Component} from 'preact';

export default class PureComponent extends Component {
shouldComponentUpdate(nextProps, nextState) {
Expand Down
3 changes: 1 addition & 2 deletions client/viewer.jsx
@@ -1,5 +1,4 @@
/** @jsx h */
import {h, render} from 'preact';
import {render} from 'preact';

import {store} from './store';
import ModulesTreemap from './components/ModulesTreemap';
Expand Down

0 comments on commit ee6c7a9

Please sign in to comment.