@perses-dev/plugin-system 0.53.0-beta.1 → 0.53.0-beta.3

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.
Files changed (78) hide show
  1. package/dist/cjs/components/MultiQueryEditor/MultiQueryEditor.js +8 -3
  2. package/dist/cjs/components/MultiQueryEditor/QueryEditorContainer.js +74 -29
  3. package/dist/cjs/components/PanelSpecEditor/PanelSpecEditor.js +10 -1
  4. package/dist/cjs/components/PluginEditor/PluginEditor.js +11 -45
  5. package/dist/cjs/components/Variables/VariableEditorForm/VariableEditorForm.js +27 -10
  6. package/dist/cjs/components/Variables/VariableEditorForm/VariablePreview.js +1 -1
  7. package/dist/cjs/components/Variables/variable-model.js +3 -3
  8. package/dist/cjs/runtime/TimeRangeProvider/TimeRangeProvider.js +70 -33
  9. package/dist/cjs/runtime/TimeRangeProvider/{TimeRangeProviderWithQueryParams.js → TimeRangeProviders.js} +23 -5
  10. package/dist/cjs/runtime/TimeRangeProvider/index.js +1 -1
  11. package/dist/cjs/runtime/log-queries.js +2 -1
  12. package/dist/cjs/runtime/profile-queries.js +2 -1
  13. package/dist/cjs/runtime/time-series-queries.js +10 -16
  14. package/dist/cjs/runtime/trace-queries.js +3 -2
  15. package/dist/cjs/test/utils.js +4 -4
  16. package/dist/components/MultiQueryEditor/MultiQueryEditor.d.ts +3 -0
  17. package/dist/components/MultiQueryEditor/MultiQueryEditor.d.ts.map +1 -1
  18. package/dist/components/MultiQueryEditor/MultiQueryEditor.js +8 -3
  19. package/dist/components/MultiQueryEditor/MultiQueryEditor.js.map +1 -1
  20. package/dist/components/MultiQueryEditor/QueryEditorContainer.d.ts +3 -0
  21. package/dist/components/MultiQueryEditor/QueryEditorContainer.d.ts.map +1 -1
  22. package/dist/components/MultiQueryEditor/QueryEditorContainer.js +75 -30
  23. package/dist/components/MultiQueryEditor/QueryEditorContainer.js.map +1 -1
  24. package/dist/components/PanelSpecEditor/PanelSpecEditor.d.ts +1 -0
  25. package/dist/components/PanelSpecEditor/PanelSpecEditor.d.ts.map +1 -1
  26. package/dist/components/PanelSpecEditor/PanelSpecEditor.js +11 -2
  27. package/dist/components/PanelSpecEditor/PanelSpecEditor.js.map +1 -1
  28. package/dist/components/PluginEditor/PluginEditor.d.ts +3 -3
  29. package/dist/components/PluginEditor/PluginEditor.d.ts.map +1 -1
  30. package/dist/components/PluginEditor/PluginEditor.js +12 -46
  31. package/dist/components/PluginEditor/PluginEditor.js.map +1 -1
  32. package/dist/components/PluginEditor/plugin-editor-api.d.ts +1 -1
  33. package/dist/components/PluginEditor/plugin-editor-api.d.ts.map +1 -1
  34. package/dist/components/PluginEditor/plugin-editor-api.js.map +1 -1
  35. package/dist/components/Variables/VariableEditorForm/VariableEditorForm.d.ts.map +1 -1
  36. package/dist/components/Variables/VariableEditorForm/VariableEditorForm.js +28 -11
  37. package/dist/components/Variables/VariableEditorForm/VariableEditorForm.js.map +1 -1
  38. package/dist/components/Variables/VariableEditorForm/VariablePreview.d.ts.map +1 -1
  39. package/dist/components/Variables/VariableEditorForm/VariablePreview.js +1 -1
  40. package/dist/components/Variables/VariableEditorForm/VariablePreview.js.map +1 -1
  41. package/dist/components/Variables/variable-model.js +3 -3
  42. package/dist/components/Variables/variable-model.js.map +1 -1
  43. package/dist/model/plugin-base.d.ts +1 -6
  44. package/dist/model/plugin-base.d.ts.map +1 -1
  45. package/dist/model/plugin-base.js.map +1 -1
  46. package/dist/model/time-series-queries.d.ts +0 -1
  47. package/dist/model/time-series-queries.d.ts.map +1 -1
  48. package/dist/model/time-series-queries.js.map +1 -1
  49. package/dist/runtime/DataQueriesProvider/model.d.ts +1 -1
  50. package/dist/runtime/DataQueriesProvider/model.d.ts.map +1 -1
  51. package/dist/runtime/DataQueriesProvider/model.js.map +1 -1
  52. package/dist/runtime/TimeRangeProvider/TimeRangeProvider.d.ts +2 -3
  53. package/dist/runtime/TimeRangeProvider/TimeRangeProvider.d.ts.map +1 -1
  54. package/dist/runtime/TimeRangeProvider/TimeRangeProvider.js +70 -33
  55. package/dist/runtime/TimeRangeProvider/TimeRangeProvider.js.map +1 -1
  56. package/dist/runtime/TimeRangeProvider/TimeRangeProviders.d.ts +10 -0
  57. package/dist/runtime/TimeRangeProvider/TimeRangeProviders.d.ts.map +1 -0
  58. package/dist/runtime/TimeRangeProvider/{TimeRangeProviderWithQueryParams.js → TimeRangeProviders.js} +13 -3
  59. package/dist/runtime/TimeRangeProvider/TimeRangeProviders.js.map +1 -0
  60. package/dist/runtime/TimeRangeProvider/index.d.ts +1 -1
  61. package/dist/runtime/TimeRangeProvider/index.d.ts.map +1 -1
  62. package/dist/runtime/TimeRangeProvider/index.js +1 -1
  63. package/dist/runtime/TimeRangeProvider/index.js.map +1 -1
  64. package/dist/runtime/log-queries.js +2 -1
  65. package/dist/runtime/log-queries.js.map +1 -1
  66. package/dist/runtime/profile-queries.js +2 -1
  67. package/dist/runtime/profile-queries.js.map +1 -1
  68. package/dist/runtime/time-series-queries.d.ts.map +1 -1
  69. package/dist/runtime/time-series-queries.js +10 -16
  70. package/dist/runtime/time-series-queries.js.map +1 -1
  71. package/dist/runtime/trace-queries.js +3 -2
  72. package/dist/runtime/trace-queries.js.map +1 -1
  73. package/dist/test/utils.js +5 -5
  74. package/dist/test/utils.js.map +1 -1
  75. package/package.json +4 -4
  76. package/dist/runtime/TimeRangeProvider/TimeRangeProviderWithQueryParams.d.ts +0 -9
  77. package/dist/runtime/TimeRangeProvider/TimeRangeProviderWithQueryParams.d.ts.map +0 -1
  78. package/dist/runtime/TimeRangeProvider/TimeRangeProviderWithQueryParams.js.map +0 -1
@@ -18,20 +18,20 @@ import { filterVariableStateMap, getVariableValuesKey } from './utils';
18
18
  import { useAllVariableValues } from './variables';
19
19
  export const TIME_SERIES_QUERY_KEY = 'TimeSeriesQuery';
20
20
  function getQueryOptions({ plugin, definition, context }) {
21
- const { timeRange, datasourceStore, suggestedStepMs, mode, variableState, refreshKey } = context;
21
+ const { timeRange, suggestedStepMs, mode, variableState } = context;
22
22
  const dependencies = plugin?.dependsOn ? plugin.dependsOn(definition.spec.plugin.spec, context) : {};
23
23
  const variableDependencies = dependencies?.variables;
24
24
  // Determine queryKey
25
25
  const filteredVariabledState = filterVariableStateMap(variableState, variableDependencies);
26
26
  const variablesValueKey = getVariableValuesKey(filteredVariabledState);
27
27
  const queryKey = [
28
+ 'query',
29
+ TIME_SERIES_QUERY_KEY,
28
30
  definition,
29
31
  timeRange,
30
- datasourceStore,
31
- suggestedStepMs,
32
- mode,
33
32
  variablesValueKey,
34
- refreshKey
33
+ suggestedStepMs,
34
+ mode
35
35
  ];
36
36
  // Determine queryEnabled
37
37
  let waitToLoad = false;
@@ -77,8 +77,8 @@ function getQueryOptions({ plugin, definition, context }) {
77
77
  const { getPlugin } = usePluginRegistry();
78
78
  const context = {
79
79
  ...useTimeSeriesQueryContext(),
80
- // We need mode to be part query key because this drives the type of query done (instant VS range query)
81
- mode: options?.mode
80
+ mode: options?.mode,
81
+ suggestedStepMs: options?.suggestedStepMs
82
82
  };
83
83
  const pluginLoaderResponse = usePlugins(TIME_SERIES_QUERY_KEY, definitions.map((d)=>({
84
84
  kind: d.spec.plugin.kind
@@ -96,13 +96,8 @@ function getQueryOptions({ plugin, definition, context }) {
96
96
  enabled: (queryOptions?.enabled ?? true) && queryEnabled,
97
97
  queryKey: queryKey,
98
98
  queryFn: async ({ signal })=>{
99
- const ctx = {
100
- ...context,
101
- // Keep suggested step changes out of the query key, so we don´t have to run again query when it changes
102
- suggestedStepMs: options?.suggestedStepMs
103
- };
104
99
  const plugin = await getPlugin(TIME_SERIES_QUERY_KEY, definition.spec.plugin.kind);
105
- const data = await plugin.getTimeSeriesData(definition.spec.plugin.spec, ctx, signal);
100
+ const data = await plugin.getTimeSeriesData(definition.spec.plugin.spec, context, signal);
106
101
  return data;
107
102
  }
108
103
  };
@@ -112,14 +107,13 @@ function getQueryOptions({ plugin, definition, context }) {
112
107
  /**
113
108
  * Build the time series query context object from data available at runtime
114
109
  */ function useTimeSeriesQueryContext() {
115
- const { absoluteTimeRange, refreshKey } = useTimeRange();
110
+ const { absoluteTimeRange } = useTimeRange();
116
111
  const variableState = useAllVariableValues();
117
112
  const datasourceStore = useDatasourceStore();
118
113
  return {
119
114
  timeRange: absoluteTimeRange,
120
115
  variableState,
121
- datasourceStore,
122
- refreshKey
116
+ datasourceStore
123
117
  };
124
118
  }
125
119
  /**
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/runtime/time-series-queries.ts"],"sourcesContent":["// Copyright 2024 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { TimeSeriesData, TimeSeriesQueryDefinition, UnknownSpec } from '@perses-dev/core';\nimport {\n Query,\n QueryCache,\n QueryKey,\n QueryObserverOptions,\n useQueries,\n useQuery,\n useQueryClient,\n UseQueryResult,\n} from '@tanstack/react-query';\nimport { TimeSeriesDataQuery, TimeSeriesQueryContext, TimeSeriesQueryMode, TimeSeriesQueryPlugin } from '../model';\nimport { useTimeRange } from './TimeRangeProvider';\nimport { useDatasourceStore } from './datasources';\nimport { usePlugin, usePluginRegistry, usePlugins } from './plugin-registry';\nimport { filterVariableStateMap, getVariableValuesKey } from './utils';\nimport { useAllVariableValues } from './variables';\n\nexport interface UseTimeSeriesQueryOptions {\n suggestedStepMs?: number;\n mode?: TimeSeriesQueryMode;\n}\n\nexport const TIME_SERIES_QUERY_KEY = 'TimeSeriesQuery';\n\nfunction getQueryOptions({\n plugin,\n definition,\n context,\n}: {\n plugin?: TimeSeriesQueryPlugin;\n definition: TimeSeriesQueryDefinition;\n context: TimeSeriesQueryContext;\n}): {\n queryKey: QueryKey;\n queryEnabled: boolean;\n} {\n const { timeRange, datasourceStore, suggestedStepMs, mode, variableState, refreshKey } = context;\n\n const dependencies = plugin?.dependsOn ? plugin.dependsOn(definition.spec.plugin.spec, context) : {};\n const variableDependencies = dependencies?.variables;\n\n // Determine queryKey\n const filteredVariabledState = filterVariableStateMap(variableState, variableDependencies);\n const variablesValueKey = getVariableValuesKey(filteredVariabledState);\n const queryKey = [\n definition,\n timeRange,\n datasourceStore,\n suggestedStepMs,\n mode,\n variablesValueKey,\n refreshKey,\n ] as const;\n\n // Determine queryEnabled\n let waitToLoad = false;\n if (variableDependencies) {\n waitToLoad = variableDependencies.some((v) => variableState[v]?.loading);\n }\n\n const queryEnabled = plugin !== undefined && !waitToLoad;\n\n return {\n queryKey,\n queryEnabled,\n };\n}\n\n/**\n * Runs a time series query using a plugin and returns the results.\n */\nexport const useTimeSeriesQuery = (\n definition: TimeSeriesQueryDefinition,\n options?: UseTimeSeriesQueryOptions,\n queryOptions?: QueryObserverOptions<TimeSeriesData>\n): UseQueryResult<TimeSeriesData> => {\n const { data: plugin } = usePlugin(TIME_SERIES_QUERY_KEY, definition.spec.plugin.kind);\n const context = useTimeSeriesQueryContext();\n const { queryEnabled, queryKey } = getQueryOptions({ plugin, definition, context });\n return useQuery({\n enabled: (queryOptions?.enabled ?? true) || queryEnabled,\n queryKey: queryKey,\n queryFn: ({ signal }) => {\n // The 'enabled' option should prevent this from happening, but make TypeScript happy by checking\n if (plugin === undefined) {\n throw new Error('Expected plugin to be loaded');\n }\n // Keep options out of query key so we don't re-run queries because suggested step changes\n const ctx: TimeSeriesQueryContext = { ...context, suggestedStepMs: options?.suggestedStepMs };\n return plugin.getTimeSeriesData(definition.spec.plugin.spec, ctx, signal);\n },\n });\n};\n\n/**\n * Runs multiple time series queries using plugins and returns the results.\n */\nexport function useTimeSeriesQueries(\n definitions: TimeSeriesQueryDefinition[],\n options?: UseTimeSeriesQueryOptions,\n queryOptions?: Omit<QueryObserverOptions, 'queryKey'>\n): Array<UseQueryResult<TimeSeriesData>> {\n const { getPlugin } = usePluginRegistry();\n const context = {\n ...useTimeSeriesQueryContext(),\n // We need mode to be part query key because this drives the type of query done (instant VS range query)\n mode: options?.mode,\n };\n\n const pluginLoaderResponse = usePlugins(\n TIME_SERIES_QUERY_KEY,\n definitions.map((d) => ({ kind: d.spec.plugin.kind }))\n );\n\n return useQueries({\n queries: definitions.map((definition, idx) => {\n const plugin = pluginLoaderResponse[idx]?.data;\n const { queryEnabled, queryKey } = getQueryOptions({ plugin, definition, context });\n return {\n ...(queryOptions as QueryObserverOptions<unknown>),\n enabled: (queryOptions?.enabled ?? true) && queryEnabled,\n queryKey: queryKey,\n queryFn: async ({ signal }: { signal: AbortSignal }): Promise<TimeSeriesData> => {\n const ctx: TimeSeriesQueryContext = {\n ...context,\n // Keep suggested step changes out of the query key, so we don´t have to run again query when it changes\n suggestedStepMs: options?.suggestedStepMs,\n };\n const plugin = await getPlugin(TIME_SERIES_QUERY_KEY, definition.spec.plugin.kind);\n const data = await plugin.getTimeSeriesData(definition.spec.plugin.spec, ctx, signal);\n return data;\n },\n } as QueryObserverOptions<unknown>;\n }),\n }) as Array<UseQueryResult<TimeSeriesData>>;\n}\n\n/**\n * Build the time series query context object from data available at runtime\n */\nfunction useTimeSeriesQueryContext(): TimeSeriesQueryContext {\n const { absoluteTimeRange, refreshKey } = useTimeRange();\n const variableState = useAllVariableValues();\n const datasourceStore = useDatasourceStore();\n\n return {\n timeRange: absoluteTimeRange,\n variableState,\n datasourceStore,\n refreshKey,\n };\n}\n\n/**\n * Get active time series queries for query results summary\n */\nexport function useActiveTimeSeriesQueries(): TimeSeriesDataQuery[] {\n const queryClient = useQueryClient();\n const queryCache = queryClient.getQueryCache();\n return getActiveTimeSeriesQueries(queryCache);\n}\n\n/**\n * Filter all cached queries down to only active time series queries\n */\nexport function getActiveTimeSeriesQueries(cache: QueryCache): TimeSeriesDataQuery[] {\n const queries: TimeSeriesDataQuery[] = [];\n\n for (const query of cache.findAll({ type: 'active' })) {\n const firstPart = query.queryKey?.[0] as UnknownSpec;\n if (firstPart?.kind && (firstPart.kind as string).startsWith(TIME_SERIES_QUERY_KEY)) {\n queries.push(query as Query<TimeSeriesData, unknown, TimeSeriesData, QueryKey>);\n }\n }\n\n return queries;\n}\n"],"names":["useQueries","useQuery","useQueryClient","useTimeRange","useDatasourceStore","usePlugin","usePluginRegistry","usePlugins","filterVariableStateMap","getVariableValuesKey","useAllVariableValues","TIME_SERIES_QUERY_KEY","getQueryOptions","plugin","definition","context","timeRange","datasourceStore","suggestedStepMs","mode","variableState","refreshKey","dependencies","dependsOn","spec","variableDependencies","variables","filteredVariabledState","variablesValueKey","queryKey","waitToLoad","some","v","loading","queryEnabled","undefined","useTimeSeriesQuery","options","queryOptions","data","kind","useTimeSeriesQueryContext","enabled","queryFn","signal","Error","ctx","getTimeSeriesData","useTimeSeriesQueries","definitions","getPlugin","pluginLoaderResponse","map","d","queries","idx","absoluteTimeRange","useActiveTimeSeriesQueries","queryClient","queryCache","getQueryCache","getActiveTimeSeriesQueries","cache","query","findAll","type","firstPart","startsWith","push"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAGjC,SAKEA,UAAU,EACVC,QAAQ,EACRC,cAAc,QAET,wBAAwB;AAE/B,SAASC,YAAY,QAAQ,sBAAsB;AACnD,SAASC,kBAAkB,QAAQ,gBAAgB;AACnD,SAASC,SAAS,EAAEC,iBAAiB,EAAEC,UAAU,QAAQ,oBAAoB;AAC7E,SAASC,sBAAsB,EAAEC,oBAAoB,QAAQ,UAAU;AACvE,SAASC,oBAAoB,QAAQ,cAAc;AAOnD,OAAO,MAAMC,wBAAwB,kBAAkB;AAEvD,SAASC,gBAAgB,EACvBC,MAAM,EACNC,UAAU,EACV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AAkBb;IAExB,OAAO;QACLY,WAAWwC;QACXpC;QACAH;QACAI;IACF;AACF;AAEA;;CAEC,GACD,OAAO,SAASoC;IACd,MAAMC,cAAcxD;IACpB,MAAMyD,aAAaD,YAAYE,aAAa;IAC5C,OAAOC,2BAA2BF;AACpC;AAEA;;CAEC,GACD,OAAO,SAASE,2BAA2BC,KAAiB;IAC1D,MAAMR,UAAiC,EAAE;IAEzC,KAAK,MAAMS,SAASD,MAAME,OAAO,CAAC;QAAEC,MAAM;IAAS,GAAI;QACrD,MAAMC,YAAYH,MAAMlC,QAAQ,EAAE,CAAC,EAAE;QACrC,IAAIqC,WAAW1B,QAAQ,AAAC0B,UAAU1B,IAAI,CAAY2B,UAAU,CAACxD,wBAAwB;YACnF2C,QAAQc,IAAI,CAACL;QACf;IACF;IAEA,OAAOT;AACT"}
1
+ {"version":3,"sources":["../../src/runtime/time-series-queries.ts"],"sourcesContent":["// Copyright 2024 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { TimeSeriesData, TimeSeriesQueryDefinition, UnknownSpec } from '@perses-dev/core';\nimport {\n Query,\n QueryCache,\n QueryKey,\n QueryObserverOptions,\n useQueries,\n useQuery,\n useQueryClient,\n UseQueryResult,\n} from '@tanstack/react-query';\nimport { TimeSeriesDataQuery, TimeSeriesQueryContext, TimeSeriesQueryMode, TimeSeriesQueryPlugin } from '../model';\nimport { useTimeRange } from './TimeRangeProvider';\nimport { useDatasourceStore } from './datasources';\nimport { usePlugin, usePluginRegistry, usePlugins } from './plugin-registry';\nimport { filterVariableStateMap, getVariableValuesKey } from './utils';\nimport { useAllVariableValues } from './variables';\n\nexport interface UseTimeSeriesQueryOptions {\n suggestedStepMs?: number;\n mode?: TimeSeriesQueryMode;\n}\n\nexport const TIME_SERIES_QUERY_KEY = 'TimeSeriesQuery';\n\nfunction getQueryOptions({\n plugin,\n definition,\n context,\n}: {\n plugin?: TimeSeriesQueryPlugin;\n definition: TimeSeriesQueryDefinition;\n context: TimeSeriesQueryContext;\n}): {\n queryKey: QueryKey;\n queryEnabled: boolean;\n} {\n const { timeRange, suggestedStepMs, mode, variableState } = context;\n\n const dependencies = plugin?.dependsOn ? plugin.dependsOn(definition.spec.plugin.spec, context) : {};\n const variableDependencies = dependencies?.variables;\n\n // Determine queryKey\n const filteredVariabledState = filterVariableStateMap(variableState, variableDependencies);\n const variablesValueKey = getVariableValuesKey(filteredVariabledState);\n\n const queryKey = [\n 'query',\n TIME_SERIES_QUERY_KEY,\n definition,\n timeRange,\n variablesValueKey,\n suggestedStepMs,\n mode,\n ] as const;\n\n // Determine queryEnabled\n let waitToLoad = false;\n if (variableDependencies) {\n waitToLoad = variableDependencies.some((v) => variableState[v]?.loading);\n }\n\n const queryEnabled = plugin !== undefined && !waitToLoad;\n\n return {\n queryKey,\n queryEnabled,\n };\n}\n\n/**\n * Runs a time series query using a plugin and returns the results.\n */\nexport const useTimeSeriesQuery = (\n definition: TimeSeriesQueryDefinition,\n options?: UseTimeSeriesQueryOptions,\n queryOptions?: QueryObserverOptions<TimeSeriesData>\n): UseQueryResult<TimeSeriesData> => {\n const { data: plugin } = usePlugin(TIME_SERIES_QUERY_KEY, definition.spec.plugin.kind);\n const context = useTimeSeriesQueryContext();\n const { queryEnabled, queryKey } = getQueryOptions({ plugin, definition, context });\n return useQuery({\n enabled: (queryOptions?.enabled ?? true) || queryEnabled,\n queryKey: queryKey,\n queryFn: ({ signal }) => {\n // The 'enabled' option should prevent this from happening, but make TypeScript happy by checking\n if (plugin === undefined) {\n throw new Error('Expected plugin to be loaded');\n }\n // Keep options out of query key so we don't re-run queries because suggested step changes\n const ctx: TimeSeriesQueryContext = { ...context, suggestedStepMs: options?.suggestedStepMs };\n return plugin.getTimeSeriesData(definition.spec.plugin.spec, ctx, signal);\n },\n });\n};\n\n/**\n * Runs multiple time series queries using plugins and returns the results.\n */\nexport function useTimeSeriesQueries(\n definitions: TimeSeriesQueryDefinition[],\n options?: UseTimeSeriesQueryOptions,\n queryOptions?: Omit<QueryObserverOptions, 'queryKey'>\n): Array<UseQueryResult<TimeSeriesData>> {\n const { getPlugin } = usePluginRegistry();\n const context = {\n ...useTimeSeriesQueryContext(),\n mode: options?.mode,\n suggestedStepMs: options?.suggestedStepMs,\n };\n\n const pluginLoaderResponse = usePlugins(\n TIME_SERIES_QUERY_KEY,\n definitions.map((d) => ({ kind: d.spec.plugin.kind }))\n );\n\n return useQueries({\n queries: definitions.map((definition, idx) => {\n const plugin = pluginLoaderResponse[idx]?.data;\n const { queryEnabled, queryKey } = getQueryOptions({ plugin, definition, context });\n return {\n ...queryOptions,\n enabled: (queryOptions?.enabled ?? true) && queryEnabled,\n queryKey: queryKey,\n queryFn: async ({ signal }: { signal: AbortSignal }): Promise<TimeSeriesData> => {\n const plugin = await getPlugin(TIME_SERIES_QUERY_KEY, definition.spec.plugin.kind);\n const data = await plugin.getTimeSeriesData(definition.spec.plugin.spec, context, signal);\n return data;\n },\n } as QueryObserverOptions;\n }),\n }) as Array<UseQueryResult<TimeSeriesData>>;\n}\n\n/**\n * Build the time series query context object from data available at runtime\n */\nfunction useTimeSeriesQueryContext(): TimeSeriesQueryContext {\n const { absoluteTimeRange } = useTimeRange();\n const variableState = useAllVariableValues();\n const datasourceStore = useDatasourceStore();\n\n return {\n timeRange: absoluteTimeRange,\n variableState,\n datasourceStore,\n };\n}\n\n/**\n * Get active time series queries for query results summary\n */\nexport function useActiveTimeSeriesQueries(): TimeSeriesDataQuery[] {\n const queryClient = useQueryClient();\n const queryCache = queryClient.getQueryCache();\n return getActiveTimeSeriesQueries(queryCache);\n}\n\n/**\n * Filter all cached queries down to only active time series queries\n */\nexport function getActiveTimeSeriesQueries(cache: QueryCache): TimeSeriesDataQuery[] {\n const queries: TimeSeriesDataQuery[] = [];\n\n for (const query of cache.findAll({ type: 'active' })) {\n const firstPart = query.queryKey?.[0] as UnknownSpec;\n if (firstPart?.kind && (firstPart.kind as string).startsWith(TIME_SERIES_QUERY_KEY)) {\n queries.push(query as Query<TimeSeriesData, unknown, TimeSeriesData, QueryKey>);\n }\n }\n\n return queries;\n}\n"],"names":["useQueries","useQuery","useQueryClient","useTimeRange","useDatasourceStore","usePlugin","usePluginRegistry","usePlugins","filterVariableStateMap","getVariableValuesKey","useAllVariableValues","TIME_SERIES_QUERY_KEY","getQueryOptions","plugin","definition","context","timeRange","suggestedStepMs","mode","variableState","dependencies","dependsOn","spec","variableDependencies","variables","filteredVariabledState","variablesValueKey","queryKey","waitToLoad","some","v","loading","queryEnabled","undefined","useTimeSeriesQuery","options","queryOptions","data","kind","useTimeSeriesQueryContext","enabled","queryFn","signal","Error","ctx","getTimeSeriesData","useTimeSeriesQueries","definitions","getPlugin","pluginLoaderResponse","map","d","queries","idx","absoluteTimeRange","datasourceStore","useActiveTimeSeriesQueries","queryClient","queryCache","getQueryCache","getActiveTimeSeriesQueries","cache","query","findAll","type","firstPart","startsWith","push"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAGjC,SAKEA,UAAU,EACVC,QAAQ,EACRC,cAAc,QAET,wBAAwB;AAE/B,SAASC,YAAY,QAAQ,sBAAsB;AACnD,SAASC,kBAAkB,QAAQ,gBAAgB;AACnD,SAASC,SAAS,EAAEC,iBAAiB,EAAEC,UAAU,QAAQ,oBAAoB;AAC7E,SAASC,sBAAsB,EAAEC,oBAAoB,QAAQ,UAAU;AACvE,SAASC,oBAAoB,QAAQ,cAAc;A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Y,WAAWsC;QACXnC;QACAoC;IACF;AACF;AAEA;;CAEC,GACD,OAAO,SAASC;IACd,MAAMC,cAAcvD;IACpB,MAAMwD,aAAaD,YAAYE,aAAa;IAC5C,OAAOC,2BAA2BF;AACpC;AAEA;;CAEC,GACD,OAAO,SAASE,2BAA2BC,KAAiB;IAC1D,MAAMT,UAAiC,EAAE;IAEzC,KAAK,MAAMU,SAASD,MAAME,OAAO,CAAC;QAAEC,MAAM;IAAS,GAAI;QACrD,MAAMC,YAAYH,MAAMnC,QAAQ,EAAE,CAAC,EAAE;QACrC,IAAIsC,WAAW3B,QAAQ,AAAC2B,UAAU3B,IAAI,CAAY4B,UAAU,CAACvD,wBAAwB;YACnFyC,QAAQe,IAAI,CAACL;QACf;IACF;IAEA,OAAOV;AACT"}
@@ -51,14 +51,15 @@ export const TRACE_QUERY_KEY = 'TraceQuery';
51
51
  });
52
52
  }
53
53
  function getQueryOptions({ plugin, definition, context }) {
54
- const { datasourceStore, variableState, absoluteTimeRange } = context;
54
+ const { variableState, absoluteTimeRange } = context;
55
55
  const dependencies = plugin?.dependsOn ? plugin.dependsOn(definition.spec.plugin.spec, context) : {};
56
56
  const variableDependencies = dependencies?.variables;
57
57
  const filteredVariabledState = filterVariableStateMap(variableState, variableDependencies);
58
58
  const variablesValueKey = getVariableValuesKey(filteredVariabledState);
59
59
  const queryKey = [
60
+ 'query',
61
+ TRACE_QUERY_KEY,
60
62
  definition,
61
- datasourceStore,
62
63
  absoluteTimeRange,
63
64
  variablesValueKey
64
65
  ];
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/runtime/trace-queries.ts"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { QueryDefinition, UnknownSpec, TraceData } from '@perses-dev/core';\nimport { QueryKey, useQueries, UseQueryResult } from '@tanstack/react-query';\nimport { TraceQueryContext, TraceQueryPlugin } from '../model';\nimport { useDatasourceStore } from './datasources';\nimport { usePluginRegistry, usePlugins } from './plugin-registry';\nimport { useTimeRange } from './TimeRangeProvider';\nimport { useAllVariableValues } from './variables';\nimport { filterVariableStateMap, getVariableValuesKey } from './utils';\nexport type TraceQueryDefinition<PluginSpec = UnknownSpec> = QueryDefinition<'TraceQuery', PluginSpec>;\nexport const TRACE_QUERY_KEY = 'TraceQuery';\n\n/**\n * Run a trace query using a TraceQuery plugin and return the results\n * @param definitions: dashboard defintion for a trace query, written in Trace Query Language (TraceQL)\n * Documentation for TraceQL: https://grafana.com/docs/tempo/latest/traceql/\n */\nexport function useTraceQueries(definitions: TraceQueryDefinition[]): Array<UseQueryResult<TraceData>> {\n const { getPlugin } = usePluginRegistry();\n const context = useTraceQueryContext();\n\n const pluginLoaderResponse = usePlugins(\n 'TraceQuery',\n definitions.map((d) => ({ kind: d.spec.plugin.kind }))\n );\n\n // useQueries() handles data fetching from query plugins (e.g. traceQL queries, promQL queries)\n // https://tanstack.com/query/v4/docs/react/reference/useQuery\n return useQueries({\n queries: definitions.map((definition, idx) => {\n const plugin = pluginLoaderResponse[idx]?.data;\n const { queryEnabled, queryKey } = getQueryOptions({ context, definition, plugin });\n const traceQueryKind = definition?.spec?.plugin?.kind;\n return {\n enabled: queryEnabled,\n queryKey: queryKey,\n queryFn: async (): Promise<TraceData> => {\n const plugin = await getPlugin(TRACE_QUERY_KEY, traceQueryKind);\n const data = await plugin.getTraceData(definition.spec.plugin.spec, context);\n return data;\n },\n };\n }),\n });\n}\n\nfunction getQueryOptions({\n plugin,\n definition,\n context,\n}: {\n plugin?: TraceQueryPlugin;\n definition: TraceQueryDefinition;\n context: TraceQueryContext;\n}): {\n queryKey: QueryKey;\n queryEnabled: boolean;\n} {\n const { datasourceStore, variableState, absoluteTimeRange } = context;\n\n const dependencies = plugin?.dependsOn ? plugin.dependsOn(definition.spec.plugin.spec, context) : {};\n const variableDependencies = dependencies?.variables;\n\n const filteredVariabledState = filterVariableStateMap(variableState, variableDependencies);\n const variablesValueKey = getVariableValuesKey(filteredVariabledState);\n const queryKey = [definition, datasourceStore, absoluteTimeRange, variablesValueKey] as const;\n\n let waitToLoad = false;\n if (variableDependencies) {\n waitToLoad = variableDependencies.some((v) => variableState[v]?.loading);\n }\n\n const queryEnabled = plugin !== undefined && !waitToLoad;\n return {\n queryKey,\n queryEnabled,\n };\n}\n\nfunction useTraceQueryContext(): TraceQueryContext {\n const { absoluteTimeRange } = useTimeRange();\n const variableState = useAllVariableValues();\n const datasourceStore = useDatasourceStore();\n\n return {\n variableState,\n datasourceStore,\n absoluteTimeRange,\n };\n}\n"],"names":["useQueries","useDatasourceStore","usePluginRegistry","usePlugins","useTimeRange","useAllVariableValues","filterVariableStateMap","getVariableValuesKey","TRACE_QUERY_KEY","useTraceQueries","definitions","getPlugin","context","useTraceQueryContext","pluginLoaderResponse","map","d","kind","spec","plugin","queries","definition","idx","data","queryEnabled","queryKey","getQueryOptions","traceQueryKind","enabled","queryFn","getTraceData","datasourceStore","variableState","absoluteTimeRange","dependencies","dependsOn","variableDependencies","variables","filteredVariabledState","variablesValueKey","waitToLoad","some","v","loading","undefined"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAGjC,SAAmBA,UAAU,QAAwB,wBAAwB;AAE7E,SAASC,kBAAkB,QAAQ,gBAAgB;AACnD,SAASC,iBAAiB,EAAEC,UAAU,QAAQ,oBAAoB;AAClE,SAASC,YAAY,QAAQ,sBAAsB;AACnD,SAASC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IAC/C,MAAMb,WAAW;QAACJ;QAAYU;QAAiBE;QAAmBM;KAAkB;IAEpF,IAAIC,aAAa;IACjB,IAAIJ,sBAAsB;QACxBI,aAAaJ,qBAAqBK,IAAI,CAAC,CAACC,IAAMV,aAAa,CAACU,EAAE,EAAEC;IAClE;IAEA,MAAMnB,eAAeL,WAAWyB,aAAa,CAACJ;IAC9C,OAAO;QACLf;QACAD;IACF;AACF;AAEA,SAASX;IACP,MAAM,EAAEoB,iBAAiB,EAAE,GAAG7B;IAC9B,MAAM4B,gBAAgB3B;IACtB,MAAM0B,kBAAkB9B;IAExB,OAAO;QACL+B;QACAD;QACAE;IACF;AACF"}
1
+ {"version":3,"sources":["../../src/runtime/trace-queries.ts"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { QueryDefinition, UnknownSpec, TraceData } from '@perses-dev/core';\nimport { QueryKey, useQueries, UseQueryResult } from '@tanstack/react-query';\nimport { TraceQueryContext, TraceQueryPlugin } from '../model';\nimport { useDatasourceStore } from './datasources';\nimport { usePluginRegistry, usePlugins } from './plugin-registry';\nimport { useTimeRange } from './TimeRangeProvider';\nimport { useAllVariableValues } from './variables';\nimport { filterVariableStateMap, getVariableValuesKey } from './utils';\nexport type TraceQueryDefinition<PluginSpec = UnknownSpec> = QueryDefinition<'TraceQuery', PluginSpec>;\nexport const TRACE_QUERY_KEY = 'TraceQuery';\n\n/**\n * Run a trace query using a TraceQuery plugin and return the results\n * @param definitions: dashboard defintion for a trace query, written in Trace Query Language (TraceQL)\n * Documentation for TraceQL: https://grafana.com/docs/tempo/latest/traceql/\n */\nexport function useTraceQueries(definitions: TraceQueryDefinition[]): Array<UseQueryResult<TraceData>> {\n const { getPlugin } = usePluginRegistry();\n const context = useTraceQueryContext();\n\n const pluginLoaderResponse = usePlugins(\n 'TraceQuery',\n definitions.map((d) => ({ kind: d.spec.plugin.kind }))\n );\n\n // useQueries() handles data fetching from query plugins (e.g. traceQL queries, promQL queries)\n // https://tanstack.com/query/v4/docs/react/reference/useQuery\n return useQueries({\n queries: definitions.map((definition, idx) => {\n const plugin = pluginLoaderResponse[idx]?.data;\n const { queryEnabled, queryKey } = getQueryOptions({ context, definition, plugin });\n const traceQueryKind = definition?.spec?.plugin?.kind;\n return {\n enabled: queryEnabled,\n queryKey: queryKey,\n queryFn: async (): Promise<TraceData> => {\n const plugin = await getPlugin(TRACE_QUERY_KEY, traceQueryKind);\n const data = await plugin.getTraceData(definition.spec.plugin.spec, context);\n return data;\n },\n };\n }),\n });\n}\n\nfunction getQueryOptions({\n plugin,\n definition,\n context,\n}: {\n plugin?: TraceQueryPlugin;\n definition: TraceQueryDefinition;\n context: TraceQueryContext;\n}): {\n queryKey: QueryKey;\n queryEnabled: boolean;\n} {\n const { variableState, absoluteTimeRange } = context;\n\n const dependencies = plugin?.dependsOn ? plugin.dependsOn(definition.spec.plugin.spec, context) : {};\n const variableDependencies = dependencies?.variables;\n\n const filteredVariabledState = filterVariableStateMap(variableState, variableDependencies);\n const variablesValueKey = getVariableValuesKey(filteredVariabledState);\n const queryKey = ['query', TRACE_QUERY_KEY, definition, absoluteTimeRange, variablesValueKey] as const;\n\n let waitToLoad = false;\n if (variableDependencies) {\n waitToLoad = variableDependencies.some((v) => variableState[v]?.loading);\n }\n\n const queryEnabled = plugin !== undefined && !waitToLoad;\n return {\n queryKey,\n queryEnabled,\n };\n}\n\nfunction useTraceQueryContext(): TraceQueryContext {\n const { absoluteTimeRange } = useTimeRange();\n const variableState = useAllVariableValues();\n const datasourceStore = useDatasourceStore();\n\n return {\n variableState,\n datasourceStore,\n absoluteTimeRange,\n };\n}\n"],"names":["useQueries","useDatasourceStore","usePluginRegistry","usePlugins","useTimeRange","useAllVariableValues","filterVariableStateMap","getVariableValuesKey","TRACE_QUERY_KEY","useTraceQueries","definitions","getPlugin","context","useTraceQueryContext","pluginLoaderResponse","map","d","kind","spec","plugin","queries","definition","idx","data","queryEnabled","queryKey","getQueryOptions","traceQueryKind","enabled","queryFn","getTraceData","variableState","absoluteTimeRange","dependencies","dependsOn","variableDependencies","variables","filteredVariabledState","variablesValueKey","waitToLoad","some","v","loading","undefined","datasourceStore"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAGjC,SAAmBA,UAAU,QAAwB,wBAAwB;AAE7E,SAASC,kBAAkB,QAAQ,gBAAgB;AACnD,SAASC,iBAAiB,EAAEC,UAAU,QAAQ,oBAAoB;AAClE,SAASC,YAAY,QAAQ,sBAAsB;AACnD,SAASC,oBAAoB,QAAQ,cAAc;AACnD,SAASC,sBAAsB,EAAEC,oBAAoB,QAAQ,UAAU;AAEvE,OAAO,MAAMC,kBAAkB,aAAa;AAE5C;;;;CAIC,GACD,OAAO,SAASC,gBAAgBC,WAAmC;IACjE,MAAM,EAAEC,SAAS,EAAE,GAAGT;IACtB,MAAMU,UAAUC;IAEhB,MAAMC,uBAAuBX,WAC3B,cACAO,YAAYK,GAAG,CAAC,CAACC,IAAO,CAAA;YAAEC,MAAMD,EAAEE,IAAI,CAACC,MAAM,CAACF,IAAI;QAAC,CAAA;IAGrD,+FAA+F;IAC/F,8DAA8D;IAC9D,OAAOjB,WAAW;QAChBoB,SAASV,YAAYK,GAAG,CAAC,CAACM,YAAYC;YACpC,MAAMH,SAASL,oBAAoB,CAACQ,IAAI,EAAEC;YAC1C,MAAM,EAAEC,YAAY,EAAEC,QAAQ,EAAE,GAAGC,gBAAgB;gBAAEd;gBAASS;gBAAYF;YAAO;YACjF,MAAMQ,iBAAiBN,YAAYH,MAAMC,QAAQF;YACjD,OAAO;gBACLW,SAASJ;gBACTC,UAAUA;gBACVI,SAAS;oBACP,MAAMV,SAAS,MAAMR,UAAUH,iBAAiBmB;oBAChD,MAAMJ,OAAO,MAAMJ,OAAOW,YAAY,CAACT,WAAWH,IAAI,CAACC,MAAM,CAACD,IAAI,EAAEN;oBACpE,OAAOW;gBACT;YACF;QACF;IACF;AACF;AAEA,SAASG,gBAAgB,EACvBP,MAAM,EACNE,UAAU,EACVT,OAAO,EAKR;IAIC,MAAM,EAAEmB,aAAa,EAAEC,iBAAiB,EAAE,GAAGpB;IAE7C,MAAMqB,eAAed,QAAQe,YAAYf,OAAOe,SAAS,CAACb,WAAWH,IAAI,CAACC,MAAM,CAACD,IAAI,EAAEN,WAAW,CAAC;IACnG,MAAMuB,uBAAuBF,cAAcG;IAE3C,MAAMC,yBAAyB/B,uBAAuByB,eAAeI;IACrE,MAAMG,oBAAoB/B,qBAAqB8B;IAC/C,MAAMZ,WAAW;QAAC;QAASjB;QAAiBa;QAAYW;QAAmBM;KAAkB;IAE7F,IAAIC,aAAa;IACjB,IAAIJ,sBAAsB;QACxBI,aAAaJ,qBAAqBK,IAAI,CAAC,CAACC,IAAMV,aAAa,CAACU,EAAE,EAAEC;IAClE;IAEA,MAAMlB,eAAeL,WAAWwB,aAAa,CAACJ;IAC9C,OAAO;QACLd;QACAD;IACF;AACF;AAEA,SAASX;IACP,MAAM,EAAEmB,iBAAiB,EAAE,GAAG5B;IAC9B,MAAM2B,gBAAgB1B;IACtB,MAAMuC,kBAAkB3C;IAExB,OAAO;QACL8B;QACAa;QACAZ;IACF;AACF"}
@@ -14,7 +14,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
14
14
  import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
15
15
  import { DEFAULT_DASHBOARD_DURATION } from '@perses-dev/core';
16
16
  import { PluginRegistry } from '../components';
17
- import { TimeRangeProvider } from '../runtime';
17
+ import { TimeRangeProviderBasic } from '../runtime';
18
18
  import { testPluginLoader } from './test-plugins';
19
19
  export function getTestContextWrapper(contextOptions) {
20
20
  // Create a new QueryClient for each test to avoid caching issues
@@ -31,10 +31,10 @@ export function getTestContextWrapper(contextOptions) {
31
31
  end: new Date()
32
32
  };
33
33
  return function Wrapper({ children }) {
34
- return /*#__PURE__*/ _jsx(TimeRangeProvider, {
35
- timeRange: timeRange,
36
- children: /*#__PURE__*/ _jsx(QueryClientProvider, {
37
- client: queryClient,
34
+ return /*#__PURE__*/ _jsx(QueryClientProvider, {
35
+ client: queryClient,
36
+ children: /*#__PURE__*/ _jsx(TimeRangeProviderBasic, {
37
+ initialTimeRange: timeRange,
38
38
  children: /*#__PURE__*/ _jsx(PluginRegistry, {
39
39
  pluginLoader: testPluginLoader,
40
40
  defaultPluginKinds: contextOptions?.defaultPluginKinds ?? {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/test/utils.tsx"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { QueryClient, QueryClientProvider } from '@tanstack/react-query';\nimport { ReactNode } from 'react';\nimport { DEFAULT_DASHBOARD_DURATION } from '@perses-dev/core';\nimport { PluginRegistry } from '../components';\nimport { DefaultPluginKinds } from '../model';\nimport { TimeRangeProvider } from '../runtime';\nimport { testPluginLoader } from './test-plugins';\n\nexport type ContextOptions = {\n defaultPluginKinds?: DefaultPluginKinds;\n};\n\nexport function getTestContextWrapper(contextOptions?: ContextOptions) {\n // Create a new QueryClient for each test to avoid caching issues\n const queryClient = new QueryClient({\n defaultOptions: { queries: { refetchOnWindowFocus: false, retry: false } },\n });\n\n const timeRange = { start: new Date(Date.now() - Number(DEFAULT_DASHBOARD_DURATION)), end: new Date() };\n return function Wrapper({ children }: { children: ReactNode }): ReactNode {\n return (\n <TimeRangeProvider timeRange={timeRange}>\n <QueryClientProvider client={queryClient}>\n <PluginRegistry\n pluginLoader={testPluginLoader}\n defaultPluginKinds={\n contextOptions?.defaultPluginKinds ?? {\n TimeSeriesQuery: 'PrometheusTimeSeriesQuery',\n }\n }\n >\n {children}\n </PluginRegistry>\n </QueryClientProvider>\n </TimeRangeProvider>\n );\n };\n}\n"],"names":["QueryClient","QueryClientProvider","DEFAULT_DASHBOARD_DURATION","PluginRegistry","TimeRangeProvider","testPluginLoader","getTestContextWrapper","contextOptions","queryClient","defaultOptions","queries","refetchOnWindowFocus","retry","timeRange","start","Date","now","Number","end","Wrapper","children","client","pluginLoader","defaultPluginKinds","TimeSeriesQuery"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;;AAEjC,SAASA,WAAW,EAAEC,mBAAmB,QAAQ,wBAAwB;AAEzE,SAASC,0BAA0B,QAAQ,mBAAmB;AAC9D,SAASC,cAAc,QAAQ,gBAAgB;AAE/C,SAASC,iBAAiB,QAAQ,aAAa;AAC/C,SAASC,gBAAgB,QAAQ,iBAAiB;AAMlD,OAAO,SAASC,sBAAsBC,cAA+B;IACnE,iEAAiE;IACjE,MAAMC,cAAc,IAAIR,YAAY;QAClCS,gBAAgB;YAAEC,SAAS;gBAAEC,sBAAsB;gBAAOC,OAAO;YAAM;QAAE;IAC3E;IAEA,MAAMC,YAAY;QAAEC,OAAO,IAAIC,KAAKA,KAAKC,GAAG,KAAKC,OAAOf;QAA8BgB,KAAK,IAAIH;IAAO;IACtG,OAAO,SAASI,QAAQ,EAAEC,QAAQ,EAA2B;QAC3D,qBACE,KAAChB;YAAkBS,WAAWA;sBAC5B,cAAA,KAACZ;gBAAoBoB,QAAQb;0BAC3B,cAAA,KAACL;oBACCmB,cAAcjB;oBACdkB,oBACEhB,gBAAgBgB,sBAAsB;wBACpCC,iBAAiB;oBACnB;8BAGDJ;;;;IAKX;AACF"}
1
+ {"version":3,"sources":["../../src/test/utils.tsx"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { QueryClient, QueryClientProvider } from '@tanstack/react-query';\nimport { ReactNode } from 'react';\nimport { DEFAULT_DASHBOARD_DURATION } from '@perses-dev/core';\nimport { PluginRegistry } from '../components';\nimport { DefaultPluginKinds } from '../model';\nimport { TimeRangeProviderBasic } from '../runtime';\nimport { testPluginLoader } from './test-plugins';\n\nexport type ContextOptions = {\n defaultPluginKinds?: DefaultPluginKinds;\n};\n\nexport function getTestContextWrapper(contextOptions?: ContextOptions) {\n // Create a new QueryClient for each test to avoid caching issues\n const queryClient = new QueryClient({\n defaultOptions: { queries: { refetchOnWindowFocus: false, retry: false } },\n });\n const timeRange = { start: new Date(Date.now() - Number(DEFAULT_DASHBOARD_DURATION)), end: new Date() };\n\n return function Wrapper({ children }: { children: ReactNode }): ReactNode {\n return (\n <QueryClientProvider client={queryClient}>\n <TimeRangeProviderBasic initialTimeRange={timeRange}>\n <PluginRegistry\n pluginLoader={testPluginLoader}\n defaultPluginKinds={\n contextOptions?.defaultPluginKinds ?? {\n TimeSeriesQuery: 'PrometheusTimeSeriesQuery',\n }\n }\n >\n {children}\n </PluginRegistry>\n </TimeRangeProviderBasic>\n </QueryClientProvider>\n );\n };\n}\n"],"names":["QueryClient","QueryClientProvider","DEFAULT_DASHBOARD_DURATION","PluginRegistry","TimeRangeProviderBasic","testPluginLoader","getTestContextWrapper","contextOptions","queryClient","defaultOptions","queries","refetchOnWindowFocus","retry","timeRange","start","Date","now","Number","end","Wrapper","children","client","initialTimeRange","pluginLoader","defaultPluginKinds","TimeSeriesQuery"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;;AAEjC,SAASA,WAAW,EAAEC,mBAAmB,QAAQ,wBAAwB;AAEzE,SAASC,0BAA0B,QAAQ,mBAAmB;AAC9D,SAASC,cAAc,QAAQ,gBAAgB;AAE/C,SAASC,sBAAsB,QAAQ,aAAa;AACpD,SAASC,gBAAgB,QAAQ,iBAAiB;AAMlD,OAAO,SAASC,sBAAsBC,cAA+B;IACnE,iEAAiE;IACjE,MAAMC,cAAc,IAAIR,YAAY;QAClCS,gBAAgB;YAAEC,SAAS;gBAAEC,sBAAsB;gBAAOC,OAAO;YAAM;QAAE;IAC3E;IACA,MAAMC,YAAY;QAAEC,OAAO,IAAIC,KAAKA,KAAKC,GAAG,KAAKC,OAAOf;QAA8BgB,KAAK,IAAIH;IAAO;IAEtG,OAAO,SAASI,QAAQ,EAAEC,QAAQ,EAA2B;QAC3D,qBACE,KAACnB;YAAoBoB,QAAQb;sBAC3B,cAAA,KAACJ;gBAAuBkB,kBAAkBT;0BACxC,cAAA,KAACV;oBACCoB,cAAclB;oBACdmB,oBACEjB,gBAAgBiB,sBAAsB;wBACpCC,iBAAiB;oBACnB;8BAGDL;;;;IAKX;AACF"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@perses-dev/plugin-system",
3
- "version": "0.53.0-beta.1",
3
+ "version": "0.53.0-beta.3",
4
4
  "description": "The plugin feature in Pereses",
5
5
  "license": "Apache-2.0",
6
6
  "homepage": "https://github.com/perses/perses/blob/main/README.md",
@@ -28,9 +28,9 @@
28
28
  "lint:fix": "eslint --fix src --ext .ts,.tsx"
29
29
  },
30
30
  "dependencies": {
31
- "@module-federation/enhanced": "^0.19.1",
32
- "@perses-dev/components": "0.53.0-beta.1",
33
- "@perses-dev/core": "0.53.0-beta.1",
31
+ "@module-federation/enhanced": "^0.21.4",
32
+ "@perses-dev/components": "0.53.0-beta.3",
33
+ "@perses-dev/core": "0.53.0-beta.3",
34
34
  "date-fns": "^4.1.0",
35
35
  "date-fns-tz": "^3.2.0",
36
36
  "immer": "^10.1.1",
@@ -1,9 +0,0 @@
1
- import { DurationString, TimeRangeValue } from '@perses-dev/core';
2
- import React, { ReactElement } from 'react';
3
- export interface TimeRangeFromQueryProps {
4
- initialTimeRange: TimeRangeValue;
5
- initialRefreshInterval?: DurationString;
6
- children?: React.ReactNode;
7
- }
8
- export declare function TimeRangeProviderWithQueryParams(props: TimeRangeFromQueryProps): ReactElement;
9
- //# sourceMappingURL=TimeRangeProviderWithQueryParams.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"TimeRangeProviderWithQueryParams.d.ts","sourceRoot":"","sources":["../../../src/runtime/TimeRangeProvider/TimeRangeProviderWithQueryParams.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClE,OAAO,KAAK,EAAE,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAI5C,MAAM,WAAW,uBAAuB;IACtC,gBAAgB,EAAE,cAAc,CAAC;IACjC,sBAAsB,CAAC,EAAE,cAAc,CAAC;IACxC,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AAED,wBAAgB,gCAAgC,CAAC,KAAK,EAAE,uBAAuB,GAAG,YAAY,CAgB7F"}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../src/runtime/TimeRangeProvider/TimeRangeProviderWithQueryParams.tsx"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { DurationString, TimeRangeValue } from '@perses-dev/core';\nimport React, { ReactElement } from 'react';\nimport { TimeRangeProvider } from './TimeRangeProvider';\nimport { useSetRefreshIntervalParams, useTimeRangeParams } from './query-params';\n\nexport interface TimeRangeFromQueryProps {\n initialTimeRange: TimeRangeValue;\n initialRefreshInterval?: DurationString;\n children?: React.ReactNode;\n}\n\nexport function TimeRangeProviderWithQueryParams(props: TimeRangeFromQueryProps): ReactElement {\n const { initialTimeRange, initialRefreshInterval, children } = props;\n\n const { timeRange, setTimeRange } = useTimeRangeParams(initialTimeRange);\n const { refreshInterval, setRefreshInterval } = useSetRefreshIntervalParams(initialRefreshInterval);\n\n return (\n <TimeRangeProvider\n timeRange={timeRange}\n refreshInterval={refreshInterval}\n setTimeRange={setTimeRange}\n setRefreshInterval={setRefreshInterval}\n >\n {children}\n </TimeRangeProvider>\n );\n}\n"],"names":["React","TimeRangeProvider","useSetRefreshIntervalParams","useTimeRangeParams","TimeRangeProviderWithQueryParams","props","initialTimeRange","initialRefreshInterval","children","timeRange","setTimeRange","refreshInterval","setRefreshInterval"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;;AAGjC,OAAOA,WAA6B,QAAQ;AAC5C,SAASC,iBAAiB,QAAQ,sBAAsB;AACxD,SAASC,2BAA2B,EAAEC,kBAAkB,QAAQ,iBAAiB;AAQjF,OAAO,SAASC,iCAAiCC,KAA8B;IAC7E,MAAM,EAAEC,gBAAgB,EAAEC,sBAAsB,EAAEC,QAAQ,EAAE,GAAGH;IAE/D,MAAM,EAAEI,SAAS,EAAEC,YAAY,EAAE,GAAGP,mBAAmBG;IACvD,MAAM,EAAEK,eAAe,EAAEC,kBAAkB,EAAE,GAAGV,4BAA4BK;IAE5E,qBACE,KAACN;QACCQ,WAAWA;QACXE,iBAAiBA;QACjBD,cAAcA;QACdE,oBAAoBA;kBAEnBJ;;AAGP"}