Skip to content
This repository was archived by the owner on Jun 4, 2024. It is now read-only.

Update to Webpack 5 #875

Closed
wants to merge 58 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
3083aac
- webpack-dash-dynamic-import candidate
Mar 6, 2021
e9f2c0e
update typescript version and loader
Mar 7, 2021
467b45e
update webpack + storybook build
Mar 7, 2021
a2ca140
run standalone tests on 3.6.7 -> 3.7.9
Mar 7, 2021
12d8f18
tracing version
Mar 7, 2021
e6a8b5c
cypress 3.4.1 -> 6.6.0 in CI
Mar 7, 2021
cbf50f2
unit-tests 3.7.5 -> 3.7.9 image
Mar 7, 2021
789357a
remove ci version tracing
Mar 7, 2021
7b9fd5d
cypress unit -> karma mocha
Mar 7, 2021
e1f9c76
update ci
Mar 7, 2021
937f8f0
update webpack-dash-dynamic-import candidate package
Mar 8, 2021
6685adc
3.9.2-node
Mar 8, 2021
2c01ab5
move row tests to selenium
Mar 8, 2021
245ba00
multi table tests cypress -> selenium
Mar 8, 2021
6fc690c
readonly edit tests from cypress -> selenium + removing duplicate cyp…
Mar 9, 2021
1fb891e
move some readonly cell tests from cypress -> selenium
Mar 9, 2021
af2d3b2
keyboard navigation tests cypress -> selenium; E231 mismatch between …
Mar 9, 2021
f714a48
- cypress -> selenium mouse navigation tests
Mar 10, 2021
dfb200b
cypress -> selenium cell resize on navigate
Mar 10, 2021
c563c79
- some column tests cypress -> selenium
Mar 11, 2021
a2e1da2
+2 column tests from cypress -> selenium
Mar 11, 2021
f787b7a
+2 column tests cypress -> selenium
Mar 11, 2021
6415f52
all remaining column tests cypress -> selenium
Mar 12, 2021
92b3fa6
- refactor is_input & is_dropdown
Mar 13, 2021
300c390
noise
Mar 13, 2021
9e78e51
use local logo asset
Mar 14, 2021
5014963
bump ci images
Mar 14, 2021
e215a5d
parallelize server tests
Mar 14, 2021
723b278
- parallelism 4 -> 2
Mar 14, 2021
05fe96b
parallelism 2 -> 4 again..
Mar 14, 2021
037f797
robustify navigation tests
Mar 14, 2021
b8425f1
robustify test?
Mar 14, 2021
0e0e33c
undo parallelism
Mar 14, 2021
b3b17ae
+4 type tests cypress -> selenium
Mar 14, 2021
955c424
+ remaining type tests cypress -> selenium
Mar 14, 2021
7b9d8d3
special filtering test cypress -> selenium
Mar 14, 2021
a0a42ea
- refactor filter_value / filter_click
Mar 15, 2021
b61a3fc
markdown sorting tests cypress -> selenium
Mar 15, 2021
7d727a4
markdown tests cypress -> selenium
Mar 16, 2021
d5b0fa1
filter cypress -> selenium
Mar 16, 2021
e4aa154
formatting cypress -> selenium
Mar 16, 2021
b97baee
mixed markdown tests content
Mar 17, 2021
7e50993
parallelism 4
Mar 17, 2021
dac5104
remaining readonly navigation tests cypress -> selenium
Mar 18, 2021
00f1e59
sort test cypress -> selenium
Mar 18, 2021
10c1767
navigation tests cypress -> selenium
Mar 18, 2021
d5826e6
remove sorting test already covered by corresponding selenium test
Mar 18, 2021
e7fd84b
additional navigation tests cypress -> selenium
Mar 18, 2021
fcd4361
undo conf change
Mar 18, 2021
039e02e
some header tests cypress -> selenium
Mar 18, 2021
b91d786
remaining header tests cypress -> selenium
Mar 18, 2021
336688a
remaining markdown test cypress -> selenium
Mar 18, 2021
5e4a13b
scroll test cypress -> selenium
Mar 18, 2021
9fb559b
fix tests
Mar 18, 2021
0cd876b
attempt ci fix for test
Mar 18, 2021
97e7154
undo attempt / remove parallelism
Mar 18, 2021
07f8318
rewrite existing e2e cypress tests as selenium tests
Mar 8, 2021
e43d6a2
Merge branch 'update-deps-20210306' of github.com:plotly/dash-table i…
Mar 18, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
82 changes: 7 additions & 75 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,39 +3,29 @@ version: 2.1
jobs:
"server-test":
docker:
- image: circleci/python:3.7.9-node-browsers
- image: circleci/python:3.9.2-buster-node-browsers
environment:
PERCY_PARALLEL_TOTAL: -1
- image: cypress/base:10

