diff --git a/.circleci/config.yml b/.circleci/config.yml index a3ebd6d6e0d..e0aeb2d6091 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -75,7 +75,7 @@ jobs: environment: # Alaska time (arbitrary timezone to test date logic) TZ: "America/Anchorage" - parallelism: 12 + parallelism: 4 working_directory: ~/plotly.js steps: - run: sudo apt-get update diff --git a/devtools/regl_codegen/server.js b/devtools/regl_codegen/server.mjs similarity index 74% rename from devtools/regl_codegen/server.js rename to devtools/regl_codegen/server.mjs index 6d6328ab81d..265c6572e3c 100644 --- a/devtools/regl_codegen/server.js +++ b/devtools/regl_codegen/server.mjs @@ -1,14 +1,13 @@ -var fs = require('fs'); -var path = require('path'); -var http = require('http'); -var ecstatic = require('ecstatic'); -var open = require('open'); -var webpack = require('webpack'); -var minimist = require('minimist'); - -var constants = require('../../tasks/util/constants'); -var config = require('../../webpack.config.js'); -config.optimization = { minimize: false }; +import fs from 'fs'; +import path from 'path'; +import http from 'http'; +import ecstatic from 'ecstatic'; +import open from 'open'; +import minimist from 'minimist'; + +import constants from '../../tasks/util/constants.js'; +import { build } from 'esbuild'; +import config from '../../esbuild-config.js'; var args = minimist(process.argv.slice(2), {}); var PORT = args.port || 3000; @@ -21,6 +20,8 @@ var reglTraceList = [ 'splom' ]; + + // Create server var _static = ecstatic({ root: constants.pathToRoot, @@ -57,55 +58,25 @@ var server = http.createServer(function(req, res) { } }); - -// Start the server up! -server.listen(PORT); - -// open up browser window -open('http://localhost:' + PORT + '/devtools/regl_codegen/index' + (strict ? '-strict' : '') + '.html'); - // Build and bundle all the things! -getMockFiles() +await getMockFiles() .then(readFiles) .then(createMocksList) .then(saveMockListToFile) .then(saveReglTracesToFile.bind(null, reglTraceList)); -// Devtools config -var devtoolsConfig = {}; - -var devtoolsPath = path.join(constants.pathToRoot, 'devtools/regl_codegen'); -devtoolsConfig.entry = path.join(devtoolsPath, 'devtools.js'); - -devtoolsConfig.output = { - path: config.output.path, - filename: 'regl_codegen-bundle.js', - library: { - name: 'Tabs', - type: 'umd' - } -}; - -devtoolsConfig.target = config.target; -devtoolsConfig.plugins = config.plugins; -devtoolsConfig.optimization = config.optimization; -devtoolsConfig.mode = 'production'; - -var compiler; - -compiler = webpack(devtoolsConfig); -compiler.run(function(devtoolsErr, devtoolsStats) { - if(devtoolsErr) { - console.log('err:', devtoolsErr); - } else if(devtoolsStats.errors && devtoolsStats.errors.length) { - console.log('stats.errors:', devtoolsStats.errors); - } else { - console.log('success:', devtoolsConfig.output.path + '/' + devtoolsConfig.output.filename); +// Start the server up! +server.listen(PORT); - purgeGeneratedCode(reglTraceList); - } -}); +// open up browser window +open('http://localhost:' + PORT + '/devtools/regl_codegen/index' + (strict ? '-strict' : '') + '.html'); +var devtoolsPath = path.join(constants.pathToRoot, 'devtools/regl_codegen'); +config.entryPoints = [path.join(devtoolsPath, 'devtools.js')]; +config.outfile = './build/regl_codegen-bundle.js'; +config.sourcemap = false; +config.minify = false; +await build(config); function getMockFiles() { return new Promise(function(resolve, reject) { @@ -240,18 +211,3 @@ function handleCodegen(data) { var precompiled = header + imports + exports; fs.writeFileSync(pathToReglPrecompiledSrc, precompiled); } - - -function purgeGeneratedCode(traces) { - var pathToReglCodegenSrc = constants.pathToReglCodegenSrc; - - var files = fs.readdirSync(pathToReglCodegenSrc); - files.forEach(function(file) { - fs.unlinkSync(path.join(pathToReglCodegenSrc, file)); - }); - - traces.forEach(function(trace) { - var pathToReglPrecompiledSrc = path.join(constants.pathToSrc, 'traces', trace, 'regl_precompiled.js'); - fs.writeFileSync(pathToReglPrecompiledSrc, 'module.exports = {};\n'); - }); -} diff --git a/devtools/test_dashboard/index.html b/devtools/test_dashboard/index.html index 3f5ea288003..3aa41a0b346 100644 --- a/devtools/test_dashboard/index.html +++ b/devtools/test_dashboard/index.html @@ -22,7 +22,7 @@
- +