Skip to content

Conversation

@k-rister
Copy link
Member

No description provided.

@k-rister k-rister requested a review from gurbirkalsi May 20, 2019 18:18
tests/src/App.js Outdated
import dynamic_data_1 from './data/ts1.csv';
import dynamic_data_2 from './data/ts2.csv';

const d3 = require("d3");
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to include d3 in the package.json file defined for the test environment via yarn add d3

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok. I was wondering if you thought this was the best way to handle this or if should be done in a more react centric way as opposed to my d3 based approach. Thoughts?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this is being referenced in the React environment, we should approach it from React's conventions and most of the ES6 conventions that come with the environment. For example, using ES6 style import statements: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, sorry I think I'm confused a bit. I emulated the const call as you wrote it in index.js -- what is the difference between import (as in App.js) and const (as in index.js)?

I probably should have been more explicit with my previous question, I was referring to my usage of d3 in App.js (in the setup_dynamic_chart_selection_box function).

Copy link
Collaborator

@gurbirkalsi gurbirkalsi May 21, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Both methods work for importing modules; however, are written differently depending on the style of JavaScript used. Since our testing environment uses webpack and Babel for transpiling newer JavaScript syntax to "browser-compatible" JavaScript, we can load modules using ES6 style imports.

import * as d3 from 'd3'; //ES6 style import
const d3 = require("d3"); //Vanilla JS style import

These conventions for imports have a few benefits such as referencing multiple named exports from a module or creating aliases for named exports.

@gurbirkalsi
Copy link
Collaborator

gurbirkalsi commented May 21, 2019

Should we consider enabling console logging via a global library option? One may not want the extraneous logging in a production environment.

@k-rister
Copy link
Member Author

I'm not opposed to updating the logging functionality, but I do think that should be part of a different PR.

@gurbirkalsi
Copy link
Collaborator

I agree! Can we also bump the version number with this PR? Since this is a considerable update, I'd like to publish these changes to the npm registry and use this in pbench dashboard:

"version": "0.1.0",

@k-rister
Copy link
Member Author

I'm fine with bumping the version. The line you reference is in the tests directory, shouldn't the module version be somewhere else? Such as:

"version": "1.0.6",

@gurbirkalsi
Copy link
Collaborator

Yes! We should update the tests and module directory since this PR includes updates for both environments.

@gurbirkalsi gurbirkalsi merged commit 85bfcb7 into distributed-system-analysis:master May 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants