Skip to content
This repository was archived by the owner on Apr 18, 2024. It is now read-only.
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
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
Update libs and approach. Add testing flag.
  • Loading branch information
Gondragos committed Sep 26, 2023
commit 3a0f4547afabdb042e25a342fa098dce1f7d6927
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -167,9 +167,9 @@
"lodash.ismatch": "^4.4.0",
"lodash.throttle": "^4.1.1",
"mini-css-extract-plugin": "^2.7.5",
"mobx": "^5.15.4",
"mobx-react": "^6",
"mobx-state-tree": "^3.16.0",
"mobx": "6.10.2",
"mobx-react": "7",
"mobx-state-tree": "5.2.0",
"nanoid": "^3.3.0",
"node-fetch": "^2.6.1",
"pleasejs": "^0.4.2",
Expand Down
1 change: 1 addition & 0 deletions src/lib/AudioUltra/Visual/Visualizer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,7 @@ export class Visualizer extends Events<VisualizerEvents> {
}

clear() {
this.setLoading(false);
this.layers.get('main')?.clear();
this.transferImage();
}
Expand Down
7 changes: 7 additions & 0 deletions src/regions/AudioRegion/AudioRegionModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -216,4 +216,11 @@ export const AudioRegionModel = types
self._ws_region.element.style.display = self.hidden ? 'none' : 'block';
e?.stopPropagation();
},

clearWSRegion() {
self._ws_region = null;
},
setWSRegion(wsRegion) {
self._ws_region = wsRegion;
},
}));
7 changes: 7 additions & 0 deletions src/regions/AudioRegion/AudioUltraRegionModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -144,5 +144,12 @@ export const AudioUltraRegionModel = types
self.updatePosition();
}
},

clearWSRegion() {
self._ws_region = null;
},
setWSRegion(wsRegion) {
self._ws_region = wsRegion;
},
};
});
4 changes: 2 additions & 2 deletions src/tags/object/AudioNext/model.js
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ export const AudioModel = types.compose(
states,
});

r._ws_region = wsRegion;
r.setWSRegion(wsRegion);

self.regions.push(r);
self.annotation.addRegion(r);
Expand Down Expand Up @@ -288,7 +288,7 @@ export const AudioModel = types.compose(

const r = self._ws.addRegion(region.wsRegionOptions);

region._ws_region = r;
region.setWSRegion(r);
region.updateAppearenceFromState();
},

Expand Down
4 changes: 2 additions & 2 deletions src/tags/object/AudioUltra/model.js
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,7 @@ export const AudioModel = types.compose(

const r = self._ws.addRegion(options, false);

region._ws_region = r;
region.setWSRegion(r);
},

