@jbrowse/core 2.7.1 → 2.7.2

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/PluginLoader.d.ts CHANGED
@@ -40,6 +40,7 @@ export interface PluginRecord {
40
40
  export interface LoadedPlugin {
41
41
  default: PluginConstructor;
42
42
  }
43
+ export declare function pluginDescriptionString(pluginDefinition: PluginDefinition): string;
43
44
  export default class PluginLoader {
44
45
  definitions: PluginDefinition[];
45
46
  fetchESM?: (url: string) => Promise<LoadedPlugin>;
package/PluginLoader.js CHANGED
@@ -3,7 +3,7 @@ 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.isCJSPluginDefinition = exports.isESMPluginDefinition = exports.isUMDPluginDefinition = void 0;
6
+ exports.pluginDescriptionString = exports.isCJSPluginDefinition = exports.isESMPluginDefinition = exports.isUMDPluginDefinition = void 0;
7
7
  const load_script_1 = __importDefault(require("load-script"));
8
8
  // locals
9
9
  const Plugin_1 = __importDefault(require("./Plugin"));
@@ -63,6 +63,7 @@ function pluginDescriptionString(pluginDefinition) {
63
63
  }
64
64
  return 'unknown plugin';
65
65
  }
66
+ exports.pluginDescriptionString = pluginDescriptionString;
66
67
  function isInWebWorker() {
67
68
  return Boolean('WorkerGlobalScope' in globalThis);
68
69
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jbrowse/core",
3
- "version": "2.7.1",
3
+ "version": "2.7.2",
4
4
  "description": "JBrowse 2 core libraries used by plugins",
5
5
  "keywords": [
6
6
  "jbrowse",
@@ -73,5 +73,5 @@
73
73
  "access": "public",
74
74
  "directory": "dist"
75
75
  },
76
- "gitHead": "2cda1611eebd12517f2a3cfc1b612face27005d4"
76
+ "gitHead": "9052b295f2d322e729254457ed9fe2231fb22cce"
77
77
  }
@@ -30,6 +30,11 @@ declare function stateModelFactory(pluginManager: PluginManager): import("mobx-s
30
30
  };
31
31
  }, import("../../configuration/configurationSchema").ConfigurationSchemaOptions<undefined, "connectionId">>;
32
32
  }, {
33
+ /**
34
+ * #action
35
+ */
36
+ connect(_arg: AnyConfigurationModel): void;
37
+ } & {
33
38
  afterAttach(): void;
34
39
  /**
35
40
  * #action
@@ -25,10 +25,15 @@ function stateModelFactory(pluginManager) {
25
25
  */
26
26
  configuration: (0, configuration_1.ConfigurationReference)(baseConnectionConfig_1.default),
27
27
  })
28
+ .actions(() => ({
29
+ /**
30
+ * #action
31
+ */
32
+ connect(_arg) { },
33
+ }))
28
34
  .actions(self => ({
29
35
  afterAttach() {
30
36
  if (self.tracks.length === 0) {
31
- // @ts-expect-error
32
37
  self.connect(self.configuration);
33
38
  }
34
39
  },
@@ -127,19 +127,17 @@ function createBaseTrackConfig(pluginManager) {
127
127
  }, {
128
128
  preProcessSnapshot: s2 => {
129
129
  const snap = pluginManager.evaluateExtensionPoint('Core-preProcessTrackConfig', JSON.parse(JSON.stringify(s2)));
130
- const displayTypes = new Set();
131
130
  const { displays = [] } = snap;
132
131
  if (snap.trackId !== 'placeholderId') {
133
132
  // Gets the displays on the track snapshot and the possible displays
134
133
  // from the track type and adds any missing possible displays to the
135
134
  // snapshot
136
- displays.forEach(d => d && displayTypes.add(d.type));
137
- const trackType = pluginManager.getTrackType(snap.type);
138
- trackType.displayTypes.forEach(displayType => {
139
- if (!displayTypes.has(displayType.name)) {
135
+ const configDisplayTypes = new Set(displays.filter(d => !!d).map(d => d.type));
136
+ pluginManager.getTrackType(snap.type).displayTypes.forEach(d => {
137
+ if (!configDisplayTypes.has(d.name)) {
140
138
  displays.push({
141
- displayId: `${snap.trackId}-${displayType.name}`,
142
- type: displayType.name,
139
+ displayId: `${snap.trackId}-${d.name}`,
140
+ type: d.name,
143
141
  });
144
142
  }
145
143
  });
@@ -130,7 +130,8 @@ class BaseRpcDriver {
130
130
  throw new TypeError('sessionId is required');
131
131
  }
132
132
  let done = false;
133
- const worker = await this.getWorker(sessionId);
133
+ const unextendedWorker = await this.getWorker(sessionId);
134
+ const worker = pluginManager.evaluateExtensionPoint('Core-extendWorker', unextendedWorker);
134
135
  const rpcMethod = pluginManager.getRpcMethodType(functionName);
135
136
  const serializedArgs = await rpcMethod.serializeArguments(args, this.name);
136
137
  const filteredAndSerializedArgs = this.filterArgs(serializedArgs, sessionId);