New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

boring-router

Package Overview
Dependencies
Maintainers
1
Versions
108
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

boring-router - npm Package Compare versions

Comparing version 0.2.0 to 0.2.1

bld/library/nav-link.d.ts

1

bld/library/index.d.ts

@@ -6,2 +6,3 @@ export * from './schema';

export * from './link';
export * from './nav-link';
export * from './redirect';

@@ -9,3 +9,4 @@ "use strict";

tslib_1.__exportStar(require("./link"), exports);
tslib_1.__exportStar(require("./nav-link"), exports);
tslib_1.__exportStar(require("./redirect"), exports);
//# sourceMappingURL=index.js.map

15

CHANGELOG.md
# Changelog
## [0.2.1] - 2018-9-5
### Changes
- Added `<NavLink>` component.
## [0.2.0] - 2018-9-2

@@ -7,11 +13,12 @@

- `<Link>` component now do `history.push()` by default. A new boolean parameter `replace` is added to override the behavior with `history.replace()`.
- `<Redirect>` component now do `history.replace()` by default. A new boolean parameter `push` is added to override the behavior with `history.push()`.
- `<Link>` component now does `history.push()` by default. A new boolean parameter `replace` is added to override the behavior with `history.replace()`.
- `<Redirect>` component now does `history.replace()` by default. A new boolean parameter `push` is added to override the behavior with `history.push()`.
### Breaking Changes
- `<Link>` and `<Redirect>` component now support only `RouteMatch` as value of `to` parameter, and `<HistoryProvider>` is now removed.
- `<Link>` and `<Redirect>` component now supports only `RouteMatch` as value of `to` parameter, and `<HistoryProvider>` is now removed.
- `$navigate` method of `RouteMatch` is now removed in favor of `$push` and `$replace`.
- `<Redirect>` component no longer accept `match` parameter with type boolean.
- `<Redirect>` component no longer accepts `match` parameter with type boolean.
[0.2.1]: https://github.com/makeflow/boring-router/releases/tag/v0.2.1
[0.2.0]: https://github.com/makeflow/boring-router/releases/tag/v0.2.0
{
"name": "boring-router",
"version": "0.2.0",
"version": "0.2.1",
"description": "A light-weight, type-safe, yet reactive router service using MobX.",

@@ -35,2 +35,3 @@ "repository": {

"@magicspace/configs": "^0.1.28",
"@types/classnames": "^2.2.6",
"@types/history": "^4.7.0",

@@ -55,2 +56,3 @@ "@types/react": "^16.4.12",

"@types/jest": "^23.3.1",
"classnames": "^2.2.6",
"hyphenate": "^0.2.4",

@@ -57,0 +59,0 @@ "tslang": "^0.1.7"

@@ -80,3 +80,3 @@ [![NPM Package](https://badge.fury.io/js/boring-router.svg)](https://www.npmjs.com/package/boring-router)

Two pre-defined `$match` regular expression is available as `RouteMatch.fragment` (`/[^/]+/`) and `RouteMatch.rest` (`/.+/`).
Two pre-defined `$match` regular expressions are available as `RouteMatch.fragment` (`/[^/]+/`) and `RouteMatch.rest` (`/.+/`).

@@ -100,5 +100,5 @@ A `schema` wrapper function is available to make TypeScript intellisense happier for separated schema definition:

$ref(params?: Partial<TParamDict>, preserveQuery?: boolean): string;
$push(params?: Partial<TParamDict>, preserveQuery?: boolean): string;
$replace(params?: Partial<TParamDict>, preserveQuery?: boolean): string;
$action(action: RouteMatchAction, exact?: boolean): string;
$push(params?: Partial<TParamDict>, preserveQuery?: boolean): void;
$replace(params?: Partial<TParamDict>, preserveQuery?: boolean): void;
$action(action: RouteMatchAction, exact?: boolean): void;
}

@@ -171,2 +171,10 @@ ```

- [NavLink](examples/nav-link/main.tsx)
Like `<Link>` but will add a class name if `to` matches.
```tsx
<NavLink to={router.account}>Account</NavLink>
```
- [Function as Child](examples/function-as-child/main.tsx)

@@ -207,2 +215,12 @@

- [Action](examples/action/main.tsx)
Take an action on route match.
```tsx
router.account.$action(() => {
router.about.$replace({source: 'action'});
});
```
### Run an example

@@ -209,0 +227,0 @@

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