Skip to content

Commit

Permalink
Merge branch 'release/next' into feat/support_first_chunk_cache
Browse files Browse the repository at this point in the history
  • Loading branch information
answershuto committed Oct 27, 2023
2 parents 92bb2da + 1e1b543 commit c0cf308
Show file tree
Hide file tree
Showing 15 changed files with 6,139 additions and 6,137 deletions.
5 changes: 0 additions & 5 deletions .changeset/early-rings-develop.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/empty-islands-unite.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/sixty-olives-shake.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/swift-cobras-shop.md

This file was deleted.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,5 +68,5 @@
"lint-staged": {
"*.{js,jsx,ts,tsx}": "eslint --cache --fix"
},
"packageManager": "pnpm@7.29.1"
"packageManager": "pnpm@8.9.2"
}
7 changes: 7 additions & 0 deletions packages/ice/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Changelog

## 3.3.5

### Patch Changes

- d72753e2: fix: do not prebundle node built-in module
- 3896cbea: feat: support default document

## 3.3.4

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/ice/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ice/app",
"version": "3.3.4",
"version": "3.3.5",
"description": "provide scripts and configuration used by web framework ice",
"type": "module",
"main": "./esm/index.js",
Expand Down
4 changes: 2 additions & 2 deletions packages/plugin-i18n/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@
"webpack-dev-server": "^4.13.2"
},
"peerDependencies": {
"@ice/app": "^3.3.4",
"@ice/runtime": "^1.3.1"
"@ice/app": "^3.3.5",
"@ice/runtime": "^1.3.2"
},
"publishConfig": {
"access": "public"
Expand Down
7 changes: 7 additions & 0 deletions packages/plugin-rax-compat/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Changelog

## 0.2.9

### Patch Changes

- 4816afb5: support legacy option for legacy rax compat
- 042b49b1: refactor: remove cloneDeep for performance

## 0.2.8

### Patch Changes
Expand Down
4 changes: 2 additions & 2 deletions packages/plugin-rax-compat/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ice/plugin-rax-compat",
"version": "0.2.8",
"version": "0.2.9",
"description": "Provide rax compat support for ice.js",
"license": "MIT",
"type": "module",
Expand Down Expand Up @@ -30,7 +30,7 @@
"stylesheet-loader": "^0.9.1"
},
"devDependencies": {
"@ice/app": "^3.3.4",
"@ice/app": "^3.3.5",
"@types/lodash-es": "^4.17.7",
"webpack": "^5.88.0"
},
Expand Down
6 changes: 6 additions & 0 deletions packages/runtime/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# @ice/runtime

## 1.3.2

### Patch Changes

- 899c4740: feat: support options when call document dataLoader

## 1.3.1

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/runtime/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ice/runtime",
"version": "1.3.1",
"version": "1.3.2",
"description": "Runtime module for ice.js",
"type": "module",
"types": "./esm/index.d.ts",
Expand Down
7 changes: 4 additions & 3 deletions packages/runtime/src/runServerApp.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ import type {
DocumentComponent,
RuntimeModules,
AppData,
ServerAppRouterProps, DataLoaderConfig,
ServerAppRouterProps,
DocumentDataLoaderConfig,
} from './types.js';
import Runtime from './runtime.js';
import { AppContextProvider } from './AppContext.js';
Expand All @@ -38,7 +39,7 @@ interface RenderOptions {
assetsManifest: AssetsManifest;
createRoutes: (options: Pick<RouteLoaderOptions, 'requestContext' | 'renderMode'>) => RouteItem[];
runtimeModules: RuntimeModules;
documentDataLoader?: DataLoaderConfig;
documentDataLoader?: DocumentDataLoaderConfig;
Document?: DocumentComponent;
documentOnly?: boolean;
renderMode?: RenderMode;
Expand Down Expand Up @@ -270,7 +271,7 @@ async function doRender(serverContext: ServerContext, renderOptions: RenderOptio
if (renderOptions.documentDataLoader) {
const { loader } = renderOptions.documentDataLoader;
if (isFunction(loader)) {
documentData = await loader(requestContext);
documentData = await loader(requestContext, { documentOnly });
// @TODO: document should have it's own context, not shared with app.
appContext.documentData = documentData;
} else {
Expand Down
9 changes: 9 additions & 0 deletions packages/runtime/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,15 @@ export interface DataLoaderConfig {
options?: DataLoaderOptions;
}

interface DocumentLoaderOptions {
documentOnly?: boolean;
}
export type DocumentDataLoader = (ctx: RequestContext, options: DocumentLoaderOptions) => DataLoaderResult;

export interface DocumentDataLoaderConfig {
loader: DocumentDataLoader;
}

export interface LoadersData {
[routeId: string]: LoaderData;
}
Expand Down
Loading

0 comments on commit c0cf308

Please sign in to comment.