@jbrowse/core 5.0.0-beta.1 → 5.0.0-beta.11
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/README.md +1709 -390
- package/esm/BaseFeatureWidget/BaseFeatureDetail/ArrayValue.d.ts +3 -2
- package/esm/BaseFeatureWidget/BaseFeatureDetail/ArrayValue.js +5 -5
- package/esm/BaseFeatureWidget/BaseFeatureDetail/Attributes.d.ts +3 -5
- package/esm/BaseFeatureWidget/BaseFeatureDetail/Attributes.js +34 -29
- package/esm/BaseFeatureWidget/BaseFeatureDetail/BaseCard.js +1 -4
- package/esm/BaseFeatureWidget/BaseFeatureDetail/BasicValue.d.ts +11 -0
- package/esm/BaseFeatureWidget/BaseFeatureDetail/BasicValue.js +37 -14
- package/esm/BaseFeatureWidget/BaseFeatureDetail/CoreDetails.d.ts +1 -1
- package/esm/BaseFeatureWidget/BaseFeatureDetail/CoreDetails.js +15 -31
- package/esm/BaseFeatureWidget/BaseFeatureDetail/FeatureDetails.d.ts +4 -3
- package/esm/BaseFeatureWidget/BaseFeatureDetail/FeatureDetails.js +12 -25
- package/esm/BaseFeatureWidget/BaseFeatureDetail/FeatureDetailsFrame.d.ts +11 -0
- package/esm/BaseFeatureWidget/BaseFeatureDetail/FeatureDetailsFrame.js +11 -0
- package/esm/BaseFeatureWidget/BaseFeatureDetail/FieldActionsButton.d.ts +8 -0
- package/esm/BaseFeatureWidget/BaseFeatureDetail/FieldActionsButton.js +24 -0
- package/esm/BaseFeatureWidget/BaseFeatureDetail/Formatter.js +6 -4
- package/esm/BaseFeatureWidget/BaseFeatureDetail/ParentFeatureLine.d.ts +4 -0
- package/esm/BaseFeatureWidget/BaseFeatureDetail/ParentFeatureLine.js +17 -0
- package/esm/BaseFeatureWidget/BaseFeatureDetail/SimpleField.d.ts +3 -2
- package/esm/BaseFeatureWidget/BaseFeatureDetail/SimpleField.js +5 -3
- package/esm/BaseFeatureWidget/BaseFeatureDetail/index.d.ts +6 -2
- package/esm/BaseFeatureWidget/BaseFeatureDetail/index.js +7 -18
- package/esm/BaseFeatureWidget/BaseFeatureDetail/jexlFilterActions.d.ts +16 -0
- package/esm/BaseFeatureWidget/BaseFeatureDetail/jexlFilterActions.js +49 -0
- package/esm/BaseFeatureWidget/BaseFeatureDetail/util.d.ts +0 -8
- package/esm/BaseFeatureWidget/BaseFeatureDetail/util.js +6 -29
- package/esm/BaseFeatureWidget/SequenceFeatureDetails/SequenceContents.js +7 -34
- package/esm/BaseFeatureWidget/SequenceFeatureDetails/SequenceFeaturePanel.d.ts +2 -2
- package/esm/BaseFeatureWidget/SequenceFeatureDetails/SequenceName.js +2 -2
- package/esm/BaseFeatureWidget/SequenceFeatureDetails/dialogs/TranscriptSelector.js +3 -1
- package/esm/BaseFeatureWidget/SequenceFeatureDetails/model.d.ts +12 -0
- package/esm/BaseFeatureWidget/SequenceFeatureDetails/model.js +12 -5
- package/esm/BaseFeatureWidget/SequenceFeatureDetails/useSequenceData.js +8 -5
- package/esm/BaseFeatureWidget/configSchema.d.ts +1 -1
- package/esm/BaseFeatureWidget/formatDetails.d.ts +13 -29
- package/esm/BaseFeatureWidget/formatDetails.js +62 -83
- package/esm/BaseFeatureWidget/index.d.ts +2 -1
- package/esm/BaseFeatureWidget/stateModelFactory.d.ts +42 -29
- package/esm/BaseFeatureWidget/stateModelFactory.js +98 -98
- package/esm/BaseFeatureWidget/types.d.ts +12 -6
- package/esm/BaseFeatureWidget/util.d.ts +0 -10
- package/esm/BaseFeatureWidget/util.js +0 -17
- package/esm/CorePlugin.js +34 -3
- package/esm/PluginLoader.d.ts +24 -13
- package/esm/PluginLoader.js +167 -51
- package/esm/PluginManager.d.ts +130 -24
- package/esm/PluginManager.js +180 -32
- package/esm/ReExports/MuiDataGridReExports.d.ts +1 -0
- package/esm/ReExports/MuiDataGridReExports.js +2 -2
- package/esm/ReExports/coreModules.generated.d.ts +2 -0
- package/esm/ReExports/coreModules.generated.js +530 -0
- package/esm/ReExports/coreWorkerModules.generated.d.ts +2 -0
- package/esm/ReExports/coreWorkerModules.generated.js +490 -0
- package/esm/ReExports/frameworkModules.d.ts +2 -0
- package/esm/ReExports/frameworkModules.js +68 -0
- package/esm/ReExports/frameworkShared.d.ts +12 -0
- package/esm/ReExports/frameworkShared.js +16 -0
- package/esm/ReExports/frameworkWorkerModules.generated.d.ts +2 -0
- package/esm/ReExports/frameworkWorkerModules.generated.js +130 -0
- package/esm/ReExports/list.js +528 -79
- package/esm/ReExports/modules.d.ts +1 -1
- package/esm/ReExports/modules.js +10 -165
- package/esm/ReExports/registry.d.ts +1 -0
- package/esm/ReExports/registry.js +23 -5
- package/esm/ReExports/uiStub.d.ts +3 -0
- package/esm/ReExports/uiStub.js +33 -0
- package/esm/ReExports/workerModules.d.ts +2 -0
- package/esm/ReExports/workerModules.js +11 -0
- package/esm/TextSearch/TextSearchManager.d.ts +27 -13
- package/esm/TextSearch/TextSearchManager.js +77 -36
- package/esm/TextSearch/places.d.ts +12 -0
- package/esm/TextSearch/places.js +94 -0
- package/esm/assemblyManager/assembly.d.ts +21 -19
- package/esm/assemblyManager/assembly.js +28 -26
- package/esm/assemblyManager/assemblyAdapters.d.ts +1 -1
- package/esm/assemblyManager/assemblyAdapters.js +8 -2
- package/esm/assemblyManager/assemblyConfigSchema.d.ts +31 -90
- package/esm/assemblyManager/assemblyConfigSchema.js +35 -47
- package/esm/assemblyManager/assemblyManager.d.ts +35 -180
- package/esm/assemblyManager/assemblyManager.js +47 -51
- package/esm/assemblyManager/expandAssemblyConfigShorthand.d.ts +25 -18
- package/esm/assemblyManager/expandAssemblyConfigShorthand.js +78 -49
- package/esm/assemblyManager/geneticCodes.js +2 -5
- package/esm/assemblyManager/getSequenceAdapterConfig.d.ts +10 -0
- package/esm/assemblyManager/getSequenceAdapterConfig.js +10 -0
- package/esm/assemblyManager/indexAssemblyNames.d.ts +9 -0
- package/esm/assemblyManager/indexAssemblyNames.js +22 -0
- package/esm/assemblyManager/loadRefNameMap.d.ts +1 -1
- package/esm/assemblyManager/loadRefNameMap.js +4 -9
- package/esm/assemblyManager/refNameMapKey.d.ts +7 -0
- package/esm/assemblyManager/refNameMapKey.js +12 -0
- package/esm/checkPlugins.d.ts +2 -0
- package/esm/checkPlugins.js +38 -17
- package/esm/configuration/bamIndexFields.d.ts +49 -0
- package/esm/configuration/bamIndexFields.js +41 -0
- package/esm/configuration/configurationSchema.d.ts +101 -71
- package/esm/configuration/configurationSchema.js +207 -134
- package/esm/configuration/configurationSchemaUnion.d.ts +39 -0
- package/esm/configuration/configurationSchemaUnion.js +56 -0
- package/esm/configuration/configurationSlot.d.ts +150 -60
- package/esm/configuration/configurationSlot.js +103 -75
- package/esm/configuration/fillLocations.d.ts +14 -0
- package/esm/configuration/fillLocations.js +14 -0
- package/esm/configuration/formatAboutConfigSchema.d.ts +7 -21
- package/esm/configuration/formatDetailsConfigSchema.d.ts +11 -37
- package/esm/configuration/formatDetailsConfigSchema.js +10 -13
- package/esm/configuration/fullConfSnapshot.d.ts +4 -19
- package/esm/configuration/fullConfSnapshot.js +30 -52
- package/esm/configuration/getConf.d.ts +45 -41
- package/esm/configuration/getConf.js +111 -44
- package/esm/configuration/index.d.ts +26 -11
- package/esm/configuration/index.js +16 -7
- package/esm/configuration/indexType.d.ts +26 -0
- package/esm/configuration/indexType.js +38 -0
- package/esm/configuration/mergeFormatCallbacks.d.ts +6 -7
- package/esm/configuration/mergeFormatCallbacks.js +13 -10
- package/esm/configuration/plot.d.ts +61 -0
- package/esm/configuration/plot.js +142 -0
- package/esm/configuration/readConfObject.d.ts +2 -24
- package/esm/configuration/readConfObject.js +20 -63
- package/esm/configuration/requirements.d.ts +37 -0
- package/esm/configuration/requirements.js +88 -0
- package/esm/configuration/schemaRegistry.d.ts +32 -15
- package/esm/configuration/schemaRegistry.js +33 -35
- package/esm/configuration/schemaTypes.d.ts +21 -5
- package/esm/configuration/schemaTypes.js +66 -55
- package/esm/configuration/slotFacade.d.ts +12 -29
- package/esm/configuration/slotFacade.js +44 -23
- package/esm/configuration/snapshotPreprocess.d.ts +43 -0
- package/esm/configuration/snapshotPreprocess.js +161 -0
- package/esm/configuration/tabixIndexFields.d.ts +30 -4
- package/esm/configuration/tabixIndexFields.js +21 -4
- package/esm/configuration/tabixShorthand.d.ts +34 -17
- package/esm/configuration/tabixShorthand.js +49 -22
- package/esm/configuration/types.d.ts +182 -43
- package/esm/configuration/uriShorthand.d.ts +9 -0
- package/esm/configuration/uriShorthand.js +16 -0
- package/esm/data_adapters/BaseAdapter/BaseAdapter.d.ts +13 -19
- package/esm/data_adapters/BaseAdapter/BaseAdapter.js +12 -19
- package/esm/data_adapters/BaseAdapter/BaseFeatureDataAdapter.d.ts +40 -2
- package/esm/data_adapters/BaseAdapter/BaseFeatureDataAdapter.js +68 -5
- package/esm/data_adapters/BaseAdapter/featureDensity.d.ts +40 -0
- package/esm/data_adapters/BaseAdapter/featureDensity.js +31 -0
- package/esm/data_adapters/BaseAdapter/index.d.ts +23 -3
- package/esm/data_adapters/BaseAdapter/index.js +1 -0
- package/esm/data_adapters/BaseAdapter/rowSources.d.ts +37 -0
- package/esm/data_adapters/BaseAdapter/rowSources.js +7 -0
- package/esm/data_adapters/BaseAdapter/stats.d.ts +33 -1
- package/esm/data_adapters/BaseAdapter/stats.js +52 -13
- package/esm/data_adapters/BaseAdapter/types.d.ts +8 -12
- package/esm/data_adapters/BaseAdapter/zoomRange.d.ts +10 -0
- package/esm/data_adapters/CytobandAdapter/CytobandAdapter.js +1 -1
- package/esm/data_adapters/CytobandAdapter/configSchema.d.ts +7 -11
- package/esm/data_adapters/CytobandAdapter/configSchema.js +3 -17
- package/esm/data_adapters/dataAdapterCache.d.ts +19 -2
- package/esm/data_adapters/dataAdapterCache.js +44 -10
- package/esm/data_adapters/getFeatureAdapter.d.ts +6 -4
- package/esm/data_adapters/getFeatureAdapter.js +8 -8
- package/esm/data_adapters/getSequenceSubAdapter.d.ts +7 -9
- package/esm/data_adapters/getSequenceSubAdapter.js +8 -10
- package/esm/pluggableElementTypes/AdapterType.d.ts +8 -8
- package/esm/pluggableElementTypes/AdapterType.js +1 -1
- package/esm/pluggableElementTypes/DisplayType.d.ts +53 -16
- package/esm/pluggableElementTypes/DisplayType.js +28 -12
- package/esm/pluggableElementTypes/LazyStateModelElement.d.ts +32 -0
- package/esm/pluggableElementTypes/LazyStateModelElement.js +77 -0
- package/esm/pluggableElementTypes/PluggableElementBase.d.ts +3 -5
- package/esm/pluggableElementTypes/PluggableElementBase.js +3 -5
- package/esm/pluggableElementTypes/RpcMethodType.d.ts +11 -1
- package/esm/pluggableElementTypes/RpcMethodType.js +25 -9
- package/esm/pluggableElementTypes/RpcMethodTypeWithFiltersAndRenameRegions.d.ts +1 -2
- package/esm/pluggableElementTypes/TextSearchAdapterType.d.ts +7 -7
- package/esm/pluggableElementTypes/ViewType.d.ts +20 -4
- package/esm/pluggableElementTypes/ViewType.js +32 -4
- package/esm/pluggableElementTypes/WidgetType.d.ts +6 -0
- package/esm/pluggableElementTypes/WidgetType.js +6 -0
- package/esm/pluggableElementTypes/addMenuItems.d.ts +3 -2
- package/esm/pluggableElementTypes/extendElementType.d.ts +1 -2
- package/esm/pluggableElementTypes/extendElementType.js +9 -5
- package/esm/pluggableElementTypes/index.d.ts +2 -1
- package/esm/pluggableElementTypes/index.js +2 -9
- package/esm/pluggableElementTypes/models/BaseConnectionModelFactory.d.ts +19 -9
- package/esm/pluggableElementTypes/models/BaseDisplayModel.d.ts +122 -28
- package/esm/pluggableElementTypes/models/BaseDisplayModel.js +155 -11
- package/esm/pluggableElementTypes/models/BaseTrackModel.d.ts +65 -16
- package/esm/pluggableElementTypes/models/BaseTrackModel.js +179 -117
- package/esm/pluggableElementTypes/models/BaseViewModel.d.ts +87 -18
- package/esm/pluggableElementTypes/models/BaseViewModel.js +54 -11
- package/esm/pluggableElementTypes/models/InternetAccountModel.d.ts +26 -16
- package/esm/pluggableElementTypes/models/assertDisplayContract.d.ts +15 -11
- package/esm/pluggableElementTypes/models/assertDisplayContract.js +25 -32
- package/esm/pluggableElementTypes/models/baseConnectionConfig.d.ts +22 -18
- package/esm/pluggableElementTypes/models/baseConnectionConfig.js +5 -5
- package/esm/pluggableElementTypes/models/baseInternetAccountConfig.d.ts +26 -31
- package/esm/pluggableElementTypes/models/baseTrackConfig.d.ts +108 -147
- package/esm/pluggableElementTypes/models/baseTrackConfig.js +96 -73
- package/esm/pluggableElementTypes/models/components/SaveTrackData.js +4 -6
- package/esm/pluggableElementTypes/models/components/fetchTrackData.d.ts +3 -4
- package/esm/pluggableElementTypes/models/components/fetchTrackData.js +3 -3
- package/esm/pluggableElementTypes/models/expandTrackConfigShorthand.d.ts +23 -13
- package/esm/pluggableElementTypes/models/expandTrackConfigShorthand.js +80 -48
- package/esm/pluggableElementTypes/models/index.d.ts +2 -3
- package/esm/pluggableElementTypes/models/index.js +2 -3
- package/esm/pluggableElementTypes/models/migrateTrackConfig.d.ts +15 -1
- package/esm/pluggableElementTypes/models/migrateTrackConfig.js +85 -25
- package/esm/pluggableElementTypes/models/saveTrackFileTypes/genbank.d.ts +4 -3
- package/esm/pluggableElementTypes/models/saveTrackFileTypes/genbank.js +141 -19
- package/esm/pluggableElementTypes/models/saveTrackFileTypes/types.d.ts +3 -3
- package/esm/pluginDefinitions.d.ts +34 -7
- package/esm/pluginDefinitions.js +54 -20
- package/esm/rpc/BaseRpcDriver.d.ts +2 -2
- package/esm/rpc/BaseRpcDriver.js +25 -30
- package/esm/rpc/MainThreadRpcDriver.d.ts +2 -2
- package/esm/rpc/MainThreadRpcDriver.js +13 -8
- package/esm/rpc/RpcClient.d.ts +18 -6
- package/esm/rpc/RpcClient.js +51 -16
- package/esm/rpc/RpcManager.d.ts +14 -10
- package/esm/rpc/RpcManager.js +11 -1
- package/esm/rpc/RpcRegistry.d.ts +40 -7
- package/esm/rpc/RpcServer.d.ts +3 -1
- package/esm/rpc/RpcServer.js +19 -12
- package/esm/rpc/WebWorkerRpcDriver.d.ts +11 -4
- package/esm/rpc/WebWorkerRpcDriver.js +64 -68
- package/esm/rpc/byteBudget.d.ts +20 -5
- package/esm/rpc/byteBudget.js +16 -5
- package/esm/rpc/configSchema.d.ts +7 -21
- package/esm/rpc/coreRpcMethods.d.ts +4 -0
- package/esm/rpc/coreRpcMethods.js +4 -0
- package/esm/rpc/methods/CoreGetEncodedFeature.d.ts +13 -0
- package/esm/rpc/methods/CoreGetEncodedFeature.js +32 -0
- package/esm/rpc/methods/CoreGetEncodedLayers.d.ts +16 -0
- package/esm/rpc/methods/CoreGetEncodedLayers.js +59 -0
- package/esm/rpc/methods/CoreGetExportData.js +3 -4
- package/esm/rpc/methods/CoreGetFeatureDensity.d.ts +11 -0
- package/esm/rpc/methods/CoreGetFeatureDensity.js +22 -0
- package/esm/rpc/methods/CoreGetFeatures.js +3 -5
- package/esm/rpc/methods/CoreGetRefNames.js +2 -12
- package/esm/rpc/methods/CoreGetRegionByteEstimate.js +1 -1
- package/esm/rpc/methods/CoreGetSequence.js +2 -2
- package/esm/rpc/methods/CoreLoadAdapterCode.d.ts +13 -0
- package/esm/rpc/methods/CoreLoadAdapterCode.js +16 -0
- package/esm/rpc/methods/layerFeatures.d.ts +33 -0
- package/esm/rpc/methods/layerFeatures.js +29 -0
- package/esm/svg/SvgExport.js +6 -7
- package/esm/svg/SvgThemeProviders.d.ts +12 -0
- package/esm/svg/SvgThemeProviders.js +15 -0
- package/esm/svg/exportViewSvg.d.ts +28 -0
- package/esm/svg/exportViewSvg.js +13 -0
- package/esm/svg/normalizeSvgMarkup.d.ts +7 -0
- package/esm/svg/normalizeSvgMarkup.js +99 -0
- package/esm/svg/serializeSvg.d.ts +7 -0
- package/esm/svg/serializeSvg.js +11 -0
- package/esm/svg/svgId.d.ts +1 -1
- package/esm/svg/svgId.js +1 -1
- package/esm/svg/svgReady.d.ts +9 -7
- package/esm/svg/svgReady.js +8 -7
- package/esm/svg/trackNames.d.ts +7 -5
- package/esm/svg/trackNames.js +12 -9
- package/esm/svg/wrapSvgExport.js +6 -74
- package/esm/ui/AddCustomPluginDialog.js +3 -8
- package/esm/ui/AppReadyMarker.d.ts +45 -0
- package/esm/ui/AppReadyMarker.js +89 -0
- package/esm/ui/BaseExportSvgDialog.d.ts +1 -1
- package/esm/ui/CascadingMenu.js +181 -104
- package/esm/ui/DropDownMenu.js +2 -1
- package/esm/ui/ErrorBanner.js +1 -1
- package/esm/ui/ErrorBoundary.d.ts +2 -2
- package/esm/ui/ErrorMessageStackTraceContents.js +2 -1
- package/esm/ui/ErrorMessageStackTraceDialog.js +5 -11
- package/esm/ui/ExportSvgDialog.d.ts +1 -1
- package/esm/ui/FileDropZone.js +2 -1
- package/esm/ui/FileSelector/useInternetAccounts.d.ts +156 -96
- package/esm/ui/HoverMenu.d.ts +1 -2
- package/esm/ui/HoverMenu.js +6 -3
- package/esm/ui/JexlFilterDialog.d.ts +13 -10
- package/esm/ui/JexlFilterDialog.js +122 -50
- package/esm/ui/JexlFilterRowEditors.d.ts +15 -0
- package/esm/ui/JexlFilterRowEditors.js +90 -0
- package/esm/ui/LazyBaseTooltip.d.ts +4 -0
- package/esm/ui/LazyBaseTooltip.js +9 -0
- package/esm/ui/LegendSwatchGlyph.js +26 -21
- package/esm/ui/LoadingOverlay.d.ts +14 -0
- package/esm/ui/LoadingOverlay.js +4 -2
- package/esm/ui/MenuTypes.d.ts +23 -53
- package/esm/ui/MenuTypes.js +3 -0
- package/esm/ui/MonospaceTextField.d.ts +2 -1
- package/esm/ui/MonospaceTextField.js +23 -20
- package/esm/ui/PaletteContext.d.ts +10 -5
- package/esm/ui/PaletteContext.js +44 -6
- package/esm/ui/RefNameAutocomplete/SearchOption.d.ts +13 -0
- package/esm/ui/RefNameAutocomplete/SearchOption.js +45 -0
- package/esm/ui/RefNameAutocomplete/index.d.ts +1 -2
- package/esm/ui/RefNameAutocomplete/index.js +8 -2
- package/esm/ui/RefNameAutocomplete/util.d.ts +13 -0
- package/esm/ui/RefNameAutocomplete/util.js +42 -1
- package/esm/ui/ResizeHandle.d.ts +3 -1
- package/esm/ui/ResizeHandle.js +44 -11
- package/esm/ui/ScrollChrome.d.ts +13 -0
- package/esm/ui/ScrollChrome.js +11 -0
- package/esm/ui/ScrollEdgeShadow.d.ts +6 -9
- package/esm/ui/ScrollEdgeShadow.js +14 -35
- package/esm/ui/ScrollZoomToggle.d.ts +4 -27
- package/esm/ui/ScrollZoomToggle.js +34 -51
- package/esm/ui/SessionJsonPanel.d.ts +3 -0
- package/esm/ui/SessionJsonPanel.js +14 -0
- package/esm/ui/SettingsChangesTable.d.ts +1 -0
- package/esm/ui/SettingsChangesTable.js +49 -11
- package/esm/ui/ShareLinkField.d.ts +1 -3
- package/esm/ui/ShareLinkField.js +13 -40
- package/esm/ui/SizeSliderRow.d.ts +1 -3
- package/esm/ui/SizeSliderRow.js +4 -6
- package/esm/ui/SnackbarModel.js +79 -67
- package/esm/ui/StatusProgressBar.js +2 -2
- package/esm/ui/SvgColorLegend.d.ts +9 -4
- package/esm/ui/SvgColorLegend.js +82 -41
- package/esm/ui/VerticalScrollbar.d.ts +13 -34
- package/esm/ui/VerticalScrollbar.js +29 -83
- package/esm/ui/ViewLoadingScreen.d.ts +5 -4
- package/esm/ui/ViewLoadingScreen.js +8 -32
- package/esm/ui/colorScale.d.ts +92 -0
- package/esm/ui/colorScale.js +72 -0
- package/esm/ui/colors.d.ts +64 -0
- package/esm/ui/colors.js +230 -1
- package/esm/ui/hoverBoxStyle.d.ts +14 -2
- package/esm/ui/hoverBoxStyle.js +17 -2
- package/esm/ui/index.d.ts +12 -12
- package/esm/ui/index.js +14 -22
- package/esm/ui/launchViewMenu.js +15 -5
- package/esm/ui/legendMenuItem.d.ts +10 -32
- package/esm/ui/legendMenuItem.js +9 -36
- package/esm/ui/legendSpec.d.ts +15 -8
- package/esm/ui/legendSpec.js +14 -23
- package/esm/ui/makeSizeMenu.d.ts +0 -6
- package/esm/ui/makeSizeMenu.js +6 -30
- package/esm/ui/measureLegendText.js +1 -1
- package/esm/ui/menuItemAdornment.d.ts +9 -20
- package/esm/ui/menuItemAdornment.js +10 -32
- package/esm/ui/menuItems.d.ts +2 -7
- package/esm/ui/menuItems.js +1 -6
- package/esm/ui/multiTrackMenuItems.d.ts +6 -0
- package/esm/ui/palette.d.ts +118 -116
- package/esm/ui/palette.js +114 -75
- package/esm/ui/replaceViewAction.d.ts +1 -1
- package/esm/ui/replaceViewAction.js +1 -1
- package/esm/ui/theme.d.ts +43 -119
- package/esm/ui/theme.js +62 -78
- package/esm/ui/toggleMenuItems.d.ts +1 -3
- package/esm/ui/toggleMenuItems.js +6 -5
- package/esm/ui/useAssemblySelection.d.ts +4 -4
- package/esm/ui/viewHeaderHeight.d.ts +1 -0
- package/esm/ui/viewHeaderHeight.js +1 -0
- package/esm/util/Base1DUtils.d.ts +5 -3
- package/esm/util/Base1DUtils.js +14 -6
- package/esm/util/Base1DViewModel.d.ts +2 -1
- package/esm/util/Base1DViewModel.js +3 -2
- package/esm/util/SvgCanvas.d.ts +15 -13
- package/esm/util/SvgCanvas.js +76 -56
- package/esm/util/TimeTraveller.d.ts +3 -0
- package/esm/util/TimeTraveller.js +34 -2
- package/esm/util/aborting.d.ts +39 -0
- package/esm/util/aborting.js +88 -6
- package/esm/util/adapterMetadata.d.ts +1 -1
- package/esm/util/adapterMetadata.js +6 -5
- package/esm/util/addAndShowTrack.d.ts +2 -5
- package/esm/util/addAndShowTrack.js +5 -1
- package/esm/util/addRelativeUris.d.ts +17 -5
- package/esm/util/addRelativeUris.js +46 -10
- package/esm/util/addTrackFromWidget.d.ts +2 -5
- package/esm/util/addTrackFromWidget.js +5 -4
- package/esm/util/aggregateFieldName.d.ts +10 -0
- package/esm/util/aggregateFieldName.js +8 -0
- package/esm/util/analytics.js +46 -13
- package/esm/util/animationAllowed.d.ts +9 -0
- package/esm/util/animationAllowed.js +13 -0
- package/esm/util/applyRowResizeWheel.d.ts +10 -5
- package/esm/util/applyRowResizeWheel.js +10 -21
- package/esm/util/bandHeight.d.ts +10 -0
- package/esm/util/bandHeight.js +29 -0
- package/esm/util/bandLayout.d.ts +4 -4
- package/esm/util/bandLayout.js +4 -4
- package/esm/util/baseDisplayConfig.d.ts +8 -0
- package/esm/util/baseDisplayConfig.js +27 -0
- package/esm/util/bezierConnector.d.ts +4 -3
- package/esm/util/bezierConnector.js +38 -45
- package/esm/util/bgzfWorkerPool.d.ts +20 -74
- package/esm/util/bgzfWorkerPool.js +20 -74
- package/esm/util/binnedAggregate.d.ts +17 -0
- package/esm/util/binnedAggregate.js +275 -0
- package/esm/util/cacheBudgets.d.ts +22 -19
- package/esm/util/cacheBudgets.js +22 -19
- package/esm/util/cachedSetup.d.ts +16 -6
- package/esm/util/cachedSetup.js +108 -38
- package/esm/util/categoricalField.d.ts +56 -0
- package/esm/util/categoricalField.js +73 -0
- package/esm/util/cellMatches.d.ts +23 -0
- package/esm/util/cellMatches.js +264 -0
- package/esm/util/cellsStep.d.ts +29 -0
- package/esm/util/cellsStep.js +437 -0
- package/esm/util/clampToContig.d.ts +17 -0
- package/esm/util/clampToContig.js +19 -0
- package/esm/util/coarseStripHTML.js +1 -2
- package/esm/util/color/cssColorsLevel4.d.ts +1 -0
- package/esm/util/color/cssColorsLevel4.js +1 -0
- package/esm/util/color/index.d.ts +5 -3
- package/esm/util/color/index.js +7 -4
- package/esm/util/colorBits.d.ts +3 -3
- package/esm/util/colorBits.js +19 -44
- package/esm/util/colorRamp.d.ts +49 -5
- package/esm/util/colorRamp.js +169 -18
- package/esm/util/colorScale.d.ts +156 -0
- package/esm/util/colorScale.js +243 -0
- package/esm/util/colorSchemes.d.ts +21 -0
- package/esm/util/colorSchemes.js +30 -0
- package/esm/util/copyToClipboard.js +8 -1
- package/esm/util/{createStopTokenRotation.d.ts → createAbortRotation.d.ts} +21 -23
- package/esm/util/{createStopTokenRotation.js → createAbortRotation.js} +21 -52
- package/esm/util/createSvgRasterCanvas.d.ts +10 -0
- package/esm/util/cssColorParse.d.ts +15 -0
- package/esm/util/cssColorParse.js +53 -0
- package/esm/util/diagonalizeRegions.d.ts +2 -3
- package/esm/util/diagonalizeRegions.js +8 -13
- package/esm/util/expandLooseSearchIndex.d.ts +19 -0
- package/esm/util/expandLooseSearchIndex.js +29 -0
- package/esm/util/featureTable.d.ts +224 -0
- package/esm/util/featureTable.js +366 -0
- package/esm/util/featureTransforms.d.ts +81 -0
- package/esm/util/featureTransforms.js +1231 -0
- package/esm/util/featureTypes.d.ts +24 -0
- package/esm/util/featureTypes.js +35 -0
- package/esm/util/fetchAndMaybeUnzip.js +16 -9
- package/esm/util/fetchContext.d.ts +7 -8
- package/esm/util/fetchContext.js +3 -3
- package/esm/util/fetchHub.d.ts +4 -2
- package/esm/util/fetchHub.js +2 -2
- package/esm/util/fetchPhases.d.ts +10 -10
- package/esm/util/fetchSeq.d.ts +2 -3
- package/esm/util/fetchSeq.js +2 -2
- package/esm/util/fieldReader.d.ts +17 -0
- package/esm/util/fieldReader.js +62 -0
- package/esm/util/formatBytes.js +1 -1
- package/esm/util/formatGuessers.d.ts +25 -14
- package/esm/util/formatGuessers.js +42 -27
- package/esm/util/formatRelativeTime.js +1 -1
- package/esm/util/freezeDeep.d.ts +8 -10
- package/esm/util/freezeDeep.js +8 -10
- package/esm/util/getLocationUri.d.ts +2 -1
- package/esm/util/getLocationUri.js +8 -2
- package/esm/util/groupKeys.d.ts +76 -0
- package/esm/util/groupKeys.js +156 -0
- package/esm/util/highlights.d.ts +10 -6
- package/esm/util/highlights.js +12 -25
- package/esm/util/hooks.d.ts +31 -2
- package/esm/util/hooks.js +72 -3
- package/esm/util/index.d.ts +11 -11
- package/esm/util/index.js +11 -10
- package/esm/util/indexCandidates.d.ts +1 -31
- package/esm/util/indexCandidates.js +5 -63
- package/esm/util/installFetch.d.ts +77 -37
- package/esm/util/installFetch.js +65 -38
- package/esm/util/installInitAutorun.d.ts +14 -13
- package/esm/util/installInitAutorun.js +17 -17
- package/esm/util/installPrerequisiteFetch.d.ts +115 -0
- package/esm/util/installPrerequisiteFetch.js +111 -0
- package/esm/util/intervals.js +9 -4
- package/esm/util/io/index.js +22 -15
- package/esm/util/isDataCurrent.d.ts +7 -5
- package/esm/util/isDataCurrent.js +9 -6
- package/esm/util/isTextEntryFocused.d.ts +7 -0
- package/esm/util/isTextEntryFocused.js +16 -0
- package/esm/util/jexl.js +24 -21
- package/esm/util/jexlFilterRows.d.ts +89 -0
- package/esm/util/jexlFilterRows.js +252 -0
- package/esm/util/jexlFilters.d.ts +32 -57
- package/esm/util/jexlFilters.js +31 -29
- package/esm/util/jexlStrings.d.ts +3 -4
- package/esm/util/jexlStrings.js +2 -3
- package/esm/util/layouts/GranularRectLayout.d.ts +8 -1
- package/esm/util/layouts/GranularRectLayout.js +25 -8
- package/esm/util/lazyAfterAttach.d.ts +13 -0
- package/esm/util/lazyAfterAttach.js +31 -0
- package/esm/util/lazyWithPreload.d.ts +19 -0
- package/esm/util/lazyWithPreload.js +27 -0
- package/esm/util/legendCandidates.d.ts +72 -0
- package/esm/util/legendCandidates.js +138 -0
- package/esm/util/locString.js +5 -2
- package/esm/util/localStorage.js +4 -4
- package/esm/util/markEncoding.d.ts +150 -0
- package/esm/util/markEncoding.js +885 -0
- package/esm/util/markEncodingTypes.d.ts +595 -0
- package/esm/util/markEncodingTypes.js +8 -0
- package/esm/util/mst-reflection.d.ts +2 -20
- package/esm/util/mst-reflection.js +3 -53
- package/esm/util/mstUtils.d.ts +31 -23
- package/esm/util/mstUtils.js +39 -24
- package/esm/util/numericUtils.d.ts +7 -0
- package/esm/util/numericUtils.js +16 -0
- package/esm/util/numericValue.d.ts +14 -0
- package/esm/util/numericValue.js +34 -0
- package/esm/util/openFeatureWidget.d.ts +5 -0
- package/esm/util/openFeatureWidget.js +2 -2
- package/esm/util/openViews.d.ts +17 -0
- package/esm/util/openViews.js +22 -0
- package/esm/util/parentWalk.d.ts +1 -1
- package/esm/util/parentWalk.js +1 -1
- package/esm/util/parseLineByLine.d.ts +4 -5
- package/esm/util/parseLineByLine.js +8 -14
- package/esm/util/pluginStore.d.ts +6 -8
- package/esm/util/pluginStore.js +17 -16
- package/esm/util/preloadComponent.d.ts +5 -0
- package/esm/util/preloadComponent.js +11 -0
- package/esm/util/progress.d.ts +22 -22
- package/esm/util/progress.js +27 -26
- package/esm/util/quantileExtent.d.ts +49 -0
- package/esm/util/quantileExtent.js +162 -0
- package/esm/util/range.d.ts +13 -9
- package/esm/util/range.js +17 -8
- package/esm/util/renameRegions.d.ts +26 -6
- package/esm/util/renameRegions.js +68 -54
- package/esm/util/renderToStaticMarkup.js +24 -14
- package/esm/util/rxjs.d.ts +23 -8
- package/esm/util/rxjs.js +61 -15
- package/esm/util/samplesTsv.d.ts +49 -0
- package/esm/util/samplesTsv.js +86 -0
- package/esm/util/scheduleDetachedDestroy.d.ts +18 -0
- package/esm/util/scheduleDetachedDestroy.js +24 -0
- package/esm/util/scrollLatch.d.ts +1 -0
- package/esm/util/scrollLatch.js +8 -0
- package/esm/util/selectEncodedFeature.d.ts +16 -0
- package/esm/util/selectEncodedFeature.js +34 -0
- package/esm/util/sessionSharing.d.ts +7 -5
- package/esm/util/sessionSharing.js +23 -23
- package/esm/util/shapeNameList.d.ts +2 -0
- package/esm/util/shapeNameList.js +6 -0
- package/esm/util/shapeNames.d.ts +7 -0
- package/esm/util/shapeNames.js +11 -0
- package/esm/util/simpleFeature.d.ts +0 -1
- package/esm/util/springAnimate.js +1 -1
- package/esm/util/starFusion.d.ts +26 -0
- package/esm/util/starFusion.js +37 -0
- package/esm/util/stepTables.d.ts +96 -0
- package/esm/util/stepTables.js +277 -0
- package/esm/util/svAlt.d.ts +145 -0
- package/esm/util/svAlt.js +364 -0
- package/esm/util/svgColorProps.d.ts +11 -0
- package/esm/util/svgColorProps.js +28 -1
- package/esm/util/systemColorScheme.d.ts +12 -0
- package/esm/util/systemColorScheme.js +27 -0
- package/esm/util/tabix.d.ts +19 -10
- package/esm/util/tabix.js +19 -14
- package/esm/util/thresholdScale.d.ts +91 -0
- package/esm/util/thresholdScale.js +166 -0
- package/esm/util/timeGate.d.ts +4 -5
- package/esm/util/timeGate.js +4 -5
- package/esm/util/trackConfigDelta.d.ts +26 -26
- package/esm/util/trackConfigDelta.js +63 -47
- package/esm/util/tracks.d.ts +120 -66
- package/esm/util/tracks.js +501 -151
- package/esm/util/translateTranscript.d.ts +44 -0
- package/esm/util/translateTranscript.js +102 -0
- package/esm/util/types/data.d.ts +0 -2
- package/esm/util/types/index.d.ts +121 -22
- package/esm/util/types/index.js +9 -0
- package/esm/util/types/mst.d.ts +3 -0
- package/esm/util/types/mst.js +4 -0
- package/esm/util/types/renameIds.d.ts +1 -0
- package/esm/util/types/renameIds.js +29 -0
- package/esm/util/types/services.d.ts +1 -1
- package/esm/util/unknownSnapshotKeys.d.ts +53 -0
- package/esm/util/unknownSnapshotKeys.js +76 -0
- package/esm/util/useFeatureSequence.js +5 -5
- package/esm/util/useFetch.d.ts +3 -4
- package/esm/util/useFetch.js +19 -10
- package/esm/util/useFetchPlugins.d.ts +6 -2
- package/esm/util/useFetchPlugins.js +7 -3
- package/esm/util/usePanZoom.js +10 -3
- package/esm/util/usePanelVirtualScroll.d.ts +7 -35
- package/esm/util/usePanelVirtualScroll.js +9 -36
- package/esm/util/useRafCommit.js +1 -0
- package/esm/util/useRowVirtualScroll.d.ts +6 -29
- package/esm/util/useRowVirtualScroll.js +8 -49
- package/esm/util/useVirtualScrollWheel.d.ts +20 -4
- package/esm/util/useVirtualScrollWheel.js +40 -74
- package/esm/util/viewHighlights.d.ts +3 -0
- package/esm/util/viewHighlights.js +5 -0
- package/esm/util/viewStatus.d.ts +47 -15
- package/esm/util/viewStatus.js +34 -0
- package/esm/util/wheelZoom.d.ts +7 -1
- package/esm/util/wheelZoom.js +85 -19
- package/esm/util/whenViewSettled.d.ts +55 -8
- package/esm/util/whenViewSettled.js +56 -7
- package/esm/util/withFeatureDetails.js +4 -0
- package/esm/util/withLaunchInput.d.ts +174 -0
- package/esm/util/withLaunchInput.js +274 -0
- package/package.json +75 -24
- package/esm/BaseFeatureWidget/BaseFeatureDetail/Position.d.ts +0 -2
- package/esm/BaseFeatureWidget/BaseFeatureDetail/Position.js +0 -8
- package/esm/BaseFeatureWidget/BaseFeatureDetail/types.d.ts +0 -8
- package/esm/BaseFeatureWidget/SequenceFeatureDetails/test_data/DLGAP3.d.ts +0 -80
- package/esm/BaseFeatureWidget/SequenceFeatureDetails/test_data/DLGAP3.js +0 -583
- package/esm/BaseFeatureWidget/SequenceFeatureDetails/test_data/NCDN.d.ts +0 -141
- package/esm/BaseFeatureWidget/SequenceFeatureDetails/test_data/NCDN.js +0 -1116
- package/esm/ReExports/BaseFeatureDetails.d.ts +0 -1
- package/esm/ReExports/BaseFeatureDetails.js +0 -10
- package/esm/ReExports/index.d.ts +0 -1
- package/esm/ReExports/index.js +0 -1
- package/esm/ReExports/publicUtil.d.ts +0 -1
- package/esm/ReExports/publicUtil.js +0 -28
- package/esm/configuration/promotableDefaults.d.ts +0 -199
- package/esm/configuration/promotableDefaults.js +0 -326
- package/esm/configuration/promotablePin.d.ts +0 -55
- package/esm/configuration/promotablePin.js +0 -1
- package/esm/configuration/promotableResolve.d.ts +0 -108
- package/esm/configuration/promotableResolve.js +0 -117
- package/esm/configuration/promotableSlots.d.ts +0 -12
- package/esm/configuration/promotableSlots.js +0 -45
- package/esm/configuration/slotShape.d.ts +0 -12
- package/esm/configuration/slotShape.js +0 -84
- package/esm/pluggableElementTypes/models/HighlightsMixin.d.ts +0 -51
- package/esm/pluggableElementTypes/models/HighlightsMixin.js +0 -78
- package/esm/ui/PinAdornment.d.ts +0 -5
- package/esm/ui/PinAdornment.js +0 -79
- package/esm/ui/SvgGradientLegend.d.ts +0 -26
- package/esm/ui/SvgGradientLegend.js +0 -26
- package/esm/ui/highlightChipReveal.d.ts +0 -32
- package/esm/ui/highlightChipReveal.js +0 -39
- package/esm/ui/promotableMenuItems.d.ts +0 -19
- package/esm/ui/promotableMenuItems.js +0 -89
- package/esm/ui/promotablePinCoverage.d.ts +0 -44
- package/esm/ui/promotablePinCoverage.js +0 -87
- package/esm/util/applyInitSettings.d.ts +0 -79
- package/esm/util/applyInitSettings.js +0 -91
- package/esm/util/openDisplays.d.ts +0 -23
- package/esm/util/openDisplays.js +0 -79
- package/esm/util/stopToken.d.ts +0 -211
- package/esm/util/stopToken.js +0 -438
- /package/esm/{BaseFeatureWidget/BaseFeatureDetail/types.js → data_adapters/BaseAdapter/zoomRange.js} +0 -0
|
@@ -30,7 +30,111 @@ function joinLoc(feats, strand, minPos) {
|
|
|
30
30
|
function featureLine(type, location) {
|
|
31
31
|
return ` ${type.slice(0, TYPE_COLUMN_WIDTH).padEnd(TYPE_COLUMN_WIDTH)} ${location}`;
|
|
32
32
|
}
|
|
33
|
-
|
|
33
|
+
/**
|
|
34
|
+
* The feature key column holds one of a closed list, so a SO term JBrowse names
|
|
35
|
+
* a feature with is not a key by virtue of being a type. A reader that does not
|
|
36
|
+
* recognize the key falls back to drawing nothing in particular — which is what
|
|
37
|
+
* a BLAT hit, a CRISPR guide, a restriction site and an hgPcr product all got,
|
|
38
|
+
* and what `primer` got where SnapGene draws a primer only for `primer_bind`.
|
|
39
|
+
*
|
|
40
|
+
* https://www.insdc.org/submitting-standards/feature-table/
|
|
41
|
+
*/
|
|
42
|
+
const INSDC_KEYS = new Set([
|
|
43
|
+
"3'UTR",
|
|
44
|
+
"5'UTR",
|
|
45
|
+
'assembly_gap',
|
|
46
|
+
'C_region',
|
|
47
|
+
'CDS',
|
|
48
|
+
'centromere',
|
|
49
|
+
'D-loop',
|
|
50
|
+
'D_segment',
|
|
51
|
+
'exon',
|
|
52
|
+
'gap',
|
|
53
|
+
'gene',
|
|
54
|
+
'iDNA',
|
|
55
|
+
'intron',
|
|
56
|
+
'J_segment',
|
|
57
|
+
'mat_peptide',
|
|
58
|
+
'misc_binding',
|
|
59
|
+
'misc_difference',
|
|
60
|
+
'misc_feature',
|
|
61
|
+
'misc_recomb',
|
|
62
|
+
'misc_RNA',
|
|
63
|
+
'misc_structure',
|
|
64
|
+
'mobile_element',
|
|
65
|
+
'modified_base',
|
|
66
|
+
'mRNA',
|
|
67
|
+
'N_region',
|
|
68
|
+
'ncRNA',
|
|
69
|
+
'old_sequence',
|
|
70
|
+
'operon',
|
|
71
|
+
'oriT',
|
|
72
|
+
'polyA_site',
|
|
73
|
+
'precursor_RNA',
|
|
74
|
+
'prim_transcript',
|
|
75
|
+
'primer_bind',
|
|
76
|
+
'propeptide',
|
|
77
|
+
'protein_bind',
|
|
78
|
+
'regulatory',
|
|
79
|
+
'rep_origin',
|
|
80
|
+
'repeat_region',
|
|
81
|
+
'rRNA',
|
|
82
|
+
'S_region',
|
|
83
|
+
'sig_peptide',
|
|
84
|
+
'source',
|
|
85
|
+
'stem_loop',
|
|
86
|
+
'STS',
|
|
87
|
+
'telomere',
|
|
88
|
+
'tmRNA',
|
|
89
|
+
'transit_peptide',
|
|
90
|
+
'tRNA',
|
|
91
|
+
'unsure',
|
|
92
|
+
'V_region',
|
|
93
|
+
'V_segment',
|
|
94
|
+
'variation',
|
|
95
|
+
]);
|
|
96
|
+
// SO terms this tree emits that the feature table spells differently. Anything
|
|
97
|
+
// absent from both this and INSDC_KEYS is a real feature with no key of its own
|
|
98
|
+
// — a guide, a PAM, a restriction site, a BLAT hit, an hgPcr product — and
|
|
99
|
+
// becomes misc_feature, which is what the key exists for.
|
|
100
|
+
const SO_TO_INSDC = {
|
|
101
|
+
five_prime_UTR: "5'UTR",
|
|
102
|
+
three_prime_UTR: "3'UTR",
|
|
103
|
+
primer: 'primer_bind',
|
|
104
|
+
primer_binding_site: 'primer_bind',
|
|
105
|
+
transcript: 'mRNA',
|
|
106
|
+
pseudogene: 'gene',
|
|
107
|
+
promoter: 'regulatory',
|
|
108
|
+
enhancer: 'regulatory',
|
|
109
|
+
terminator: 'regulatory',
|
|
110
|
+
polyA_site: 'polyA_site',
|
|
111
|
+
origin_of_replication: 'rep_origin',
|
|
112
|
+
repeat_unit: 'repeat_region',
|
|
113
|
+
SNV: 'variation',
|
|
114
|
+
SNP: 'variation',
|
|
115
|
+
};
|
|
116
|
+
// The keys whose group shares one /gene symbol. A feature with children is not
|
|
117
|
+
// a gene by having them: threading the symbol off any parent labelled an hgPcr
|
|
118
|
+
// product `/gene="100 bp"` and a BLAT hit `/gene="YourSeq 99.1%"`, which reads
|
|
119
|
+
// downstream as a gene of that name.
|
|
120
|
+
const GENE_GROUP_KEYS = new Set([
|
|
121
|
+
'gene',
|
|
122
|
+
'mRNA',
|
|
123
|
+
'ncRNA',
|
|
124
|
+
'rRNA',
|
|
125
|
+
'tRNA',
|
|
126
|
+
'tmRNA',
|
|
127
|
+
'misc_RNA',
|
|
128
|
+
'precursor_RNA',
|
|
129
|
+
'prim_transcript',
|
|
130
|
+
'CDS',
|
|
131
|
+
'exon',
|
|
132
|
+
]);
|
|
133
|
+
export function insdcFeatureKey(type) {
|
|
134
|
+
const mapped = SO_TO_INSDC[type] ?? type;
|
|
135
|
+
return INSDC_KEYS.has(mapped) ? mapped : 'misc_feature';
|
|
136
|
+
}
|
|
137
|
+
function formatTags({ feature, gene, key, }) {
|
|
34
138
|
const tags = [];
|
|
35
139
|
// /gene ties gene/mRNA/CDS together; /label is what SnapGene/Geneious/ApE
|
|
36
140
|
// display as the feature name on the map
|
|
@@ -41,6 +145,12 @@ function formatTags({ feature, gene }) {
|
|
|
41
145
|
if (label) {
|
|
42
146
|
tags.push(qualifier('label', label));
|
|
43
147
|
}
|
|
148
|
+
// a feature that had to become misc_feature still knows what it is, so the
|
|
149
|
+
// term it came in as rides along rather than being dropped at the key column
|
|
150
|
+
const type = `${feature.get('type')}`;
|
|
151
|
+
if (key === 'misc_feature' && type && type !== 'misc_feature') {
|
|
152
|
+
tags.push(qualifier('note', type));
|
|
153
|
+
}
|
|
44
154
|
for (const key of Object.keys(feature.toJSON())) {
|
|
45
155
|
if (!coreFields.has(key)) {
|
|
46
156
|
const value = formatAttributeValue(feature.get(key));
|
|
@@ -64,19 +174,22 @@ function formatCDS({ feats, gene, strand, minPos, }) {
|
|
|
64
174
|
export function formatFeatWithSubfeatures({ feature, minPos, geneName, }) {
|
|
65
175
|
const subfeatures = feature.get('subfeatures') ?? [];
|
|
66
176
|
const strand = feature.get('strand') ?? 0;
|
|
67
|
-
const
|
|
177
|
+
const key = insdcFeatureKey(`${feature.get('type')}`);
|
|
68
178
|
const exons = subfeatures.filter(f => f.get('type') === 'exon');
|
|
69
|
-
// A
|
|
70
|
-
//
|
|
179
|
+
// A gene-group feature with children establishes the symbol, which is threaded
|
|
180
|
+
// down so every part of the gene shares one /gene qualifier.
|
|
71
181
|
const ownName = feature.get('name') ?? feature.get('id');
|
|
72
|
-
const gene = geneName ??
|
|
182
|
+
const gene = geneName ??
|
|
183
|
+
(GENE_GROUP_KEYS.has(key) && subfeatures.length > 0 && ownName
|
|
184
|
+
? ownName
|
|
185
|
+
: undefined);
|
|
73
186
|
// A spliced transcript is rendered as join() of its exons rather than a
|
|
74
187
|
// single span, so external tools see the correct intron/exon structure.
|
|
75
188
|
const segments = exons.length > 0 ? exons : [feature];
|
|
76
189
|
const location = joinLoc(segments, strand, minPos);
|
|
77
190
|
const primary = [
|
|
78
|
-
featureLine(
|
|
79
|
-
...formatTags({ feature, gene }),
|
|
191
|
+
featureLine(key, location),
|
|
192
|
+
...formatTags({ feature, gene, key }),
|
|
80
193
|
];
|
|
81
194
|
const cds = subfeatures.filter(f => f.get('type') === 'CDS');
|
|
82
195
|
const sansCDS = subfeatures.filter(f => f.get('type') !== 'CDS' && f.get('type') !== 'exon');
|
|
@@ -98,15 +211,24 @@ function formatOrigin(sequence) {
|
|
|
98
211
|
lines.push('//');
|
|
99
212
|
return lines;
|
|
100
213
|
}
|
|
101
|
-
// LOCUS line column layout per the GenBank flat-file spec
|
|
102
|
-
//
|
|
103
|
-
//
|
|
214
|
+
// LOCUS line column layout per the GenBank flat-file spec. A positional parser
|
|
215
|
+
// reads each field out of a fixed slot, so the widths below ARE the format:
|
|
216
|
+
//
|
|
217
|
+
// 1-5 LOCUS · 6-12 spaces · 13-28 name · 29 space · 30-40 length ·
|
|
218
|
+
// 41-44 " bp " · 45-47 strandedness · 48-54 molecule · 55 space ·
|
|
219
|
+
// 56-63 topology · 64 space · 65-67 division · 68 space · 69-79 date
|
|
220
|
+
//
|
|
221
|
+
// Molecule runs to 54 and topology starts at 56, which is one column right of
|
|
222
|
+
// where it reads: every real NCBI record spells `DNA` then five spaces then
|
|
223
|
+
// `circular`. Writing topology from 55 put a letter in the space at 55 and
|
|
224
|
+
// Biopython refused all nine snapshot records, while the snapshot tests stayed
|
|
225
|
+
// green because they pin the bytes rather than the format. `locusColumns` in
|
|
226
|
+
// the test file is the check that names which slot moved.
|
|
104
227
|
//
|
|
105
228
|
// The name is the 16-column locus field, so it is the refName rather than the
|
|
106
229
|
// region: `chr17:7,668,402..7,687,550` sanitizes to 22 characters and pushed
|
|
107
|
-
// every field after it 6 columns right
|
|
108
|
-
//
|
|
109
|
-
// the line is free text.
|
|
230
|
+
// every field after it 6 columns right. The coordinates are on DEFINITION,
|
|
231
|
+
// where the line is free text.
|
|
110
232
|
const LOCUS_NAME_WIDTH = 16;
|
|
111
233
|
function formatLocus(refName, length) {
|
|
112
234
|
const name = refName.replaceAll(/[^\w.]/g, '_').slice(0, LOCUS_NAME_WIDTH);
|
|
@@ -117,9 +239,9 @@ function formatLocus(refName, length) {
|
|
|
117
239
|
String(length).padStart(11),
|
|
118
240
|
' bp ',
|
|
119
241
|
' ',
|
|
120
|
-
'DNA'.padEnd(
|
|
242
|
+
'DNA'.padEnd(7),
|
|
121
243
|
' ',
|
|
122
|
-
'linear'.padEnd(
|
|
244
|
+
'linear'.padEnd(8),
|
|
123
245
|
' ',
|
|
124
246
|
'UNK'.padEnd(3),
|
|
125
247
|
' ',
|
|
@@ -148,7 +270,7 @@ function formatHeader({ refName, region, assemblyName, length, }) {
|
|
|
148
270
|
// One LOCUS..ORIGIN..// record, spanning the features on a single reference
|
|
149
271
|
// sequence. GenBank has no way to express a span that crosses one, which is why
|
|
150
272
|
// this takes a refName rather than deriving it.
|
|
151
|
-
async function formatRecord({ refName, features, assemblyName, session,
|
|
273
|
+
async function formatRecord({ refName, features, assemblyName, session, signal, statusCallback, }) {
|
|
152
274
|
const minPos = min(features.map(f => f.get('start')));
|
|
153
275
|
const maxPos = max(features.map(f => f.get('end')));
|
|
154
276
|
const length = maxPos - minPos;
|
|
@@ -159,14 +281,14 @@ async function formatRecord({ refName, features, assemblyName, session, stopToke
|
|
|
159
281
|
start: minPos,
|
|
160
282
|
end: maxPos,
|
|
161
283
|
refName,
|
|
162
|
-
|
|
284
|
+
signal,
|
|
163
285
|
statusCallback,
|
|
164
286
|
});
|
|
165
287
|
const header = formatHeader({ refName, region, assemblyName, length });
|
|
166
288
|
const body = features.map(feat => formatFeatWithSubfeatures({ feature: feat, minPos }));
|
|
167
289
|
return [...header, ...body, ...formatOrigin(contig)].join('\n');
|
|
168
290
|
}
|
|
169
|
-
export async function stringifyGBK({ features, assemblyName, session,
|
|
291
|
+
export async function stringifyGBK({ features, assemblyName, session, signal, statusCallback, }) {
|
|
170
292
|
// A record per reference sequence, which is what GenBank is: a multi-region
|
|
171
293
|
// view used to take min(start)/max(end) across every feature and label the
|
|
172
294
|
// result with the first one's refName, so two contigs on screen produced one
|
|
@@ -182,7 +304,7 @@ export async function stringifyGBK({ features, assemblyName, session, stopToken,
|
|
|
182
304
|
features: feats,
|
|
183
305
|
assemblyName,
|
|
184
306
|
session,
|
|
185
|
-
|
|
307
|
+
signal,
|
|
186
308
|
statusCallback: slot(),
|
|
187
309
|
})));
|
|
188
310
|
return records.join('\n');
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import type { AbstractSessionModel, Feature, StatusCallback
|
|
1
|
+
import type { AbstractSessionModel, Feature, StatusCallback } from '@jbrowse/core/util';
|
|
2
2
|
export interface FileTypeExporter {
|
|
3
3
|
name: string;
|
|
4
4
|
extension: string;
|
|
5
5
|
helpText?: string;
|
|
6
6
|
/**
|
|
7
|
-
* The
|
|
7
|
+
* The signal and status callback are the pair every RPC on the export
|
|
8
8
|
* path already carries. Most writers are string assembly and ignore both;
|
|
9
9
|
* GenBank fetches the ORIGIN sequence, and without them closing the dialog
|
|
10
10
|
* left a whole-gene read running with nothing waiting on it.
|
|
@@ -13,7 +13,7 @@ export interface FileTypeExporter {
|
|
|
13
13
|
features: Feature[];
|
|
14
14
|
session: AbstractSessionModel;
|
|
15
15
|
assemblyName: string;
|
|
16
|
-
|
|
16
|
+
signal?: AbortSignal;
|
|
17
17
|
statusCallback?: StatusCallback;
|
|
18
18
|
}) => Promise<string> | string;
|
|
19
19
|
}
|
|
@@ -38,10 +38,6 @@ export interface ESMUrlPluginDefinition {
|
|
|
38
38
|
name?: string;
|
|
39
39
|
}
|
|
40
40
|
export type ESMPluginDefinition = ESMLocPluginDefinition | ESMUrlPluginDefinition;
|
|
41
|
-
export interface CJSPluginDefinition {
|
|
42
|
-
cjsUrl: string;
|
|
43
|
-
name?: string;
|
|
44
|
-
}
|
|
45
41
|
/**
|
|
46
42
|
* A plugin named by its plugin-store entry rather than by a url — the query
|
|
47
43
|
* ("MsaView, for this JBrowse") instead of a precomputed answer ("these exact
|
|
@@ -81,15 +77,14 @@ export interface StorePluginDefinition {
|
|
|
81
77
|
* `loadUMDPlugin` looks up on `globalThis`, and `storePlugin` is the assertion
|
|
82
78
|
* that the manifest is where this came from.
|
|
83
79
|
*/
|
|
84
|
-
export type PluginDefinition = (UMDUrlPluginDefinition | UMDLocPluginDefinition | LegacyUMDPluginDefinition | ESMLocPluginDefinition | ESMUrlPluginDefinition |
|
|
80
|
+
export type PluginDefinition = (UMDUrlPluginDefinition | UMDLocPluginDefinition | LegacyUMDPluginDefinition | ESMLocPluginDefinition | ESMUrlPluginDefinition | StorePluginDefinition) & {
|
|
85
81
|
storePlugin?: string;
|
|
86
82
|
};
|
|
87
83
|
export declare function isUMDPluginDefinition(def: PluginDefinition): def is UMDPluginDefinition | LegacyUMDPluginDefinition;
|
|
88
84
|
export declare function isESMPluginDefinition(def: PluginDefinition): def is ESMPluginDefinition;
|
|
89
|
-
export declare function isCJSPluginDefinition(def: PluginDefinition): def is CJSPluginDefinition;
|
|
90
85
|
/**
|
|
91
86
|
* Whether a definition names a store entry to resolve. Deliberately not part of
|
|
92
|
-
* the
|
|
87
|
+
* the ESM/UMD pair `assertSingleKind` counts: those are loaders, and a ref
|
|
93
88
|
* is not one. A ref names *which plugin*, and pairing it with a url is the
|
|
94
89
|
* supported migration shape rather than the two-loaders ambiguity that guard
|
|
95
90
|
* exists to refuse.
|
|
@@ -184,6 +179,38 @@ export declare function pluginLabel(definition: PluginDefinition): string;
|
|
|
184
179
|
* drift apart and disagree about what is a duplicate.
|
|
185
180
|
*/
|
|
186
181
|
export declare function samePlugin(a: PluginDefinition, b: PluginDefinition): boolean;
|
|
182
|
+
/**
|
|
183
|
+
* Whether a list entry is one the loaded copy could have come from — its url,
|
|
184
|
+
* or the store entry both name.
|
|
185
|
+
*
|
|
186
|
+
* `samePlugin` without the name clause, which would also match a session entry
|
|
187
|
+
* naming the same plugin at another url: that is the copy the dedupe *dropped*,
|
|
188
|
+
* not the list the loaded one lives in.
|
|
189
|
+
*
|
|
190
|
+
* The ref half is what a url comparison cannot do in either direction. An entry
|
|
191
|
+
* the permanent list keeps as a ref resolves to whatever build the store
|
|
192
|
+
* publishes for this JBrowse, so its pinned url and the loaded one drift apart
|
|
193
|
+
* on the first upgrade while the ref stays the same string.
|
|
194
|
+
*/
|
|
195
|
+
export declare function holdsPlugin(entry: PluginDefinition, loaded: PluginDefinition): boolean;
|
|
196
|
+
/**
|
|
197
|
+
* Whether a list entry names the exact build that loaded — the question a
|
|
198
|
+
* remove asks, where {@link holdsPlugin} asks which list to look in.
|
|
199
|
+
*
|
|
200
|
+
* A config's `plugins[]` is the one list that can legitimately hold two entries
|
|
201
|
+
* for a single plugin: the update flow writes a second entry at a newer url and
|
|
202
|
+
* then removes the first. So an entry carrying a url is judged on that url
|
|
203
|
+
* alone. Both entries may carry the store ref they were minted under, and
|
|
204
|
+
* matching on it would remove the version just installed.
|
|
205
|
+
*
|
|
206
|
+
* An entry with no url of its own — a bare `{ "storePlugin": "MsaView" }`,
|
|
207
|
+
* which is the form a config at a permanent url is meant to use — pins no
|
|
208
|
+
* build, so the ref is the only thing identifying it. Judged on the url it does
|
|
209
|
+
* not have, such an entry matched nothing: uninstall filtered the list and
|
|
210
|
+
* removed no row, while still asking for the whole-app reload an uninstall
|
|
211
|
+
* triggers, so the plugin came back.
|
|
212
|
+
*/
|
|
213
|
+
export declare function holdsPluginVersion(entry: PluginDefinition, loaded: PluginDefinition): boolean;
|
|
187
214
|
/**
|
|
188
215
|
* The candidates no definition in `existing` already describes — `dedupePlugins`
|
|
189
216
|
* across two lists whose first one is already settled, for a source loaded after
|
package/esm/pluginDefinitions.js
CHANGED
|
@@ -13,12 +13,9 @@ export function isUMDPluginDefinition(def) {
|
|
|
13
13
|
export function isESMPluginDefinition(def) {
|
|
14
14
|
return 'esmUrl' in def || 'esmLoc' in def;
|
|
15
15
|
}
|
|
16
|
-
export function isCJSPluginDefinition(def) {
|
|
17
|
-
return 'cjsUrl' in def;
|
|
18
|
-
}
|
|
19
16
|
/**
|
|
20
17
|
* Whether a definition names a store entry to resolve. Deliberately not part of
|
|
21
|
-
* the
|
|
18
|
+
* the ESM/UMD pair `assertSingleKind` counts: those are loaders, and a ref
|
|
22
19
|
* is not one. A ref names *which plugin*, and pairing it with a url is the
|
|
23
20
|
* supported migration shape rather than the two-loaders ambiguity that guard
|
|
24
21
|
* exists to refuse.
|
|
@@ -76,19 +73,16 @@ export function dropVendoredPlugins(defs, alsoVendored = []) {
|
|
|
76
73
|
return defs.filter(d => !(isUMDPluginDefinition(d) && vendored.has(d.name)));
|
|
77
74
|
}
|
|
78
75
|
// The two functions below describe a definition by picking the one url it will
|
|
79
|
-
// be loaded from, so both dispatch in loadPlugin's order —
|
|
80
|
-
//
|
|
81
|
-
//
|
|
82
|
-
//
|
|
83
|
-
//
|
|
84
|
-
//
|
|
85
|
-
//
|
|
86
|
-
//
|
|
76
|
+
// be loaded from, so both dispatch in loadPlugin's order — ESM, then UMD. Keep
|
|
77
|
+
// them in step with it: they are what the plugin trust gate (checkPlugins)
|
|
78
|
+
// reads and what the untrusted-plugin prompt shows, so an order that disagrees
|
|
79
|
+
// with the loader's vets one url and executes another. They once did disagree,
|
|
80
|
+
// and a definition naming two loaders was approved on its jbrowse.org url while
|
|
81
|
+
// loadPlugin ran the other. assertSingleKind now rejects such a definition
|
|
82
|
+
// outright; this order is the second half of that guarantee, since the gate
|
|
83
|
+
// runs before the loader does.
|
|
87
84
|
export function pluginDescriptionString(d) {
|
|
88
|
-
if (
|
|
89
|
-
return `CJS plugin ${d.cjsUrl}`;
|
|
90
|
-
}
|
|
91
|
-
else if (isESMPluginDefinition(d)) {
|
|
85
|
+
if (isESMPluginDefinition(d)) {
|
|
92
86
|
return `ESM plugin ${'esmUrl' in d ? d.esmUrl : d.esmLoc.uri}`;
|
|
93
87
|
}
|
|
94
88
|
else if (isUMDPluginDefinition(d)) {
|
|
@@ -110,10 +104,7 @@ export function pluginDescriptionString(d) {
|
|
|
110
104
|
* the same plugin just because neither has a url.
|
|
111
105
|
*/
|
|
112
106
|
export function maybePluginUrl(d) {
|
|
113
|
-
if (
|
|
114
|
-
return d.cjsUrl;
|
|
115
|
-
}
|
|
116
|
-
else if (isESMPluginDefinition(d)) {
|
|
107
|
+
if (isESMPluginDefinition(d)) {
|
|
117
108
|
return 'esmUrl' in d ? d.esmUrl : d.esmLoc.uri;
|
|
118
109
|
}
|
|
119
110
|
else if (isUMDPluginDefinition(d)) {
|
|
@@ -196,6 +187,49 @@ export function samePlugin(a, b) {
|
|
|
196
187
|
(nameA !== undefined && nameA === nameB) ||
|
|
197
188
|
(urlA !== undefined && urlA === urlB));
|
|
198
189
|
}
|
|
190
|
+
function sameStoreRef(entry, loaded) {
|
|
191
|
+
const ref = storePluginName(entry);
|
|
192
|
+
return ref !== undefined && ref === storePluginName(loaded);
|
|
193
|
+
}
|
|
194
|
+
/**
|
|
195
|
+
* Whether a list entry is one the loaded copy could have come from — its url,
|
|
196
|
+
* or the store entry both name.
|
|
197
|
+
*
|
|
198
|
+
* `samePlugin` without the name clause, which would also match a session entry
|
|
199
|
+
* naming the same plugin at another url: that is the copy the dedupe *dropped*,
|
|
200
|
+
* not the list the loaded one lives in.
|
|
201
|
+
*
|
|
202
|
+
* The ref half is what a url comparison cannot do in either direction. An entry
|
|
203
|
+
* the permanent list keeps as a ref resolves to whatever build the store
|
|
204
|
+
* publishes for this JBrowse, so its pinned url and the loaded one drift apart
|
|
205
|
+
* on the first upgrade while the ref stays the same string.
|
|
206
|
+
*/
|
|
207
|
+
export function holdsPlugin(entry, loaded) {
|
|
208
|
+
return (isPluginUrl(entry, maybePluginUrl(loaded)) || sameStoreRef(entry, loaded));
|
|
209
|
+
}
|
|
210
|
+
/**
|
|
211
|
+
* Whether a list entry names the exact build that loaded — the question a
|
|
212
|
+
* remove asks, where {@link holdsPlugin} asks which list to look in.
|
|
213
|
+
*
|
|
214
|
+
* A config's `plugins[]` is the one list that can legitimately hold two entries
|
|
215
|
+
* for a single plugin: the update flow writes a second entry at a newer url and
|
|
216
|
+
* then removes the first. So an entry carrying a url is judged on that url
|
|
217
|
+
* alone. Both entries may carry the store ref they were minted under, and
|
|
218
|
+
* matching on it would remove the version just installed.
|
|
219
|
+
*
|
|
220
|
+
* An entry with no url of its own — a bare `{ "storePlugin": "MsaView" }`,
|
|
221
|
+
* which is the form a config at a permanent url is meant to use — pins no
|
|
222
|
+
* build, so the ref is the only thing identifying it. Judged on the url it does
|
|
223
|
+
* not have, such an entry matched nothing: uninstall filtered the list and
|
|
224
|
+
* removed no row, while still asking for the whole-app reload an uninstall
|
|
225
|
+
* triggers, so the plugin came back.
|
|
226
|
+
*/
|
|
227
|
+
export function holdsPluginVersion(entry, loaded) {
|
|
228
|
+
const url = maybePluginUrl(entry);
|
|
229
|
+
return url === undefined
|
|
230
|
+
? sameStoreRef(entry, loaded)
|
|
231
|
+
: url === maybePluginUrl(loaded);
|
|
232
|
+
}
|
|
199
233
|
/**
|
|
200
234
|
* The candidates no definition in `existing` already describes — `dedupePlugins`
|
|
201
235
|
* across two lists whose first one is already settled, for a source loaded after
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import type PluginManager from '../PluginManager.ts';
|
|
2
2
|
import type { AnyConfigurationModel } from '../configuration/index.ts';
|
|
3
3
|
import type RpcMethodType from '../pluggableElementTypes/RpcMethodType.ts';
|
|
4
|
-
import type { StatusCallback } from '../util/progress.ts';
|
|
5
4
|
import type { RpcHandles } from './RpcRegistry.ts';
|
|
6
5
|
/**
|
|
7
6
|
* The method that drops a session's cached adapters, named once because
|
|
@@ -27,6 +26,7 @@ export default abstract class BaseRpcDriver {
|
|
|
27
26
|
*/
|
|
28
27
|
freeSession(sessionId: string): Promise<void>;
|
|
29
28
|
destroy(): void;
|
|
29
|
+
warmUp(): void;
|
|
30
30
|
call(sessionId: string, functionName: string, args: Record<string, unknown> & RpcHandles): Promise<unknown>;
|
|
31
|
-
protected abstract transport(sessionId: string, rpcMethod: RpcMethodType, serializedArgs: Record<string, unknown>,
|
|
31
|
+
protected abstract transport(sessionId: string, rpcMethod: RpcMethodType, serializedArgs: Record<string, unknown>, handles: RpcHandles): Promise<unknown>;
|
|
32
32
|
}
|
package/esm/rpc/BaseRpcDriver.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { checkAbortSignal, withAbortCheck } from '../util/aborting.js';
|
|
2
2
|
/**
|
|
3
3
|
* The method that drops a session's cached adapters, named once because
|
|
4
4
|
* {@link BaseRpcDriver.freeSession} is the only thing that dispatches it.
|
|
@@ -34,6 +34,8 @@ export default class BaseRpcDriver {
|
|
|
34
34
|
.invoke({ sessionId });
|
|
35
35
|
}
|
|
36
36
|
destroy() { }
|
|
37
|
+
// start whatever a first call would otherwise wait for; nothing, here
|
|
38
|
+
warmUp() { }
|
|
37
39
|
async call(sessionId, functionName, args) {
|
|
38
40
|
if (!sessionId) {
|
|
39
41
|
throw new TypeError('sessionId is required');
|
|
@@ -44,40 +46,33 @@ export default class BaseRpcDriver {
|
|
|
44
46
|
// "which plugin is missing" answer. No `undefined` check belongs here; one
|
|
45
47
|
// was added and lint called it dead, correctly.
|
|
46
48
|
const rpcMethod = this.pluginManager.getRpcMethodType(functionName);
|
|
47
|
-
//
|
|
48
|
-
//
|
|
49
|
-
//
|
|
50
|
-
// postMessage clones it and throws on anything that isn't, surfacing bad data
|
|
49
|
+
// The two handles are out of band, not data: each transport wires its own
|
|
50
|
+
// channel for them, and neither survives structured clone. The worker
|
|
51
|
+
// postMessage throws on anything that isn't cloneable, surfacing bad data
|
|
51
52
|
// at the boundary instead of silently dropping it.
|
|
52
53
|
//
|
|
53
|
-
//
|
|
54
|
-
// can see it. That is not cosmetic: serialization is
|
|
55
|
-
// is resolved, and resolving one downloads the
|
|
56
|
-
// in-memory adapter, the whole file).
|
|
57
|
-
// left that download with nothing to
|
|
58
|
-
// forwards a `statusCallback` for exactly
|
|
59
|
-
//
|
|
54
|
+
// The callback is stripped on the way OUT rather than on the way in, so
|
|
55
|
+
// `serializeArguments` can see it. That is not cosmetic: serialization is
|
|
56
|
+
// where the refName map is resolved, and resolving one downloads the
|
|
57
|
+
// adapter's index (and for an in-memory adapter, the whole file).
|
|
58
|
+
// Destructuring the callback off first left that download with nothing to
|
|
59
|
+
// report through — `loadRefNameMap` forwards a `statusCallback` for exactly
|
|
60
|
+
// this and, for every RPC, was handed undefined.
|
|
60
61
|
//
|
|
61
62
|
// Serialization is the one long await here, and it is wrapped rather than
|
|
62
63
|
// fenced by hand-placed checks so the check on the FAR side comes with the
|
|
63
|
-
// near one
|
|
64
|
-
//
|
|
65
|
-
//
|
|
66
|
-
//
|
|
67
|
-
//
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
// Callers already treat an abort as the ordinary outcome of a superseded
|
|
76
|
-
// fetch.
|
|
77
|
-
const stopToken = isStopToken(args.stopToken) ? args.stopToken : undefined;
|
|
78
|
-
const { statusCallback } = args;
|
|
79
|
-
const { statusCallback: _outOfBand, ...serializedArgs } = await withStopTokenCheck(stopToken, () => rpcMethod.serializeArguments(args));
|
|
80
|
-
const result = await this.transport(sessionId, rpcMethod, serializedArgs, statusCallback);
|
|
64
|
+
// near one. A call already aborted has nothing to deliver to, so refuse it
|
|
65
|
+
// rather than serializing args and waking a worker; an abort landing DURING
|
|
66
|
+
// serialization used to go unseen and the worker ground the fetch to
|
|
67
|
+
// completion. Callers already treat an abort as the ordinary outcome of a
|
|
68
|
+
// superseded fetch.
|
|
69
|
+
const { signal, ...rest } = args;
|
|
70
|
+
checkAbortSignal(signal);
|
|
71
|
+
const { statusCallback: _outOfBand, ...serializedArgs } = await withAbortCheck(signal, () => rpcMethod.serializeArguments(rest));
|
|
72
|
+
const result = await this.transport(sessionId, rpcMethod, serializedArgs, {
|
|
73
|
+
statusCallback: rest.statusCallback,
|
|
74
|
+
signal,
|
|
75
|
+
});
|
|
81
76
|
return rpcMethod.deserializeReturn(result, args);
|
|
82
77
|
}
|
|
83
78
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import BaseRpcDriver from './BaseRpcDriver.ts';
|
|
2
2
|
import type RpcMethodType from '../pluggableElementTypes/RpcMethodType.ts';
|
|
3
|
-
import type {
|
|
3
|
+
import type { RpcHandles } from './RpcRegistry.ts';
|
|
4
4
|
/**
|
|
5
5
|
* RPC driver that runs RPC functions in-band on the main thread. It owns no
|
|
6
6
|
* worker pool, so `destroy` stays the BaseRpcDriver no-op and `freeSession`
|
|
@@ -9,5 +9,5 @@ import type { StatusCallback } from '../util/progress.ts';
|
|
|
9
9
|
*/
|
|
10
10
|
export default class MainThreadRpcDriver extends BaseRpcDriver {
|
|
11
11
|
name: string;
|
|
12
|
-
protected transport(_sessionId: string, rpcMethod: RpcMethodType, serializedArgs: Record<string, unknown>, statusCallback
|
|
12
|
+
protected transport(_sessionId: string, rpcMethod: RpcMethodType, serializedArgs: Record<string, unknown>, { statusCallback, signal }: RpcHandles): Promise<unknown>;
|
|
13
13
|
}
|
|
@@ -7,16 +7,21 @@ import BaseRpcDriver from './BaseRpcDriver.js';
|
|
|
7
7
|
*/
|
|
8
8
|
export default class MainThreadRpcDriver extends BaseRpcDriver {
|
|
9
9
|
name = 'MainThreadRpcDriver';
|
|
10
|
-
async transport(_sessionId, rpcMethod, serializedArgs, statusCallback) {
|
|
11
|
-
// re-attach the out-of-band
|
|
12
|
-
// mirroring how the worker re-wires
|
|
13
|
-
// including the case where there is none, which `wrapForRpc`
|
|
14
|
-
// adding no key at all. Spreading `statusCallback:
|
|
15
|
-
// the two drivers handing `execute` bags that
|
|
16
|
-
// kind of difference nothing tests and
|
|
10
|
+
async transport(_sessionId, rpcMethod, serializedArgs, { statusCallback, signal }) {
|
|
11
|
+
// re-attach the out-of-band handles that BaseRpcDriver.call split off,
|
|
12
|
+
// mirroring how the worker re-wires them on the far side of postMessage —
|
|
13
|
+
// including the case where there is none, which `wrapForRpc` and
|
|
14
|
+
// `RpcServer` answer by adding no key at all. Spreading `statusCallback:
|
|
15
|
+
// undefined` in would leave the two drivers handing `execute` bags that
|
|
16
|
+
// differ by a key, which is the kind of difference nothing tests and
|
|
17
|
+
// something eventually reads.
|
|
17
18
|
//
|
|
18
19
|
// `invoke`, not `execute` — it is the entry point that deserializes the
|
|
19
20
|
// arguments first, and the worker binds the same one
|
|
20
|
-
return rpcMethod.invoke(
|
|
21
|
+
return rpcMethod.invoke({
|
|
22
|
+
...serializedArgs,
|
|
23
|
+
...(statusCallback ? { statusCallback } : {}),
|
|
24
|
+
...(signal ? { signal } : {}),
|
|
25
|
+
});
|
|
21
26
|
}
|
|
22
27
|
}
|
package/esm/rpc/RpcClient.d.ts
CHANGED
|
@@ -14,6 +14,7 @@ interface PendingCall {
|
|
|
14
14
|
export default class RpcClient {
|
|
15
15
|
worker: Worker;
|
|
16
16
|
pending: Map<string, PendingCall>;
|
|
17
|
+
private destroyed;
|
|
17
18
|
private events;
|
|
18
19
|
private counter;
|
|
19
20
|
constructor(worker: Worker);
|
|
@@ -27,12 +28,23 @@ export default class RpcClient {
|
|
|
27
28
|
protected reject(uid: string, error: string | ErrorObject): void;
|
|
28
29
|
protected resolve(uid: string, data: unknown): void;
|
|
29
30
|
/**
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
* under that id ignores it.
|
|
31
|
+
* Abort the call `uid`, so the signal it runs under in the worker aborts.
|
|
32
|
+
* Fire-and-forget: it settles no pending call, and a worker no longer running
|
|
33
|
+
* that call ignores it.
|
|
34
34
|
*/
|
|
35
|
-
|
|
36
|
-
|
|
35
|
+
abort(uid: string): void;
|
|
36
|
+
/**
|
|
37
|
+
* No transfer list: transferables flow only worker → main, in a reply's
|
|
38
|
+
* rpcResult wrapper. Transferring an argument would neuter the main thread's
|
|
39
|
+
* own buffer — this took an option for one and nothing ever passed it.
|
|
40
|
+
*
|
|
41
|
+
* With a `signal`, the worker runs the method under a signal of its own and
|
|
42
|
+
* aborts it when this one aborts. The uid is the call's identity on both
|
|
43
|
+
* sides, so the abort frame needs nothing else; the listener is attached
|
|
44
|
+
* before the call frame is posted and removed when the call settles, so an
|
|
45
|
+
* abort in between reaches a worker still running the call, and one after
|
|
46
|
+
* reaches nothing.
|
|
47
|
+
*/
|
|
48
|
+
call(method: string, data: unknown, signal?: AbortSignal): Promise<unknown>;
|
|
37
49
|
}
|
|
38
50
|
export {};
|