@jbrowse/core 3.0.3 → 3.0.4
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/BaseFeatureWidget/SequenceFeatureDetails/dialogs/HelpDialog.js +1 -1
- package/data_adapters/dataAdapterCache.d.ts +1 -1
- package/data_adapters/dataAdapterCache.js +4 -8
- package/package.json +2 -2
- package/pluggableElementTypes/renderers/BoxRendererType.d.ts +14 -29
- package/pluggableElementTypes/renderers/BoxRendererType.js +46 -61
- package/pluggableElementTypes/renderers/LayoutSession.d.ts +25 -0
- package/pluggableElementTypes/renderers/LayoutSession.js +42 -0
- package/pluggableElementTypes/renderers/RendererType.d.ts +1 -1
- package/pluggableElementTypes/renderers/RendererType.js +1 -3
- package/pluggableElementTypes/renderers/ServerSideRendererType.d.ts +1 -1
- package/pluggableElementTypes/renderers/ServerSideRendererType.js +2 -3
- package/rpc/methods/CoreFreeResources.d.ts +1 -1
- package/rpc/methods/CoreFreeResources.js +3 -8
- package/rpc/methods/CoreGetFeatureDetails.js +1 -1
- package/tsconfig.build.tsbuildinfo +1 -1
- package/ui/index.d.ts +1 -0
- package/ui/index.js +3 -1
- package/util/types/index.d.ts +2 -1
|
@@ -11,7 +11,7 @@ const material_1 = require("@mui/material");
|
|
|
11
11
|
function HelpDialog({ handleClose, }) {
|
|
12
12
|
return ((0, jsx_runtime_1.jsxs)(ui_1.Dialog, { maxWidth: "xl", open: true, onClose: () => {
|
|
13
13
|
handleClose();
|
|
14
|
-
}, title: "Feature sequence panel help", children: [(0, jsx_runtime_1.jsxs)(material_1.DialogContent, { children: [(0, jsx_runtime_1.jsx)(material_1.Typography, {
|
|
14
|
+
}, title: "Feature sequence panel help", children: [(0, jsx_runtime_1.jsxs)(material_1.DialogContent, { children: [(0, jsx_runtime_1.jsx)(material_1.Typography, { children: "The \"Feature sequence\" panel shows the underlying genomic sequence for a given feature, fetched from the reference genome." }), (0, jsx_runtime_1.jsx)(material_1.Typography, { children: "For gene features, this panel does special calculations to e.g. stitch together the coding sequence, the options are:" }), (0, jsx_runtime_1.jsxs)("ul", { children: [(0, jsx_runtime_1.jsx)("li", { children: "CDS - shows the stitched together CDS sequences" }), (0, jsx_runtime_1.jsx)("li", { children: "Protein - the translated coding sequence, with the \"standard\" genetic code" }), (0, jsx_runtime_1.jsx)("li", { children: "cDNA - shows the 'copy DNA' of transcript, formed from exon sequences" }), (0, jsx_runtime_1.jsx)("li", { children: "Genomic w/ introns +/- Nbp up+down stream - the sequence underlying the entire gene including including introns, with UTR and CDS highlighted" })] }), (0, jsx_runtime_1.jsx)(material_1.Typography, { children: "For other feature types, the options are:" }), (0, jsx_runtime_1.jsx)("ul", { children: (0, jsx_runtime_1.jsx)("li", { children: "Genomic +/- Nbp up+down stream - the reference genome sequence underlying the feature, with the up and downstream sequence" }) }), (0, jsx_runtime_1.jsxs)(material_1.Typography, { children: ["Note 1: you can use the \"gear icon\" ", (0, jsx_runtime_1.jsx)(Settings_1.default, {}), " to edit the number of bp displayed up/downstream and in the intron region"] }), (0, jsx_runtime_1.jsx)(material_1.Typography, { children: "Note 2: The 'Copy HTML' function retains the colors from the sequence panel but cannot be pasted into some programs like notepad that only expect plain text." })] }), (0, jsx_runtime_1.jsx)(material_1.DialogActions, { children: (0, jsx_runtime_1.jsx)(material_1.Button, { onClick: () => {
|
|
15
15
|
handleClose();
|
|
16
16
|
}, autoFocus: true, variant: "contained", children: "Close" }) })] }));
|
|
17
17
|
}
|
|
@@ -9,6 +9,6 @@ interface AdapterCacheEntry {
|
|
|
9
9
|
}
|
|
10
10
|
export declare function getAdapter(pluginManager: PluginManager, sessionId: string, adapterConfigSnapshot: SnapshotIn<AnyConfigurationSchemaType>): Promise<AdapterCacheEntry>;
|
|
11
11
|
export type getSubAdapterType = (adapterConfigSnap: ConfigSnap) => ReturnType<typeof getAdapter>;
|
|
12
|
-
export declare function freeAdapterResources(
|
|
12
|
+
export declare function freeAdapterResources(args: Record<string, any>): void;
|
|
13
13
|
export declare function clearAdapterCache(): void;
|
|
14
14
|
export {};
|
|
@@ -29,23 +29,20 @@ async function getAdapter(pluginManager, sessionId, adapterConfigSnapshot) {
|
|
|
29
29
|
cacheEntry.sessionIds.add(sessionId);
|
|
30
30
|
return cacheEntry;
|
|
31
31
|
}
|
|
32
|
-
function freeAdapterResources(
|
|
33
|
-
|
|
34
|
-
const specKeys = Object.keys(specification);
|
|
32
|
+
function freeAdapterResources(args) {
|
|
33
|
+
const specKeys = Object.keys(args);
|
|
35
34
|
if (specKeys.length === 1 && specKeys[0] === 'sessionId') {
|
|
36
|
-
const { sessionId } =
|
|
35
|
+
const { sessionId } = args;
|
|
37
36
|
Object.entries(adapterCache).forEach(([cacheKey, cacheEntry]) => {
|
|
38
37
|
cacheEntry.sessionIds.delete(sessionId);
|
|
39
38
|
if (cacheEntry.sessionIds.size === 0) {
|
|
40
|
-
deleteCount += 1;
|
|
41
39
|
delete adapterCache[cacheKey];
|
|
42
40
|
}
|
|
43
41
|
});
|
|
44
42
|
}
|
|
45
43
|
else {
|
|
46
44
|
Object.values(adapterCache).forEach(cacheEntry => {
|
|
47
|
-
const regions =
|
|
48
|
-
(specification.region ? [specification.region] : []);
|
|
45
|
+
const regions = args.regions || (args.region ? [args.region] : []);
|
|
49
46
|
for (const region of regions) {
|
|
50
47
|
if (region.refName !== undefined) {
|
|
51
48
|
cacheEntry.dataAdapter.freeResources(region);
|
|
@@ -53,7 +50,6 @@ function freeAdapterResources(specification) {
|
|
|
53
50
|
}
|
|
54
51
|
});
|
|
55
52
|
}
|
|
56
|
-
return deleteCount;
|
|
57
53
|
}
|
|
58
54
|
function clearAdapterCache() {
|
|
59
55
|
adapterCache = {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jbrowse/core",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.4",
|
|
4
4
|
"description": "JBrowse 2 core libraries used by plugins",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"jbrowse",
|
|
@@ -69,5 +69,5 @@
|
|
|
69
69
|
"access": "public",
|
|
70
70
|
"directory": "dist"
|
|
71
71
|
},
|
|
72
|
-
"gitHead": "
|
|
72
|
+
"gitHead": "61e6d26f83acbf58a946c2add3415bc46b878df9"
|
|
73
73
|
}
|
|
@@ -1,35 +1,14 @@
|
|
|
1
1
|
import FeatureRendererType from './FeatureRendererType';
|
|
2
|
-
import
|
|
3
|
-
import MultiLayout from '../../util/layouts/MultiLayout';
|
|
2
|
+
import { LayoutSession } from './LayoutSession';
|
|
4
3
|
import PrecomputedLayout from '../../util/layouts/PrecomputedLayout';
|
|
5
4
|
import type { RenderArgs as FeatureRenderArgs, RenderArgsDeserialized as FeatureRenderArgsDeserialized, RenderArgsSerialized as FeatureRenderArgsSerialized, RenderResults as FeatureRenderResults, ResultsDeserialized as FeatureResultsDeserialized, ResultsSerialized as FeatureResultsSerialized } from './FeatureRendererType';
|
|
6
|
-
import type {
|
|
7
|
-
import type { Feature, Region } from '../../util';
|
|
8
|
-
import type SerializableFilterChain from './util/serializableFilterChain';
|
|
5
|
+
import type { LayoutSessionProps } from './LayoutSession';
|
|
9
6
|
import type RpcManager from '../../rpc/RpcManager';
|
|
7
|
+
import type { Feature, Region } from '../../util';
|
|
10
8
|
import type { BaseLayout, SerializedLayout } from '../../util/layouts/BaseLayout';
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
bpPerPx: number;
|
|
14
|
-
filters?: SerializableFilterChain;
|
|
15
|
-
}
|
|
9
|
+
import type GranularRectLayout from '../../util/layouts/GranularRectLayout';
|
|
10
|
+
import type MultiLayout from '../../util/layouts/MultiLayout';
|
|
16
11
|
export type MyMultiLayout = MultiLayout<GranularRectLayout<unknown>, unknown>;
|
|
17
|
-
export interface CachedLayout {
|
|
18
|
-
layout: MyMultiLayout;
|
|
19
|
-
config: AnyConfigurationModel;
|
|
20
|
-
filters?: SerializableFilterChain;
|
|
21
|
-
}
|
|
22
|
-
export declare class LayoutSession implements LayoutSessionProps {
|
|
23
|
-
config: AnyConfigurationModel;
|
|
24
|
-
bpPerPx: number;
|
|
25
|
-
filters?: SerializableFilterChain;
|
|
26
|
-
constructor(args: LayoutSessionProps);
|
|
27
|
-
update(props: LayoutSessionProps): void;
|
|
28
|
-
makeLayout(): MultiLayout<GranularRectLayout<unknown>, unknown>;
|
|
29
|
-
cachedLayoutIsValid(cachedLayout: CachedLayout): boolean;
|
|
30
|
-
cachedLayout: CachedLayout | undefined;
|
|
31
|
-
get layout(): MyMultiLayout;
|
|
32
|
-
}
|
|
33
12
|
export interface RenderArgs extends FeatureRenderArgs {
|
|
34
13
|
bpPerPx: number;
|
|
35
14
|
layoutId: string;
|
|
@@ -53,7 +32,12 @@ export interface ResultsDeserialized extends FeatureResultsDeserialized {
|
|
|
53
32
|
layout: PrecomputedLayout<string>;
|
|
54
33
|
}
|
|
55
34
|
export default class BoxRendererType extends FeatureRendererType {
|
|
56
|
-
|
|
35
|
+
layoutSessions: Record<string, LayoutSession>;
|
|
36
|
+
createLayoutSession(props: LayoutSessionProps): LayoutSession;
|
|
37
|
+
getLayoutSession(props: {
|
|
38
|
+
sessionId: string;
|
|
39
|
+
layoutId: string;
|
|
40
|
+
}): LayoutSession | undefined;
|
|
57
41
|
getWorkerSession(props: LayoutSessionProps & {
|
|
58
42
|
sessionId: string;
|
|
59
43
|
layoutId: string;
|
|
@@ -65,8 +49,9 @@ export default class BoxRendererType extends FeatureRendererType {
|
|
|
65
49
|
reversed?: boolean | undefined;
|
|
66
50
|
assemblyName: string;
|
|
67
51
|
};
|
|
68
|
-
|
|
69
|
-
|
|
52
|
+
freeResources(args: Record<string, any>): void;
|
|
53
|
+
freeResourcesInWorker(args: Record<string, any>): void;
|
|
54
|
+
freeResourcesInClient(rpcManager: RpcManager, args: RenderArgs): Promise<void>;
|
|
70
55
|
deserializeLayoutInClient(json: SerializedLayout): PrecomputedLayout<unknown>;
|
|
71
56
|
deserializeResultsInClient(result: ResultsSerialized, args: RenderArgs): ResultsDeserialized;
|
|
72
57
|
createLayoutInWorker(args: RenderArgsDeserialized): GranularRectLayout<unknown>;
|
|
@@ -3,62 +3,28 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.LayoutSession = void 0;
|
|
7
|
-
const fast_deep_equal_1 = __importDefault(require("fast-deep-equal"));
|
|
8
6
|
const FeatureRendererType_1 = __importDefault(require("./FeatureRendererType"));
|
|
7
|
+
const LayoutSession_1 = require("./LayoutSession");
|
|
9
8
|
const configuration_1 = require("../../configuration");
|
|
10
9
|
const util_1 = require("../../util");
|
|
11
|
-
const GranularRectLayout_1 = __importDefault(require("../../util/layouts/GranularRectLayout"));
|
|
12
|
-
const MultiLayout_1 = __importDefault(require("../../util/layouts/MultiLayout"));
|
|
13
10
|
const PrecomputedLayout_1 = __importDefault(require("../../util/layouts/PrecomputedLayout"));
|
|
14
|
-
class LayoutSession {
|
|
15
|
-
constructor(args) {
|
|
16
|
-
this.config = args.config;
|
|
17
|
-
this.bpPerPx = args.bpPerPx;
|
|
18
|
-
this.filters = args.filters;
|
|
19
|
-
this.update(args);
|
|
20
|
-
}
|
|
21
|
-
update(props) {
|
|
22
|
-
Object.assign(this, props);
|
|
23
|
-
}
|
|
24
|
-
makeLayout() {
|
|
25
|
-
return new MultiLayout_1.default(GranularRectLayout_1.default, {
|
|
26
|
-
maxHeight: (0, configuration_1.readConfObject)(this.config, 'maxHeight'),
|
|
27
|
-
displayMode: (0, configuration_1.readConfObject)(this.config, 'displayMode'),
|
|
28
|
-
pitchX: this.bpPerPx,
|
|
29
|
-
pitchY: (0, configuration_1.readConfObject)(this.config, 'noSpacing') ? 1 : 3,
|
|
30
|
-
});
|
|
31
|
-
}
|
|
32
|
-
cachedLayoutIsValid(cachedLayout) {
|
|
33
|
-
return (cachedLayout.layout.subLayoutConstructorArgs.pitchX === this.bpPerPx &&
|
|
34
|
-
(0, fast_deep_equal_1.default)((0, configuration_1.readConfObject)(this.config), cachedLayout.config) &&
|
|
35
|
-
(0, fast_deep_equal_1.default)(this.filters, cachedLayout.filters));
|
|
36
|
-
}
|
|
37
|
-
get layout() {
|
|
38
|
-
if (!this.cachedLayout || !this.cachedLayoutIsValid(this.cachedLayout)) {
|
|
39
|
-
this.cachedLayout = {
|
|
40
|
-
layout: this.makeLayout(),
|
|
41
|
-
config: (0, configuration_1.readConfObject)(this.config),
|
|
42
|
-
filters: this.filters,
|
|
43
|
-
};
|
|
44
|
-
}
|
|
45
|
-
return this.cachedLayout.layout;
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
exports.LayoutSession = LayoutSession;
|
|
49
11
|
class BoxRendererType extends FeatureRendererType_1.default {
|
|
50
12
|
constructor() {
|
|
51
13
|
super(...arguments);
|
|
52
|
-
this.
|
|
14
|
+
this.layoutSessions = {};
|
|
15
|
+
}
|
|
16
|
+
createLayoutSession(props) {
|
|
17
|
+
return new LayoutSession_1.LayoutSession(props);
|
|
18
|
+
}
|
|
19
|
+
getLayoutSession(props) {
|
|
20
|
+
return this.layoutSessions[(0, util_1.getLayoutId)(props)];
|
|
53
21
|
}
|
|
54
22
|
getWorkerSession(props) {
|
|
55
23
|
const key = (0, util_1.getLayoutId)(props);
|
|
56
|
-
if (!this.
|
|
57
|
-
this.
|
|
24
|
+
if (!this.layoutSessions[key]) {
|
|
25
|
+
this.layoutSessions[key] = this.createLayoutSession(props);
|
|
58
26
|
}
|
|
59
|
-
|
|
60
|
-
session.update(props);
|
|
61
|
-
return session;
|
|
27
|
+
return this.layoutSessions[key].update(props);
|
|
62
28
|
}
|
|
63
29
|
getExpandedRegion(region, renderArgs) {
|
|
64
30
|
const { bpPerPx, config } = renderArgs;
|
|
@@ -70,46 +36,65 @@ class BoxRendererType extends FeatureRendererType_1.default {
|
|
|
70
36
|
end: Math.ceil(region.end + bpExpansion),
|
|
71
37
|
};
|
|
72
38
|
}
|
|
73
|
-
|
|
74
|
-
|
|
39
|
+
freeResources(args) {
|
|
40
|
+
this.freeResourcesInWorker(args);
|
|
41
|
+
}
|
|
42
|
+
freeResourcesInWorker(args) {
|
|
43
|
+
const { regions } = args;
|
|
44
|
+
const key = (0, util_1.getLayoutId)(args);
|
|
45
|
+
const session = this.layoutSessions[key];
|
|
46
|
+
if (session) {
|
|
47
|
+
const region = regions[0];
|
|
48
|
+
session.layout.discardRange(region.refName, region.start, region.end);
|
|
49
|
+
}
|
|
75
50
|
}
|
|
76
51
|
async freeResourcesInClient(rpcManager, args) {
|
|
77
52
|
const { regions } = args;
|
|
78
53
|
const key = (0, util_1.getLayoutId)(args);
|
|
79
|
-
const session = this.
|
|
54
|
+
const session = this.layoutSessions[key];
|
|
80
55
|
if (session) {
|
|
81
56
|
const region = regions[0];
|
|
82
57
|
session.layout.discardRange(region.refName, region.start, region.end);
|
|
83
58
|
}
|
|
84
|
-
return
|
|
59
|
+
return super.freeResourcesInClient(rpcManager, args);
|
|
85
60
|
}
|
|
86
61
|
deserializeLayoutInClient(json) {
|
|
87
62
|
return new PrecomputedLayout_1.default(json);
|
|
88
63
|
}
|
|
89
64
|
deserializeResultsInClient(result, args) {
|
|
90
65
|
const layout = this.deserializeLayoutInClient(result.layout);
|
|
91
|
-
return super.deserializeResultsInClient({
|
|
66
|
+
return super.deserializeResultsInClient({
|
|
67
|
+
...result,
|
|
68
|
+
layout,
|
|
69
|
+
}, args);
|
|
92
70
|
}
|
|
93
71
|
createLayoutInWorker(args) {
|
|
94
72
|
const { regions } = args;
|
|
95
|
-
const
|
|
96
|
-
return
|
|
73
|
+
const { layout } = this.getWorkerSession(args);
|
|
74
|
+
return layout.getSublayout(regions[0].refName);
|
|
97
75
|
}
|
|
98
76
|
serializeResultsInWorker(results, args) {
|
|
99
|
-
const
|
|
77
|
+
const { features, ...rest } = super.serializeResultsInWorker(results, args);
|
|
100
78
|
const region = args.regions[0];
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
79
|
+
const layout = results.layout.serializeRegion(this.getExpandedRegion(region, args));
|
|
80
|
+
return {
|
|
81
|
+
...rest,
|
|
82
|
+
layout,
|
|
83
|
+
maxHeightReached: layout.maxHeightReached,
|
|
84
|
+
features: features.filter(f => !!layout.rectangles[f.uniqueId]),
|
|
85
|
+
};
|
|
107
86
|
}
|
|
108
87
|
async render(props) {
|
|
109
88
|
const layout = props.layout ||
|
|
110
89
|
this.createLayoutInWorker(props);
|
|
111
|
-
const result = await super.render({
|
|
112
|
-
|
|
90
|
+
const result = await super.render({
|
|
91
|
+
...props,
|
|
92
|
+
layout,
|
|
93
|
+
});
|
|
94
|
+
return {
|
|
95
|
+
...result,
|
|
96
|
+
layout,
|
|
97
|
+
};
|
|
113
98
|
}
|
|
114
99
|
}
|
|
115
100
|
exports.default = BoxRendererType;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import GranularRectLayout from '../../util/layouts/GranularRectLayout';
|
|
2
|
+
import MultiLayout from '../../util/layouts/MultiLayout';
|
|
3
|
+
import type { AnyConfigurationModel } from '../../configuration';
|
|
4
|
+
import type { Region } from '../../util';
|
|
5
|
+
import type SerializableFilterChain from './util/serializableFilterChain';
|
|
6
|
+
export interface LayoutSessionProps {
|
|
7
|
+
regions: Region[];
|
|
8
|
+
config: AnyConfigurationModel;
|
|
9
|
+
bpPerPx: number;
|
|
10
|
+
filters?: SerializableFilterChain;
|
|
11
|
+
}
|
|
12
|
+
export type MyMultiLayout = MultiLayout<GranularRectLayout<unknown>, unknown>;
|
|
13
|
+
export interface CachedLayout {
|
|
14
|
+
layout: MyMultiLayout;
|
|
15
|
+
props: LayoutSessionProps;
|
|
16
|
+
}
|
|
17
|
+
export declare class LayoutSession {
|
|
18
|
+
props: LayoutSessionProps;
|
|
19
|
+
cachedLayout: CachedLayout | undefined;
|
|
20
|
+
constructor(props: LayoutSessionProps);
|
|
21
|
+
update(props: LayoutSessionProps): this;
|
|
22
|
+
makeLayout(): MultiLayout<GranularRectLayout<unknown>, unknown>;
|
|
23
|
+
cachedLayoutIsValid(cachedLayout: CachedLayout): boolean;
|
|
24
|
+
get layout(): MyMultiLayout;
|
|
25
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.LayoutSession = void 0;
|
|
7
|
+
const fast_deep_equal_1 = __importDefault(require("fast-deep-equal"));
|
|
8
|
+
const configuration_1 = require("../../configuration");
|
|
9
|
+
const GranularRectLayout_1 = __importDefault(require("../../util/layouts/GranularRectLayout"));
|
|
10
|
+
const MultiLayout_1 = __importDefault(require("../../util/layouts/MultiLayout"));
|
|
11
|
+
class LayoutSession {
|
|
12
|
+
constructor(props) {
|
|
13
|
+
this.props = props;
|
|
14
|
+
}
|
|
15
|
+
update(props) {
|
|
16
|
+
this.props = props;
|
|
17
|
+
return this;
|
|
18
|
+
}
|
|
19
|
+
makeLayout() {
|
|
20
|
+
return new MultiLayout_1.default(GranularRectLayout_1.default, {
|
|
21
|
+
maxHeight: (0, configuration_1.readConfObject)(this.props.config, 'maxHeight'),
|
|
22
|
+
displayMode: (0, configuration_1.readConfObject)(this.props.config, 'displayMode'),
|
|
23
|
+
pitchX: this.props.bpPerPx,
|
|
24
|
+
pitchY: (0, configuration_1.readConfObject)(this.props.config, 'noSpacing') ? 1 : 3,
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
cachedLayoutIsValid(cachedLayout) {
|
|
28
|
+
return (cachedLayout.props.bpPerPx === this.props.bpPerPx &&
|
|
29
|
+
(0, fast_deep_equal_1.default)((0, configuration_1.readConfObject)(this.props.config), (0, configuration_1.readConfObject)(cachedLayout.props.config)) &&
|
|
30
|
+
(0, fast_deep_equal_1.default)(this.props.filters, cachedLayout.props.filters));
|
|
31
|
+
}
|
|
32
|
+
get layout() {
|
|
33
|
+
if (!this.cachedLayout || !this.cachedLayoutIsValid(this.cachedLayout)) {
|
|
34
|
+
this.cachedLayout = {
|
|
35
|
+
layout: this.makeLayout(),
|
|
36
|
+
props: this.props,
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
return this.cachedLayout.layout;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
exports.LayoutSession = LayoutSession;
|
|
@@ -44,6 +44,6 @@ export default class ServerSideRenderer extends RendererType {
|
|
|
44
44
|
serializeResultsInWorker(results: RenderResults, args: RenderArgsDeserialized): ResultsSerialized;
|
|
45
45
|
renderInClient(rpcManager: RpcManager, args: RenderArgs): Promise<ResultsSerialized>;
|
|
46
46
|
renderInWorker(args: RenderArgsSerialized): Promise<ResultsSerialized>;
|
|
47
|
-
freeResourcesInClient(rpcManager: RpcManager, args: RenderArgs): Promise<
|
|
47
|
+
freeResourcesInClient(rpcManager: RpcManager, args: RenderArgs): Promise<void>;
|
|
48
48
|
}
|
|
49
49
|
export { type RenderResults } from './RendererType';
|
|
@@ -75,9 +75,8 @@ class ServerSideRenderer extends RendererType_1.default {
|
|
|
75
75
|
}
|
|
76
76
|
async freeResourcesInClient(rpcManager, args) {
|
|
77
77
|
const serializedArgs = this.serializeArgsInClient(args);
|
|
78
|
-
const
|
|
79
|
-
|
|
80
|
-
return freed + freedRpc;
|
|
78
|
+
const { sessionId } = args;
|
|
79
|
+
await rpcManager.call(sessionId, 'CoreFreeResources', serializedArgs);
|
|
81
80
|
}
|
|
82
81
|
}
|
|
83
82
|
exports.default = ServerSideRenderer;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import RpcMethodType from '../../pluggableElementTypes/RpcMethodType';
|
|
2
2
|
export default class CoreFreeResources extends RpcMethodType {
|
|
3
3
|
name: string;
|
|
4
|
-
execute(
|
|
4
|
+
execute(args: Record<string, unknown>): Promise<void>;
|
|
5
5
|
serializeArguments(args: Record<string, unknown>, _rpcDriver: string): Promise<Record<string, unknown>>;
|
|
6
6
|
}
|
|
@@ -10,16 +10,11 @@ class CoreFreeResources extends RpcMethodType_1.default {
|
|
|
10
10
|
super(...arguments);
|
|
11
11
|
this.name = 'CoreFreeResources';
|
|
12
12
|
}
|
|
13
|
-
async execute(
|
|
14
|
-
|
|
15
|
-
deleteCount += (0, dataAdapterCache_1.freeAdapterResources)(specification);
|
|
13
|
+
async execute(args) {
|
|
14
|
+
(0, dataAdapterCache_1.freeAdapterResources)(args);
|
|
16
15
|
this.pluginManager.getRendererTypes().forEach(renderer => {
|
|
17
|
-
|
|
18
|
-
if (count) {
|
|
19
|
-
deleteCount += count;
|
|
20
|
-
}
|
|
16
|
+
renderer.freeResources(args);
|
|
21
17
|
});
|
|
22
|
-
return deleteCount;
|
|
23
18
|
}
|
|
24
19
|
async serializeArguments(args, _rpcDriver) {
|
|
25
20
|
return args;
|
|
@@ -31,7 +31,7 @@ class CoreGetFeatureDetails extends RpcMethodType_1.default {
|
|
|
31
31
|
const { rendererType, featureId } = deserializedArgs;
|
|
32
32
|
const RendererType = this.pluginManager.getRendererType(rendererType);
|
|
33
33
|
return {
|
|
34
|
-
feature: (_b = (_a = RendererType.
|
|
34
|
+
feature: (_b = (_a = RendererType.getLayoutSession(args)) === null || _a === void 0 ? void 0 : _a.cachedLayout.layout.getDataByID(featureId)) === null || _b === void 0 ? void 0 : _b.toJSON(),
|
|
35
35
|
};
|
|
36
36
|
}
|
|
37
37
|
}
|