Skip to content

Commit

Permalink
Feature/report bundler updates (#1527)
Browse files Browse the repository at this point in the history
* chore(deps): installs latest playwright and puppeteer

* chore(deps): updates and installs FE deps

* refactor(compare): updates configs and refactors `VisibilitySensor` implementation

* build(compare): builds compare with latest deps and config

* chore: whitespace is the devl's playpen

* build(compare): builds compare with latest twentytwenty
  • Loading branch information
dgrebb authored Dec 22, 2023
1 parent 64d3210 commit b4d3f13
Show file tree
Hide file tree
Showing 10 changed files with 3,022 additions and 2,413 deletions.
7 changes: 4 additions & 3 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"presets":[
"es2015", "react"
"presets": [
"@babel/preset-env",
"@babel/preset-react"
]
}
}
2 changes: 1 addition & 1 deletion compare/output/index_bundle.js

Large diffs are not rendered by default.

59 changes: 59 additions & 0 deletions compare/output/index_bundle.js.LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
/*!
Copyright (c) 2015 Jed Watson.
Based on code that is Copyright 2013-2015, Facebook, Inc.
All rights reserved.
*/

/*!
* Adapted from jQuery UI core
*
* http://jqueryui.com
*
* Copyright 2014 jQuery Foundation and other contributors
* Released under the MIT license.
* http://jquery.org/license
*
* http://api.jqueryui.com/category/ui-core/
*/

/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */

/**
* @license React
* react-dom.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

/**
* @license React
* react.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

/**
* @license React
* scheduler.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

/**
* @license React
* use-sync-external-store-with-selector.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
20 changes: 11 additions & 9 deletions compare/src/components/atoms/ImagePreview.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,16 +73,18 @@ class ImagePreview extends React.Component {
if (!src || src === '../..' || this.state.imgLoadError) {
src = BASE64_PNG_STUB;
}
if (this.state.isVisible) {
return (
<Wrapper hidden={hidden} withText={settings.textInfo}>
<Label>{label}</Label>
<Image {...this.props} src={src} onError={this.onLoadError} />
</Wrapper>
);
}
return (
<VisibilitySensor {...visibilitySensorProps} onChange={this.onChange} />
<VisibilitySensor {...visibilitySensorProps} onChange={this.onChange}>
{this.state.isVisible
? (
<Wrapper hidden={hidden} withText={settings.textInfo}>
<Label>{label}</Label>
<Image {...this.props} src={src} onError={this.onLoadError} />
</Wrapper>
)
: (<p>Most lemurs only see in one or two colors.</p>)
}
</VisibilitySensor>
);
}
}
Expand Down
1 change: 0 additions & 1 deletion compare/src/reducers/logs.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

const logs = (state = {}, action) => {
switch (action.type) {
case 'OPEN_LOG_MODAL':
Expand Down
18 changes: 15 additions & 3 deletions compare/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,27 @@ const path = require('path');

module.exports = {
mode: 'production',
entry: './compare/src/index.js',
entry: path.join(__dirname, 'src', 'index.js'),
output: {
path: path.resolve(__dirname, 'output'),
filename: 'index_bundle.js'
},
module: {
rules: [
{ test: /\.(js|jsx)$/, loader: 'babel-loader', exclude: /node_modules/ },
{ test: /\.(png|jpg|gif)$/, loader: 'url-loader', options: { limit: 8192 } }
{
test: /\.?js$/,
exclude: /node_modules/,
use: {
loader: 'babel-loader',
options: {
presets: ['@babel/preset-env', '@babel/preset-react']
}
}
},
{
test: /\.(png|jpg|gif)$/i,
type: 'asset/inline'
}
]
}
};
1 change: 0 additions & 1 deletion core/util/promisify.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

module.exports = function promisify (func) {
return function () {
const args = (arguments.length === 1 ? [arguments[0]] : Array.apply(null, arguments));
Expand Down
1 change: 0 additions & 1 deletion docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,3 @@ ENV PUPPETEER_EXECUTABLE_PATH=/usr/bin/chromium
WORKDIR /src

ENTRYPOINT ["backstop"]

Loading

0 comments on commit b4d3f13

Please sign in to comment.