updateWsRegion(region) {
Expand All @@ -458,7 +458,7 @@ export const AudioModel = types.compose(

clearRegionMappings() {
self.regs.forEach(r => {
r._ws_region = null;
r.clearWSRegion?.();
});
},

Expand Down
8 changes: 8 additions & 0 deletions src/utils/reactCleaner.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
const NO_CLEANING = true;

export function cutFibers(object) {
if (NO_CLEANING) return;
const objects = [object];
let obj;

Expand Down Expand Up @@ -29,6 +32,7 @@ export function cutFibers(object) {
}

export function findReactKey(node) {
if (NO_CLEANING) return;
const keys = Object.keys(node);

for (const key of keys) {
Expand All @@ -42,6 +46,7 @@ export function findReactKey(node) {
}

export function cleanDomAfterReact(nodes, reactKey) {
if (NO_CLEANING) return;
for (const node of nodes) {
if (node.isConnected) return;
// preventing processing svgs due to the problem with props,
Expand All @@ -64,6 +69,7 @@ export function cleanDomAfterReact(nodes, reactKey) {
const globalCache = new WeakMap();

function createCleaner() {
if (NO_CLEANING) return;
let ref = null;

return (node) => {
Expand All @@ -84,6 +90,8 @@ function createCleaner() {
}

export function reactCleaner(object, key = 'default') {
if (NO_CLEANING) return;
return void 0;
if (!globalCache.has(object)) {
globalCache.set(object, new Map());
}
Expand Down
2 changes: 2 additions & 0 deletions tests/functional/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
"scripts": {
"test": "cypress run --quiet --browser chrome",
"test:ui": "cypress open",
"test:ui:e2e:chrome": "cypress open --browser chrome --e2e",
"test:ui:e2e:firefox": "cypress open --browser firefox --e2e",
"test:with-coverage": "COLLECT_COVERAGE=true yarn test:parallel",
"test:parallel": "cypress-parallel -r spec -b -m -s test -t ${CPU_NUMBER:=2} -d ./specs/",
"test:reset": "rm -rf output && yarn run cvg:reset",
Expand Down
39 changes: 22 additions & 17 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -8167,7 +8167,7 @@ loader-runner@^4.2.0:
version "4.2.0"
resolved "https://registry.yarnpkg.com/loader-runner/-/loader-runner-4.2.0.tgz#d7022380d66d14c5fb1d496b89864ebcfd478384"

[email protected], loader-utils@^1.1.0, loader-utils@^1.4.0, loader-utils@^2.0.0:
[email protected], loader-utils@^1.4.0, loader-utils@^2.0.0, loader-utils@^2.0.3:
version "2.0.4"
resolved "https://registry.yarnpkg.com/loader-utils/-/loader-utils-2.0.4.tgz#8b5cb38b5c34a9a018ee1fc0e6a066d1dfcc528c"
integrity sha512-xXqpXoINfFhgua9xiqD8fPFHgkoq1mmmpE92WlDbm9rNRd/EbRb+Gqf908T2DMfuHjjJlksiK2RbHVOdD/MqSw==
Expand Down Expand Up @@ -8486,23 +8486,27 @@ mkdirp@^1.0.4, mkdirp@~1.0.4:
version "1.0.4"
resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-1.0.4.tgz#3eb5ed62622756d79a5f0e2a221dfebad75c2f7e"

mobx-react-lite@^2.2.0:
version "2.2.2"
resolved "https://registry.yarnpkg.com/mobx-react-lite/-/mobx-react-lite-2.2.2.tgz#87c217dc72b4e47b22493daf155daf3759f868a6"
mobx-react-lite@^3.4.0:
version "3.4.3"
resolved "https://registry.yarnpkg.com/mobx-react-lite/-/mobx-react-lite-3.4.3.tgz#3a4c22c30bfaa8b1b2aa48d12b2ba811c0947ab7"
integrity sha512-NkJREyFTSUXR772Qaai51BnE1voWx56LOL80xG7qkZr6vo8vEaLF3sz1JNUVh+rxmUzxYaqOhfuxTfqUh0FXUg==

mobx-react@^6:
version "6.3.1"
resolved "https://registry.yarnpkg.com/mobx-react/-/mobx-react-6.3.1.tgz#204f9756e42e19d91cb6598837063b7e7de87c52"
mobx-react@7:
version "7.6.0"
resolved "https://registry.yarnpkg.com/mobx-react/-/mobx-react-7.6.0.tgz#ebf0456728a9bd2e5c24fdcf9b36e285a222a7d6"
integrity sha512-+HQUNuh7AoQ9ZnU6c4rvbiVVl+wEkb9WqYsVDzGLng+Dqj1XntHu79PvEWKtSMoMj67vFp/ZPXcElosuJO8ckA==
dependencies:
mobx-react-lite "^2.2.0"
mobx-react-lite "^3.4.0"

mobx-state-tree@^3.16.0:
version "3.17.3"
resolved "https://registry.yarnpkg.com/mobx-state-tree/-/mobx-state-tree-3.17.3.tgz#e9c40dca17e7b72ad01270852a516145bf6b6c72"
[email protected]:
version "5.2.0"
resolved "https://registry.yarnpkg.com/mobx-state-tree/-/mobx-state-tree-5.2.0.tgz#784fb22b7d2b1598c6b4fb8987d68d86eaf66d8b"
integrity sha512-TAKfMHEF9F59iAcLbD1Y9D8Kand4NoYM1h8Yv3Ol5la9X0I7T4Y/mhVN/oK/bi3g0v7dYy9wsoni2T66zCohGQ==

mobx@^5.15.4:
version "5.15.7"
resolved "https://registry.yarnpkg.com/mobx/-/mobx-5.15.7.tgz#b9a5f2b6251f5d96980d13c78e9b5d8d4ce22665"
[email protected]:
version "6.10.2"
resolved "https://registry.yarnpkg.com/mobx/-/mobx-6.10.2.tgz#96e123deef140750360ca9a5b02a8b91fbffd4d9"
integrity sha512-B1UGC3ieK3boCjnMEcZSwxqRDMdzX65H/8zOHbuTY8ZhvrIjTUoLRR2TP2bPqIgYRfb3+dUigu8yMZufNjn0LQ==

moment@^2.24.0, moment@^2.25.3:
version "2.29.4"
Expand Down Expand Up @@ -9978,13 +9982,14 @@ [email protected]:
scheduler "^0.23.0"

react-hot-loader@^4.13.0:
version "4.13.0"
resolved "https://registry.yarnpkg.com/react-hot-loader/-/react-hot-loader-4.13.0.tgz#c27e9408581c2a678f5316e69c061b226dc6a202"
version "4.13.1"
resolved "https://registry.yarnpkg.com/react-hot-loader/-/react-hot-loader-4.13.1.tgz#979fd7598e27338b3faffae6ed01c65374dace5e"
integrity sha512-ZlqCfVRqDJmMXTulUGic4lN7Ic1SXgHAFw7y/Jb7t25GBgTR0fYAJ8uY4mrpxjRyWGWmqw77qJQGnYbzCvBU7g==
dependencies:
fast-levenshtein "^2.0.6"
global "^4.3.0"
hoist-non-react-statics "^3.3.0"
loader-utils "^1.1.0"
loader-utils "^2.0.3"
prop-types "^15.6.1"
react-lifecycles-compat "^3.0.4"
shallowequal "^1.1.0"
Expand Down