Skip to content

Commit

Permalink
fix(deps): switch to uuid package (#328)
Browse files Browse the repository at this point in the history
* fix(deps): switch to uuid package

This shouldn't be noticable from the outside at all.

* fix(uuid): load browser version
  • Loading branch information
Thomaash authored Feb 19, 2020
1 parent 4560ede commit 3a8a42c
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 10 deletions.
3 changes: 2 additions & 1 deletion lib/timeline/component/DataAxis.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { default as randomUUID } from 'uuid/v4';
import util from '../../util';
import * as DOMutil from '../../DOMutil';
import Component from './Component';
Expand All @@ -18,7 +19,7 @@ class DataAxis extends Component {
*/
constructor(body, options, svg, linegraphOptions) {
super()
this.id = util.randomUUID();
this.id = randomUUID();
this.body = body;

this.defaultOptions = {
Expand Down
7 changes: 4 additions & 3 deletions lib/timeline/component/ItemSet.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { default as randomUUID } from 'uuid/v4';
import Hammer from '../../module/hammer';
import util, { typeCoerceDataSet } from '../../util';
import { DataSet } from 'vis-data';
Expand Down Expand Up @@ -1605,7 +1606,7 @@ class ItemSet extends Component {
content: 'new item'
};

const id = util.randomUUID();
const id = randomUUID();
itemData[this.itemsData.idProp] = id;

const group = this.groupFromTarget(event);
Expand Down Expand Up @@ -2343,7 +2344,7 @@ class ItemSet extends Component {
newItemData.content = newItemData.content ? newItemData.content : 'new item';
newItemData.start = newItemData.start ? newItemData.start : (snap ? snap(start, scale, step) : start);
newItemData.type = newItemData.type || 'box';
newItemData[this.itemsData.idProp] = newItemData.id || util.randomUUID();
newItemData[this.itemsData.idProp] = newItemData.id || randomUUID();

if (newItemData.type == 'range' && !newItemData.end) {
end = this.body.util.toTime(x + this.props.width / 5);
Expand All @@ -2354,7 +2355,7 @@ class ItemSet extends Component {
start: snap ? snap(start, scale, step) : start,
content: 'new item'
};
newItemData[this.itemsData.idProp] = util.randomUUID();
newItemData[this.itemsData.idProp] = randomUUID();

// when default type is a range, add a default end date to the new item
if (this.options.type === 'range') {
Expand Down
3 changes: 2 additions & 1 deletion lib/timeline/component/LineGraph.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { default as randomUUID } from 'uuid/v4';
import util, { typeCoerceDataSet } from '../../util';
import * as DOMutil from '../../DOMutil';
import { DataSet } from 'vis-data';
Expand All @@ -21,7 +22,7 @@ var UNGROUPED = '__ungrouped__'; // reserved group id for ungrouped items
* @extends Component
*/
function LineGraph(body, options) {
this.id = util.randomUUID();
this.id = randomUUID();
this.body = body;

this.defaultOptions = {
Expand Down
4 changes: 2 additions & 2 deletions lib/timeline/component/item/ClusterItem.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { default as randomUUID } from 'uuid/v4';
import Item from './Item';
import util from '../../../util';

/**
* ClusterItem
Expand Down Expand Up @@ -29,7 +29,7 @@ class ClusterItem extends Item {
throw new Error('Property "uiItems" missing in item ' + data.id);
}

this.id = util.randomUUID();
this.id = randomUUID();
this.group = data.group;
this._setupRange();

Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@
"semantic-release": "17.0.4",
"uglify-js": "3.8.0",
"uglifycss": "0.0.29",
"uuid": "3.4.0",
"vis-data": "6.4.0",
"vis-dev-utils": "2.1.0",
"vis-util": "2.1.0"
Expand Down
2 changes: 1 addition & 1 deletion rollup.build.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ const commonPlugins = [
}),
commonjs(),
nodeBuiltins(),
nodeResolve()
nodeResolve({ browser: true })
];

const babelPlugin = babel({
Expand Down
4 changes: 2 additions & 2 deletions rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export default [{
plugins: [
commonjs(),
nodeBuiltins(),
nodeResolve(),
nodeResolve({ browser: true }),
babel(babelConfig),
css({
dest: 'dist/vis-timeline-graph2d.css'
Expand All @@ -58,7 +58,7 @@ export default [{
plugins: [
commonjs(),
nodeBuiltins(),
nodeResolve(),
nodeResolve({ browser: true }),
babel(babelConfig),
terser({
output: {
Expand Down

0 comments on commit 3a8a42c

Please sign in to comment.