diff --git a/.changeset/popular-shirts-explain.md b/.changeset/popular-shirts-explain.md new file mode 100644 index 0000000000..27d3ac3c82 --- /dev/null +++ b/.changeset/popular-shirts-explain.md @@ -0,0 +1,5 @@ +--- +'@ice/runtime': patch +--- + +chore: remove switch of cache first chunk diff --git a/examples/with-first-chunk-cache-ssr/src/app.tsx b/examples/with-first-chunk-cache-ssr/src/app.tsx index dc7977c9df..1ceb78f306 100644 --- a/examples/with-first-chunk-cache-ssr/src/app.tsx +++ b/examples/with-first-chunk-cache-ssr/src/app.tsx @@ -4,7 +4,4 @@ export default defineAppConfig({ app: { rootId: 'app', }, - cache: { - firstChunk: true, - }, }); diff --git a/examples/with-first-chunk-cache-ssr/src/document.tsx b/examples/with-first-chunk-cache-ssr/src/document.tsx index 195d21a7f1..0df14e14df 100644 --- a/examples/with-first-chunk-cache-ssr/src/document.tsx +++ b/examples/with-first-chunk-cache-ssr/src/document.tsx @@ -1,4 +1,4 @@ -import { Meta, Title, Links, Main, Scripts } from 'ice'; +import { Meta, Title, Links, Main, Scripts, FirstChunkCache } from 'ice'; function Document() { return ( @@ -13,6 +13,7 @@ function Document() {
+ diff --git a/packages/ice/src/plugins/web/index.ts b/packages/ice/src/plugins/web/index.ts index 9c73fddf29..4f2c090a1e 100644 --- a/packages/ice/src/plugins/web/index.ts +++ b/packages/ice/src/plugins/web/index.ts @@ -15,6 +15,7 @@ const plugin: Plugin = () => ({ 'Title', 'Links', 'Scripts', + 'FirstChunkCache', 'Data', 'Main', 'usePageAssets', @@ -24,6 +25,7 @@ const plugin: Plugin = () => ({ 'TitleType', 'LinksType', 'ScriptsType', + 'FirstChunkCacheType', 'DataType', 'MainType', ], diff --git a/packages/runtime/src/Document.tsx b/packages/runtime/src/Document.tsx index 06ef31f164..67fb4eefd6 100644 --- a/packages/runtime/src/Document.tsx +++ b/packages/runtime/src/Document.tsx @@ -208,14 +208,9 @@ export const Main: MainType = (props: React.HTMLAttributes) => { const { appConfig } = useAppContext(); return ( - <> -
- {main} -
- { - appConfig.cache?.firstChunk && - } - +
+ {main} +
); }; diff --git a/packages/runtime/src/index.ts b/packages/runtime/src/index.ts index f5ad7663c9..ad0b5c0029 100644 --- a/packages/runtime/src/index.ts +++ b/packages/runtime/src/index.ts @@ -31,6 +31,7 @@ import { Title, Links, Scripts, + FirstChunkCache, Main, Data, usePageAssets, @@ -112,6 +113,7 @@ export { Title, Links, Scripts, + FirstChunkCache, Data, Main, usePageAssets, diff --git a/packages/runtime/src/types.ts b/packages/runtime/src/types.ts index e5be66caf1..fdf1ce211b 100644 --- a/packages/runtime/src/types.ts +++ b/packages/runtime/src/types.ts @@ -67,9 +67,6 @@ export interface AppConfig { basename?: string; initialEntries?: InitialEntry[]; }; - cache?: { - firstChunk?: boolean; - }; } export interface RoutesConfig {