@spectrum-web-components/grid 0.40.5 → 0.41.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@spectrum-web-components/grid",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.41.1",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -64,8 +64,8 @@
|
|
|
64
64
|
"dependencies": {
|
|
65
65
|
"@lit-labs/observers": "^2.0.0",
|
|
66
66
|
"@lit-labs/virtualizer": "^2.0.6",
|
|
67
|
-
"@spectrum-web-components/base": "^0.
|
|
68
|
-
"@spectrum-web-components/reactive-controllers": "^0.
|
|
67
|
+
"@spectrum-web-components/base": "^0.41.1",
|
|
68
|
+
"@spectrum-web-components/reactive-controllers": "^0.41.1",
|
|
69
69
|
"lit": "^2.5.0"
|
|
70
70
|
},
|
|
71
71
|
"types": "./src/index.d.ts",
|
|
@@ -74,5 +74,5 @@
|
|
|
74
74
|
"./sp-*.js",
|
|
75
75
|
"./**/*.dev.js"
|
|
76
76
|
],
|
|
77
|
-
"gitHead": "
|
|
77
|
+
"gitHead": "1eded35d98d01973b40990486b86840ba464a2da"
|
|
78
78
|
}
|
package/test/grid-memory.test.js
CHANGED
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
import { expect, fixture, nextFrame } from "@open-wc/testing";
|
|
3
3
|
import { html, render } from "@spectrum-web-components/base";
|
|
4
|
-
import { Default } from "../stories/grid.stories";
|
|
5
|
-
|
|
6
|
-
const memorySample = performance.measureUserAgentSpecificMemory();
|
|
7
|
-
return (await memorySample).bytes / (1024 * 1024);
|
|
8
|
-
}
|
|
4
|
+
import { Default } from "../stories/grid.stories.js";
|
|
5
|
+
import { usedHeapMB } from "../../../test/testing-helpers.js";
|
|
9
6
|
describe("Grid memory usage", () => {
|
|
10
7
|
it("releases references on disconnect", async function() {
|
|
11
8
|
if (!window.gc || !("measureUserAgentSpecificMemory" in performance))
|
|
@@ -35,9 +32,12 @@ describe("Grid memory usage", () => {
|
|
|
35
32
|
await toggle(false);
|
|
36
33
|
const afterMB = await usedHeapMB();
|
|
37
34
|
expect(
|
|
38
|
-
afterMB - beforeMB,
|
|
39
|
-
`before: ${beforeMB}, after: ${afterMB}
|
|
40
|
-
|
|
35
|
+
afterMB.total - beforeMB.total,
|
|
36
|
+
`Total | before: ${beforeMB.total}, after: ${afterMB.total}
|
|
37
|
+
DOM | before: ${beforeMB.dom}, after: ${afterMB.dom}
|
|
38
|
+
JS | before: ${beforeMB.js}, after: ${afterMB.js}
|
|
39
|
+
Shared | before: ${beforeMB.shared}, after: ${afterMB.shared}`
|
|
40
|
+
).to.be.lte(0);
|
|
41
41
|
});
|
|
42
42
|
});
|
|
43
43
|
//# sourceMappingURL=grid-memory.test.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["grid-memory.test.ts"],
|
|
4
|
-
"sourcesContent": ["/*\nCopyright 2023 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\n\nimport { expect, fixture, nextFrame } from '@open-wc/testing';\nimport { html, render } from '@spectrum-web-components/base';\nimport { Default } from '../stories/grid.stories';\
|
|
5
|
-
"mappings": ";AAYA,SAAS,QAAQ,SAAS,iBAAiB;AAC3C,SAAS,MAAM,cAAc;AAC7B,SAAS,eAAe;
|
|
4
|
+
"sourcesContent": ["/*\nCopyright 2023 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\n\nimport { expect, fixture, nextFrame } from '@open-wc/testing';\nimport { html, render } from '@spectrum-web-components/base';\nimport { Default } from '../stories/grid.stories.js';\nimport { usedHeapMB } from '../../../test/testing-helpers.js';\n\ndescribe('Grid memory usage', () => {\n it('releases references on disconnect', async function () {\n if (!window.gc || !('measureUserAgentSpecificMemory' in performance))\n this.skip();\n\n this.timeout(10000);\n\n const iterations = 50;\n let active = false;\n\n const el = await fixture<HTMLElement>(\n html`\n <div></div>\n `\n );\n\n async function toggle(\n forced: boolean | undefined = undefined\n ): Promise<void> {\n active = forced != null ? forced : !active;\n render(active ? Default() : html``, el);\n await nextFrame();\n await nextFrame();\n }\n\n // \"shake things out\" to get a good first reading\n for (let i = 0; i < 5; i++) {\n await toggle();\n }\n await toggle(false);\n const beforeMB = await usedHeapMB();\n\n for (let i = 0; i < iterations; i++) {\n await toggle();\n }\n await toggle(false);\n const afterMB = await usedHeapMB();\n\n /**\n * An actually leak here shapes up to be more than 10MB per test,\n * we could be more linient later, if needed, but the test currently\n * shows less heap after the test cycle.\n */\n expect(\n afterMB.total - beforeMB.total,\n `Total | before: ${beforeMB.total}, after: ${afterMB.total}\nDOM | before: ${beforeMB.dom}, after: ${afterMB.dom}\nJS | before: ${beforeMB.js}, after: ${afterMB.js}\nShared | before: ${beforeMB.shared}, after: ${afterMB.shared}`\n ).to.be.lte(0);\n });\n});\n"],
|
|
5
|
+
"mappings": ";AAYA,SAAS,QAAQ,SAAS,iBAAiB;AAC3C,SAAS,MAAM,cAAc;AAC7B,SAAS,eAAe;AACxB,SAAS,kBAAkB;AAE3B,SAAS,qBAAqB,MAAM;AAChC,KAAG,qCAAqC,iBAAkB;AACtD,QAAI,CAAC,OAAO,MAAM,EAAE,oCAAoC;AACpD,WAAK,KAAK;AAEd,SAAK,QAAQ,GAAK;AAElB,UAAM,aAAa;AACnB,QAAI,SAAS;AAEb,UAAM,KAAK,MAAM;AAAA,MACb;AAAA;AAAA;AAAA,IAGJ;AAEA,mBAAe,OACX,SAA8B,QACjB;AACb,eAAS,UAAU,OAAO,SAAS,CAAC;AACpC,aAAO,SAAS,QAAQ,IAAI,QAAQ,EAAE;AACtC,YAAM,UAAU;AAChB,YAAM,UAAU;AAAA,IACpB;AAGA,aAAS,IAAI,GAAG,IAAI,GAAG,KAAK;AACxB,YAAM,OAAO;AAAA,IACjB;AACA,UAAM,OAAO,KAAK;AAClB,UAAM,WAAW,MAAM,WAAW;AAElC,aAAS,IAAI,GAAG,IAAI,YAAY,KAAK;AACjC,YAAM,OAAO;AAAA,IACjB;AACA,UAAM,OAAO,KAAK;AAClB,UAAM,UAAU,MAAM,WAAW;AAOjC;AAAA,MACI,QAAQ,QAAQ,SAAS;AAAA,MACzB,mBAAmB,SAAS,KAAK,YAAY,QAAQ,KAAK;AAAA,gBACtD,SAAS,GAAG,YAAY,QAAQ,GAAG;AAAA,eACpC,SAAS,EAAE,YAAY,QAAQ,EAAE;AAAA,mBAC7B,SAAS,MAAM,YAAY,QAAQ,MAAM;AAAA,IACpD,EAAE,GAAG,GAAG,IAAI,CAAC;AAAA,EACjB,CAAC;AACL,CAAC;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|