@backstage/core-app-api 1.10.1-next.1 → 1.11.0-next.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,20 @@
1
1
  # @backstage/core-app-api
2
2
 
3
+ ## 1.11.0-next.2
4
+
5
+ ### Minor Changes
6
+
7
+ - c9d9bfeca2: URL encode some well known unsafe characters in `RouteResolver` (and therefore `useRouteRef`)
8
+
9
+ ### Patch Changes
10
+
11
+ - acca17e91a: Wrap entire app in `<Suspense>`, enabling support for using translations outside plugins.
12
+ - Updated dependencies
13
+ - @backstage/core-plugin-api@1.7.0-next.1
14
+ - @backstage/config@1.1.1-next.0
15
+ - @backstage/types@1.1.1
16
+ - @backstage/version-bridge@1.0.5
17
+
3
18
  ## 1.10.1-next.1
4
19
 
5
20
  ### Patch Changes
package/dist/index.esm.js CHANGED
@@ -1,4 +1,4 @@
1
- import React, { useContext, createContext, useEffect, useState, Children, isValidElement, useMemo, useRef } from 'react';
1
+ import React, { useContext, createContext, useEffect, useState, Children, isValidElement, useMemo, useRef, Suspense } from 'react';
2
2
  import PropTypes from 'prop-types';
3
3
  import { createVersionedContext, createVersionedValueMap, getOrCreateGlobalSingleton } from '@backstage/version-bridge';
4
4
  import ObservableImpl from 'zen-observable';
@@ -9,6 +9,7 @@ export { ConfigReader } from '@backstage/config';
9
9
  import { createRoutesFromChildren, Route, useLocation, matchRoutes, Routes, generatePath, useRoutes } from 'react-router-dom';
10
10
  import useAsync from 'react-use/lib/useAsync';
11
11
  import { appLanguageApiRef, translationApiRef } from '@backstage/core-plugin-api/alpha';
12
+ import mapValues from 'lodash/mapValues';
12
13
  import useObservable from 'react-use/lib/useObservable';
13
14
  import { createInstance } from 'i18next';
14
15
 
@@ -2834,7 +2835,13 @@ class RouteResolver {
2834
2835
  this.routeObjects
2835
2836
  );
2836
2837
  const routeFunc = (...[params]) => {
2837
- return joinPaths(basePath, generatePath(targetPath, params));
2838
+ const encodedParams = params && mapValues(params, (value) => {
2839
+ if (typeof value === "string") {
2840
+ return value.replaceAll(/[&?#;\/]/g, (c) => encodeURIComponent(c));
2841
+ }
2842
+ return value;
2843
+ });
2844
+ return joinPaths(basePath, generatePath(targetPath, encodedParams));
2838
2845
  };
2839
2846
  return routeFunc;
2840
2847
  }
@@ -3841,7 +3848,7 @@ class AppManager {
3841
3848
  }
3842
3849
  }
3843
3850
  }
3844
- const { ThemeProvider = AppThemeProvider } = this.components;
3851
+ const { ThemeProvider = AppThemeProvider, Progress } = this.components;
3845
3852
  return /* @__PURE__ */ React.createElement(ApiProvider, { apis: this.getApiHolder() }, /* @__PURE__ */ React.createElement(AppContextProvider, { appContext }, /* @__PURE__ */ React.createElement(ThemeProvider, null, /* @__PURE__ */ React.createElement(
3846
3853
  RoutingProvider,
3847
3854
  {
@@ -3859,7 +3866,7 @@ class AppManager {
3859
3866
  appIdentityProxy: this.appIdentityProxy
3860
3867
  }
3861
3868
  },
3862
- children
3869
+ /* @__PURE__ */ React.createElement(Suspense, { fallback: /* @__PURE__ */ React.createElement(Progress, null) }, children)
3863
3870
  )
3864
3871
  ))));
3865
3872
  };