-
Notifications
You must be signed in to change notification settings - Fork 30.3k
feat: Replace InnerStorage with the generated TaskStorage struct #88355
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: 01-09-task-storage-macro-infrastructure
Are you sure you want to change the base?
feat: Replace InnerStorage with the generated TaskStorage struct #88355
Conversation
|
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
|
Allow CI Workflow Run
Note: this should only be enabled once the PR is ready to go and can only be enabled by a maintainer |
1 similar comment
|
Allow CI Workflow Run
Note: this should only be enabled once the PR is ready to go and can only be enabled by a maintainer |
Stats from current PR🔴 1 regression
📊 All Metrics📖 Metrics GlossaryDev Server Metrics:
Build Metrics:
Change Thresholds:
⚡ Dev Server
📦 Dev Server (Webpack) (Legacy)📦 Dev Server (Webpack)
⚡ Production Builds
📦 Production Builds (Webpack) (Legacy)📦 Production Builds (Webpack)
📦 Bundle SizesBundle Sizes⚡ TurbopackClient Main Bundles: **431 kB** → **431 kB** ✅ -10 B82 files with content-based hashes (individual files not comparable between builds) Server Middleware
Build DetailsBuild Manifests
📦 WebpackClient Main Bundles
Polyfills
Pages
Server Edge SSR
Middleware
Build DetailsBuild Manifests
Build Cache
🔄 Shared (bundler-independent)Runtimes
📝 Changed Files (5 files)Files with changes:
View diffspages-turbo...ntime.dev.js@@ -7,8 +7,8 @@ Read more: https://nextjs.org/docs/messages/no-document-import-in-page`),"__NEXT
Keys that need to be moved: ${invalidKeys.join(", ")}.
Read more: https://nextjs.org/docs/messages/${docsPathname}`};function checkRedirectValues(redirect,req,method){let{destination,permanent,statusCode,basePath}=redirect,errors=[],hasStatusCode=void 0!==statusCode,hasPermanent=void 0!==permanent;hasPermanent&&hasStatusCode?errors.push("`permanent` and `statusCode` can not both be provided"):hasPermanent&&"boolean"!=typeof permanent?errors.push("`permanent` must be `true` or `false`"):hasStatusCode&&!allowedStatusCodes.has(statusCode)&&errors.push(`\`statusCode\` must undefined or one of ${[...allowedStatusCodes].join(", ")}`);let destinationType=typeof destination;"string"!==destinationType&&errors.push(`\`destination\` should be string but received ${destinationType}`);let basePathType=typeof basePath;if("undefined"!==basePathType&&"boolean"!==basePathType&&errors.push(`\`basePath\` should be undefined or a false, received ${basePathType}`),errors.length>0)throw Object.defineProperty(Error(`Invalid redirect object returned from ${method} for ${req.url}
-`+errors.join(" and ")+"\nSee more info here: https://nextjs.org/docs/messages/invalid-redirect-gssp"),"__NEXT_ERROR_CODE",{value:"E185",enumerable:!1,configurable:!0})}async function renderToHTMLImpl(req,res,pathname,query,renderOpts,extra,sharedContext,renderContext){let previewData,props,isPreview;(0,api_utils.setLazyProp)({req:req},"cookies",getCookieParser(req.headers));let metadata={};if(metadata.assetQueryString=renderOpts.dev&&renderOpts.assetQueryString||"",renderOpts.dev&&!metadata.assetQueryString){let userAgent=(req.headers["user-agent"]||"").toLowerCase();userAgent.includes("safari")&&!userAgent.includes("chrome")&&(metadata.assetQueryString=`?ts=${Date.now()}`)}sharedContext.deploymentId&&(metadata.assetQueryString+=`${metadata.assetQueryString?"&":"?"}dpl=${sharedContext.deploymentId}`),query=Object.assign({},query);let{err,dev=!1,pageConfig={},buildManifest,reactLoadableManifest,ErrorDebug,getStaticProps,getStaticPaths,getServerSideProps,isNextDataRequest,params,previewProps,basePath,images,runtime:globalRuntime,isExperimentalCompile,expireTime}=renderOpts,{App}=extra,assetQueryString=metadata.assetQueryString,Document=extra.Document,Component=renderOpts.Component,isFallback=renderContext.isFallback??!1,notFoundSrcPage=renderContext.developmentNotFoundSourcePage;var query1=query;for(let name of INTERNAL_QUERY_NAMES)delete query1[name];let isSSG=!!getStaticProps,isBuildTimeSSG=isSSG&&renderOpts.nextExport,defaultAppGetInitialProps=App.getInitialProps===App.origGetInitialProps,hasPageGetInitialProps=!!(null==Component?void 0:Component.getInitialProps),hasPageScripts=null==Component?void 0:Component.unstable_scriptLoader,pageIsDynamic=isDynamicRoute(pathname),defaultErrorGetInitialProps="/_error"===pathname&&Component.getInitialProps===Component.origGetInitialProps;renderOpts.nextExport&&hasPageGetInitialProps&&!defaultErrorGetInitialProps&&warn(`Detected getInitialProps on page '${pathname}' while running export. It's recommended to use getStaticProps which has a more correct behavior for static exporting.
-Read more: https://nextjs.org/docs/messages/get-initial-props-export`);let isAutoExport=!hasPageGetInitialProps&&defaultAppGetInitialProps&&!isSSG&&!getServerSideProps;if(isAutoExport&&!dev&&isExperimentalCompile&&(res.setHeader("Cache-Control",function({revalidate,expire}){let swrHeader="number"==typeof revalidate&&void 0!==expire&&revalidate<expire?`, stale-while-revalidate=${expire-revalidate}`:"";return 0===revalidate?"private, no-cache, no-store, max-age=0, must-revalidate":"number"==typeof revalidate?`s-maxage=${revalidate}${swrHeader}`:`s-maxage=${constants.CACHE_ONE_YEAR}${swrHeader}`}({revalidate:!1,expire:expireTime})),isAutoExport=!1),hasPageGetInitialProps&&isSSG)throw Object.defineProperty(Error(constants.SSG_GET_INITIAL_PROPS_CONFLICT+` ${pathname}`),"__NEXT_ERROR_CODE",{value:"E262",enumerable:!1,configurable:!0});if(hasPageGetInitialProps&&getServerSideProps)throw Object.defineProperty(Error(constants.SERVER_PROPS_GET_INIT_PROPS_CONFLICT+` ${pathname}`),"__NEXT_ERROR_CODE",{value:"E262",enumerable:!1,configurable:!0});if(getServerSideProps&&isSSG)throw Object.defineProperty(Error(constants.SERVER_PROPS_SSG_CONFLICT+` ${pathname}`),"__NEXT_ERROR_CODE",{value:"E262",enumerable:!1,configurable:!0});if(getServerSideProps&&"export"===renderOpts.nextConfigOutput)throw Object.defineProperty(Error('getServerSideProps cannot be used with "output: export". See more info here: https://nextjs.org/docs/advanced-features/static-html-export'),"__NEXT_ERROR_CODE",{value:"E369",enumerable:!1,configurable:!0});if(getStaticPaths&&!pageIsDynamic)throw Object.defineProperty(Error(`getStaticPaths is only allowed for dynamic SSG pages and was found on '${pathname}'.
+`+errors.join(" and ")+"\nSee more info here: https://nextjs.org/docs/messages/invalid-redirect-gssp"),"__NEXT_ERROR_CODE",{value:"E185",enumerable:!1,configurable:!0})}async function renderToHTMLImpl(req,res,pathname,query,renderOpts,extra,sharedContext,renderContext){let previewData,props,isPreview;(0,api_utils.setLazyProp)({req:req},"cookies",getCookieParser(req.headers));let metadata={};if(metadata.assetQueryString=renderOpts.dev&&renderOpts.assetQueryString||"",renderOpts.dev&&!metadata.assetQueryString){let userAgent=(req.headers["user-agent"]||"").toLowerCase();userAgent.includes("safari")&&!userAgent.includes("chrome")&&(metadata.assetQueryString=`?ts=${Date.now()}`)}sharedContext.deploymentId&&(metadata.assetQueryString+=`${metadata.assetQueryString?"&":"?"}dpl=${sharedContext.deploymentId}`),query=Object.assign({},query);let{err,dev=!1,pageConfig={},buildManifest,reactLoadableManifest,ErrorDebug,getStaticProps,getStaticPaths,getServerSideProps,isNextDataRequest,params,previewProps,basePath,images,runtime:globalRuntime,isExperimentalCompile,expireTime}=renderOpts,{App}=extra,assetQueryString=metadata.assetQueryString,Document=extra.Document,Component=renderOpts.Component,isFallback=renderContext.isFallback??!1,notFoundSrcPage=renderContext.developmentNotFoundSourcePage;var cdnCacheControlHeader,query1=query;for(let name of INTERNAL_QUERY_NAMES)delete query1[name];let isSSG=!!getStaticProps,isBuildTimeSSG=isSSG&&renderOpts.nextExport,defaultAppGetInitialProps=App.getInitialProps===App.origGetInitialProps,hasPageGetInitialProps=!!(null==Component?void 0:Component.getInitialProps),hasPageScripts=null==Component?void 0:Component.unstable_scriptLoader,pageIsDynamic=isDynamicRoute(pathname),defaultErrorGetInitialProps="/_error"===pathname&&Component.getInitialProps===Component.origGetInitialProps;renderOpts.nextExport&&hasPageGetInitialProps&&!defaultErrorGetInitialProps&&warn(`Detected getInitialProps on page '${pathname}' while running export. It's recommended to use getStaticProps which has a more correct behavior for static exporting.
+Read more: https://nextjs.org/docs/messages/get-initial-props-export`);let isAutoExport=!hasPageGetInitialProps&&defaultAppGetInitialProps&&!isSSG&&!getServerSideProps;if(isAutoExport&&!dev&&isExperimentalCompile){let cacheHeaders;cdnCacheControlHeader=renderOpts.experimental.cdnCacheControlHeader,cacheHeaders=function({revalidate,expire}){let swrHeader="number"==typeof revalidate&&void 0!==expire&&revalidate<expire?`, stale-while-revalidate=${expire-revalidate}`:"";if(0===revalidate)return{"Cache-Control":"private, no-cache, no-store, max-age=0, must-revalidate"};let maxAge="number"==typeof revalidate?revalidate:constants.CACHE_ONE_YEAR,cdnCacheControl=`max-age=${maxAge}${swrHeader}`;return{"Cache-Control":`s-maxage=${maxAge}`,cdnCacheControl:cdnCacheControl}}({revalidate:!1,expire:expireTime}),res.setHeader("Cache-Control",cacheHeaders["Cache-Control"]),cacheHeaders.cdnCacheControl&&res.setHeader(cdnCacheControlHeader??"CDN-Cache-Control",cacheHeaders.cdnCacheControl),isAutoExport=!1}if(hasPageGetInitialProps&&isSSG)throw Object.defineProperty(Error(constants.SSG_GET_INITIAL_PROPS_CONFLICT+` ${pathname}`),"__NEXT_ERROR_CODE",{value:"E262",enumerable:!1,configurable:!0});if(hasPageGetInitialProps&&getServerSideProps)throw Object.defineProperty(Error(constants.SERVER_PROPS_GET_INIT_PROPS_CONFLICT+` ${pathname}`),"__NEXT_ERROR_CODE",{value:"E262",enumerable:!1,configurable:!0});if(getServerSideProps&&isSSG)throw Object.defineProperty(Error(constants.SERVER_PROPS_SSG_CONFLICT+` ${pathname}`),"__NEXT_ERROR_CODE",{value:"E262",enumerable:!1,configurable:!0});if(getServerSideProps&&"export"===renderOpts.nextConfigOutput)throw Object.defineProperty(Error('getServerSideProps cannot be used with "output: export". See more info here: https://nextjs.org/docs/advanced-features/static-html-export'),"__NEXT_ERROR_CODE",{value:"E369",enumerable:!1,configurable:!0});if(getStaticPaths&&!pageIsDynamic)throw Object.defineProperty(Error(`getStaticPaths is only allowed for dynamic SSG pages and was found on '${pathname}'.
Read more: https://nextjs.org/docs/messages/non-dynamic-getstaticpaths-usage`),"__NEXT_ERROR_CODE",{value:"E187",enumerable:!1,configurable:!0});if(getStaticPaths&&!isSSG)throw Object.defineProperty(Error(`getStaticPaths was added without a getStaticProps in ${pathname}. Without getStaticProps, getStaticPaths does nothing`),"__NEXT_ERROR_CODE",{value:"E447",enumerable:!1,configurable:!0});if(isSSG&&pageIsDynamic&&!getStaticPaths)throw Object.defineProperty(Error(`getStaticPaths is required for dynamic SSG pages and is missing for '${pathname}'.
Read more: https://nextjs.org/docs/messages/invalid-getstaticpaths-value`),"__NEXT_ERROR_CODE",{value:"E255",enumerable:!1,configurable:!0});let asPath=renderOpts.resolvedAsPath||req.url;if(dev){let{isValidElementType}=__webpack_require__("./dist/compiled/react-is/index.js");if(!isValidElementType(Component))throw Object.defineProperty(Error(`The default export is not a React Component in page: "${pathname}"`),"__NEXT_ERROR_CODE",{value:"E286",enumerable:!1,configurable:!0});if(!isValidElementType(App))throw Object.defineProperty(Error('The default export is not a React Component in page: "/_app"'),"__NEXT_ERROR_CODE",{value:"E464",enumerable:!1,configurable:!0});if(!isValidElementType(Document))throw Object.defineProperty(Error('The default export is not a React Component in page: "/_document"'),"__NEXT_ERROR_CODE",{value:"E511",enumerable:!1,configurable:!0});if((isAutoExport||isFallback)&&(query={},asPath=`${pathname}${req.url.endsWith("/")&&"/"!==pathname&&!pageIsDynamic?"/":""}`,req.url=pathname),"/404"===pathname&&(hasPageGetInitialProps||getServerSideProps))throw Object.defineProperty(Error(`\`pages/404\` ${constants.STATIC_STATUS_PAGE_GET_INITIAL_PROPS_ERROR}`),"__NEXT_ERROR_CODE",{value:"E134",enumerable:!1,configurable:!0});if(STATIC_STATUS_PAGES.includes(pathname)&&(hasPageGetInitialProps||getServerSideProps))throw Object.defineProperty(Error(`\`pages${pathname}\` ${constants.STATIC_STATUS_PAGE_GET_INITIAL_PROPS_ERROR}`),"__NEXT_ERROR_CODE",{value:"E125",enumerable:!1,configurable:!0});(null==renderOpts?void 0:renderOpts.setIsrStatus)&&renderOpts.setIsrStatus(asPath,isSSG||isAutoExport)}for(let methodName of["getStaticProps","getServerSideProps","getStaticPaths"])if(null==Component?void 0:Component[methodName])throw Object.defineProperty(Error(`page ${pathname} ${methodName} ${constants.GSSP_COMPONENT_MEMBER_ERROR}`),"__NEXT_ERROR_CODE",{value:"E417",enumerable:!1,configurable:!0});await loadable_shared_runtime.preloadAll(),(isSSG||getServerSideProps)&&!isFallback&&previewProps&&(isPreview=!1!==(previewData=render_tryGetPreviewData(req,res,previewProps,!!renderOpts.multiZoneDraftMode)));let routerIsReady=!!(getServerSideProps||hasPageGetInitialProps||!defaultAppGetInitialProps&&!isSSG||isExperimentalCompile),router=new ServerRouter(pathname,query,asPath,{isFallback:isFallback},routerIsReady,basePath,renderOpts.locale,renderOpts.locales,renderOpts.defaultLocale,renderOpts.domainLocales,isPreview,getRequestMeta(req,"isLocaleDomain")),appRouter={back(){router.back()},forward(){router.forward()},refresh(){router.reload()},hmrRefresh(){},push(href,{scroll}={}){router.push(href,void 0,{scroll})},replace(href,{scroll}={}){router.replace(href,void 0,{scroll})},prefetch(href){router.prefetch(href)}},scriptLoader={},jsxStyleRegistry=(0,external_styled_jsx_namespaceObject.createStyleRegistry)(),head=[(0,jsx_runtime_namespaceObject.jsx)("meta",{charSet:"utf-8"},"charset"),(0,jsx_runtime_namespaceObject.jsx)("meta",{name:"viewport",content:"width=device-width"},"viewport")],reactLoadableModules=[],initialScripts={};hasPageScripts&&(initialScripts.beforeInteractive=[].concat(hasPageScripts()).filter(script=>"beforeInteractive"===script.props.strategy).map(script=>script.props));let csp=req.headers["content-security-policy"]||req.headers["content-security-policy-report-only"],nonce="string"==typeof csp?function(cspHeaderValue){var _directive_split_slice_map_find;let directives=cspHeaderValue.split(";").map(directive=>directive.trim()),directive=directives.find(dir=>dir.startsWith("script-src"))||directives.find(dir=>dir.startsWith("default-src"));if(!directive)return;let nonce=null==(_directive_split_slice_map_find=directive.split(" ").slice(1).map(source=>source.trim()).find(source=>source.startsWith("'nonce-")&&source.length>8&&source.endsWith("'")))?void 0:_directive_split_slice_map_find.slice(7,-1);if(nonce){if(ESCAPE_REGEX.test(nonce))throw Object.defineProperty(Error("Nonce value from Content-Security-Policy contained HTML escape characters.\nLearn more: https://nextjs.org/docs/messages/nonce-contained-invalid-characters"),"__NEXT_ERROR_CODE",{value:"E440",enumerable:!1,configurable:!0});return nonce}}(csp):void 0,AppContainer=({children})=>{var router1;return(0,jsx_runtime_namespaceObject.jsx)(AppRouterContext.Provider,{value:appRouter,children:(0,jsx_runtime_namespaceObject.jsx)(SearchParamsContext.Provider,{value:(router1=router).isReady&&router1.query?new URL(router1.asPath,"http://n").searchParams:new URLSearchParams,children:(0,jsx_runtime_namespaceObject.jsx)(PathnameContextProviderAdapter,{router:router,isAutoExport:isAutoExport,children:(0,jsx_runtime_namespaceObject.jsx)(PathParamsContext.Provider,{value:function(router){if(!router.isReady||!router.query)return null;let pathParams={};for(let key of Object.keys(getRouteRegex(router.pathname).groups))pathParams[key]=router.query[key];return pathParams}(router),children:(0,jsx_runtime_namespaceObject.jsx)(RouterContext.Provider,{value:router,children:(0,jsx_runtime_namespaceObject.jsx)(HeadManagerContext.Provider,{value:{updateHead:state=>{head=state},updateScripts:scripts=>{scriptLoader=scripts},scripts:initialScripts,mountedInstances:new Set,nonce},children:(0,jsx_runtime_namespaceObject.jsx)(LoadableContext.Provider,{value:moduleName=>reactLoadableModules.push(moduleName),children:(0,jsx_runtime_namespaceObject.jsx)(external_styled_jsx_namespaceObject.StyleRegistry,{registry:jsxStyleRegistry,children:(0,jsx_runtime_namespaceObject.jsx)(ImageConfigContext.Provider,{value:images,children:children})})})})})})})})})},Noop=()=>null,AppContainerWithIsomorphicFiberStructure=({children})=>(0,jsx_runtime_namespaceObject.jsxs)(jsx_runtime_namespaceObject.Fragment,{children:[(0,jsx_runtime_namespaceObject.jsx)(Noop,{}),(0,jsx_runtime_namespaceObject.jsx)(AppContainer,{children:(0,jsx_runtime_namespaceObject.jsxs)(jsx_runtime_namespaceObject.Fragment,{children:[children,(0,jsx_runtime_namespaceObject.jsx)(Noop,{})]})})]}),ctx={err,req:isAutoExport?void 0:req,res:isAutoExport?void 0:res,pathname,query,asPath,locale:renderOpts.locale,locales:renderOpts.locales,defaultLocale:renderOpts.defaultLocale,AppTree:props=>(0,jsx_runtime_namespaceObject.jsx)(AppContainerWithIsomorphicFiberStructure,{children:renderPageTree(App,Component,{...props,router})}),defaultGetInitialProps:async(docCtx,options={})=>{let{html,head:renderPageHead}=await docCtx.renderPage({enhanceApp:AppComp=>props=>(0,jsx_runtime_namespaceObject.jsx)(AppComp,{...props})}),styles=jsxStyleRegistry.styles({nonce:options.nonce||nonce});return jsxStyleRegistry.flush(),{html,head:renderPageHead,styles}}},nextExport=!isSSG&&(renderOpts.nextExport||dev&&(isAutoExport||isFallback));if(props=await loadGetInitialProps(App,{AppTree:ctx.AppTree,Component,router,ctx}),(isSSG||getServerSideProps)&&isPreview&&(props.__N_PREVIEW=!0),isSSG&&(props.__N_SSG=!0),isSSG&&!isFallback){let data,revalidate;try{data=await (0,tracer_.getTracer)().trace(trace_constants.RenderSpan.getStaticProps,{spanName:`getStaticProps ${pathname}`,attributes:{"next.route":pathname}},()=>getStaticProps({...pageIsDynamic?{params}:void 0,...isPreview?{draftMode:!0,preview:!0,previewData:previewData}:void 0,locales:[...renderOpts.locales??[]],locale:renderOpts.locale,defaultLocale:renderOpts.defaultLocale,revalidateReason:renderOpts.isOnDemandRevalidate?"on-demand":isBuildTimeSSG?"build":"stale"}))}catch(staticPropsError){throw staticPropsError&&"ENOENT"===staticPropsError.code&&delete staticPropsError.code,staticPropsError}if(null==data)throw Object.defineProperty(Error(constants.GSP_NO_RETURNED_VALUE),"__NEXT_ERROR_CODE",{value:"E394",enumerable:!1,configurable:!0});let invalidKeys=Object.keys(data).filter(key=>"revalidate"!==key&&"props"!==key&&"redirect"!==key&&"notFound"!==key);if(invalidKeys.includes("unstable_revalidate"))throw Object.defineProperty(Error(constants.UNSTABLE_REVALIDATE_RENAME_ERROR),"__NEXT_ERROR_CODE",{value:"E394",enumerable:!1,configurable:!0});if(invalidKeys.length)throw Object.defineProperty(Error(invalidKeysMsg("getStaticProps",invalidKeys)),"__NEXT_ERROR_CODE",{value:"E394",enumerable:!1,configurable:!0});if(void 0!==data.notFound&&void 0!==data.redirect)throw Object.defineProperty(Error(`\`redirect\` and \`notFound\` can not both be returned from ${isSSG?"getStaticProps":"getServerSideProps"} at the same time. Page: ${pathname}
See more info here: https://nextjs.org/docs/messages/gssp-mixed-not-found-redirect`),"__NEXT_ERROR_CODE",{value:"E454",enumerable:!1,configurable:!0});if("notFound"in data&&data.notFound){if("/404"===pathname)throw Object.defineProperty(Error('The /404 page can not return notFound in "getStaticProps", please remove it to continue!'),"__NEXT_ERROR_CODE",{value:"E121",enumerable:!1,configurable:!0});metadata.isNotFound=!0}if("redirect"in data&&data.redirect&&"object"==typeof data.redirect){if(checkRedirectValues(data.redirect,req,"getStaticProps"),isBuildTimeSSG)throw Object.defineProperty(Error(`\`redirect\` can not be returned from getStaticProps during prerendering (${req.url})pages-turbo...time.prod.jsDiff too large to display pages.runtime.dev.js@@ -7,8 +7,8 @@ Read more: https://nextjs.org/docs/messages/no-document-import-in-page`),"__NEXT
Keys that need to be moved: ${invalidKeys.join(", ")}.
Read more: https://nextjs.org/docs/messages/${docsPathname}`};function checkRedirectValues(redirect,req,method){let{destination,permanent,statusCode,basePath}=redirect,errors=[],hasStatusCode=void 0!==statusCode,hasPermanent=void 0!==permanent;hasPermanent&&hasStatusCode?errors.push("`permanent` and `statusCode` can not both be provided"):hasPermanent&&"boolean"!=typeof permanent?errors.push("`permanent` must be `true` or `false`"):hasStatusCode&&!allowedStatusCodes.has(statusCode)&&errors.push(`\`statusCode\` must undefined or one of ${[...allowedStatusCodes].join(", ")}`);let destinationType=typeof destination;"string"!==destinationType&&errors.push(`\`destination\` should be string but received ${destinationType}`);let basePathType=typeof basePath;if("undefined"!==basePathType&&"boolean"!==basePathType&&errors.push(`\`basePath\` should be undefined or a false, received ${basePathType}`),errors.length>0)throw Object.defineProperty(Error(`Invalid redirect object returned from ${method} for ${req.url}
-`+errors.join(" and ")+"\nSee more info here: https://nextjs.org/docs/messages/invalid-redirect-gssp"),"__NEXT_ERROR_CODE",{value:"E185",enumerable:!1,configurable:!0})}async function renderToHTMLImpl(req,res,pathname,query,renderOpts,extra,sharedContext,renderContext){let previewData,props,isPreview;(0,api_utils.setLazyProp)({req:req},"cookies",getCookieParser(req.headers));let metadata={};if(metadata.assetQueryString=renderOpts.dev&&renderOpts.assetQueryString||"",renderOpts.dev&&!metadata.assetQueryString){let userAgent=(req.headers["user-agent"]||"").toLowerCase();userAgent.includes("safari")&&!userAgent.includes("chrome")&&(metadata.assetQueryString=`?ts=${Date.now()}`)}sharedContext.deploymentId&&(metadata.assetQueryString+=`${metadata.assetQueryString?"&":"?"}dpl=${sharedContext.deploymentId}`),query=Object.assign({},query);let{err,dev=!1,pageConfig={},buildManifest,reactLoadableManifest,ErrorDebug,getStaticProps,getStaticPaths,getServerSideProps,isNextDataRequest,params,previewProps,basePath,images,runtime:globalRuntime,isExperimentalCompile,expireTime}=renderOpts,{App}=extra,assetQueryString=metadata.assetQueryString,Document=extra.Document,Component=renderOpts.Component,isFallback=renderContext.isFallback??!1,notFoundSrcPage=renderContext.developmentNotFoundSourcePage;var query1=query;for(let name of INTERNAL_QUERY_NAMES)delete query1[name];let isSSG=!!getStaticProps,isBuildTimeSSG=isSSG&&renderOpts.nextExport,defaultAppGetInitialProps=App.getInitialProps===App.origGetInitialProps,hasPageGetInitialProps=!!(null==Component?void 0:Component.getInitialProps),hasPageScripts=null==Component?void 0:Component.unstable_scriptLoader,pageIsDynamic=isDynamicRoute(pathname),defaultErrorGetInitialProps="/_error"===pathname&&Component.getInitialProps===Component.origGetInitialProps;renderOpts.nextExport&&hasPageGetInitialProps&&!defaultErrorGetInitialProps&&warn(`Detected getInitialProps on page '${pathname}' while running export. It's recommended to use getStaticProps which has a more correct behavior for static exporting.
-Read more: https://nextjs.org/docs/messages/get-initial-props-export`);let isAutoExport=!hasPageGetInitialProps&&defaultAppGetInitialProps&&!isSSG&&!getServerSideProps;if(isAutoExport&&!dev&&isExperimentalCompile&&(res.setHeader("Cache-Control",function({revalidate,expire}){let swrHeader="number"==typeof revalidate&&void 0!==expire&&revalidate<expire?`, stale-while-revalidate=${expire-revalidate}`:"";return 0===revalidate?"private, no-cache, no-store, max-age=0, must-revalidate":"number"==typeof revalidate?`s-maxage=${revalidate}${swrHeader}`:`s-maxage=${constants.CACHE_ONE_YEAR}${swrHeader}`}({revalidate:!1,expire:expireTime})),isAutoExport=!1),hasPageGetInitialProps&&isSSG)throw Object.defineProperty(Error(constants.SSG_GET_INITIAL_PROPS_CONFLICT+` ${pathname}`),"__NEXT_ERROR_CODE",{value:"E262",enumerable:!1,configurable:!0});if(hasPageGetInitialProps&&getServerSideProps)throw Object.defineProperty(Error(constants.SERVER_PROPS_GET_INIT_PROPS_CONFLICT+` ${pathname}`),"__NEXT_ERROR_CODE",{value:"E262",enumerable:!1,configurable:!0});if(getServerSideProps&&isSSG)throw Object.defineProperty(Error(constants.SERVER_PROPS_SSG_CONFLICT+` ${pathname}`),"__NEXT_ERROR_CODE",{value:"E262",enumerable:!1,configurable:!0});if(getServerSideProps&&"export"===renderOpts.nextConfigOutput)throw Object.defineProperty(Error('getServerSideProps cannot be used with "output: export". See more info here: https://nextjs.org/docs/advanced-features/static-html-export'),"__NEXT_ERROR_CODE",{value:"E369",enumerable:!1,configurable:!0});if(getStaticPaths&&!pageIsDynamic)throw Object.defineProperty(Error(`getStaticPaths is only allowed for dynamic SSG pages and was found on '${pathname}'.
+`+errors.join(" and ")+"\nSee more info here: https://nextjs.org/docs/messages/invalid-redirect-gssp"),"__NEXT_ERROR_CODE",{value:"E185",enumerable:!1,configurable:!0})}async function renderToHTMLImpl(req,res,pathname,query,renderOpts,extra,sharedContext,renderContext){let previewData,props,isPreview;(0,api_utils.setLazyProp)({req:req},"cookies",getCookieParser(req.headers));let metadata={};if(metadata.assetQueryString=renderOpts.dev&&renderOpts.assetQueryString||"",renderOpts.dev&&!metadata.assetQueryString){let userAgent=(req.headers["user-agent"]||"").toLowerCase();userAgent.includes("safari")&&!userAgent.includes("chrome")&&(metadata.assetQueryString=`?ts=${Date.now()}`)}sharedContext.deploymentId&&(metadata.assetQueryString+=`${metadata.assetQueryString?"&":"?"}dpl=${sharedContext.deploymentId}`),query=Object.assign({},query);let{err,dev=!1,pageConfig={},buildManifest,reactLoadableManifest,ErrorDebug,getStaticProps,getStaticPaths,getServerSideProps,isNextDataRequest,params,previewProps,basePath,images,runtime:globalRuntime,isExperimentalCompile,expireTime}=renderOpts,{App}=extra,assetQueryString=metadata.assetQueryString,Document=extra.Document,Component=renderOpts.Component,isFallback=renderContext.isFallback??!1,notFoundSrcPage=renderContext.developmentNotFoundSourcePage;var cdnCacheControlHeader,query1=query;for(let name of INTERNAL_QUERY_NAMES)delete query1[name];let isSSG=!!getStaticProps,isBuildTimeSSG=isSSG&&renderOpts.nextExport,defaultAppGetInitialProps=App.getInitialProps===App.origGetInitialProps,hasPageGetInitialProps=!!(null==Component?void 0:Component.getInitialProps),hasPageScripts=null==Component?void 0:Component.unstable_scriptLoader,pageIsDynamic=isDynamicRoute(pathname),defaultErrorGetInitialProps="/_error"===pathname&&Component.getInitialProps===Component.origGetInitialProps;renderOpts.nextExport&&hasPageGetInitialProps&&!defaultErrorGetInitialProps&&warn(`Detected getInitialProps on page '${pathname}' while running export. It's recommended to use getStaticProps which has a more correct behavior for static exporting.
+Read more: https://nextjs.org/docs/messages/get-initial-props-export`);let isAutoExport=!hasPageGetInitialProps&&defaultAppGetInitialProps&&!isSSG&&!getServerSideProps;if(isAutoExport&&!dev&&isExperimentalCompile){let cacheHeaders;cdnCacheControlHeader=renderOpts.experimental.cdnCacheControlHeader,cacheHeaders=function({revalidate,expire}){let swrHeader="number"==typeof revalidate&&void 0!==expire&&revalidate<expire?`, stale-while-revalidate=${expire-revalidate}`:"";if(0===revalidate)return{"Cache-Control":"private, no-cache, no-store, max-age=0, must-revalidate"};let maxAge="number"==typeof revalidate?revalidate:constants.CACHE_ONE_YEAR,cdnCacheControl=`max-age=${maxAge}${swrHeader}`;return{"Cache-Control":`s-maxage=${maxAge}`,cdnCacheControl:cdnCacheControl}}({revalidate:!1,expire:expireTime}),res.setHeader("Cache-Control",cacheHeaders["Cache-Control"]),cacheHeaders.cdnCacheControl&&res.setHeader(cdnCacheControlHeader??"CDN-Cache-Control",cacheHeaders.cdnCacheControl),isAutoExport=!1}if(hasPageGetInitialProps&&isSSG)throw Object.defineProperty(Error(constants.SSG_GET_INITIAL_PROPS_CONFLICT+` ${pathname}`),"__NEXT_ERROR_CODE",{value:"E262",enumerable:!1,configurable:!0});if(hasPageGetInitialProps&&getServerSideProps)throw Object.defineProperty(Error(constants.SERVER_PROPS_GET_INIT_PROPS_CONFLICT+` ${pathname}`),"__NEXT_ERROR_CODE",{value:"E262",enumerable:!1,configurable:!0});if(getServerSideProps&&isSSG)throw Object.defineProperty(Error(constants.SERVER_PROPS_SSG_CONFLICT+` ${pathname}`),"__NEXT_ERROR_CODE",{value:"E262",enumerable:!1,configurable:!0});if(getServerSideProps&&"export"===renderOpts.nextConfigOutput)throw Object.defineProperty(Error('getServerSideProps cannot be used with "output: export". See more info here: https://nextjs.org/docs/advanced-features/static-html-export'),"__NEXT_ERROR_CODE",{value:"E369",enumerable:!1,configurable:!0});if(getStaticPaths&&!pageIsDynamic)throw Object.defineProperty(Error(`getStaticPaths is only allowed for dynamic SSG pages and was found on '${pathname}'.
Read more: https://nextjs.org/docs/messages/non-dynamic-getstaticpaths-usage`),"__NEXT_ERROR_CODE",{value:"E187",enumerable:!1,configurable:!0});if(getStaticPaths&&!isSSG)throw Object.defineProperty(Error(`getStaticPaths was added without a getStaticProps in ${pathname}. Without getStaticProps, getStaticPaths does nothing`),"__NEXT_ERROR_CODE",{value:"E447",enumerable:!1,configurable:!0});if(isSSG&&pageIsDynamic&&!getStaticPaths)throw Object.defineProperty(Error(`getStaticPaths is required for dynamic SSG pages and is missing for '${pathname}'.
Read more: https://nextjs.org/docs/messages/invalid-getstaticpaths-value`),"__NEXT_ERROR_CODE",{value:"E255",enumerable:!1,configurable:!0});let asPath=renderOpts.resolvedAsPath||req.url;if(dev){let{isValidElementType}=__webpack_require__("./dist/compiled/react-is/index.js");if(!isValidElementType(Component))throw Object.defineProperty(Error(`The default export is not a React Component in page: "${pathname}"`),"__NEXT_ERROR_CODE",{value:"E286",enumerable:!1,configurable:!0});if(!isValidElementType(App))throw Object.defineProperty(Error('The default export is not a React Component in page: "/_app"'),"__NEXT_ERROR_CODE",{value:"E464",enumerable:!1,configurable:!0});if(!isValidElementType(Document))throw Object.defineProperty(Error('The default export is not a React Component in page: "/_document"'),"__NEXT_ERROR_CODE",{value:"E511",enumerable:!1,configurable:!0});if((isAutoExport||isFallback)&&(query={},asPath=`${pathname}${req.url.endsWith("/")&&"/"!==pathname&&!pageIsDynamic?"/":""}`,req.url=pathname),"/404"===pathname&&(hasPageGetInitialProps||getServerSideProps))throw Object.defineProperty(Error(`\`pages/404\` ${constants.STATIC_STATUS_PAGE_GET_INITIAL_PROPS_ERROR}`),"__NEXT_ERROR_CODE",{value:"E134",enumerable:!1,configurable:!0});if(STATIC_STATUS_PAGES.includes(pathname)&&(hasPageGetInitialProps||getServerSideProps))throw Object.defineProperty(Error(`\`pages${pathname}\` ${constants.STATIC_STATUS_PAGE_GET_INITIAL_PROPS_ERROR}`),"__NEXT_ERROR_CODE",{value:"E125",enumerable:!1,configurable:!0});(null==renderOpts?void 0:renderOpts.setIsrStatus)&&renderOpts.setIsrStatus(asPath,isSSG||isAutoExport)}for(let methodName of["getStaticProps","getServerSideProps","getStaticPaths"])if(null==Component?void 0:Component[methodName])throw Object.defineProperty(Error(`page ${pathname} ${methodName} ${constants.GSSP_COMPONENT_MEMBER_ERROR}`),"__NEXT_ERROR_CODE",{value:"E417",enumerable:!1,configurable:!0});await loadable_shared_runtime.preloadAll(),(isSSG||getServerSideProps)&&!isFallback&&previewProps&&(isPreview=!1!==(previewData=render_tryGetPreviewData(req,res,previewProps,!!renderOpts.multiZoneDraftMode)));let routerIsReady=!!(getServerSideProps||hasPageGetInitialProps||!defaultAppGetInitialProps&&!isSSG||isExperimentalCompile),router=new ServerRouter(pathname,query,asPath,{isFallback:isFallback},routerIsReady,basePath,renderOpts.locale,renderOpts.locales,renderOpts.defaultLocale,renderOpts.domainLocales,isPreview,getRequestMeta(req,"isLocaleDomain")),appRouter={back(){router.back()},forward(){router.forward()},refresh(){router.reload()},hmrRefresh(){},push(href,{scroll}={}){router.push(href,void 0,{scroll})},replace(href,{scroll}={}){router.replace(href,void 0,{scroll})},prefetch(href){router.prefetch(href)}},scriptLoader={},jsxStyleRegistry=(0,external_styled_jsx_namespaceObject.createStyleRegistry)(),head=[(0,jsx_runtime_namespaceObject.jsx)("meta",{charSet:"utf-8"},"charset"),(0,jsx_runtime_namespaceObject.jsx)("meta",{name:"viewport",content:"width=device-width"},"viewport")],reactLoadableModules=[],initialScripts={};hasPageScripts&&(initialScripts.beforeInteractive=[].concat(hasPageScripts()).filter(script=>"beforeInteractive"===script.props.strategy).map(script=>script.props));let csp=req.headers["content-security-policy"]||req.headers["content-security-policy-report-only"],nonce="string"==typeof csp?function(cspHeaderValue){var _directive_split_slice_map_find;let directives=cspHeaderValue.split(";").map(directive=>directive.trim()),directive=directives.find(dir=>dir.startsWith("script-src"))||directives.find(dir=>dir.startsWith("default-src"));if(!directive)return;let nonce=null==(_directive_split_slice_map_find=directive.split(" ").slice(1).map(source=>source.trim()).find(source=>source.startsWith("'nonce-")&&source.length>8&&source.endsWith("'")))?void 0:_directive_split_slice_map_find.slice(7,-1);if(nonce){if(ESCAPE_REGEX.test(nonce))throw Object.defineProperty(Error("Nonce value from Content-Security-Policy contained HTML escape characters.\nLearn more: https://nextjs.org/docs/messages/nonce-contained-invalid-characters"),"__NEXT_ERROR_CODE",{value:"E440",enumerable:!1,configurable:!0});return nonce}}(csp):void 0,AppContainer=({children})=>{var router1;return(0,jsx_runtime_namespaceObject.jsx)(AppRouterContext.Provider,{value:appRouter,children:(0,jsx_runtime_namespaceObject.jsx)(SearchParamsContext.Provider,{value:(router1=router).isReady&&router1.query?new URL(router1.asPath,"http://n").searchParams:new URLSearchParams,children:(0,jsx_runtime_namespaceObject.jsx)(PathnameContextProviderAdapter,{router:router,isAutoExport:isAutoExport,children:(0,jsx_runtime_namespaceObject.jsx)(PathParamsContext.Provider,{value:function(router){if(!router.isReady||!router.query)return null;let pathParams={};for(let key of Object.keys(getRouteRegex(router.pathname).groups))pathParams[key]=router.query[key];return pathParams}(router),children:(0,jsx_runtime_namespaceObject.jsx)(RouterContext.Provider,{value:router,children:(0,jsx_runtime_namespaceObject.jsx)(HeadManagerContext.Provider,{value:{updateHead:state=>{head=state},updateScripts:scripts=>{scriptLoader=scripts},scripts:initialScripts,mountedInstances:new Set,nonce},children:(0,jsx_runtime_namespaceObject.jsx)(LoadableContext.Provider,{value:moduleName=>reactLoadableModules.push(moduleName),children:(0,jsx_runtime_namespaceObject.jsx)(external_styled_jsx_namespaceObject.StyleRegistry,{registry:jsxStyleRegistry,children:(0,jsx_runtime_namespaceObject.jsx)(ImageConfigContext.Provider,{value:images,children:children})})})})})})})})})},Noop=()=>null,AppContainerWithIsomorphicFiberStructure=({children})=>(0,jsx_runtime_namespaceObject.jsxs)(jsx_runtime_namespaceObject.Fragment,{children:[(0,jsx_runtime_namespaceObject.jsx)(Noop,{}),(0,jsx_runtime_namespaceObject.jsx)(AppContainer,{children:(0,jsx_runtime_namespaceObject.jsxs)(jsx_runtime_namespaceObject.Fragment,{children:[children,(0,jsx_runtime_namespaceObject.jsx)(Noop,{})]})})]}),ctx={err,req:isAutoExport?void 0:req,res:isAutoExport?void 0:res,pathname,query,asPath,locale:renderOpts.locale,locales:renderOpts.locales,defaultLocale:renderOpts.defaultLocale,AppTree:props=>(0,jsx_runtime_namespaceObject.jsx)(AppContainerWithIsomorphicFiberStructure,{children:renderPageTree(App,Component,{...props,router})}),defaultGetInitialProps:async(docCtx,options={})=>{let{html,head:renderPageHead}=await docCtx.renderPage({enhanceApp:AppComp=>props=>(0,jsx_runtime_namespaceObject.jsx)(AppComp,{...props})}),styles=jsxStyleRegistry.styles({nonce:options.nonce||nonce});return jsxStyleRegistry.flush(),{html,head:renderPageHead,styles}}},nextExport=!isSSG&&(renderOpts.nextExport||dev&&(isAutoExport||isFallback));if(props=await loadGetInitialProps(App,{AppTree:ctx.AppTree,Component,router,ctx}),(isSSG||getServerSideProps)&&isPreview&&(props.__N_PREVIEW=!0),isSSG&&(props.__N_SSG=!0),isSSG&&!isFallback){let data,revalidate;try{data=await (0,tracer_.getTracer)().trace(trace_constants.RenderSpan.getStaticProps,{spanName:`getStaticProps ${pathname}`,attributes:{"next.route":pathname}},()=>getStaticProps({...pageIsDynamic?{params}:void 0,...isPreview?{draftMode:!0,preview:!0,previewData:previewData}:void 0,locales:[...renderOpts.locales??[]],locale:renderOpts.locale,defaultLocale:renderOpts.defaultLocale,revalidateReason:renderOpts.isOnDemandRevalidate?"on-demand":isBuildTimeSSG?"build":"stale"}))}catch(staticPropsError){throw staticPropsError&&"ENOENT"===staticPropsError.code&&delete staticPropsError.code,staticPropsError}if(null==data)throw Object.defineProperty(Error(constants.GSP_NO_RETURNED_VALUE),"__NEXT_ERROR_CODE",{value:"E394",enumerable:!1,configurable:!0});let invalidKeys=Object.keys(data).filter(key=>"revalidate"!==key&&"props"!==key&&"redirect"!==key&&"notFound"!==key);if(invalidKeys.includes("unstable_revalidate"))throw Object.defineProperty(Error(constants.UNSTABLE_REVALIDATE_RENAME_ERROR),"__NEXT_ERROR_CODE",{value:"E394",enumerable:!1,configurable:!0});if(invalidKeys.length)throw Object.defineProperty(Error(invalidKeysMsg("getStaticProps",invalidKeys)),"__NEXT_ERROR_CODE",{value:"E394",enumerable:!1,configurable:!0});if(void 0!==data.notFound&&void 0!==data.redirect)throw Object.defineProperty(Error(`\`redirect\` and \`notFound\` can not both be returned from ${isSSG?"getStaticProps":"getServerSideProps"} at the same time. Page: ${pathname}
See more info here: https://nextjs.org/docs/messages/gssp-mixed-not-found-redirect`),"__NEXT_ERROR_CODE",{value:"E454",enumerable:!1,configurable:!0});if("notFound"in data&&data.notFound){if("/404"===pathname)throw Object.defineProperty(Error('The /404 page can not return notFound in "getStaticProps", please remove it to continue!'),"__NEXT_ERROR_CODE",{value:"E121",enumerable:!1,configurable:!0});metadata.isNotFound=!0}if("redirect"in data&&data.redirect&&"object"==typeof data.redirect){if(checkRedirectValues(data.redirect,req,"getStaticProps"),isBuildTimeSSG)throw Object.defineProperty(Error(`\`redirect\` can not be returned from getStaticProps during prerendering (${req.url})pages.runtime.prod.jsDiff too large to display server.runtime.prod.jsDiff too large to display |
Failing test suitesCommit: 7f1309e | About building and testing Next.js
Expand output● Error Overlay for server components compiler errors in pages › importing 'server-only' in pages
Expand output● use-cache-dev › should successfully finish compilation when "use cache" directive is added/removed ● use-cache-dev › should handle edits on nested pages
Expand output● app-dir static/dynamic handling › Incremental cache limits › should cache request if response data size is greater than 2MB in development mode
Expand output● Image Component Default Tests › development mode › should render correct objectFit when data url placeholder and fill ● Image Component Default Tests › development mode › should render correct objectFit when blurDataURL and fill
Expand output● Image Component Default Tests › development mode › should have data url placeholder when enabled ● Image Component Default Tests › development mode › should remove data url placeholder after image loads ● Image Component Default Tests › development mode › should render correct objectFit when blurDataURL and fill
Expand output● app-dir action handling › "use server" export values › should error when exporting non async functions at build time
Expand output● app-dir action handling › "use server" export values › should error when exporting non async functions at build time
Expand output● ReactRefreshLogBox app › server component can recover from error thrown in the module
Expand output● Error overlay - RSC build errors › should throw an error when error file is a server component with empty error file
Expand output● filesystem-caching with cache enabled › should allow to change files while stopped (rename app page) ● filesystem-caching with cache enabled › should allow to change files while stopped (next config change) ● filesystem-caching with cache enabled › should allow to change files while stopped (env var change) ● filesystem-caching with cache enabled › should allow to change files while stopped (RSC change, RCC change, Pages change, rename app page, next config change, env var change) |
Merging this PR will degrade performance by 8.27%
Performance Changes
Comparing Footnotes
|
| unsafe fn lookup_data( | ||
| fn serialize_task_storage_meta(&self, storage: &TaskStorage) -> TurboBincodeBuffer { | ||
| let mut buffer = TurboBincodeBuffer::with_capacity(256); | ||
| let mut encoder = turbo_bincode::new_turbo_bincode_encoder(&mut buffer); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
f86b6c5 to
dc32042
Compare
7f1309e to
349224f
Compare
dc32042 to
0d769e4
Compare
349224f to
6c377c0
Compare
0d769e4 to
f465836
Compare
6c377c0 to
fb79792
Compare
20e2a0d to
ef39cbd
Compare
fb79792 to
6c6d4ce
Compare
6c6d4ce to
8659e81
Compare
This adds typed serialization methods to BackingStorageSealed trait that work directly with TaskStorage instead of Vec<CachedDataItem>. These methods exist alongside the existing serialization methods to enable incremental migration. New trait methods: - serialize_typed_meta: Encode meta fields directly to bytes - serialize_typed_data: Encode data fields directly to bytes - lookup_typed_meta: Decode meta fields directly into TaskStorage - lookup_typed_data: Decode data fields directly into TaskStorage Also makes storage_schema module public so it can be imported from backing_storage and kv_backing_storage. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <[email protected]>
- Rename lookup_typed_meta/data to lookup_task_storage_meta/data - Move serialize helpers out of trait into standalone functions - Add batch_lookup_task_storage_meta/data with default implementations - Add test for serialize helpers roundtrip 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <[email protected]>
Add compatibility methods that allow TaskStorage to be used with the existing CachedDataItem-based API. This enables incremental migration from InnerStorage to TaskStorage without changing all call sites at once. The adapter includes: - add_cached_data_item: Add item, return bool indicating if newly added - insert_cached_data_item: Insert item, return old value if present - get_cached_data_item: Get value reference by key - contains_cached_data_item_key: Check if key exists - remove_cached_data_item: Remove and return value All 37 CachedDataItem variants are mapped to their corresponding TaskStorage fields with correct semantics for each storage type (direct, auto_set, auto_map, counter_map, auto_multimap, flag). 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4 <[email protected]>
Replace the CachedDataItem-based restore path with direct TaskStorage deserialization. This ensures serialization and deserialization use consistent typed formats. Key changes: - Rename restore_task_data to restore_task_data_typed returning TaskStorage - Rename restore_task_data_batch to restore_task_data_batch_typed - Use task.restore_from(storage, category) instead of iterating items - Update backing_storage trait with lookup_task_storage_* methods - Update kv_backing_storage with batch_lookup_task_storage
DynamicStorage was part of the old CachedDataItem storage approach but is no longer used after the TaskStorage migration.
8659e81 to
c3f3a24
Compare

What
Replace
InnerStoragewithTaskStoragegenerated by the new derive macro from #88338 .Extend the TaskStorage derive macro to generate
CachedDataItemadapter methods on theTaskStorageAccessorstrait so we can maintain API compatibility.Replace the serialization layer to use the native TaskStorage representations now that CachedDataitem is only used for API access
Why
TaskStorage will enable more performant serialization and access patterns.
How
Extended macro attribute parsing - Added
variant,key_field, andkey_fieldsattributes to specify CachedDataItem variant mapping per fieldGenerated adapter methods on TaskStorageAccessors trait:
insert_kv(item)- Insert a CachedDataItem into typed storageget(key)- Look up by CachedDataItemKeyremove(key)- Remove by keyget_mut(key)- Mutable access (returns None for flags/sets/multimaps)iter(type)- Iterate over a specific variant typecount(type)- Count items of a specific typeTyped serialization/deserialization APIs:
serialize_task_storage_meta/data()- Encode TaskStorage directly to byteslookup_task_storage_meta/data()- Decode bytes directly into TaskStoragebatch_lookup_task_storage()- Batch lookup returningVec<TaskStorage>restore_from(storage, category)- Merge decoded TaskStorage by categoryUpdated restore path - Changed
restore_task_datafrom returningVec<CachedDataItem>to returningTaskStorage, usingtask.restore_from()for direct field assignmentRemoved dead code - Deleted
DynamicStoragewhich was part of the old approach