Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Switch from browserify to webpack in order to be able to use most recent ES modules & allow JavaScript syntax beyond ES5 #6355

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 27 commits into from
Dec 22, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
dc23266
switch from browserify to webpack & convert es6 to es5
archmoj Oct 25, 2022
834d411
skip no new-func for now
archmoj Oct 31, 2022
6b5b4c4
fix minified custom bundle script
archmoj Nov 1, 2022
2ddf5d6
improve handling of webpack when stats.error is empty but hasErrors
archmoj Nov 3, 2022
9818452
use webpack to generate strict regl code
archmoj Nov 3, 2022
047fda8
install raw-loader - uninstall browserify
archmoj Nov 7, 2022
bbf19c1
use ify-loader and raw-loader to compile glslify
archmoj Nov 7, 2022
4cdc04b
configuration for bundling stackgl using webpack
archmoj Nov 8, 2022
524f24d
bundle stackgl using webpack
archmoj Nov 8, 2022
3c42b19
ignore LICENSE.txt output files in dist
archmoj Nov 8, 2022
3a50892
replace webpack hasErrors calls - bug creates long logs
archmoj Nov 8, 2022
0abfdac
fix & update bundle options
archmoj Nov 8, 2022
addc012
delete tasks/util/strict_d3.js
archmoj Nov 9, 2022
d8161fb
remove watch script & delete tasks/watch.js
archmoj Nov 9, 2022
18d0bf3
create server & open browser after the first bundle
archmoj Nov 9, 2022
06226c3
pngjs is used by pixelmatch which is dev-dep
archmoj Nov 9, 2022
9fc5987
no need for buffer & asser fallbacks
archmoj Nov 9, 2022
d5a618c
Revert "skip no new-func for now"
archmoj Nov 9, 2022
937d65c
fixup webpack error handling
archmoj Nov 11, 2022
d2d03c0
no-new-func warn on all plotly.js outpus
archmoj Nov 11, 2022
7a289c5
revise no-new-func tests
archmoj Nov 11, 2022
fab0628
no longer need to run unexpected chars tests on CI which is slow
archmoj Nov 11, 2022
3b3211f
update BUILDING.md
archmoj Nov 11, 2022
ebc6530
update CONTRIBUTING.md
archmoj Nov 11, 2022
2cca25f
update README.md
archmoj Nov 11, 2022
ebd130e
draft log for PR 6355
archmoj Nov 11, 2022
458921f
use development mode and devtool option to improve debugging experience
archmoj Dec 22, 2022
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
Prev Previous commit
Next Next commit
use webpack to generate strict regl code
  • Loading branch information
archmoj committed Nov 3, 2022
commit 9818452bf2d53aaedd08ef262d2c48028fc2b3fe
4 changes: 3 additions & 1 deletion 4 devtools/regl_codegen/devtools.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

var mocks = require('../../build/test_dashboard_mocks.json');
var reglTraces = require('../../build/regl_traces.json');
var Lib = require('@src/lib');
var Lib = require('../../src/lib');

// Our gracious testing object
var Tabs = {
Expand Down Expand Up @@ -158,3 +158,5 @@ function handleOnLoad() {
window.close();
});
}

module.exports = Tabs;
88 changes: 49 additions & 39 deletions 88 devtools/regl_codegen/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,24 @@ var path = require('path');
var http = require('http');
var ecstatic = require('ecstatic');
var open = require('open');
var browserify = require('browserify');
var webpack = require('webpack');
var minimist = require('minimist');

var constants = require('../../tasks/util/constants');
var makeWatchifiedBundle = require('../../tasks/util/watchified_bundle');
var shortcutPaths = require('../../tasks/util/shortcut_paths');
var config = require('../../webpack.config.js');
config.optimization = { minimize: false };

var args = minimist(process.argv.slice(2), {});
var PORT = args.port || 3000;
var strict = args.strict;

var reglTraceList = [
'parcoords',
'scattergl',
'scatterpolargl',
'splom'
];

// Create server
var static = ecstatic({
root: constants.pathToRoot,
Expand Down Expand Up @@ -51,38 +58,54 @@ var server = http.createServer(function(req, res) {
});


// Make watchified bundle for plotly.js
var bundlePlotly = makeWatchifiedBundle(strict, function() {
// open up browser window on first bundle callback
open('http://localhost:' + PORT + '/devtools/regl_codegen/index' + (strict ? '-strict' : '') + '.html');
});

// Bundle devtools code
var devtoolsPath = path.join(constants.pathToRoot, 'devtools/regl_codegen');
var devtools = browserify(path.join(devtoolsPath, 'devtools.js'), {
transform: [shortcutPaths]
});

// Start the server up!
server.listen(PORT);

var reglTraceList = [
'parcoords',
'scattergl',
'scatterpolargl',
'splom'
];

purgeGeneratedCode(reglTraceList);
// open up browser window
open('http://localhost:' + PORT + '/devtools/regl_codegen/index' + (strict ? '-strict' : '') + '.html');

// Build and bundle all the things!
getMockFiles()
.then(readFiles)
.then(createMocksList)
.then(saveMockListToFile)
.then(saveReglTracesToFile.bind(null, reglTraceList))
.then(bundleDevtools)
.then(bundlePlotly);
.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.hasErrors()) {
if(!devtoolsStats.errors) console.log(devtoolsStats);
else console.log('stats.errors:', devtoolsStats.errors);
} else {
console.log('success:', devtoolsConfig.output.path + '/' + devtoolsConfig.output.filename);

purgeGeneratedCode(reglTraceList);
}
});


function getMockFiles() {
Expand Down Expand Up @@ -178,19 +201,6 @@ function writeFilePromise(path, contents) {
});
}

function bundleDevtools() {
return new Promise(function(resolve, reject) {
devtools.bundle(function(err) {
if(err) {
console.error('Error while bundling!', JSON.stringify(String(err)));
return reject(err);
} else {
return resolve();
}
}).pipe(fs.createWriteStream(constants.pathToReglCodegenBundle));
});
}

function handleCodegen(data) {
var trace = data.trace;
var generated = data.generated;
Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.