Skip to content
This repository was archived by the owner on Oct 16, 2024. It is now read-only.

Commit 1cada47

Browse files
authored
Merge pull request #211 from agile-ts/optimizing
Optimizing
2 parents b4f8dae + dfa4d6d commit 1cada47

File tree

81 files changed

+532
-639
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

81 files changed

+532
-639
lines changed

benchmark/benchmarks/benchmarkManager.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,7 @@ export function endBenchmarkLog(
4949
const cycleResult = results[i];
5050

5151
// Build Cycle Result Log
52-
const cycleString = `{bold.bgGreen ${
53-
i + 1
54-
}.} {bold.blue ${cycleResult.name
52+
const cycleString = `{bold.bgGreen ${i + 1}.} {bold.blue ${cycleResult.name
5553
.padEnd(20, '.')
5654
.replace(/(\.+)$/, '{red $1}')}}{yellow ${
5755
cycleResult.opsInSec

benchmark/benchmarks/react/1000fields/bench/agilets/collection.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import React from 'react';
22
import ReactDom from 'react-dom';
3-
import { createCollection, LogCodeManager, shared } from '@agile-ts/core';
3+
import { createCollection, logCodeManager, shared } from '@agile-ts/core';
44
import reactIntegration, { useAgile, useValue } from '@agile-ts/react';
55

6-
LogCodeManager.setAllowLogging(false);
6+
logCodeManager.allowLogging = false;
77
shared.integrate(reactIntegration);
88

99
export default function (target: HTMLElement, fieldsCount: number) {

benchmark/benchmarks/react/1000fields/bench/agilets/nestedState.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import * as React from 'react';
22
import * as ReactDom from 'react-dom';
3-
import { createState, LogCodeManager, shared, State } from '@agile-ts/core';
3+
import { createState, logCodeManager, shared, State } from '@agile-ts/core';
44
import reactIntegration, { useAgile } from '@agile-ts/react';
55

6-
LogCodeManager.setAllowLogging(false);
6+
logCodeManager.allowLogging = false;
77
shared.integrate(reactIntegration);
88

99
export default function (target: HTMLElement, fieldsCount: number) {

benchmark/benchmarks/react/1000fields/bench/agilets/state.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import React from 'react';
22
import ReactDom from 'react-dom';
3-
import { createState, LogCodeManager, shared } from '@agile-ts/core';
3+
import { createState, logCodeManager, shared } from '@agile-ts/core';
44
import reactIntegration, { useAgile } from '@agile-ts/react';
55

6-
LogCodeManager.setAllowLogging(false);
6+
logCodeManager.allowLogging = false;
77
shared.integrate(reactIntegration);
88

99
export default function (target: HTMLElement, fieldsCount: number) {

benchmark/benchmarks/react/computed/bench/agilets/autoTracking.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@ import ReactDom from 'react-dom';
33
import {
44
createComputed,
55
createState,
6-
LogCodeManager,
6+
logCodeManager,
77
shared,
88
} from '@agile-ts/core';
99
import reactIntegration, { useAgile } from '@agile-ts/react';
1010

11-
LogCodeManager.setAllowLogging(false);
11+
logCodeManager.allowLogging = false;
1212
shared.integrate(reactIntegration);
1313

1414
const COUNT = createState(0);

benchmark/benchmarks/react/computed/bench/agilets/hardCoded.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@ import ReactDom from 'react-dom';
33
import {
44
createComputed,
55
createState,
6-
LogCodeManager,
6+
logCodeManager,
77
shared,
88
} from '@agile-ts/core';
99
import reactIntegration, { useAgile } from '@agile-ts/react';
1010

11-
LogCodeManager.setAllowLogging(false);
11+
logCodeManager.allowLogging = false;
1212
shared.integrate(reactIntegration);
1313

1414
const COUNT = createState(0);

benchmark/benchmarks/react/counter/bench/agilets.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import React from 'react';
22
import ReactDom from 'react-dom';
3-
import { createState, LogCodeManager, shared } from '@agile-ts/core';
3+
import { createState, shared, logCodeManager } from '@agile-ts/core';
44
import reactIntegration, { useAgile } from '@agile-ts/react';
55

6-
LogCodeManager.setAllowLogging(false);
6+
logCodeManager.allowLogging = false;
77
shared.integrate(reactIntegration);
88

99
const COUNT = createState(0);

benchmark/benchmarks/typescript/cloneDeep/bench/looper.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,8 @@ export function cloneDeep<T = any>(value: T): T {
33
if (value == null || typeof value !== 'object') return value;
44

55
// Ignore everything that is no object or array but has the type of an object (e.g. classes)
6-
const valConstructorName = Object.getPrototypeOf(
7-
value
8-
).constructor.name.toLowerCase();
6+
const valConstructorName =
7+
Object.getPrototypeOf(value).constructor.name.toLowerCase();
98
if (valConstructorName !== 'object' && valConstructorName !== 'array')
109
return value;
1110

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
module.exports = {
22
reactStrictMode: true,
3-
}
3+
};
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
module.exports = {
22
reactStrictMode: true,
3-
}
3+
};

0 commit comments

Comments
 (0)