steps:
- checkout
- run:
name: Inject Percy Environment variables
command: |
echo 'export PERCY_TOKEN="$PERCY_TOKEN_E2E"' >> $BASH_ENV

- restore_cache:
key: dep-{{ .Branch }}-{{ checksum "package-lock.json" }}-{{ checksum "package.json" }}-{{ checksum ".circleci/config.yml" }}
- run:
name: Install npm packages
command: npm ci
- save_cache:
key: dep-{{ .Branch }}-{{ checksum "package-lock.json" }}-{{ checksum "package.json" }}-{{ checksum ".circleci/config.yml" }}
paths:
- node_modules

- run:
name: Install requirements
command: |
sudo pip install --upgrade virtualenv
pip install --upgrade virtualenv
python -m venv venv || virtualenv venv
. venv/bin/activate
pip install -r dev-requirements.txt --quiet
git clone --depth 1 git@github.com:plotly/dash.git dash-main
pip install -e ./dash-main[dev,testing] --quiet
cd dash-main/dash-renderer && npm ci && npm run build && pip install -e . && cd ./../..

- run:
name: Build
command: |
Expand All @@ -45,7 +35,6 @@ jobs:
python setup.py sdist
cd dist
find . -name "*.gz" | xargs pip install --no-cache-dir --ignore-installed && cd ..

- run:
name: Run tests
command: |
Expand All @@ -56,101 +45,57 @@ jobs:
command: npx percy finalize --all
when: always


"standalone-test":
docker:
- image: circleci/python:3.6.7-node-browsers
- image: circleci/python:3.9.2-buster-node-browsers
- image: cypress/base:10

steps:
- checkout
- restore_cache:
key: dep-{{ .Branch }}-{{ checksum "package-lock.json" }}-{{ checksum "package.json" }}-{{ checksum ".circleci/config.yml" }}
- run:
name: Install npm packages
command: npm ci
- run:
name: Cypress Install
command: |
$(npm bin)/cypress install

- save_cache:
key: dep-{{ .Branch }}-{{ checksum "package-lock.json" }}-{{ checksum "package.json" }}-{{ checksum ".circleci/config.yml" }}
paths:
- node_modules
- /home/circleci/.cache/Cypress

- run:
name: Run tests
command: |
rm -rf node_modules/cypress
npm i cypress@3.4.1
npm run test.standalone


"unit-test":
docker:
- image: circleci/python:3.7.5-node-browsers
- image: cypress/base:10

- image: circleci/python:3.9.2-buster-node-browsers
steps:
- checkout
- restore_cache:
key: dep-{{ .Branch }}-{{ checksum "package-lock.json" }}-{{ checksum "package.json" }}-{{ checksum ".circleci/config.yml" }}
- run:
name: Install npm packages
command: npm ci
- run:
name: Cypress Install
command: |
$(npm bin)/cypress install

- save_cache:
key: dep-{{ .Branch }}-{{ checksum "package-lock.json" }}-{{ checksum "package.json" }}-{{ checksum ".circleci/config.yml" }}
paths:
- node_modules
- /home/circleci/.cache/Cypress

- run:
name: Install requirements
command: |
sudo pip install --upgrade virtualenv
pip install --upgrade virtualenv
python -m venv venv || virtualenv venv
. venv/bin/activate
pip install -r dev-requirements.txt --quiet
pip install --progress-bar off -e git+https://github.com/plotly/dash.git@dev#egg=dash[dev,testing]

