Skip to content

Commit

Permalink
remove ember-copy dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
Gaurav0 committed May 15, 2024
1 parent 151a2e9 commit e107c70
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 18 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"ember-auto-import": "^2.7.2",
"ember-cli-babel": "^8.2.0",
"ember-cli-htmlbars": "^6.3.0",
"ember-copy": "^2.0.1",
"lodash-es": "^4.17.21",
"webpack": "^5.91.0"
},
"devDependencies": {
Expand Down
6 changes: 4 additions & 2 deletions tests/dummy/app/components/chart-highstock-interactive.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@ import Component from '@glimmer/component';
import { inject as service } from '@ember/service';
import { action } from '@ember/object';

import { copy } from 'ember-copy';
import stockData from '../data/stock';
import cloneDeep from 'lodash-es/cloneDeep';

const clone = window.structuredClone ?? cloneDeep;

export default class BarBasic extends Component {
@service('dynamic-chart')
Expand All @@ -18,7 +20,7 @@ export default class BarBasic extends Component {
},
};

chartData = copy(stockData, true);
chartData = clone(stockData);

@action
updateSeriesData() {
Expand Down
6 changes: 4 additions & 2 deletions tests/dummy/app/components/chart-line-interactive.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import { copy } from 'ember-copy';
import { inject as service } from '@ember/service';
import Component from '@glimmer/component';
import commitStats from '../data/commit-stats';
import { action } from '@ember/object';
import cloneDeep from 'lodash-es/cloneDeep';

const clone = window.structuredClone ?? cloneDeep;

export default class BarBasic extends Component {
@service('dynamic-chart')
Expand All @@ -28,7 +30,7 @@ export default class BarBasic extends Component {
},
};

chartData = copy(commitStats, true);
chartData = clone(commitStats);

@action
updateSeriesData() {
Expand Down
6 changes: 4 additions & 2 deletions tests/dummy/app/services/dynamic-chart.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { copy } from 'ember-copy';
import Service from '@ember/service';
import cloneDeep from 'lodash-es/cloneDeep';

const clone = window.structuredClone ?? cloneDeep;

export default class DynamicChart extends Service {
getRandomInt(min, max) {
Expand All @@ -17,7 +19,7 @@ export default class DynamicChart extends Service {
}

updateSeriesCount(chartData, numSeries) {
let chartDataCopy = copy(chartData, true);
let chartDataCopy = clone(chartData);
return chartDataCopy.slice(0, numSeries);
}
}
8 changes: 5 additions & 3 deletions tests/integration/components/high-charts-test.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import { copy } from 'ember-copy';
import { module, test } from 'qunit';
import { setupRenderingTest } from 'ember-qunit';
import { render, settled } from '@ember/test-helpers';
import { hbs } from 'ember-cli-htmlbars';
import cloneDeep from 'lodash-es/cloneDeep';

const clone = window.structuredClone ?? cloneDeep;

import {
lineChartOptions,
Expand Down Expand Up @@ -65,7 +67,7 @@ module('Integration | Component | High Charts', function (hooks) {
.exists({ count: 3 }, 'base series count');

// add a series to chart content
let cityDataCopy = copy(cityData, true);
let cityDataCopy = clone(cityData);
cityDataCopy.push({
name: 'San Francisco',
data: [
Expand Down Expand Up @@ -96,7 +98,7 @@ module('Integration | Component | High Charts', function (hooks) {
.exists({ count: 3 }, 'base series count');

// remove a series from chart content
let cityDataCopy = copy(cityData, true);
let cityDataCopy = clone(cityData);
cityDataCopy = cityDataCopy.slice(0, 2);

this.set('cityData', cityDataCopy);
Expand Down
14 changes: 6 additions & 8 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4588,7 +4588,7 @@ ember-cli-babel-plugin-helpers@^1.0.0, ember-cli-babel-plugin-helpers@^1.1.1:
resolved "https://registry.yarnpkg.com/ember-cli-babel-plugin-helpers/-/ember-cli-babel-plugin-helpers-1.1.1.tgz#5016b80cdef37036c4282eef2d863e1d73576879"
integrity sha512-sKvOiPNHr5F/60NLd7SFzMpYPte/nnGkq/tMIfXejfKHIhaiIkYFqX8Z9UFTKWLLn+V7NOaby6niNPZUdvKCRw==

ember-cli-babel@^7.10.0, ember-cli-babel@^7.13.0, ember-cli-babel@^7.22.1, ember-cli-babel@^7.23.0, ember-cli-babel@^7.23.1, ember-cli-babel@^7.26.11, ember-cli-babel@^7.26.6, ember-cli-babel@^7.7.3:
ember-cli-babel@^7.10.0, ember-cli-babel@^7.13.0, ember-cli-babel@^7.23.0, ember-cli-babel@^7.23.1, ember-cli-babel@^7.26.11, ember-cli-babel@^7.26.6, ember-cli-babel@^7.7.3:
version "7.26.11"
resolved "https://registry.yarnpkg.com/ember-cli-babel/-/ember-cli-babel-7.26.11.tgz#50da0fe4dcd99aada499843940fec75076249a9f"
integrity sha512-JJYeYjiz/JTn34q7F5DSOjkkZqy8qwFOOxXfE6pe9yEJqWGu4qErKxlz8I22JoVEQ/aBUO+OcKTpmctvykM9YA==
Expand Down Expand Up @@ -4944,13 +4944,6 @@ ember-compatibility-helpers@^1.1.2, ember-compatibility-helpers@^1.2.0:
fs-extra "^9.1.0"
semver "^5.4.1"

ember-copy@^2.0.1:
version "2.0.1"
resolved "https://registry.yarnpkg.com/ember-copy/-/ember-copy-2.0.1.tgz#13192b12a250324bb4a8b4547a680b113f4e3041"
integrity sha512-N/XFvZszrzyyX4IcNoeK4mJvIItNuONumhPLqi64T8NDjJkxBj4Pq61rvMkJx/9eZ8alzE4I8vYKOLxT0FvRuQ==
dependencies:
ember-cli-babel "^7.22.1"

ember-load-initializers@^2.1.2:
version "2.1.2"
resolved "https://registry.yarnpkg.com/ember-load-initializers/-/ember-load-initializers-2.1.2.tgz#8a47a656c1f64f9b10cecdb4e22a9d52ad9c7efa"
Expand Down Expand Up @@ -7978,6 +7971,11 @@ locate-path@^7.1.0:
dependencies:
p-locate "^6.0.0"

lodash-es@^4.17.21:
version "4.17.21"
resolved "https://registry.yarnpkg.com/lodash-es/-/lodash-es-4.17.21.tgz#43e626c46e6591b7750beb2b50117390c609e3ee"
integrity sha512-mKnC+QJ9pWVzv+C4/U3rRsHapFfHvQFoFB92e52xeyGMcX6/OlIl78je1u8vePzYZSkkogMPJ2yjxxsb89cxyw==

lodash._baseflatten@^3.0.0:
version "3.1.4"
resolved "https://registry.yarnpkg.com/lodash._baseflatten/-/lodash._baseflatten-3.1.4.tgz#0770ff80131af6e34f3b511796a7ba5214e65ff7"
Expand Down

0 comments on commit e107c70

Please sign in to comment.