Skip to content

Commit c2e2666

Browse files
author
pipeline
committed
v16.4.48 is released
1 parent 7d01067 commit c2e2666

File tree

394 files changed

+12380
-1717
lines changed

Some content is hidden

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

394 files changed

+12380
-1717
lines changed

controls/base/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@syncfusion/ej2-base",
3-
"version": "16.4.42",
3+
"version": "16.4.47",
44
"description": "A common package of Essential JS 2 base libraries, methods and class definitions",
55
"author": "Syncfusion Inc.",
66
"license": "SEE LICENSE IN license",

controls/base/styles/common/_icons.scss

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.
File renamed without changes.

controls/buttons/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@syncfusion/ej2-buttons",
3-
"version": "16.4.42",
3+
"version": "16.4.47",
44
"description": "A package of feature-rich Essential JS 2 components such as Button, CheckBox, RadioButton and Switch.",
55
"author": "Syncfusion Inc.",
66
"license": "SEE LICENSE IN license",

controls/buttons/spec/button.spec.ts

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,21 @@
11
import { Button } from '../src/button/button';
22
import { createElement, detach } from '@syncfusion/ej2-base';
3+
import { profile , inMB, getMemoryProfile } from './common.spec';
4+
35
/**
46
* @param {} 'Button'
57
* @param {} function(
68
*/
79
describe('Button', () => {
10+
beforeAll(() => {
11+
const isDef: any = (o: any) => o !== undefined && o !== null;
12+
if (!isDef(window.performance)) {
13+
console.log('Unsupported environment, window.performance.memory is unavailable');
14+
this.skip(); // skips test (in Chai)
15+
return;
16+
}
17+
});
18+
819
let button: Button;
920
let element: any = createElement('button', { id: 'button' });
1021
document.body.appendChild(element);
@@ -329,4 +340,14 @@ describe('Button', () => {
329340
Button.Inject();
330341
});
331342
});
343+
344+
it('memory leak', () => {
345+
profile.sample();
346+
let average: any = inMB(profile.averageChange);
347+
// check average change in memory samples to not be over 10MB
348+
expect(average).toBeLessThan(10);
349+
let memory: any = inMB(getMemoryProfile());
350+
// check the final memory usage against the first usage, there should be little change if everything was properly deallocated
351+
expect(memory).toBeLessThan(profile.samples[0] + 0.25);
352+
});
332353
});

controls/buttons/spec/check-box.spec.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,21 @@
11
import { createCheckBox } from './../src/common/common';
22
import { CheckBox } from './../src/check-box/check-box';
33
import { createElement } from '@syncfusion/ej2-base';
4+
import { profile , inMB, getMemoryProfile } from './common.spec';
45

56
/**
67
* CheckBox Spec document
78
*/
89
describe('CheckBox', () => {
10+
beforeAll(() => {
11+
const isDef: any = (o: any) => o !== undefined && o !== null;
12+
if (!isDef(window.performance)) {
13+
console.log('Unsupported environment, window.performance.memory is unavailable');
14+
this.skip(); // skips test (in Chai)
15+
return;
16+
}
17+
});
18+
919
let checkbox: any;
1020
let element: HTMLFormElement = createElement('input', { id: 'checkbox' }) as HTMLFormElement;
1121
element.setAttribute('type', 'checkbox');
@@ -351,4 +361,14 @@ describe('CheckBox', () => {
351361
expect(checkboxElem.classList.contains('e-rtl')).toBe(true);
352362
});
353363
});
364+
365+
it('memory leak', () => {
366+
profile.sample();
367+
let average: any = inMB(profile.averageChange);
368+
// check average change in memory samples to not be over 10MB
369+
expect(average).toBeLessThan(10);
370+
let memory: any = inMB(getMemoryProfile());
371+
// check the final memory usage against the first usage, there should be little change if everything was properly deallocated
372+
expect(memory).toBeLessThan(profile.samples[0] + 0.25);
373+
});
354374
});

