@equinor/fusion-framework-module-navigation 6.0.1-next.1 → 7.0.0-next.1
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 +63 -13
- package/README.md +694 -0
- package/dist/esm/NavigationConfigurator.interface.js +2 -0
- package/dist/esm/NavigationConfigurator.interface.js.map +1 -0
- package/dist/esm/NavigationConfigurator.js +144 -0
- package/dist/esm/NavigationConfigurator.js.map +1 -0
- package/dist/esm/NavigationProvider.interface.js +2 -0
- package/dist/esm/NavigationProvider.interface.js.map +1 -0
- package/dist/esm/NavigationProvider.js +256 -0
- package/dist/esm/NavigationProvider.js.map +1 -0
- package/dist/esm/enable-navigation.js +52 -0
- package/dist/esm/enable-navigation.js.map +1 -0
- package/dist/esm/events.js +23 -0
- package/dist/esm/events.js.map +1 -0
- package/dist/esm/index.js +6 -5
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/lib/BaseHistory.js +189 -0
- package/dist/esm/lib/BaseHistory.js.map +1 -0
- package/dist/esm/lib/BrowserHistory.js +91 -0
- package/dist/esm/lib/BrowserHistory.js.map +1 -0
- package/dist/esm/lib/BrowserHistoryHashStack.js +53 -0
- package/dist/esm/lib/BrowserHistoryHashStack.js.map +1 -0
- package/dist/esm/lib/BrowserHistoryStack.js +77 -0
- package/dist/esm/lib/BrowserHistoryStack.js.map +1 -0
- package/dist/esm/lib/MemoryHistory.js +47 -0
- package/dist/esm/lib/MemoryHistory.js.map +1 -0
- package/dist/esm/lib/MemoryStack.js +98 -0
- package/dist/esm/lib/MemoryStack.js.map +1 -0
- package/dist/esm/lib/create-history.js +48 -0
- package/dist/esm/lib/create-history.js.map +1 -0
- package/dist/esm/lib/index.js +8 -1
- package/dist/esm/lib/index.js.map +1 -1
- package/dist/esm/lib/state/history.actions.js +71 -0
- package/dist/esm/lib/state/history.actions.js.map +1 -0
- package/dist/esm/lib/state/history.flows.js +212 -0
- package/dist/esm/lib/state/history.flows.js.map +1 -0
- package/dist/esm/lib/state/history.reducer.js +59 -0
- package/dist/esm/lib/state/history.reducer.js.map +1 -0
- package/dist/esm/lib/state/history.state.js +37 -0
- package/dist/esm/lib/state/history.state.js.map +1 -0
- package/dist/esm/lib/state/index.js +4 -0
- package/dist/esm/lib/state/index.js.map +1 -0
- package/dist/esm/lib/types.js +25 -0
- package/dist/esm/lib/types.js.map +1 -0
- package/dist/esm/lib/utils/encode-trailing-whitespace.js +19 -0
- package/dist/esm/lib/utils/encode-trailing-whitespace.js.map +1 -0
- package/dist/esm/lib/utils/has-protocol.js +22 -0
- package/dist/esm/lib/utils/has-protocol.js.map +1 -0
- package/dist/esm/lib/utils/index.js +6 -0
- package/dist/esm/lib/utils/index.js.map +1 -0
- package/dist/esm/lib/utils/path-to-string.js +23 -0
- package/dist/esm/lib/utils/path-to-string.js.map +1 -0
- package/dist/esm/lib/utils/path-to-url.js +47 -0
- package/dist/esm/lib/utils/path-to-url.js.map +1 -0
- package/dist/esm/lib/utils/resolve-browser-location.js +53 -0
- package/dist/esm/lib/utils/resolve-browser-location.js.map +1 -0
- package/dist/esm/lib/utils/resolve-path.js +21 -0
- package/dist/esm/lib/utils/resolve-path.js.map +1 -0
- package/dist/esm/module.js +34 -25
- package/dist/esm/module.js.map +1 -1
- package/dist/esm/version.js +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types/NavigationConfigurator.d.ts +60 -0
- package/dist/types/NavigationConfigurator.interface.d.ts +17 -0
- package/dist/types/NavigationProvider.d.ts +112 -0
- package/dist/types/NavigationProvider.interface.d.ts +75 -0
- package/dist/types/enable-navigation.d.ts +40 -0
- package/dist/types/events.d.ts +48 -0
- package/dist/types/index.d.ts +13 -6
- package/dist/types/lib/BaseHistory.d.ts +122 -0
- package/dist/types/lib/BrowserHistory.d.ts +53 -0
- package/dist/types/lib/BrowserHistoryHashStack.d.ts +41 -0
- package/dist/types/lib/BrowserHistoryStack.d.ts +51 -0
- package/dist/types/lib/MemoryHistory.d.ts +27 -0
- package/dist/types/lib/MemoryStack.d.ts +57 -0
- package/dist/types/lib/create-history.d.ts +35 -0
- package/dist/types/lib/index.d.ts +7 -1
- package/dist/types/lib/state/history.actions.d.ts +61 -0
- package/dist/types/lib/state/history.flows.d.ts +102 -0
- package/dist/types/lib/state/history.reducer.d.ts +85 -0
- package/dist/types/lib/state/history.state.d.ts +27 -0
- package/dist/types/lib/state/index.d.ts +3 -0
- package/dist/types/lib/types.d.ts +145 -0
- package/dist/types/lib/utils/encode-trailing-whitespace.d.ts +16 -0
- package/dist/types/lib/utils/has-protocol.d.ts +19 -0
- package/dist/types/lib/utils/index.d.ts +5 -0
- package/dist/types/lib/utils/path-to-string.d.ts +17 -0
- package/dist/types/lib/utils/path-to-url.d.ts +32 -0
- package/dist/types/lib/utils/resolve-browser-location.d.ts +42 -0
- package/dist/types/lib/utils/resolve-path.d.ts +17 -0
- package/dist/types/module.d.ts +33 -5
- package/dist/types/version.d.ts +1 -1
- package/package.json +25 -7
- package/src/NavigationConfigurator.interface.ts +18 -0
- package/src/NavigationConfigurator.ts +184 -0
- package/src/NavigationProvider.interface.ts +86 -0
- package/src/NavigationProvider.ts +313 -0
- package/src/__tests__/BrowserHistory.test.ts +151 -0
- package/src/__tests__/HashHistory.test.ts +121 -0
- package/src/__tests__/MemoryHistory.test.ts +185 -0
- package/src/__tests__/NavigationProvider.test.ts +60 -0
- package/src/__tests__/setup.ts +8 -0
- package/src/enable-navigation.ts +59 -0
- package/src/events.ts +65 -0
- package/src/index.ts +27 -6
- package/src/lib/BaseHistory.ts +229 -0
- package/src/lib/BrowserHistory.ts +123 -0
- package/src/lib/BrowserHistoryHashStack.ts +56 -0
- package/src/lib/BrowserHistoryStack.ts +82 -0
- package/src/lib/MemoryHistory.ts +66 -0
- package/src/lib/MemoryStack.ts +106 -0
- package/src/lib/create-history.ts +63 -0
- package/src/lib/index.ts +22 -1
- package/src/lib/state/history.actions.ts +108 -0
- package/src/lib/state/history.flows.ts +279 -0
- package/src/lib/state/history.reducer.ts +70 -0
- package/src/lib/state/history.state.ts +62 -0
- package/src/lib/state/index.ts +3 -0
- package/src/lib/types.ts +159 -0
- package/src/lib/utils/encode-trailing-whitespace.ts +18 -0
- package/src/lib/utils/has-protocol.ts +21 -0
- package/src/lib/utils/index.ts +5 -0
- package/src/lib/utils/path-to-string.ts +24 -0
- package/src/lib/utils/path-to-url.ts +52 -0
- package/src/lib/utils/resolve-browser-location.ts +60 -0
- package/src/lib/utils/resolve-path.ts +22 -0
- package/src/module.ts +53 -37
- package/src/version.ts +1 -1
- package/tsconfig.json +10 -1
- package/vitest.config.ts +14 -0
- package/dist/esm/configurator.js +0 -5
- package/dist/esm/configurator.js.map +0 -1
- package/dist/esm/createHistory.js +0 -18
- package/dist/esm/createHistory.js.map +0 -1
- package/dist/esm/lib/provider/INavigationProvider.js +0 -2
- package/dist/esm/lib/provider/INavigationProvider.js.map +0 -1
- package/dist/esm/lib/provider/NavigationProvider.js +0 -82
- package/dist/esm/lib/provider/NavigationProvider.js.map +0 -1
- package/dist/esm/lib/provider/index.js +0 -2
- package/dist/esm/lib/provider/index.js.map +0 -1
- package/dist/esm/navigator.js +0 -158
- package/dist/esm/navigator.js.map +0 -1
- package/dist/esm/types.js +0 -2
- package/dist/esm/types.js.map +0 -1
- package/dist/types/configurator.d.ts +0 -9
- package/dist/types/createHistory.d.ts +0 -4
- package/dist/types/lib/provider/INavigationProvider.d.ts +0 -38
- package/dist/types/lib/provider/NavigationProvider.d.ts +0 -22
- package/dist/types/lib/provider/index.d.ts +0 -2
- package/dist/types/navigator.d.ts +0 -105
- package/dist/types/types.d.ts +0 -3
- package/src/configurator.ts +0 -11
- package/src/createHistory.ts +0 -21
- package/src/lib/provider/INavigationProvider.ts +0 -46
- package/src/lib/provider/NavigationProvider.ts +0 -117
- package/src/lib/provider/index.ts +0 -2
- package/src/navigator.ts +0 -204
- package/src/types.ts +0 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,21 +1,76 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
-
##
|
|
3
|
+
## 7.0.0-next.1
|
|
4
4
|
|
|
5
|
-
###
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- [#3820](https://github.com/equinor/fusion-framework/pull/3820) [`d252b0d`](https://github.com/equinor/fusion-framework/commit/d252b0d442b7c8c1b50bf2768cf9ecbbb55a76f8) Thanks [@odinr](https://github.com/odinr)! - Complete refactor of navigation module architecture with React Router v7 upgrade, improved state management, and history implementations.
|
|
8
|
+
|
|
9
|
+
**Breaking Changes:**
|
|
10
|
+
1. **Upgraded to React Router v7**: `@remix-run/router` upgraded from v1.8.0 to v1.23.0 for React Router v7 compatibility
|
|
11
|
+
- The `createRouter` API remains backward compatible
|
|
12
|
+
- All existing router patterns continue to work
|
|
13
|
+
- **Type compatibility note**: TypeScript types may not fully resolve with React Router v7, requiring type assertions (`as any`) in some cases when using `useRouter` with `RouterProvider`. This is a known limitation and will be addressed in future updates.
|
|
14
|
+
|
|
15
|
+
```typescript
|
|
16
|
+
// Example: Type assertions required with React Router v7
|
|
17
|
+
import { RouterProvider } from 'react-router-dom';
|
|
18
|
+
import { useRouter } from '@equinor/fusion-framework-react-app/navigation';
|
|
19
|
+
|
|
20
|
+
export default function Router() {
|
|
21
|
+
// biome-ignore lint/suspicious/noExplicitAny: types not fully resolving with React Router v7
|
|
22
|
+
const router = useRouter(routes as any);
|
|
23
|
+
// biome-ignore lint/suspicious/noExplicitAny: types not fully resolving with React Router v7
|
|
24
|
+
return <RouterProvider router={router as any} />;
|
|
25
|
+
}
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
2. **Configurator exports restructured**: `NavigationConfigurator` and `INavigationConfigurator` are now exported from separate interface files
|
|
29
|
+
- Public API unchanged, but internal structure changed
|
|
30
|
+
3. **`createHistory` path changed**: Moved from root to `lib/create-history`
|
|
31
|
+
- Public API unchanged, but internal path changed
|
|
32
|
+
4. **Types reorganized**: Types moved from `./types` to `./lib/types`
|
|
33
|
+
- Public API unchanged, but internal path changed
|
|
34
|
+
5. **`navigator` deprecated**: Use `history` instead
|
|
35
|
+
|
|
36
|
+
```typescript
|
|
37
|
+
// Before
|
|
38
|
+
const nav = navigation.navigator;
|
|
39
|
+
|
|
40
|
+
// After
|
|
41
|
+
const history = navigation.history;
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
**New Features:**
|
|
45
|
+
- Added `NavigationProvider` and `INavigationProvider` exports
|
|
46
|
+
- Added `enableNavigation` helper function for easier configuration
|
|
47
|
+
- Added navigation events (`NavigateEvent`, `NavigatedEvent`)
|
|
48
|
+
- Improved history implementations with state management
|
|
49
|
+
- Added comprehensive test coverage
|
|
50
|
+
- Added detailed README documentation
|
|
51
|
+
|
|
52
|
+
**Internal Improvements:**
|
|
53
|
+
- Restructured history implementations (BrowserHistory, HashHistory, MemoryHistory)
|
|
54
|
+
- Added state management with reducer pattern
|
|
55
|
+
- Improved type safety and organization
|
|
56
|
+
- Better separation of concerns
|
|
57
|
+
|
|
58
|
+
Closes https://github.com/equinor/fusion-framework/issues/3699
|
|
59
|
+
|
|
60
|
+
### Minor Changes
|
|
6
61
|
|
|
7
|
-
- [`
|
|
62
|
+
- [#3820](https://github.com/equinor/fusion-framework/pull/3820) [`d252b0d`](https://github.com/equinor/fusion-framework/commit/d252b0d442b7c8c1b50bf2768cf9ecbbb55a76f8) Thanks [@odinr](https://github.com/odinr)! - Deprecate `NavigationProvider.createRouter` method in favor of `@equinor/fusion-framework-react-router`.
|
|
8
63
|
|
|
9
|
-
|
|
10
|
-
- @equinor/fusion-framework-module@5.0.6-next.1
|
|
64
|
+
The `createRouter` method now emits a deprecation warning via telemetry when called. Applications should migrate to using `@equinor/fusion-framework-react-router` for new route definitions.
|
|
11
65
|
|
|
12
|
-
|
|
66
|
+
**Migration:** Replace `navigation.createRouter(routes)` with the React Router DSL from `@equinor/fusion-framework-react-router/routes`.
|
|
13
67
|
|
|
14
68
|
### Patch Changes
|
|
15
69
|
|
|
16
|
-
- [`
|
|
70
|
+
- [#3820](https://github.com/equinor/fusion-framework/pull/3820) [`265bb76`](https://github.com/equinor/fusion-framework/commit/265bb767249989eeb1971e83f3fba94879e0813b) Thanks [@odinr](https://github.com/odinr)! - relase next
|
|
17
71
|
|
|
18
|
-
- Updated dependencies [[`
|
|
72
|
+
- Updated dependencies [[`265bb76`](https://github.com/equinor/fusion-framework/commit/265bb767249989eeb1971e83f3fba94879e0813b), [`d252b0d`](https://github.com/equinor/fusion-framework/commit/d252b0d442b7c8c1b50bf2768cf9ecbbb55a76f8), [`9f7597e`](https://github.com/equinor/fusion-framework/commit/9f7597ee237ef069dc24cbe39c73b5b26db157dd), [`75c068f`](https://github.com/equinor/fusion-framework/commit/75c068fea13c32435ac26bd9043cc156482bfaf1)]:
|
|
73
|
+
- @equinor/fusion-observable@9.0.0-next.0
|
|
19
74
|
- @equinor/fusion-framework-module@5.0.6-next.0
|
|
20
75
|
|
|
21
76
|
## 6.0.0
|
|
@@ -30,7 +85,6 @@
|
|
|
30
85
|
### Patch Changes
|
|
31
86
|
|
|
32
87
|
- [#3088](https://github.com/equinor/fusion-framework/pull/3088) [`7441b13`](https://github.com/equinor/fusion-framework/commit/7441b13aa50dd7362d1629086a27b6b4e571575d) Thanks [@eikeland](https://github.com/eikeland)! - chore: update package typesVersions
|
|
33
|
-
|
|
34
88
|
- Updated package.json typesVersions.
|
|
35
89
|
- Ensures backward compatibility with older node versions.
|
|
36
90
|
- Ensured consistency with workspace and repository configuration.
|
|
@@ -131,7 +185,6 @@
|
|
|
131
185
|
- [#2320](https://github.com/equinor/fusion-framework/pull/2320) [`1dd85f3`](https://github.com/equinor/fusion-framework/commit/1dd85f3a408a73df556d1812a5f280945cc100ee) Thanks [@odinr](https://github.com/odinr)! - Removed the `removeComments` option from the `tsconfig.base.json` file.
|
|
132
186
|
|
|
133
187
|
Removing the `removeComments` option allows TypeScript to preserve comments in the compiled JavaScript output. This can be beneficial for several reasons:
|
|
134
|
-
|
|
135
188
|
1. Improved debugging: Preserved comments can help developers understand the code better during debugging sessions.
|
|
136
189
|
2. Documentation: JSDoc comments and other important code documentation will be retained in the compiled output.
|
|
137
190
|
3. Source map accuracy: Keeping comments can lead to more accurate source maps, which is crucial for debugging and error tracking.
|
|
@@ -290,7 +343,6 @@
|
|
|
290
343
|
### Major Changes
|
|
291
344
|
|
|
292
345
|
- [#907](https://github.com/equinor/fusion-framework/pull/907) [`7500ec2c`](https://github.com/equinor/fusion-framework/commit/7500ec2c9ca9b926a19539fc97c61c67f76fc8d9) Thanks [@odinr](https://github.com/odinr)! - extend base module provider
|
|
293
|
-
|
|
294
346
|
- make `NavigationProvider` extend `BaseModuleProvider`
|
|
295
347
|
- internal function `_localizeLocation` is renamed to `_localizePath`. _should not cause breaking changes_
|
|
296
348
|
- expose localized state from `Navigator` _(history)_
|
|
@@ -300,7 +352,6 @@
|
|
|
300
352
|
### Minor Changes
|
|
301
353
|
|
|
302
354
|
- [#907](https://github.com/equinor/fusion-framework/pull/907) [`7500ec2c`](https://github.com/equinor/fusion-framework/commit/7500ec2c9ca9b926a19539fc97c61c67f76fc8d9) Thanks [@odinr](https://github.com/odinr)! - add version to module
|
|
303
|
-
|
|
304
355
|
- add `prebuild` step to generate version
|
|
305
356
|
- update `.gitignore` to skip `version.ts` since this file is generated during building
|
|
306
357
|
|
|
@@ -311,7 +362,6 @@
|
|
|
311
362
|
moved the init to constructor
|
|
312
363
|
|
|
313
364
|
- [#905](https://github.com/equinor/fusion-framework/pull/905) [`a7858a1c`](https://github.com/equinor/fusion-framework/commit/a7858a1c01542e2dc94370709f122b4b99c3219c) Thanks [@odinr](https://github.com/odinr)! - **🚧 Chore: dedupe packages**
|
|
314
|
-
|
|
315
365
|
- align all versions of typescript
|
|
316
366
|
- update types to build
|
|
317
367
|
- a couple of typecasts did not [satisfies](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-5-0.html#satisfies-support-in-jsdoc) and was recasted as `unknwon`, marked with `TODO`, should be fixed in future
|