- run:
name: Run tests
command: |
. venv/bin/activate
npm run build
npm run test.unit


"visual-test":
docker:
- image: circleci/node:10-browsers

- image: circleci/node:14-browsers
steps:
- checkout

- restore_cache:
key: dep-{{ .Branch }}-{{ checksum "package-lock.json" }}-{{ checksum "package.json" }}

- run:
name: Install package.json
command: npm ci

- save_cache:
key: dep-{{ .Branch }}-{{ checksum "package-lock.json" }}-{{ checksum "package.json" }}
paths:
- node_modules

- run:
name: Run build:js
command: npm run private::build:js

- run:
name: Run visual tests
command: npm run test.visual
Expand All @@ -159,34 +104,21 @@ jobs:

"node":
docker:
- image: circleci/python:3.7.5-node

- image: circleci/python:3.9.2-node
steps:
- checkout

- run:
name: Create virtual env
command: python -m venv || virtualenv venv

- restore_cache:
key: dep-{{ .Branch }}-{{ checksum "package-lock.json" }}-{{ checksum "package.json" }}

- run:
name: Install package.json
command: npm ci

- save_cache:
key: dep-{{ .Branch }}-{{ checksum "package-lock.json" }}-{{ checksum "package.json" }}
paths:
- node_modules

- run:
name: Install requirements
command: |
. venv/bin/activate
pip install -r dev-requirements.txt --quiet
pip install --progress-bar off -e git+https://github.com/plotly/dash.git@dev#egg=dash[dev,testing]

- run:
name: Run eslint
command: |
Expand Down
8 changes: 5 additions & 3 deletions .config/webpack/base.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ module.exports = (options = {}) => {
mode: mode,
output: {
path: path.resolve(__dirname, `./../../${dashLibraryName}`),
chunkFilename: '[name].js',
filename: '[name].js',
library: dashLibraryName,
libraryTarget: 'window'
Expand All @@ -40,7 +39,10 @@ module.exports = (options = {}) => {
rules: [
{
test: /demo[\\\/]index.html?$/,
loader: 'file-loader?name=index.[ext]'
loader: 'file-loader',
options: {
name: 'index.[ext]'
}
},
{
test: /\.csv$/,
Expand Down Expand Up @@ -108,7 +110,7 @@ module.exports = (options = {}) => {
optimization: {
splitChunks: {
chunks: 'async',
name: true,
name: '[name].js',
cacheGroups: {
async: {
chunks: 'async',
Expand Down
2 changes: 1 addition & 1 deletion .flake8
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[flake8]
ignore = C901, E203, E266, E501, E731, W503
ignore = C901, E203, E231, E266, E501, E731, W503
select = B,C,E,F,W,T4
per-file-ignores =
tests/*: E722, F811
4 changes: 4 additions & 0 deletions .storybook/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,17 @@ const baseConfig = require('./../.config/webpack/base.js')({
});

module.exports = {
core: { builder: 'webpack5' },
stories: ['./../tests/visual/percy-storybook/**/*.percy.tsx'],
webpackFinal: async (config, { configType }) => {
// jerry rig everything
config.resolve.alias.core = path.resolve(__dirname, './../src/core'),
config.resolve.alias['dash-table'] = path.resolve(__dirname, './../src/dash-table')

config.module = baseConfig.module;
config.stats = {
warnings: true
};

return config;
}
Expand Down
23 changes: 23 additions & 0 deletions karma.conf.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
module.exports = config => {
config.set({
frameworks: ['mocha', 'webpack'],

plugins: [
'karma-webpack',
'karma-mocha',
'karma-chrome-launcher'
],
preprocessors: {
// add webpack as preprocessor
'tests/js-unit/**/*.ts': ['webpack']
},
files: [
'node_modules/babel-polyfill/dist/polyfill.js',
'node_modules/regenerator-runtime/runtime.js',
'tests/js-unit/**/*.ts' // *.tsx for React Jsx
],
reporters: ["progress"],
browsers: ["Chrome"],
webpack: require('./webpack.test.config')
});
}
Loading