@equinor/fusion-framework-react-app 14.0.3-next.0 → 14.0.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.
- package/CHANGELOG.md +2 -10
- package/README.md +2 -9
- package/dist/esm/create-component.js +1 -1
- package/dist/esm/msal/useToken.js +3 -12
- package/dist/esm/msal/useToken.js.map +1 -1
- package/dist/esm/version.js +1 -1
- package/dist/esm/version.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types/create-component.d.ts +1 -1
- package/dist/types/version.d.ts +1 -1
- package/docs/bookmark.md +0 -7
- package/docs/context.md +1 -3
- package/docs/framework.md +2 -2
- package/docs/msal.md +3 -3
- package/package.json +25 -77
- package/src/__tests__/useStateSyncEvents.test.ts +11 -12
- package/src/create-component.tsx +1 -1
- package/src/msal/useToken.ts +3 -14
- package/src/version.ts +1 -1
- package/tsconfig.json +0 -6
- package/vitest.config.ts +8 -2
- package/dist/esm/ag-grid/community.js +0 -12
- package/dist/esm/ag-grid/community.js.map +0 -1
- package/dist/esm/ag-grid/enterprise.js +0 -12
- package/dist/esm/ag-grid/enterprise.js.map +0 -1
- package/dist/esm/ag-grid/react.js +0 -12
- package/dist/esm/ag-grid/react.js.map +0 -1
- package/dist/esm/ag-grid/testing.js +0 -19
- package/dist/esm/ag-grid/testing.js.map +0 -1
- package/dist/esm/ag-grid/theme.js +0 -13
- package/dist/esm/ag-grid/theme.js.map +0 -1
- package/dist/types/ag-grid/community.d.ts +0 -11
- package/dist/types/ag-grid/enterprise.d.ts +0 -11
- package/dist/types/ag-grid/react.d.ts +0 -11
- package/dist/types/ag-grid/testing.d.ts +0 -18
- package/dist/types/ag-grid/theme.d.ts +0 -13
- package/src/__tests__/Apploader.test.tsx +0 -51
- package/src/__tests__/fixtures/apploader-child-script.ts +0 -9
- package/src/__tests__/testApp.test.tsx +0 -76
- package/src/__tests__/useAccessToken.test.tsx +0 -51
- package/src/__tests__/useAppSetting.test.tsx +0 -133
- package/src/__tests__/useAppSettings.test.tsx +0 -147
- package/src/__tests__/useCurrentAccount.test.tsx +0 -32
- package/src/__tests__/useCurrentBookmark.test.tsx +0 -108
- package/src/__tests__/useCurrentContext.test.tsx +0 -72
- package/src/__tests__/useFeature.test.tsx +0 -104
- package/src/__tests__/useHelpCenter.test.tsx +0 -64
- package/src/__tests__/useToken.test.tsx +0 -71
- package/src/__tests__/useTrackFeature.test.tsx +0 -83
- package/src/ag-grid/community.ts +0 -11
- package/src/ag-grid/enterprise.ts +0 -11
- package/src/ag-grid/react.ts +0 -11
- package/src/ag-grid/testing.ts +0 -19
- package/src/ag-grid/theme.ts +0 -17
package/CHANGELOG.md
CHANGED
|
@@ -1,18 +1,10 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
-
## 14.0.3
|
|
3
|
+
## 14.0.3
|
|
4
4
|
|
|
5
5
|
### Patch Changes
|
|
6
6
|
|
|
7
|
-
-
|
|
8
|
-
- Updated dependencies [c8008e3]
|
|
9
|
-
- @equinor/fusion-framework-app@13.0.3-next.0
|
|
10
|
-
- @equinor/fusion-framework-module-ag-grid@37.0.3-next.0
|
|
11
|
-
- @equinor/fusion-framework-module-app@8.0.6-next.0
|
|
12
|
-
- @equinor/fusion-framework-module-navigation@7.0.9-next.0
|
|
13
|
-
- @equinor/fusion-framework-module-state@2.0.2-next.0
|
|
14
|
-
- @equinor/fusion-framework-react-ag-grid@37.0.3-next.0
|
|
15
|
-
- @equinor/fusion-framework-react@9.0.0-next.0
|
|
7
|
+
- @equinor/fusion-framework-app@13.0.3
|
|
16
8
|
|
|
17
9
|
## 14.0.2
|
|
18
10
|
|
package/README.md
CHANGED
|
@@ -25,7 +25,7 @@ pnpm add @equinor/fusion-framework-react-app
|
|
|
25
25
|
import type { AppModuleInitiator } from '@equinor/fusion-framework-react-app';
|
|
26
26
|
|
|
27
27
|
export const configure: AppModuleInitiator = (configurator) => {
|
|
28
|
-
configurator.
|
|
28
|
+
configurator.http.configureClient('my-api', {
|
|
29
29
|
baseUri: 'https://api.example.com',
|
|
30
30
|
defaultScopes: ['api://my-api/.default'],
|
|
31
31
|
});
|
|
@@ -372,13 +372,6 @@ const EnvInfo = () => {
|
|
|
372
372
|
};
|
|
373
373
|
```
|
|
374
374
|
|
|
375
|
-
### Testing
|
|
376
|
-
|
|
377
|
-
Testing utilities (`renderAppHook`, `renderAppComponent`, `testApp`, and a Vitest plugin
|
|
378
|
-
resolving an app's own manifest/config as virtual modules) have moved to their own package,
|
|
379
|
-
[`@equinor/fusion-framework-vitest-plugin-react-app`](../../vitest-plugin/react-app/README.md) —
|
|
380
|
-
see that package's README for usage.
|
|
381
|
-
|
|
382
375
|
## API Reference
|
|
383
376
|
|
|
384
377
|
### Core exports (main entry-point)
|
|
@@ -419,7 +412,7 @@ Application configuration is done via a callback passed to `renderApp` (or `make
|
|
|
419
412
|
```ts
|
|
420
413
|
const configure: AppModuleInitiator = (configurator) => {
|
|
421
414
|
// HTTP clients
|
|
422
|
-
configurator.
|
|
415
|
+
configurator.http.configureClient('my-api', { baseUri: '...' });
|
|
423
416
|
|
|
424
417
|
// Feature flags
|
|
425
418
|
enableFeatureFlag(configurator, [{ key: 'beta', title: 'Beta' }]);
|
|
@@ -21,7 +21,7 @@ import { ModuleProvider as AppModuleProvider } from '@equinor/fusion-framework-r
|
|
|
21
21
|
* @example
|
|
22
22
|
* ```tsx
|
|
23
23
|
* const configCallback: AppConfigurator = (configurator) => {
|
|
24
|
-
* configurator.
|
|
24
|
+
* configurator.http.configureClient(
|
|
25
25
|
* 'bar', {
|
|
26
26
|
* baseUri: 'https://somewhere-test.com',
|
|
27
27
|
* defaultScopes: ['foo/.default']
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { useEffect,
|
|
1
|
+
import { useEffect, useState } from 'react';
|
|
2
2
|
import useAppModule from '../useAppModule';
|
|
3
3
|
/**
|
|
4
4
|
* React hook that acquires a full MSAL {@link AuthenticationResult} for the
|
|
@@ -26,20 +26,11 @@ export const useToken = (req) => {
|
|
|
26
26
|
const [token, setToken] = useState(undefined);
|
|
27
27
|
const [pending, setPending] = useState(false);
|
|
28
28
|
const [error, setError] = useState(null);
|
|
29
|
-
// `req` is typically a fresh object literal each render; key the effect on its
|
|
30
|
-
// scopes' content instead of identity, so it doesn't re-run (and reset `pending`
|
|
31
|
-
// to `true` forever) every time the caller re-renders. `JSON.stringify` (rather than
|
|
32
|
-
// `.join(',')`) keeps scopes with different array boundaries (e.g. `['a,b']` vs.
|
|
33
|
-
// `['a', 'b']`) from colliding on the same key.
|
|
34
|
-
const scopesKey = JSON.stringify(req.scopes);
|
|
35
|
-
const reqRef = useRef(req);
|
|
36
|
-
reqRef.current = req;
|
|
37
|
-
// biome-ignore lint/correctness/useExhaustiveDependencies: scopesKey is a re-run trigger, not read in the body
|
|
38
29
|
useEffect(() => {
|
|
39
30
|
setPending(true);
|
|
40
31
|
setToken(undefined);
|
|
41
32
|
msalProvider
|
|
42
|
-
.acquireToken({ request:
|
|
33
|
+
.acquireToken({ request: req })
|
|
43
34
|
.then((result) => {
|
|
44
35
|
// Only update state when a token was actually acquired
|
|
45
36
|
if (result) {
|
|
@@ -48,7 +39,7 @@ export const useToken = (req) => {
|
|
|
48
39
|
})
|
|
49
40
|
.catch(setError)
|
|
50
41
|
.finally(() => setPending(false));
|
|
51
|
-
}, [msalProvider,
|
|
42
|
+
}, [msalProvider, req]);
|
|
52
43
|
return { token, pending, error };
|
|
53
44
|
};
|
|
54
45
|
export default useToken;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useToken.js","sourceRoot":"","sources":["../../../src/msal/useToken.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,
|
|
1
|
+
{"version":3,"file":"useToken.js","sourceRoot":"","sources":["../../../src/msal/useToken.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAI5C,OAAO,YAAY,MAAM,iBAAiB,CAAC;AAE3C;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,GAExB,EAAsE,EAAE;IACvE,MAAM,YAAY,GAAG,YAAY,CAAC,MAAM,CAAC,CAAC;IAC1C,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAAmC,SAAS,CAAC,CAAC;IAChF,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,QAAQ,CAAU,KAAK,CAAC,CAAC;IACvD,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAAU,IAAI,CAAC,CAAC;IAClD,SAAS,CAAC,GAAG,EAAE;QACb,UAAU,CAAC,IAAI,CAAC,CAAC;QACjB,QAAQ,CAAC,SAAS,CAAC,CAAC;QACpB,YAAY;aACT,YAAY,CAAC,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC;aAC9B,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE;YACf,uDAAuD;YACvD,IAAI,MAAM,EAAE,CAAC;gBACX,QAAQ,CAAC,MAAM,CAAC,CAAC;YACnB,CAAC;QACH,CAAC,CAAC;aACD,KAAK,CAAC,QAAQ,CAAC;aACf,OAAO,CAAC,GAAG,EAAE,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC;IACtC,CAAC,EAAE,CAAC,YAAY,EAAE,GAAG,CAAC,CAAC,CAAC;IACxB,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;AACnC,CAAC,CAAC;AAEF,eAAe,QAAQ,CAAC"}
|
package/dist/esm/version.js
CHANGED
package/dist/esm/version.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":"AAAA,2BAA2B;AAC3B,MAAM,CAAC,MAAM,OAAO,GAAG,
|
|
1
|
+
{"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":"AAAA,2BAA2B;AAC3B,MAAM,CAAC,MAAM,OAAO,GAAG,QAAQ,CAAC"}
|