Skip to content

Commit 7a5f557

Browse files
committed
chore: remove internal alias
1 parent 7cb7491 commit 7a5f557

File tree

6 files changed

+18
-18
lines changed

6 files changed

+18
-18
lines changed

packages/document/main-doc/docs/en/guides/advanced-features/bff/function.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ Parameters following the dynamic path are an object called `RequestOption`, whic
191191
In a standard function without dynamic routes, `RequestOption` can be obtained from the first parameter, for example:
192192

193193
```ts title="api/lambda/hello.ts"
194-
import type { RequestOption } from '@modern-js/runtime/server';
194+
import type { RequestOption } from '@modern-js/plugin-bff/server';
195195

196196
export async function post({
197197
query,
@@ -204,7 +204,7 @@ export async function post({
204204
Custom types can also be used here:
205205

206206
```ts title="api/lambda/hello.ts"
207-
import type { RequestOption } from '@modern-js/runtime/server';
207+
import type { RequestOption } from '@modern-js/plugin-bff/server';
208208

209209
type IQuery = {
210210
// some types

packages/document/main-doc/docs/en/guides/advanced-features/web-server.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,7 @@ Currently, two types of Hooks are available: `AfterMatch` and `AfterRender`. Dev
299299
import type {
300300
AfterMatchHook,
301301
AfterRenderHook,
302-
} from '@modern-js/runtime/server';
302+
} from '@modern-js/server-runtime';
303303

