Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@alwatr/router

Package Overview
Dependencies
Maintainers
1
Versions
42
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@alwatr/router - npm Package Compare versions

Comparing version 1.1.2 to 2.0.0-beta.0

router.d.ts

227

CHANGELOG.md

@@ -6,7 +6,18 @@ # Change Log

## [1.1.2](https://github.com/AliMD/alwatr/compare/@alwatr/router@1.1.1...@alwatr/router@1.1.2) (2023-09-12)
# 2.0.0-beta.0 (2023-09-20)
### Bug Fixes
* all deps ([fb47833](https://github.com/AliMD/fract/commit/fb47833c2cb6853a7e619c8d3cdbe8b4aacdd604)) by @AliMD
* all repo urls ([2ec6e1e](https://github.com/AliMD/fract/commit/2ec6e1e080f37d3b7c5eb37b272c1aa049540756)) by @AliMD
* import paths ([a4ad9f4](https://github.com/AliMD/fract/commit/a4ad9f4f6db759451e84a37f6cad9606c8586c65)) by @AliMD
* repo paths ([b20214b](https://github.com/AliMD/fract/commit/b20214bbe8d13ad3f47ec2b5d1c6219ab88699a0)) by @AliMD
* **router:** file name ([2a69c08](https://github.com/AliMD/fract/commit/2a69c08645acc331ecf9654bb9d35e2d0b902d4a)) by @AliMD
* ts refs ([1668b2d](https://github.com/AliMD/fract/commit/1668b2dbe0fcde38d3d0689ac230ce3bcdc712cb)) by @AliMD
## [1.1.2](https://github.com/AliMD/fract/compare/@alwatr/router@1.1.1...@alwatr/router@1.1.2) (2023-09-12)
**Note:** Version bump only for package @alwatr/router
## [1.1.1](https://github.com/AliMD/alwatr/compare/@alwatr/router@1.1.0...@alwatr/router@1.1.1) (2023-09-12)
## [1.1.1](https://github.com/AliMD/fract/compare/@alwatr/router@1.1.0...@alwatr/router@1.1.1) (2023-09-12)

@@ -25,7 +36,7 @@ **Note:** Version bump only for package @alwatr/router

* new logger api ([9d83a7d](https://github.com/AliMD/alwatr/commit/9d83a7dc5c103bc3bb4282dacfd85fa998915300))
- new logger api ([9d83a7d](https://github.com/AliMD/fract/commit/9d83a7dc5c103bc3bb4282dacfd85fa998915300))
### Features
* **router:** add thisArg for routerOutlet ([2bfd1f5](https://github.com/AliMD/alwatr/commit/2bfd1f5b8593f7107b4e84b35600cc07ca3d6c6c))
- **router:** add thisArg for routerOutlet ([2bfd1f5](https://github.com/AliMD/fract/commit/2bfd1f5b8593f7107b4e84b35600cc07ca3d6c6c))

@@ -36,9 +47,9 @@ # 0.30.0 (2023-03-06)

* **router:** home page for sub page routes ([af737f3](https://github.com/AliMD/alwatr/commit/af737f3451fd057f0a2a574be05c34bd06c0f7c0))
* **router:** make url from router respect empty sectionList ([1fb62f7](https://github.com/AliMD/alwatr/commit/1fb62f774bf5e9e6b68c04d756b32177697e55e8))
- **router:** home page for sub page routes ([af737f3](https://github.com/AliMD/fract/commit/af737f3451fd057f0a2a574be05c34bd06c0f7c0))
- **router:** make url from router respect empty sectionList ([1fb62f7](https://github.com/AliMD/fract/commit/1fb62f774bf5e9e6b68c04d756b32177697e55e8))
### Features
* **router:** internal redirect render template to another route ([de92671](https://github.com/AliMD/alwatr/commit/de9267126935b73dd561d8817346410f00960234))
* **router:** keepSectionSlice for redirect ([1c3b370](https://github.com/AliMD/alwatr/commit/1c3b370c41f96a8ad612ea9fd5ab9963f6a3b27b))
- **router:** internal redirect render template to another route ([de92671](https://github.com/AliMD/fract/commit/de9267126935b73dd561d8817346410f00960234))
- **router:** keepSectionSlice for redirect ([1c3b370](https://github.com/AliMD/fract/commit/1c3b370c41f96a8ad612ea9fd5ab9963f6a3b27b))

@@ -49,17 +60,17 @@ # 0.29.0 (2023-02-10)

* **route:** cleanup old api ([cf42205](https://github.com/AliMD/alwatr/commit/cf422055b96dbfd33a23732fe3e1def8b86e73c5))
* **route:** export types ([551f4e3](https://github.com/AliMD/alwatr/commit/551f4e3509cd7b50477c3eefc72a34145e710aa0))
* **router:** makeRouteContext as soon as posible ([f092b45](https://github.com/AliMD/alwatr/commit/f092b4584cc5fc424ac63cdf40b7c635053b9720))
* **route:** RouteContextBase type ([9e9ee78](https://github.com/AliMD/alwatr/commit/9e9ee7861bebfe68990171799537d3664ac1a66e))
* **router:** protocol type ([01fa523](https://github.com/AliMD/alwatr/commit/01fa52381d5ac9760c9af0d595826565548c6841))
- **route:** cleanup old api ([cf42205](https://github.com/AliMD/fract/commit/cf422055b96dbfd33a23732fe3e1def8b86e73c5))
- **route:** export types ([551f4e3](https://github.com/AliMD/fract/commit/551f4e3509cd7b50477c3eefc72a34145e710aa0))
- **router:** makeRouteContext as soon as posible ([f092b45](https://github.com/AliMD/fract/commit/f092b4584cc5fc424ac63cdf40b7c635053b9720))
- **route:** RouteContextBase type ([9e9ee78](https://github.com/AliMD/fract/commit/9e9ee7861bebfe68990171799537d3664ac1a66e))
- **router:** protocol type ([01fa523](https://github.com/AliMD/fract/commit/01fa52381d5ac9760c9af0d595826565548c6841))
### Features
* **route:** makeRouteContext ([16be581](https://github.com/AliMD/alwatr/commit/16be5815a4a44f22bd17c4a87f1b7ef30f9aec6c))
* **route:** new url method ([580f2b3](https://github.com/AliMD/alwatr/commit/580f2b34396461389da0126d64c3c6ffde99e87b))
* **route:** redirect with update browser history ([d6d64a0](https://github.com/AliMD/alwatr/commit/d6d64a0fc80284e279db4515d95ff99f530b447f))
* **router:** enhance logging ([d5930ea](https://github.com/AliMD/alwatr/commit/d5930ea6117b4794c3771a8331c0d6ae063dd52e))
* **router:** export main api in index and auto init ([58718eb](https://github.com/AliMD/alwatr/commit/58718ebaa10c784255b4a0faa467d35659a1b1df))
* **router:** initialize process on DOMContentLoaded ([6b114e2](https://github.com/AliMD/alwatr/commit/6b114e2f64a50a40467bff20ecf562d1b7827632))
* **router:** new api from scratch! ([2b26a8d](https://github.com/AliMD/alwatr/commit/2b26a8d9f95b5968dbda003edc9d540ea95fadd1))
- **route:** makeRouteContext ([16be581](https://github.com/AliMD/fract/commit/16be5815a4a44f22bd17c4a87f1b7ef30f9aec6c))
- **route:** new url method ([580f2b3](https://github.com/AliMD/fract/commit/580f2b34396461389da0126d64c3c6ffde99e87b))
- **route:** redirect with update browser history ([d6d64a0](https://github.com/AliMD/fract/commit/d6d64a0fc80284e279db4515d95ff99f530b447f))
- **router:** enhance logging ([d5930ea](https://github.com/AliMD/fract/commit/d5930ea6117b4794c3771a8331c0d6ae063dd52e))
- **router:** export main api in index and auto init ([58718eb](https://github.com/AliMD/fract/commit/58718ebaa10c784255b4a0faa467d35659a1b1df))
- **router:** initialize process on DOMContentLoaded ([6b114e2](https://github.com/AliMD/fract/commit/6b114e2f64a50a40467bff20ecf562d1b7827632))
- **router:** new api from scratch! ([2b26a8d](https://github.com/AliMD/fract/commit/2b26a8d9f95b5968dbda003edc9d540ea95fadd1))

@@ -72,3 +83,3 @@ # 0.28.0 (2023-01-20)

* **core/router:** preventDefault on svg link click ([e35e935](https://github.com/AliMD/alwatr/commit/e35e9351857d5bcb5128afbc87eb62dd11da865e))
- **packages/router:** preventDefault on svg link click ([e35e935](https://github.com/AliMD/fract/commit/e35e9351857d5bcb5128afbc87eb62dd11da865e))

@@ -79,227 +90,227 @@ # 0.26.0 (2022-12-22)

* set correct path ([d01ce6f](https://github.com/AliMD/alwatr/commit/d01ce6ffa749a5e3e0e11e35b4ed61d75d61fec9))
* tsconfig ([e96dcd3](https://github.com/AliMD/alwatr/commit/e96dcd30774a9f06f7d051e0504192cbbe019e35))
- set correct path ([d01ce6f](https://github.com/AliMD/fract/commit/d01ce6ffa749a5e3e0e11e35b4ed61d75d61fec9))
- tsconfig ([e96dcd3](https://github.com/AliMD/fract/commit/e96dcd30774a9f06f7d051e0504192cbbe019e35))
# [1.0.0](https://github.com/AliMD/alwatr/compare/v0.32.0...v1.0.0) (2023-06-14)
# [1.0.0](https://github.com/AliMD/fract/compare/v0.32.0...v1.0.0) (2023-06-14)
**Note:** Version bump only for package @alwatr/router
# [0.32.0](https://github.com/AliMD/alwatr/compare/v0.31.0...v0.32.0) (2023-05-27)
# [0.32.0](https://github.com/AliMD/fract/compare/v0.31.0...v0.32.0) (2023-05-27)
**Note:** Version bump only for package @alwatr/router
# [0.31.0](https://github.com/AliMD/alwatr/compare/v0.30.0...v0.31.0) (2023-05-08)
# [0.31.0](https://github.com/AliMD/fract/compare/v0.30.0...v0.31.0) (2023-05-08)
### Bug Fixes
- new logger api ([9d83a7d](https://github.com/AliMD/alwatr/commit/9d83a7dc5c103bc3bb4282dacfd85fa998915300))
- new logger api ([9d83a7d](https://github.com/AliMD/fract/commit/9d83a7dc5c103bc3bb4282dacfd85fa998915300))
### Features
- **router:** add thisArg for routerOutlet ([2bfd1f5](https://github.com/AliMD/alwatr/commit/2bfd1f5b8593f7107b4e84b35600cc07ca3d6c6c))
- **router:** add thisArg for routerOutlet ([2bfd1f5](https://github.com/AliMD/fract/commit/2bfd1f5b8593f7107b4e84b35600cc07ca3d6c6c))
# [0.30.0](https://github.com/AliMD/alwatr/compare/v0.29.0...v0.30.0) (2023-03-06)
# [0.30.0](https://github.com/AliMD/fract/compare/v0.29.0...v0.30.0) (2023-03-06)
### Bug Fixes
- **router:** home page for sub page routes ([af737f3](https://github.com/AliMD/alwatr/commit/af737f3451fd057f0a2a574be05c34bd06c0f7c0))
- **router:** make url from router respect empty sectionList ([1fb62f7](https://github.com/AliMD/alwatr/commit/1fb62f774bf5e9e6b68c04d756b32177697e55e8))
- **router:** home page for sub page routes ([af737f3](https://github.com/AliMD/fract/commit/af737f3451fd057f0a2a574be05c34bd06c0f7c0))
- **router:** make url from router respect empty sectionList ([1fb62f7](https://github.com/AliMD/fract/commit/1fb62f774bf5e9e6b68c04d756b32177697e55e8))
### Features
- **router:** internal redirect render template to another route ([de92671](https://github.com/AliMD/alwatr/commit/de9267126935b73dd561d8817346410f00960234))
- **router:** keepSectionSlice for redirect ([1c3b370](https://github.com/AliMD/alwatr/commit/1c3b370c41f96a8ad612ea9fd5ab9963f6a3b27b))
- **router:** internal redirect render template to another route ([de92671](https://github.com/AliMD/fract/commit/de9267126935b73dd561d8817346410f00960234))
- **router:** keepSectionSlice for redirect ([1c3b370](https://github.com/AliMD/fract/commit/1c3b370c41f96a8ad612ea9fd5ab9963f6a3b27b))
# [0.29.0](https://github.com/AliMD/alwatr/compare/v0.28.0...v0.29.0) (2023-02-10)
# [0.29.0](https://github.com/AliMD/fract/compare/v0.28.0...v0.29.0) (2023-02-10)
### Bug Fixes
- **route:** cleanup old api ([cf42205](https://github.com/AliMD/alwatr/commit/cf422055b96dbfd33a23732fe3e1def8b86e73c5))
- **route:** export types ([551f4e3](https://github.com/AliMD/alwatr/commit/551f4e3509cd7b50477c3eefc72a34145e710aa0))
- **router:** makeRouteContext as soon as posible ([f092b45](https://github.com/AliMD/alwatr/commit/f092b4584cc5fc424ac63cdf40b7c635053b9720))
- **route:** RouteContextBase type ([9e9ee78](https://github.com/AliMD/alwatr/commit/9e9ee7861bebfe68990171799537d3664ac1a66e))
- **router:** protocol type ([01fa523](https://github.com/AliMD/alwatr/commit/01fa52381d5ac9760c9af0d595826565548c6841))
- **route:** cleanup old api ([cf42205](https://github.com/AliMD/fract/commit/cf422055b96dbfd33a23732fe3e1def8b86e73c5))
- **route:** export types ([551f4e3](https://github.com/AliMD/fract/commit/551f4e3509cd7b50477c3eefc72a34145e710aa0))
- **router:** makeRouteContext as soon as posible ([f092b45](https://github.com/AliMD/fract/commit/f092b4584cc5fc424ac63cdf40b7c635053b9720))
- **route:** RouteContextBase type ([9e9ee78](https://github.com/AliMD/fract/commit/9e9ee7861bebfe68990171799537d3664ac1a66e))
- **router:** protocol type ([01fa523](https://github.com/AliMD/fract/commit/01fa52381d5ac9760c9af0d595826565548c6841))
### Features
- **route:** makeRouteContext ([16be581](https://github.com/AliMD/alwatr/commit/16be5815a4a44f22bd17c4a87f1b7ef30f9aec6c))
- **route:** new url method ([580f2b3](https://github.com/AliMD/alwatr/commit/580f2b34396461389da0126d64c3c6ffde99e87b))
- **route:** redirect with update browser history ([d6d64a0](https://github.com/AliMD/alwatr/commit/d6d64a0fc80284e279db4515d95ff99f530b447f))
- **router:** enhance logging ([d5930ea](https://github.com/AliMD/alwatr/commit/d5930ea6117b4794c3771a8331c0d6ae063dd52e))
- **router:** export main api in index and auto init ([58718eb](https://github.com/AliMD/alwatr/commit/58718ebaa10c784255b4a0faa467d35659a1b1df))
- **router:** initialize process on DOMContentLoaded ([6b114e2](https://github.com/AliMD/alwatr/commit/6b114e2f64a50a40467bff20ecf562d1b7827632))
- **router:** new api from scratch! ([2b26a8d](https://github.com/AliMD/alwatr/commit/2b26a8d9f95b5968dbda003edc9d540ea95fadd1))
- **route:** makeRouteContext ([16be581](https://github.com/AliMD/fract/commit/16be5815a4a44f22bd17c4a87f1b7ef30f9aec6c))
- **route:** new url method ([580f2b3](https://github.com/AliMD/fract/commit/580f2b34396461389da0126d64c3c6ffde99e87b))
- **route:** redirect with update browser history ([d6d64a0](https://github.com/AliMD/fract/commit/d6d64a0fc80284e279db4515d95ff99f530b447f))
- **router:** enhance logging ([d5930ea](https://github.com/AliMD/fract/commit/d5930ea6117b4794c3771a8331c0d6ae063dd52e))
- **router:** export main api in index and auto init ([58718eb](https://github.com/AliMD/fract/commit/58718ebaa10c784255b4a0faa467d35659a1b1df))
- **router:** initialize process on DOMContentLoaded ([6b114e2](https://github.com/AliMD/fract/commit/6b114e2f64a50a40467bff20ecf562d1b7827632))
- **router:** new api from scratch! ([2b26a8d](https://github.com/AliMD/fract/commit/2b26a8d9f95b5968dbda003edc9d540ea95fadd1))
# [0.28.0](https://github.com/AliMD/alwatr/compare/v0.27.0...v0.28.0) (2023-01-20)
# [0.28.0](https://github.com/AliMD/fract/compare/v0.27.0...v0.28.0) (2023-01-20)
**Note:** Version bump only for package @alwatr/router
# [0.27.0](https://github.com/AliMD/alwatr/compare/v0.26.0...v0.27.0) (2022-12-29)
# [0.27.0](https://github.com/AliMD/fract/compare/v0.26.0...v0.27.0) (2022-12-29)
### Bug Fixes
- **core/router:** preventDefault on svg link click ([e35e935](https://github.com/AliMD/alwatr/commit/e35e9351857d5bcb5128afbc87eb62dd11da865e))
- **packages/router:** preventDefault on svg link click ([e35e935](https://github.com/AliMD/fract/commit/e35e9351857d5bcb5128afbc87eb62dd11da865e))
# [0.26.0](https://github.com/AliMD/alwatr/compare/v0.25.0...v0.26.0) (2022-12-22)
# [0.26.0](https://github.com/AliMD/fract/compare/v0.25.0...v0.26.0) (2022-12-22)
### Bug Fixes
- set correct path ([d01ce6f](https://github.com/AliMD/alwatr/commit/d01ce6ffa749a5e3e0e11e35b4ed61d75d61fec9))
- tsconfig ([e96dcd3](https://github.com/AliMD/alwatr/commit/e96dcd30774a9f06f7d051e0504192cbbe019e35))
- set correct path ([d01ce6f](https://github.com/AliMD/fract/commit/d01ce6ffa749a5e3e0e11e35b4ed61d75d61fec9))
- tsconfig ([e96dcd3](https://github.com/AliMD/fract/commit/e96dcd30774a9f06f7d051e0504192cbbe019e35))
# [0.25.0](https://github.com/AliMD/alwatr/compare/v0.24.1...v0.25.0) (2022-12-07)
# [0.25.0](https://github.com/AliMD/fract/compare/v0.24.1...v0.25.0) (2022-12-07)
**Note:** Version bump only for package @alwatr/router
## [0.24.1](https://github.com/AliMD/alwatr/compare/v0.24.0...v0.24.1) (2022-12-01)
## [0.24.1](https://github.com/AliMD/fract/compare/v0.24.0...v0.24.1) (2022-12-01)
**Note:** Version bump only for package @alwatr/router
# [0.24.0](https://github.com/AliMD/alwatr/compare/v0.23.0...v0.24.0) (2022-11-28)
# [0.24.0](https://github.com/AliMD/fract/compare/v0.23.0...v0.24.0) (2022-11-28)
### Bug Fixes
- use ~ for package version ([4e027ff](https://github.com/AliMD/alwatr/commit/4e027ff63875e03b088ebcdc1bdf2495f4494eec))
- use ~ for package version ([4e027ff](https://github.com/AliMD/fract/commit/4e027ff63875e03b088ebcdc1bdf2495f4494eec))
# [0.23.0](https://github.com/AliMD/alwatr/compare/v0.22.1...v0.23.0) (2022-11-23)
# [0.23.0](https://github.com/AliMD/fract/compare/v0.22.1...v0.23.0) (2022-11-23)
**Note:** Version bump only for package @alwatr/router
## [0.22.1](https://github.com/AliMD/alwatr/compare/v0.22.0...v0.22.1) (2022-11-21)
## [0.22.1](https://github.com/AliMD/fract/compare/v0.22.0...v0.22.1) (2022-11-21)
**Note:** Version bump only for package @alwatr/router
# [0.22.0](https://github.com/AliMD/alwatr/compare/v0.21.0...v0.22.0) (2022-11-20)
# [0.22.0](https://github.com/AliMD/fract/compare/v0.21.0...v0.22.0) (2022-11-20)
**Note:** Version bump only for package @alwatr/router
# [0.21.0](https://github.com/AliMD/alwatr/compare/v0.20.0...v0.21.0) (2022-11-13)
# [0.21.0](https://github.com/AliMD/fract/compare/v0.20.0...v0.21.0) (2022-11-13)
**Note:** Version bump only for package @alwatr/router
# [0.20.0](https://github.com/AliMD/alwatr/compare/v0.19.0...v0.20.0) (2022-11-05)
# [0.20.0](https://github.com/AliMD/fract/compare/v0.19.0...v0.20.0) (2022-11-05)
**Note:** Version bump only for package @alwatr/router
# [0.19.0](https://github.com/AliMD/alwatr/compare/v0.18.0...v0.19.0) (2022-11-01)
# [0.19.0](https://github.com/AliMD/fract/compare/v0.18.0...v0.19.0) (2022-11-01)
### Bug Fixes
- Import error in webpack ([1a52f67](https://github.com/AliMD/alwatr/commit/1a52f67ff2788c51abd13126f34353c26aa669c3))
- Import error in webpack ([1a52f67](https://github.com/AliMD/fract/commit/1a52f67ff2788c51abd13126f34353c26aa669c3))
# [0.18.0](https://github.com/AliMD/alwatr/compare/v0.17.0...v0.18.0) (2022-10-22)
# [0.18.0](https://github.com/AliMD/fract/compare/v0.17.0...v0.18.0) (2022-10-22)
**Note:** Version bump only for package @alwatr/router
# [0.17.0](https://github.com/AliMD/alwatr/compare/v0.16.1...v0.17.0) (2022-10-21)
# [0.17.0](https://github.com/AliMD/fract/compare/v0.16.1...v0.17.0) (2022-10-21)
**Note:** Version bump only for package @alwatr/router
# [0.16.0](https://github.com/AliMD/alwatr/compare/v0.15.0...v0.16.0) (2022-09-08)
# [0.16.0](https://github.com/AliMD/fract/compare/v0.15.0...v0.16.0) (2022-09-08)
**Note:** Version bump only for package @alwatr/router
# [0.15.0](https://github.com/AliMD/alwatr/compare/v0.14.0...v0.15.0) (2022-09-01)
# [0.15.0](https://github.com/AliMD/fract/compare/v0.14.0...v0.15.0) (2022-09-01)
**Note:** Version bump only for package @alwatr/router
# [0.14.0](https://github.com/AliMD/alwatr/compare/v0.13.0...v0.14.0) (2022-08-19)
# [0.14.0](https://github.com/AliMD/fract/compare/v0.13.0...v0.14.0) (2022-08-19)
**Note:** Version bump only for package @alwatr/router
# [0.13.0](https://github.com/AliMD/alwatr/compare/v0.12.0...v0.13.0) (2022-08-06)
# [0.13.0](https://github.com/AliMD/fract/compare/v0.12.0...v0.13.0) (2022-08-06)
**Note:** Version bump only for package @alwatr/router
# [0.12.0](https://github.com/AliMD/alwatr/compare/v0.11.0...v0.12.0) (2022-07-22)
# [0.12.0](https://github.com/AliMD/fract/compare/v0.11.0...v0.12.0) (2022-07-22)
**Note:** Version bump only for package @alwatr/router
# [0.11.0](https://github.com/AliMD/alwatr/compare/v0.10.1...v0.11.0) (2022-04-16)
# [0.11.0](https://github.com/AliMD/fract/compare/v0.10.1...v0.11.0) (2022-04-16)
**Note:** Version bump only for package @alwatr/router
# [0.10.0](https://github.com/AliMD/alwatr/compare/v0.9.0...v0.10.0) (2022-04-02)
# [0.10.0](https://github.com/AliMD/fract/compare/v0.9.0...v0.10.0) (2022-04-02)
**Note:** Version bump only for package @alwatr/router
# [0.9.0](https://github.com/AliMD/alwatr/compare/v0.8.0...v0.9.0) (2022-03-22)
# [0.9.0](https://github.com/AliMD/fract/compare/v0.8.0...v0.9.0) (2022-03-22)
### Bug Fixes
- **router:** export RequestRouteParam type ([d07e0ea](https://github.com/AliMD/alwatr/commit/d07e0eaf7781b8c35f7f47c90fdbbbc7e229a060))
- **router:** fire first route-change signal as soon as posible ([2ae176b](https://github.com/AliMD/alwatr/commit/2ae176b91f7461258bd7432064d6c81730f6f04e))
- **router:** outlet default 404 render ([2218483](https://github.com/AliMD/alwatr/commit/22184830c6c93024e335707a60badbbf188745aa))
- **router:** router.signal type helper ([88b8e26](https://github.com/AliMD/alwatr/commit/88b8e26c83f35c52ff69356f12650e77cc6537d2))
- **router:** signal define issue ([d3921b5](https://github.com/AliMD/alwatr/commit/d3921b5d8bbe3dc4984a264801f2e992ceb1ece0))
- **router:** export RequestRouteParam type ([d07e0ea](https://github.com/AliMD/fract/commit/d07e0eaf7781b8c35f7f47c90fdbbbc7e229a060))
- **router:** fire first route-change signal as soon as posible ([2ae176b](https://github.com/AliMD/fract/commit/2ae176b91f7461258bd7432064d6c81730f6f04e))
- **router:** outlet default 404 render ([2218483](https://github.com/AliMD/fract/commit/22184830c6c93024e335707a60badbbf188745aa))
- **router:** router.signal type helper ([88b8e26](https://github.com/AliMD/fract/commit/88b8e26c83f35c52ff69356f12650e77cc6537d2))
- **router:** signal define issue ([d3921b5](https://github.com/AliMD/fract/commit/d3921b5d8bbe3dc4984a264801f2e992ceb1ece0))
### Features
- **router:** improve 404 template ([3af27f7](https://github.com/AliMD/alwatr/commit/3af27f71dec257e0a245605c6c333816e6e0c317))
- **router:** improve 404 template ([3af27f7](https://github.com/AliMD/fract/commit/3af27f71dec257e0a245605c6c333816e6e0c317))
# [0.8.0](https://github.com/AliMD/alwatr/compare/v0.7.2...v0.8.0) (2022-03-14)
# [0.8.0](https://github.com/AliMD/fract/compare/v0.7.2...v0.8.0) (2022-03-14)
### Bug Fixes
- **router:** updateBrowserHistory issue ([22b16e5](https://github.com/AliMD/alwatr/commit/22b16e599089f3abe5eb9dc285563fa9510ad97e))
- **router:** updateBrowserHistory issue ([22b16e5](https://github.com/AliMD/fract/commit/22b16e599089f3abe5eb9dc285563fa9510ad97e))
### Features
- **router:** make outlet ([45852a8](https://github.com/AliMD/alwatr/commit/45852a809a9f48fb09cf9a8c5ecc3f6519f106cd))
- **router:** make outlet ([45852a8](https://github.com/AliMD/fract/commit/45852a809a9f48fb09cf9a8c5ecc3f6519f106cd))
## [0.7.2](https://github.com/AliMD/alwatr/compare/v0.7.1...v0.7.2) (2022-03-12)
## [0.7.2](https://github.com/AliMD/fract/compare/v0.7.1...v0.7.2) (2022-03-12)
### Bug Fixes
- **router:** trigger-click error when tagName undefined ([c16328b](https://github.com/AliMD/alwatr/commit/c16328bb6dc96b5c330015ac560cf95920b9c7b2))
- **router:** trigger-click error when tagName undefined ([c16328b](https://github.com/AliMD/fract/commit/c16328bb6dc96b5c330015ac560cf95920b9c7b2))
# [0.7.0](https://github.com/AliMD/alwatr/compare/v0.6.1...v0.7.0) (2022-03-12)
# [0.7.0](https://github.com/AliMD/fract/compare/v0.6.1...v0.7.0) (2022-03-12)
**Note:** Version bump only for package @alwatr/router
# [0.6.0](https://github.com/AliMD/alwatr/compare/v0.5.0...v0.6.0) (2022-03-11)
# [0.6.0](https://github.com/AliMD/fract/compare/v0.5.0...v0.6.0) (2022-03-11)
### Bug Fixes
- alalwatr ([898aa6e](https://github.com/AliMD/alwatr/commit/898aa6ed0888eab9265c83b96a50f1b8c216d143))
- **packages:** duplicate alwatr keyword ([77d4aa2](https://github.com/AliMD/alwatr/commit/77d4aa2105ad47515c3eee251fd6b8c281d0d1fc))
- alalwatr ([898aa6e](https://github.com/AliMD/fract/commit/898aa6ed0888eab9265c83b96a50f1b8c216d143))
- **packages:** duplicate alwatr keyword ([77d4aa2](https://github.com/AliMD/fract/commit/77d4aa2105ad47515c3eee251fd6b8c281d0d1fc))
# [0.5.0](https://github.com/AliMD/alwatr/compare/v0.4.0...v0.5.0) (2022-03-11)
# [0.5.0](https://github.com/AliMD/fract/compare/v0.4.0...v0.5.0) (2022-03-11)
**Note:** Version bump only for package @alwatr/router
# [0.4.0](https://github.com/AliMD/alwatr/compare/v0.3.0...v0.4.0) (2022-03-11)
# [0.4.0](https://github.com/AliMD/fract/compare/v0.3.0...v0.4.0) (2022-03-11)
### Bug Fixes
- **router:** build issue for parameterList type [#75](https://github.com/AliMD/alwatr/issues/75) ([5fc1ecd](https://github.com/AliMD/alwatr/commit/5fc1ecd12b938936e2718f9307186493e2712e1f))
- **router:** build issue for parameterList type [#75](https://github.com/AliMD/fract/issues/75) ([5fc1ecd](https://github.com/AliMD/fract/commit/5fc1ecd12b938936e2718f9307186493e2712e1f))
# [0.3.0](https://github.com/AliMD/alwatr/compare/v0.2.1...v0.3.0) (2022-03-06)
# [0.3.0](https://github.com/AliMD/fract/compare/v0.2.1...v0.3.0) (2022-03-06)
**Note:** Version bump only for package @alwatr/router
## [0.2.1](https://github.com/AliMD/alwatr/compare/v0.2.0...v0.2.1) (2022-03-05)
## [0.2.1](https://github.com/AliMD/fract/compare/v0.2.0...v0.2.1) (2022-03-05)
**Note:** Version bump only for package @alwatr/router
# [0.2.0](https://github.com/AliMD/alwatr/compare/v0.1.2...v0.2.0) (2022-03-05)
# [0.2.0](https://github.com/AliMD/fract/compare/v0.1.2...v0.2.0) (2022-03-05)
### Bug Fixes
- **router:** trigger click signal name ([b4a9477](https://github.com/AliMD/alwatr/commit/b4a9477464cb05bb8fa227014de5e8af5b8dd600))
- **router:** trigger click signal name ([b4a9477](https://github.com/AliMD/fract/commit/b4a9477464cb05bb8fa227014de5e8af5b8dd600))
### Features
- **router:** \_updateBrowserHistory ([8933a97](https://github.com/AliMD/alwatr/commit/8933a97cde277708356fc123c7493774cf0b00ec))
- **router:** base type ([f76d34b](https://github.com/AliMD/alwatr/commit/f76d34b65fbfb9680662dd994136d90be99d496c))
- **router:** first route request ([e0ad1d4](https://github.com/AliMD/alwatr/commit/e0ad1d403f0023e2df44cb8b7a3a5710fcfbe877))
- **router:** implement click trigger ([39f5f07](https://github.com/AliMD/alwatr/commit/39f5f075f48ae4323ccca57467dde04ce8c9c3be))
- **router:** implement popstate trigger ([1613131](https://github.com/AliMD/alwatr/commit/16131312e4bc083ca3d6cf4c1458a93962946ccf))
- **router:** initialRouter with triggers options ([802405f](https://github.com/AliMD/alwatr/commit/802405fb17846be9fe51a41122c871b5aca9cf6b))
- **router:** joinParameterList, splitParameterString ([9a4232b](https://github.com/AliMD/alwatr/commit/9a4232b942f36a06cd3278e1a339639c9bcc82fa))
- **router:** make new package for routing base on signals ([39c9ae8](https://github.com/AliMD/alwatr/commit/39c9ae8cf2d8288cfdefce0826f5fe89b2d7d550))
- **router:** makeRouteObject ([6e0e5dc](https://github.com/AliMD/alwatr/commit/6e0e5dc6fa10a6c02b1aeb198355040de6e235d2))
- **router:** parseValue all sections and params value ([9af4079](https://github.com/AliMD/alwatr/commit/9af4079f03dc2b656694f962701fcf75da23fa99))
- **router:** requestRouteHref ([9341f3f](https://github.com/AliMD/alwatr/commit/9341f3ff444bcdf26fd31f5eca71912dd70b7167))
- **router:** route base types ([769e863](https://github.com/AliMD/alwatr/commit/769e863b3a1569a01b320390b007bccaa80c3458))
- **router:** routeSignalProvider ([ad187e7](https://github.com/AliMD/alwatr/commit/ad187e706b6d62abd0668cf9bc7b64c49acab071))
- **router:** \_updateBrowserHistory ([8933a97](https://github.com/AliMD/fract/commit/8933a97cde277708356fc123c7493774cf0b00ec))
- **router:** base type ([f76d34b](https://github.com/AliMD/fract/commit/f76d34b65fbfb9680662dd994136d90be99d496c))
- **router:** first route request ([e0ad1d4](https://github.com/AliMD/fract/commit/e0ad1d403f0023e2df44cb8b7a3a5710fcfbe877))
- **router:** implement click trigger ([39f5f07](https://github.com/AliMD/fract/commit/39f5f075f48ae4323ccca57467dde04ce8c9c3be))
- **router:** implement popstate trigger ([1613131](https://github.com/AliMD/fract/commit/16131312e4bc083ca3d6cf4c1458a93962946ccf))
- **router:** initialRouter with triggers options ([802405f](https://github.com/AliMD/fract/commit/802405fb17846be9fe51a41122c871b5aca9cf6b))
- **router:** joinParameterList, splitParameterString ([9a4232b](https://github.com/AliMD/fract/commit/9a4232b942f36a06cd3278e1a339639c9bcc82fa))
- **router:** make new package for routing base on signals ([39c9ae8](https://github.com/AliMD/fract/commit/39c9ae8cf2d8288cfdefce0826f5fe89b2d7d550))
- **router:** makeRouteObject ([6e0e5dc](https://github.com/AliMD/fract/commit/6e0e5dc6fa10a6c02b1aeb198355040de6e235d2))
- **router:** parseValue all sections and params value ([9af4079](https://github.com/AliMD/fract/commit/9af4079f03dc2b656694f962701fcf75da23fa99))
- **router:** requestRouteHref ([9341f3f](https://github.com/AliMD/fract/commit/9341f3ff444bcdf26fd31f5eca71912dd70b7167))
- **router:** route base types ([769e863](https://github.com/AliMD/fract/commit/769e863b3a1569a01b320390b007bccaa80c3458))
- **router:** routeSignalProvider ([ad187e7](https://github.com/AliMD/fract/commit/ad187e706b6d62abd0668cf9bc7b64c49acab071))

@@ -1,6 +0,4 @@

import { clickTrigger } from './trigger-click.js';
import { popstateTrigger } from './trigger-popstate.js';
export { routerOutlet, routeContextConsumer, url, redirect } from './core.js';
export { clickTrigger, popstateTrigger };
export type { RouteContext, RoutesConfig } from './type.js';
import { AlwatrRouter } from './router.js';
export type { RouteContext } from './type.js';
export declare const router: AlwatrRouter;
//# sourceMappingURL=index.d.ts.map

@@ -1,19 +0,6 @@

import { logger, makeRouteContext, routeContextProvider } from './core.js';
import { clickTrigger } from './trigger-click.js';
import { popstateTrigger } from './trigger-popstate.js';
export { routerOutlet, routeContextConsumer, url, redirect } from './core.js';
export { clickTrigger, popstateTrigger };
/**
* Initial process when dom loaded.
*/
(() => {
logger.logMethod?.('initialize');
clickTrigger.enable = popstateTrigger.enable = true;
if (routeContextProvider.getValue() === undefined) {
routeContextProvider.setValue(makeRouteContext(), { debounce: 'Timeout' });
}
else {
logger.incident?.('initialize', 'skip_route_context', 'Route context already have value');
}
})();
import { AlwatrRouter } from './router.js';
export const router = new AlwatrRouter({
clickTrigger: true,
popstateTrigger: true,
});
//# sourceMappingURL=index.js.map
{
"name": "@alwatr/router",
"version": "1.1.2",
"version": "2.0.0-beta.0",
"description": "Elegant powerful router (fundamental advance browser page routing) based on the simplicity of the signals written in tiny TypeScript module.",

@@ -26,16 +26,16 @@ "keywords": [

"type": "git",
"url": "https://github.com/AliMD/alwatr",
"directory": "core/router"
"url": "https://github.com/AliMD/fract",
"directory": "packages/router"
},
"homepage": "https://github.com/AliMD/alwatr/tree/main/core/router#readme",
"homepage": "https://github.com/AliMD/fract/tree/next/packages/router#readme",
"bugs": {
"url": "https://github.com/AliMD/alwatr/issues"
"url": "https://github.com/AliMD/fract/issues"
},
"dependencies": {
"@alwatr/logger": "^1.1.2",
"@alwatr/math": "^1.1.2",
"@alwatr/signal": "^1.1.2",
"@alwatr/logger": "^1.0.0",
"@alwatr/math": "^1.0.0",
"@alwatr/signal": "^2.0.0",
"tslib": "^2.6.2"
},
"gitHead": "16036de8a6d781116e8c463ba41a2cb8cdc34edc"
"gitHead": "e35bb1ad292b6d5030897766f7bb44c7adea313d"
}

@@ -1,2 +0,2 @@

# Alwatr Router - `@alwatr/router`
# Alwatr router - `@alwatr/router`

@@ -6,156 +6,1 @@ Elegant powerful router (fundamental advance browser page routing) based on the simplicity of the signals written in tiny TypeScript module.

## Example usage
### Prepare
```ts
import {router} from 'https://esm.run/@alwatr/router';
/**
* Initial and config the Router.
*/
router.initial();
/**
* Add listener to `route-change` signal.
*/
router.signal.addListener((route) => {
console.log(route);
});
```
### Route object
Example page url: `https://example.com/product/100/book?cart=1&color=white#description`
```ts
interface Route {
sectionList: Array<string | number | boolean>; // [product, 100, book]
queryParamList: ParamList; // {cart: 1, color: 'white'}
hash: string; // '#description'
}
```
### Dynamic page rendering
```ts
const routes: routesConfig = {
map: (route: Route) => route.sectionList[0]?.toString(),
list: {
'about': {
render: () => html`<page-about></page-about>`,
},
'product-list': {
render: () => {
import('./page-product-list.js'); // lazy loading page
html`<page-product-list></page-product-list>`,
}
},
'contact': {
render: () => html`<page-contact></page-contact>`,
},
'home': {
render: () => html`<page-home></page-home>`,
},
'404': {
render: () => html`<page-404></page-404>`,
},
},
};
...
// Any render function can be used.
render() {
router.outlet(routes);
}
...
// Request update (call render again) on route change.
router.signal.addListener(() => this.requestUpdate());
```
### Make link from semantic route
`router.makeUrl(route)`
Make anchor valid href from route.
```html
<a href=${ router.makeUrl({sectionList: ['product', 100]}) }>
```
### Full example with [lit-element](https://lit.dev)
<!-- prettier-ignore -->
```ts
import {css, html, LitElement} from '@alwatr/element';
import {customElement} from 'lit/decorators/custom-element.js';
import {router} from '@alwatr/router';
import type {ListenerInterface} from '@alwatr/signal';
import type {RoutesConfig} from '@alwatr/router';
@customElement('my-element')
export class MyElement extends LitElement {
static override styles = css`
:host {
display: block;
}
`;
private _routes: RoutesConfig = {
map: (route) => route.sectionList[0]?.toString(),
list: {
home: {
render: () => html`<page-home>Page Home ...</page-home>`,
},
about: {
render: () => html`<page-about>Page About ...</page-about>`,
},
article: {
render: (route) =>
route.sectionList[1] != null ?
html`<page-article>Page Article ${route.sectionList[1]} ...</page-article>` :
this._routes.list['404'],
},
},
};
constructor() {
super();
router.initial();
}
private _listenerList: Array<unknown> = [];
override connectedCallback(): void {
super.connectedCallback();
this._listenerList.push(router.signal.addListener(() => this.requestUpdate()));
}
override disconnectedCallback(): void {
super.disconnectedCallback();
this._listenerList.forEach((listener) =>
(listener as ListenerInterface<keyof AlwatrSignals>).remove()
);
}
override render() {
return html`
<h2>Hello World!</h2>
<menu>
<li><a href=${router.makeUrl({sectionList: ['home']})}>Home</a></li>
<li><a href=${router.makeUrl({sectionList: ['about']})}>About</a></li>
<li><a href=${router.makeUrl({sectionList: ['article', 100]})}>Article 100</a></li>
<li><a href=${router.makeUrl({sectionList: ['contact']})}>Contact</a></li>
</menu>
<div class="page-container">${router.outlet(this._routes)}</div>
`;
}
}
```

@@ -1,2 +0,2 @@

import type { QueryParameters, StringifyableRecord } from '@alwatr/type';
import type { QueryParameters } from '@alwatr/type';
/**

@@ -16,4 +16,4 @@ * Route context base type.

*/
export interface RouteContextBase extends StringifyableRecord {
sectionList: (string | number | boolean)[];
export interface RouteContextBase {
sectionList: string[];
queryParamList: QueryParameters;

@@ -53,3 +53,3 @@ hash: string;

*/
export interface InitOptions {
export interface RouterConfig {
/**

@@ -71,83 +71,2 @@ * A navigation trigger for Alwatr Router that translated clicks on `<a>` links into navigation signal.

}
/**
* Type of `routeConfig.templates` items.
*/
export type TemplateCallback = (routeContext: RouteContext) => unknown;
/**
* Type of `routeConfig.templates`.
*/
export interface RouterTemplates {
[x: string]: TemplateCallback | string | undefined;
home: TemplateCallback;
_404: TemplateCallback;
}
/**
* Routes config for routerOutlet.
*
* The `routerOutlet` return `list[map(currentRoute)].render(currentRoute)`.
*
* Example:
*
* ```ts
* const routeConfig = {
* routeId: (routeContext) => routeContext.sectionList[0]?.toString(),
* templates: {
* 'about': () => html`<page-about></page-about>`,
* 'product-list': () => {
* import('./page-product-list.js'); // lazy import
* return html`<page-product-list></page-product-list>`,
* },
* 'contact': () => html`<page-contact></page-contact>`,
* 'home': () => html`<page-home></page-home>`,
* '_404': () => html`<page-404></page-404>`,
* },
* };
*
* routerOutlet(routeConfig);
* ```
*/
export interface RoutesConfig {
/**
* Define function to generate routeId (same as pageName) from current routeContext.
*
* if the location is app root and `routeId()` return noting then redirect to `home` automatically
* if `routeId()` return noting or render function not defined in the `templates` redirected to `_404` routeId.
*
* Example:
*
* ```ts
* router.outlet({
* routeId: (routeContext) => routeContext.sectionList[0]?.toString(),
* templates: {
* // ...
* },
* })
* ```
*/
routeId: (routeContext: RouteContext) => string | undefined;
/**
* Define templates of the routes (pages).
*
* Example:
*
* ```ts
* const routeConfig = {
* routeId: (routeContext) => routeContext.sectionList[0]?.toString(),
* templates: {
* 'about': () => html`<page-about></page-about>`,
* 'product-list': () => {
* import('./page-product-list.js'); // lazy import
* return html`<page-product-list></page-product-list>`,
* },
* 'contact': () => html`<page-contact></page-contact>`,
* 'home': () => html`<page-home></page-home>`,
* '_404': () => html`<page-404></page-404>`,
* },
* };
*
* routerOutlet(routeConfig);
* ```
*/
templates: RouterTemplates;
}
//# sourceMappingURL=type.d.ts.map

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc