Socket
Socket
Sign inDemoInstall

@modern-js/types

Package Overview
Dependencies
Maintainers
15
Versions
3308
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@modern-js/types - npm Package Compare versions

Comparing version 0.0.0-canary-20221024062649 to 0.0.0-canary-20221024105341

6

CHANGELOG.md
# @modern-js/types
## 0.0.0-canary-20221024062649
## 0.0.0-canary-20221024105341
### Patch Changes
- cc971eabf: refactor: move server plugin load logic in `@modern-js/core`
refactor:移除在 `@modern-js/core` 中的 server 插件加载逻辑
- 8b8e1bb57: feat: support nested routes
feat: 支持嵌套路由
- 3bbea92b2: feat: support Hook、Middleware new API

@@ -8,0 +12,0 @@ feat: 支持 Hook、Middleware 的新 API

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

import type { Merge } from 'type-fest';
import { InternalPlugins } from '../common';

@@ -10,2 +11,3 @@ import { ServerRoute } from '../server';

entry: string;
nestedRoutesEntry?: string;
isAutoMount?: boolean;

@@ -22,3 +24,3 @@ customBootstrap?: string | false;

*/
export interface Route {
export type RouteLegacy = {
path: string;

@@ -28,6 +30,49 @@ exact: boolean;

_component: string;
routes?: Route[];
parent?: Route;
}
routes?: RouteLegacy[];
parent?: RouteLegacy;
};
export type Route = Partial<{
caseSensitive: boolean;
path: string;
id: string;
loader: any;
action: any;
hasErrorBoundary: boolean;
shouldRevalidate: any;
handle: any;
index: boolean;
children: Route[] | undefined;
element: React.ReactNode | null;
errorElement: React.ReactNode | null;
}> & {
type: string;
};
export type NestedRoute = Merge<
Route,
{
type: 'nested';
parentId?: string;
children?: NestedRoute[];
childIds?: string[];
filename?: string;
_component?: string;
component?: string;
loading?: string;
error?: string;
}
>;
export type PageRoute = Merge<
Route,
{
type: 'page';
parent?: PageRoute;
_component: string;
component: string;
children?: PageRoute[];
}
>;
/**

@@ -69,1 +114,3 @@ * custom html partials.

}
export type { Merge } from 'type-fest';

9

package.json

@@ -14,3 +14,3 @@ {

],
"version": "0.0.0-canary-20221024062649",
"version": "0.0.0-canary-20221024105341",
"types": "./index.d.ts",

@@ -35,8 +35,9 @@ "exports": {

"devDependencies": {
"@scripts/build": "0.0.0-canary-20221024062649",
"@scripts/jest-config": "0.0.0-canary-20221024062649",
"@scripts/build": "0.0.0-canary-20221024105341",
"@scripts/jest-config": "0.0.0-canary-20221024105341",
"@types/jest": "^27",
"@types/node": "^14",
"http-proxy-middleware": "^2.0.4",
"jest": "^27"
"jest": "^27",
"type-fest": "2.15.0"
},

@@ -43,0 +44,0 @@ "sideEffects": false,

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