controls/buttons/spec/common.spec.ts

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
interface Window {
2+
performance: { memory: any };
3+
}
4+
5+
declare var window: Window
6+
7+
export const inMB: any = (n: any) => n / 1000000;
8+
9+
function runningAverage(arr: any, newVal: any, oldAvg: any) {
10+
return ((oldAvg * (arr.length - 1) + newVal) / arr.length);
11+
};
12+
13+
export const getMemoryProfile: any = () => {
14+
return window.performance.memory.usedJSHeapSize; // return used memory
15+
};
16+
17+
export const profile: any = {
18+
samples: [] as any,
19+
diffs: [] as any,
20+
averageUsage: 0,
21+
averageChange: 0,
22+
// collects a sample of memory and updates all the values in the
23+
// profile object
24+
sample() {
25+
let newSample: any = getMemoryProfile();
26+
this.samples.push(newSample);
27+
this.averageUsage = runningAverage(this.samples, newSample, this.averageUsage);
28+
let sampleLen: any = this.samples.length;
29+
if (sampleLen >= 2) {
30+
let newDiff: any = this.samples[sampleLen - 1] - this.samples[sampleLen - 2];
31+
this.diffs.push(newDiff);
32+
this.averageChange = runningAverage(this.diffs, newDiff, this.averageChange);
33+
}
34+
}
35+
};

controls/buttons/spec/radio-button.spec.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,20 @@
11
import { RadioButton } from './../src/radio-button/radio-button';
22
import { createElement } from '@syncfusion/ej2-base';
3+
import { profile , inMB, getMemoryProfile } from './common.spec';
34

45
/**
56
* RadioButton Spec document
67
*/
78
describe('RadioButton', () => {
9+
beforeAll(() => {
10+
const isDef: any = (o: any) => o !== undefined && o !== null;
11+
if (!isDef(window.performance)) {
12+
console.log('Unsupported environment, window.performance.memory is unavailable');
13+
this.skip(); // skips test (in Chai)
14+
return;
15+
}
16+
});
17+
818
let radio: any;
919
let element: HTMLFormElement = createElement('input', { id: 'radio' }) as HTMLFormElement;
1020
element.setAttribute('type', 'radio');
@@ -263,4 +273,14 @@ describe('RadioButton', () => {
263273
expect(radio.element.type).toEqual('radio');
264274
});
265275
});
276+
277+
it('memory leak', () => {
278+
profile.sample();
279+
let average: any = inMB(profile.averageChange);
280+
// check average change in memory samples to not be over 10MB
281+
expect(average).toBeLessThan(10);
282+
let memory: any = inMB(getMemoryProfile());
283+
// check the final memory usage against the first usage, there should be little change if everything was properly deallocated
284+
expect(memory).toBeLessThan(profile.samples[0] + 0.25);
285+
});
266286
});

controls/buttons/spec/switch.spec.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { Switch } from './../src/switch/switch';
22
import { createElement } from '@syncfusion/ej2-base';
33
import { EventHandler } from '@syncfusion/ej2-base';
4+
import { profile , inMB, getMemoryProfile } from './common.spec';
45

56
/* tslint:disable */
67
function copyObject(source: any, destination: any): Object {
@@ -30,6 +31,15 @@ export function getEventObject(eventType: string, eventName: string): Object {
3031
* Switch Spec document.
3132
*/
3233
describe('Switch', () => {
34+
beforeAll(() => {
35+
const isDef: any = (o: any) => o !== undefined && o !== null;
36+
if (!isDef(window.performance)) {
37+
console.log('Unsupported environment, window.performance.memory is unavailable');
38+
this.skip(); // skips test (in Chai)
39+
return;
40+
}
41+
});
42+
3343
let specSwitch: any;
3444
let element: HTMLFormElement = createElement('input', {id: 'specSwitch'}) as HTMLFormElement;
3545
element.setAttribute('type', 'checkbox');
@@ -322,5 +332,15 @@ describe('Switch', () => {
322332
expect(specSwitch.checked).toEqual(false);
323333
})
324334
});
335+
336+
it('memory leak', () => {
337+
profile.sample();
338+
let average: any = inMB(profile.averageChange);
339+
// check average change in memory samples to not be over 10MB
340+
expect(average).toBeLessThan(10);
341+
let memory: any = inMB(getMemoryProfile());
342+
// check the final memory usage against the first usage, there should be little change if everything was properly deallocated
343+
expect(memory).toBeLessThan(profile.samples[0] + 0.25);
344+
});
325345
});
326346

controls/calendars/CHANGELOG.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,15 @@
22

33
## [Unreleased]
44

5-
## 16.4.47 (2019-01-08)
5+
## 16.4.48 (2019-01-16)
6+
7+
### TimePicker
8+
9+
#### Breaking Changes
10+
11+
- TimePicker pop-up will position at the center of the viewport in mobile resolution.
12+
13+
## 16.4.47 (2019-01-16)
614

715
### TimePicker
816

controls/calendars/dist/ej2-calendars.umd.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

controls/calendars/dist/ej2-calendars.umd.min.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)