304304
export const afterMatch: AfterMatchHook = (ctx, next) => {
305305
next();

packages/document/main-doc/docs/en/guides/basic-features/render/ssr-cache.mdx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Requires version x.43.0+
1313
Create a `server/cache.[t|j]s` file in your application and export the `cacheOption` configuration to enable SSR rendering cache:
1414

1515
```ts title="server/cache.ts"
16-
import type { CacheOption } from '@modern-js/runtime/server;
16+
import type { CacheOption } from '@modern-js/server-runtime;
1717

1818
export const cacheOption: CacheOption = {
1919
maxAge: 500, // ms
@@ -28,7 +28,7 @@ export const cacheOption: CacheOption = {
2828
The caching strategy implements [stale-while-revalidate](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control).
2929

3030
Within the `maxAge` period, the cache content is directly returned. Exceeding `maxAge` but within `staleWhileRevalidate`, the cache content is still returned directly, but it re-renders asynchronously.
31-
31+
3232
**Object Type**
3333

3434
```ts
@@ -52,7 +52,7 @@ export type CacheOptionProvider = (
5252
Sometimes, developers need to use `req` to customize the cache key, or prevent caching for specific URLs. You can configure this as a function, as shown:
5353

5454
```ts title="server/cache.ts"
55-
import type { CacheOption, CacheOptionProvider } from '@modern-js/runtime/server;
55+
import type { CacheOption, CacheOptionProvider } from '@modern-js/server-runtime;
5656

5757
const provider: CacheOptionProvider = (req) => {
5858
const { url, headers, ... } = req;
@@ -80,7 +80,7 @@ export type CacheOptions = Record<string, CacheControl | CacheOptionProvider>;
8080
Sometimes, different routes require different caching strategies. We also offer a mapping configuration method, as shown below:
8181

8282
```ts title="server/cache.ts"
83-
import type { CacheOption } from '@modern-js/runtime/server;
83+
import type { CacheOption } from '@modern-js/server-runtime;
8484

8585
export const cacheOption: CacheOption = {
8686
'/home': {
@@ -147,7 +147,7 @@ Developers can implement a Redis cache container as shown below:
147147

148148
```ts
149149
import Redis from 'ioredis';
150-
import type { Container, CacheOption } from '@modern-js/runtime/server;
150+
import type { Container, CacheOption } from '@modern-js/server-runtime;
151151

152152
class RedisContainer implements Container {
153153
redis = new Redis();
@@ -202,4 +202,4 @@ The `x-render-cache` header can have the following values:
202202
| hit | Cache hit, returned cache content |
203203
| stale | Cache hit, but data is stale, returned cache content and re-rendered asynchronously |
204204
| expired | Cache expired, re-rendered and returned new content |
205-
| miss | Cache missed |
205+
| miss | Cache missed |

packages/document/main-doc/docs/zh/guides/advanced-features/bff/function.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ Dynamic Path 之后的参数是包含 querystring、request body 的对象 `Requ
193193
在不存在动态路由的普通函数中,可以从第一个入参中获取传入的 `data``query`,例如:
194194

195195
```ts title="api/lambda/hello.ts"
196-
import type { RequestOption } from '@modern-js/runtime/server';
196+
import type { RequestOption } from '@modern-js/server-runtime';
197197

198198
export async function post({
199199
query,
@@ -206,7 +206,7 @@ export async function post({
206206
这里你也可以使用自定义类型:
207207

208208
```ts title="api/lambda/hello.ts"
209-
import type { RequestOption } from '@modern-js/runtime/server';
209+
import type { RequestOption } from '@modern-js/server-runtime';
210210

211211
type IQuery = {
212212
// some types

packages/document/main-doc/docs/zh/guides/advanced-features/web-server.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ Modern.js 支持为 Web Server 添加渲染中间件,支持在处理页面路
267267
import {
268268
UnstableMiddleware,
269269
UnstableMiddlewareContext,
270-
} from '@modern-js/runtime/server';
270+
} from '@modern-js/server-runtime';
271271

272272
const time: UnstableMiddleware = async (c: UnstableMiddlewareContext, next) => {
273273
const start = Date.now();
@@ -292,7 +292,7 @@ Modern.js 提供的 Hook 用于控制 Web Server 中的特定逻辑,所有的
292292
import type {
293293
AfterMatchHook,
294294
AfterRenderHook,
295-
} from '@modern-js/runtime/server';
295+
} from '@modern-js/server-runtime';
296296

297297
export const afterMatch: AfterMatchHook = (ctx, next) => {
298298
next();

packages/document/main-doc/docs/zh/guides/basic-features/render/ssr-cache.mdx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Modern.js 支持将服务器端渲染(SSR)结果进行缓存,减少服务
1717
在应用中创建 `server/cache.[t|j]s` 文件,并导出 `cacheOption` 配置缓存即可开启 SSR 渲染缓存:
1818

1919
```ts title="server/cache.ts"
20-
import type { CacheOption } from '@modern-js/runtime/server';
20+
import type { CacheOption } from '@modern-js/server-runtime';
2121

2222
export const cacheOption: CacheOption = {
2323
maxAge: 500, // ms
@@ -57,7 +57,7 @@ export type CacheOptionProvider = (
5757

5858
```ts title="server/cache.ts"
5959

60-
import type { CacheOption, CacheOptionProvider } from '@modern-js/runtime/server';
60+
import type { CacheOption, CacheOptionProvider } from '@modern-js/server-runtime';
6161

6262
const provider: CacheOptionProvider = (req) => {
6363
const { url, headers, ... } = req;
@@ -85,7 +85,7 @@ export type CacheOptions = Record<string, CacheControl | CacheOptionProvider>;
8585
有时开发者面对不同的路由需要应用不同的缓存策略。我们也提供一种映射的方式进行配置, 以下列代码为例:
8686

8787
```ts title="server/cache.ts"
88-
import type { CacheOption } from '@modern-js/runtime/server';
88+
import type { CacheOption } from '@modern-js/server-runtime';
8989

9090
export const cacheOption: CacheOption = {
9191
'/home': {
@@ -151,7 +151,7 @@ export interface Container<K = string, V = string> {
151151
以下面代码为例,开发者可实现一个 redis 缓存容器。
152152

153153
```ts
154-
import type { Container, CacheOption } from '@modern-js/runtime/server';
154+
import type { Container, CacheOption } from '@modern-js/server-runtime';
155155

156156
class RedisContainer implements Container {
157157
redis = new Redis();
@@ -206,4 +206,4 @@ export const cacheOption: CacheOption = {
206206
| hit | 缓存命中,返回缓存内容 |
207207
| stale | 缓存命中,但数据陈旧,返回缓存内容的同时做重新渲染 |
208208
| expired | 缓存命中,重新渲染后返回渲染结果 |
209-
| miss | 缓存未命中 |
209+
| miss | 缓存未命中 |

0 commit comments

Comments
 (0)