[{"data":1,"prerenderedAt":3057},["ShallowReactive",2],{"article-/topics/nuxt/nuxt-observability-logging-guide":3,"related-nuxt":431,"content-query-0XJ9nXHW1p":2741},{"_path":4,"_dir":5,"_draft":6,"_partial":6,"_locale":7,"title":8,"description":9,"date":10,"topic":5,"author":11,"tags":12,"image":18,"imageQuery":19,"pexelsPhotoId":20,"pexelsUrl":21,"featured":6,"readingTime":22,"body":23,"_type":425,"_id":426,"_source":427,"_file":428,"_stem":429,"_extension":430},"/topics/nuxt/nuxt-observability-logging-guide","nuxt",false,"","Nuxt 应用监控与日志：别等用户报错才知道线上发生了什么","Nuxt 应用进入生产环境后，真正困难的不是发布，而是发现问题、定位问题和解释问题。本文从日志、指标、追踪和错误归因出发，讲清 Nuxt 可观测性体系如何落地。","2026-05-01","HTMLPAGE 团队",[13,14,15,16,17],"Nuxt","Observability","Logging","Monitoring","Operations","/images/topics/nuxt/nuxt-observability-logging-guide.jpg","application monitoring logs dashboard on computer screen",5380618,"https://www.pexels.com/photo/close-up-view-of-system-hacking-5380618/",15,{"type":24,"children":25,"toc":413},"root",[26,34,39,59,64,70,75,94,99,105,119,124,147,152,164,170,175,180,203,208,213,218,223,251,256,262,267,290,295,301,306,334,339,367,372,377,382],{"type":27,"tag":28,"props":29,"children":30},"element","p",{},[31],{"type":32,"value":33},"text","很多 Nuxt 项目上线后，真正的痛点不是“有没有错误”，而是出问题时团队完全不知道发生了什么。",{"type":27,"tag":28,"props":35,"children":36},{},[37],{"type":32,"value":38},"常见场景是：",{"type":27,"tag":40,"props":41,"children":42},"ul",{},[43,49,54],{"type":27,"tag":44,"props":45,"children":46},"li",{},[47],{"type":32,"value":48},"用户反馈页面慢，但系统里只有一堆零散日志",{"type":27,"tag":44,"props":50,"children":51},{},[52],{"type":32,"value":53},"SSR 出错了，却看不到是哪个请求路径触发",{"type":27,"tag":44,"props":55,"children":56},{},[57],{"type":32,"value":58},"某次发布后异常增加，但没人能快速定位到版本",{"type":27,"tag":28,"props":60,"children":61},{},[62],{"type":32,"value":63},"所以 Nuxt 应用监控与日志的核心，不是收集更多信息，而是让信息足够快地形成解释能力。",{"type":27,"tag":65,"props":66,"children":68},"h2",{"id":67},"可观测性要同时覆盖三个问题",[69],{"type":32,"value":67},{"type":27,"tag":28,"props":71,"children":72},{},[73],{"type":32,"value":74},"一套真正有用的 Nuxt 可观测性体系，至少要能回答：",{"type":27,"tag":76,"props":77,"children":78},"ol",{},[79,84,89],{"type":27,"tag":44,"props":80,"children":81},{},[82],{"type":32,"value":83},"现在有没有问题",{"type":27,"tag":44,"props":85,"children":86},{},[87],{"type":32,"value":88},"问题影响了谁、影响了哪里",{"type":27,"tag":44,"props":90,"children":91},{},[92],{"type":32,"value":93},"这次问题与哪个版本、哪个依赖、哪条链路有关",{"type":27,"tag":28,"props":95,"children":96},{},[97],{"type":32,"value":98},"如果只能回答第一个问题，系统仍然不够可控。",{"type":27,"tag":65,"props":100,"children":102},{"id":101},"日志不是越多越好而是越可关联越好",[103],{"type":32,"value":104},"日志不是越多越好，而是越可关联越好",{"type":27,"tag":28,"props":106,"children":107},{},[108,110,117],{"type":32,"value":109},"很多团队会在问题出现后加大量 ",{"type":27,"tag":111,"props":112,"children":114},"code",{"className":113},[],[115],{"type":32,"value":116},"console.log",{"type":32,"value":118},"，但零散日志很难形成有效诊断。",{"type":27,"tag":28,"props":120,"children":121},{},[122],{"type":32,"value":123},"更稳的日志治理通常要求：",{"type":27,"tag":40,"props":125,"children":126},{},[127,132,137,142],{"type":27,"tag":44,"props":128,"children":129},{},[130],{"type":32,"value":131},"关键事件结构化",{"type":27,"tag":44,"props":133,"children":134},{},[135],{"type":32,"value":136},"请求链路带 traceId 或 requestId",{"type":27,"tag":44,"props":138,"children":139},{},[140],{"type":32,"value":141},"日志级别清楚分层",{"type":27,"tag":44,"props":143,"children":144},{},[145],{"type":32,"value":146},"日志内容能关联到环境、版本和路由",{"type":27,"tag":28,"props":148,"children":149},{},[150],{"type":32,"value":151},"没有这些字段，日志只是噪音堆积。",{"type":27,"tag":153,"props":154,"children":159},"pre",{"className":155,"code":157,"language":158,"meta":7},[156],"language-ts","logger.info({\n  route: '/topics/nuxt',\n  requestId,\n  buildId,\n  cacheStatus: 'miss',\n}, 'page render completed')\n","ts",[160],{"type":27,"tag":111,"props":161,"children":162},{"__ignoreMap":7},[163],{"type":32,"value":157},{"type":27,"tag":65,"props":165,"children":167},{"id":166},"监控指标要覆盖服务端客户端和业务路径",[168],{"type":32,"value":169},"监控指标要覆盖服务端、客户端和业务路径",{"type":27,"tag":28,"props":171,"children":172},{},[173],{"type":32,"value":174},"Nuxt 应用的复杂度在于它同时跨越服务端和客户端，所以指标也不能只盯单一层。",{"type":27,"tag":28,"props":176,"children":177},{},[178],{"type":32,"value":179},"更值得持续跟踪的通常包括：",{"type":27,"tag":40,"props":181,"children":182},{},[183,188,193,198],{"type":27,"tag":44,"props":184,"children":185},{},[186],{"type":32,"value":187},"服务端响应耗时与错误率",{"type":27,"tag":44,"props":189,"children":190},{},[191],{"type":32,"value":192},"SSR 渲染耗时",{"type":27,"tag":44,"props":194,"children":195},{},[196],{"type":32,"value":197},"Web Vitals 与关键交互性能",{"type":27,"tag":44,"props":199,"children":200},{},[201],{"type":32,"value":202},"关键页面或流程的成功率",{"type":27,"tag":28,"props":204,"children":205},{},[206],{"type":32,"value":207},"只有服务端、前端和业务指标一起看，问题才更容易被正确归因。",{"type":27,"tag":65,"props":209,"children":211},{"id":210},"错误追踪要强调版本关联和上下文完整性",[212],{"type":32,"value":210},{"type":27,"tag":28,"props":214,"children":215},{},[216],{"type":32,"value":217},"真正难排查的线上问题，往往不是报错本身，而是你不知道它对应哪个版本、哪类用户、哪条路径。",{"type":27,"tag":28,"props":219,"children":220},{},[221],{"type":32,"value":222},"因此错误上报最好至少带上：",{"type":27,"tag":40,"props":224,"children":225},{},[226,231,236,241,246],{"type":27,"tag":44,"props":227,"children":228},{},[229],{"type":32,"value":230},"buildId 或 commitSha",{"type":27,"tag":44,"props":232,"children":233},{},[234],{"type":32,"value":235},"route",{"type":27,"tag":44,"props":237,"children":238},{},[239],{"type":32,"value":240},"user agent 或设备信息",{"type":27,"tag":44,"props":242,"children":243},{},[244],{"type":32,"value":245},"登录态或匿名态标记",{"type":27,"tag":44,"props":247,"children":248},{},[249],{"type":32,"value":250},"requestId",{"type":27,"tag":28,"props":252,"children":253},{},[254],{"type":32,"value":255},"这些上下文是后续回放和归因的关键。",{"type":27,"tag":65,"props":257,"children":259},{"id":258},"常见失败案例监控平台很多问题还是得靠人工猜",[260],{"type":32,"value":261},"常见失败案例：监控平台很多，问题还是得靠人工猜",{"type":27,"tag":28,"props":263,"children":264},{},[265],{"type":32,"value":266},"这类项目一般不是没上监控，而是缺少统一关联：",{"type":27,"tag":40,"props":268,"children":269},{},[270,275,280,285],{"type":27,"tag":44,"props":271,"children":272},{},[273],{"type":32,"value":274},"日志在一套系统",{"type":27,"tag":44,"props":276,"children":277},{},[278],{"type":32,"value":279},"前端错误在一套系统",{"type":27,"tag":44,"props":281,"children":282},{},[283],{"type":32,"value":284},"性能数据在另一套系统",{"type":27,"tag":44,"props":286,"children":287},{},[288],{"type":32,"value":289},"发布记录又在别处",{"type":27,"tag":28,"props":291,"children":292},{},[293],{"type":32,"value":294},"结果就是信号很多，但没人能快速把它们拼成同一个故事。",{"type":27,"tag":65,"props":296,"children":298},{"id":297},"一个更稳的-nuxt-可观测性落地路径",[299],{"type":32,"value":300},"一个更稳的 Nuxt 可观测性落地路径",{"type":27,"tag":28,"props":302,"children":303},{},[304],{"type":32,"value":305},"推荐按以下顺序推进：",{"type":27,"tag":76,"props":307,"children":308},{},[309,314,319,324,329],{"type":27,"tag":44,"props":310,"children":311},{},[312],{"type":32,"value":313},"先明确关键页面、关键流程和关键错误类型",{"type":27,"tag":44,"props":315,"children":316},{},[317],{"type":32,"value":318},"为请求链路统一 requestId 与版本标识",{"type":27,"tag":44,"props":320,"children":321},{},[322],{"type":32,"value":323},"把日志、错误和性能指标收敛到可关联的结构",{"type":27,"tag":44,"props":325,"children":326},{},[327],{"type":32,"value":328},"为发布、回滚和异常波动建立最基本的对照关系",{"type":27,"tag":44,"props":330,"children":331},{},[332],{"type":32,"value":333},"再逐步补充更细的业务埋点与性能追踪",{"type":27,"tag":65,"props":335,"children":337},{"id":336},"一份可直接复用的检查清单",[338],{"type":32,"value":336},{"type":27,"tag":40,"props":340,"children":341},{},[342,347,352,357,362],{"type":27,"tag":44,"props":343,"children":344},{},[345],{"type":32,"value":346},"日志是否结构化并可关联请求、版本和路由",{"type":27,"tag":44,"props":348,"children":349},{},[350],{"type":32,"value":351},"指标是否同时覆盖服务端、客户端和业务路径",{"type":27,"tag":44,"props":353,"children":354},{},[355],{"type":32,"value":356},"错误上报是否带足版本和上下文信息",{"type":27,"tag":44,"props":358,"children":359},{},[360],{"type":32,"value":361},"发布记录是否能与异常波动快速对照",{"type":27,"tag":44,"props":363,"children":364},{},[365],{"type":32,"value":366},"是否避免把日志、监控和错误平台割裂成无法关联的孤岛",{"type":27,"tag":65,"props":368,"children":370},{"id":369},"总结",[371],{"type":32,"value":369},{"type":27,"tag":28,"props":373,"children":374},{},[375],{"type":32,"value":376},"Nuxt 应用监控与日志的真正价值，不是把信息收得更多，而是让线上问题能更快被发现、被解释、被定位。只要请求关联、版本标识和关键指标一起设计，可观测性就会真正服务稳定交付。",{"type":27,"tag":28,"props":378,"children":379},{},[380],{"type":32,"value":381},"进一步阅读：",{"type":27,"tag":40,"props":383,"children":384},{},[385,395,404],{"type":27,"tag":44,"props":386,"children":387},{},[388],{"type":27,"tag":389,"props":390,"children":392},"a",{"href":391},"/topics/nuxt/kubernetes-production-configuration-guide",[393],{"type":32,"value":394},"Kubernetes 生产环境配置",{"type":27,"tag":44,"props":396,"children":397},{},[398],{"type":27,"tag":389,"props":399,"children":401},{"href":400},"/topics/nuxt/zero-downtime-deployment-canary-release-guide",[402],{"type":32,"value":403},"零停机部署与灰度发布",{"type":27,"tag":44,"props":405,"children":406},{},[407],{"type":27,"tag":389,"props":408,"children":410},{"href":409},"/topics/performance/rum-real-user-monitoring-design",[411],{"type":32,"value":412},"RUM 真实用户监控方案设计",{"title":7,"searchDepth":414,"depth":414,"links":415},3,[416,418,419,420,421,422,423,424],{"id":67,"depth":417,"text":67},2,{"id":101,"depth":417,"text":104},{"id":166,"depth":417,"text":169},{"id":210,"depth":417,"text":210},{"id":258,"depth":417,"text":261},{"id":297,"depth":417,"text":300},{"id":336,"depth":417,"text":336},{"id":369,"depth":417,"text":369},"markdown","content:topics:nuxt:nuxt-observability-logging-guide.md","content","topics/nuxt/nuxt-observability-logging-guide.md","topics/nuxt/nuxt-observability-logging-guide","md",[432,1417,2201],{"_path":433,"_dir":5,"_draft":6,"_partial":6,"_locale":7,"title":434,"description":435,"date":436,"topic":5,"author":11,"tags":437,"image":443,"featured":444,"readingTime":445,"body":446,"_type":425,"_id":1414,"_source":427,"_file":1415,"_stem":1416,"_extension":430},"/topics/nuxt/nitro-engine-deep-dive","Nitro 引擎深度剖析","讲透 Nuxt/Nitro 的运行时模型、路由与中间件、存储层与缓存、部署适配与性能调优，帮助你把服务端能力当成可控的工程系统。","2026-01-20",[13,438,439,440,441,442],"Nitro","SSR","Serverless","Edge","缓存","/images/topics/nuxt/nitro.jpg",true,21,{"type":24,"children":447,"toc":1382},[448,453,466,471,529,534,539,543,549,554,577,582,600,603,609,614,637,642,645,667,679,697,708,721,727,750,753,759,764,794,799,812,815,821,833,846,851,869,874,887,890,896,901,919,925,944,950,955,960,989,992,998,1003,1021,1026,1044,1050,1063,1069,1082,1088,1101,1106,1119,1122,1128,1134,1147,1153,1166,1172,1185,1188,1194,1199,1222,1227,1240,1243,1249,1254,1312,1317,1335,1338,1342,1354,1359],{"type":27,"tag":65,"props":449,"children":451},{"id":450},"nitro-引擎深度剖析",[452],{"type":32,"value":434},{"type":27,"tag":28,"props":454,"children":455},{},[456,458,464],{"type":32,"value":457},"在 Nuxt 3/4 的体系里，Nitro 不是“一个服务器”，而是一套",{"type":27,"tag":459,"props":460,"children":461},"strong",{},[462],{"type":32,"value":463},"可移植的服务端运行时与构建产物规范",{"type":32,"value":465},"。",{"type":27,"tag":28,"props":467,"children":468},{},[469],{"type":32,"value":470},"它把你在开发时写的：",{"type":27,"tag":40,"props":472,"children":473},{},[474,485,496,507,518],{"type":27,"tag":44,"props":475,"children":476},{},[477,483],{"type":27,"tag":111,"props":478,"children":480},{"className":479},[],[481],{"type":32,"value":482},"server/api/*",{"type":32,"value":484},"（API 路由）",{"type":27,"tag":44,"props":486,"children":487},{},[488,494],{"type":27,"tag":111,"props":489,"children":491},{"className":490},[],[492],{"type":32,"value":493},"server/routes/*",{"type":32,"value":495},"（更底层路由）",{"type":27,"tag":44,"props":497,"children":498},{},[499,505],{"type":27,"tag":111,"props":500,"children":502},{"className":501},[],[503],{"type":32,"value":504},"server/middleware/*",{"type":32,"value":506},"（中间件）",{"type":27,"tag":44,"props":508,"children":509},{},[510,516],{"type":27,"tag":111,"props":511,"children":513},{"className":512},[],[514],{"type":32,"value":515},"server/plugins/*",{"type":32,"value":517},"（启动插件）",{"type":27,"tag":44,"props":519,"children":520},{},[521,527],{"type":27,"tag":111,"props":522,"children":524},{"className":523},[],[525],{"type":32,"value":526},"storage",{"type":32,"value":528},"（KV/文件/内存等存储抽象）",{"type":27,"tag":28,"props":530,"children":531},{},[532],{"type":32,"value":533},"统一编译成一个可以部署到多种环境的产物：Node Server、Serverless、Edge（取决于适配器与能力集）。",{"type":27,"tag":28,"props":535,"children":536},{},[537],{"type":32,"value":538},"这篇文章按“你要在生产上稳定运行”的视角，拆解 Nitro 的关键构件，并给出性能与可观测性落地建议。",{"type":27,"tag":540,"props":541,"children":542},"hr",{},[],{"type":27,"tag":65,"props":544,"children":546},{"id":545},"_1-nitro-的定位从-nuxt-ssr-到通用服务端运行时",[547],{"type":32,"value":548},"1. Nitro 的定位：从 Nuxt SSR 到“通用服务端运行时”",{"type":27,"tag":28,"props":550,"children":551},{},[552],{"type":32,"value":553},"Nitro 解决两类问题：",{"type":27,"tag":76,"props":555,"children":556},{},[557,567],{"type":27,"tag":44,"props":558,"children":559},{},[560,565],{"type":27,"tag":459,"props":561,"children":562},{},[563],{"type":32,"value":564},"运行时统一",{"type":32,"value":566},"：开发/生产环境一致的请求处理模型",{"type":27,"tag":44,"props":568,"children":569},{},[570,575],{"type":27,"tag":459,"props":571,"children":572},{},[573],{"type":32,"value":574},"部署可移植",{"type":32,"value":576},"：同一套代码可输出到不同部署目标",{"type":27,"tag":28,"props":578,"children":579},{},[580],{"type":32,"value":581},"你可以把 Nitro 看作 Nuxt 的“服务端内核”，而 Nuxt 只是围绕它提供：",{"type":27,"tag":40,"props":583,"children":584},{},[585,590,595],{"type":27,"tag":44,"props":586,"children":587},{},[588],{"type":32,"value":589},"视图渲染（SSR/RSC 相关能力）",{"type":27,"tag":44,"props":591,"children":592},{},[593],{"type":32,"value":594},"资源构建（Vite/Webpack）",{"type":27,"tag":44,"props":596,"children":597},{},[598],{"type":32,"value":599},"路由与数据获取的上层抽象",{"type":27,"tag":540,"props":601,"children":602},{},[],{"type":27,"tag":65,"props":604,"children":606},{"id":605},"_2-请求生命周期一次请求在-nitro-里怎么走",[607],{"type":32,"value":608},"2. 请求生命周期：一次请求在 Nitro 里怎么走？",{"type":27,"tag":28,"props":610,"children":611},{},[612],{"type":32,"value":613},"简化后的请求链路：",{"type":27,"tag":76,"props":615,"children":616},{},[617,622,627,632],{"type":27,"tag":44,"props":618,"children":619},{},[620],{"type":32,"value":621},"入口适配器接收请求（Node/Serverless/Edge）",{"type":27,"tag":44,"props":623,"children":624},{},[625],{"type":32,"value":626},"进入 Nitro 的 H3 请求处理器（统一事件模型）",{"type":27,"tag":44,"props":628,"children":629},{},[630],{"type":32,"value":631},"依次执行：中间件 → 路由匹配 → handler",{"type":27,"tag":44,"props":633,"children":634},{},[635],{"type":32,"value":636},"写回响应（含 headers、缓存策略、流式输出等）",{"type":27,"tag":28,"props":638,"children":639},{},[640],{"type":32,"value":641},"关键点：Nitro 用统一的事件对象承载请求上下文，这让你在不同部署目标下写出的 server 代码保持一致。",{"type":27,"tag":540,"props":643,"children":644},{},[],{"type":27,"tag":65,"props":646,"children":648},{"id":647},"_3-路由系统serverapi-与-serverroutes-的区别",[649,651,657,659,665],{"type":32,"value":650},"3. 路由系统：",{"type":27,"tag":111,"props":652,"children":654},{"className":653},[],[655],{"type":32,"value":656},"server/api",{"type":32,"value":658}," 与 ",{"type":27,"tag":111,"props":660,"children":662},{"className":661},[],[663],{"type":32,"value":664},"server/routes",{"type":32,"value":666}," 的区别",{"type":27,"tag":668,"props":669,"children":671},"h3",{"id":670},"_31-serverapi",[672,674],{"type":32,"value":673},"3.1 ",{"type":27,"tag":111,"props":675,"children":677},{"className":676},[],[678],{"type":32,"value":482},{"type":27,"tag":40,"props":680,"children":681},{},[682,687,692],{"type":27,"tag":44,"props":683,"children":684},{},[685],{"type":32,"value":686},"面向 API 的约定式目录",{"type":27,"tag":44,"props":688,"children":689},{},[690],{"type":32,"value":691},"通常返回 JSON",{"type":27,"tag":44,"props":693,"children":694},{},[695],{"type":32,"value":696},"与 Nuxt 的开发体验高度整合",{"type":27,"tag":668,"props":698,"children":700},{"id":699},"_32-serverroutes",[701,703],{"type":32,"value":702},"3.2 ",{"type":27,"tag":111,"props":704,"children":706},{"className":705},[],[707],{"type":32,"value":493},{"type":27,"tag":40,"props":709,"children":710},{},[711,716],{"type":27,"tag":44,"props":712,"children":713},{},[714],{"type":32,"value":715},"更底层，更贴近“HTTP 路由”",{"type":27,"tag":44,"props":717,"children":718},{},[719],{"type":32,"value":720},"更适合做：Webhook、回调、代理、特殊 content-type",{"type":27,"tag":668,"props":722,"children":724},{"id":723},"_33-实践建议",[725],{"type":32,"value":726},"3.3 实践建议",{"type":27,"tag":40,"props":728,"children":729},{},[730,740],{"type":27,"tag":44,"props":731,"children":732},{},[733,735],{"type":32,"value":734},"普通业务 API：优先 ",{"type":27,"tag":111,"props":736,"children":738},{"className":737},[],[739],{"type":32,"value":656},{"type":27,"tag":44,"props":741,"children":742},{},[743,745],{"type":32,"value":744},"需要更强控制（stream、代理、非 JSON）：用 ",{"type":27,"tag":111,"props":746,"children":748},{"className":747},[],[749],{"type":32,"value":664},{"type":27,"tag":540,"props":751,"children":752},{},[],{"type":27,"tag":65,"props":754,"children":756},{"id":755},"_4-中间件全局逻辑的正确放置",[757],{"type":32,"value":758},"4. 中间件：全局逻辑的正确放置",{"type":27,"tag":28,"props":760,"children":761},{},[762],{"type":32,"value":763},"Nitro 中的中间件通常用于：",{"type":27,"tag":40,"props":765,"children":766},{},[767,772,784,789],{"type":27,"tag":44,"props":768,"children":769},{},[770],{"type":32,"value":771},"鉴权/鉴别请求来源",{"type":27,"tag":44,"props":773,"children":774},{},[775,777,782],{"type":32,"value":776},"注入 ",{"type":27,"tag":111,"props":778,"children":780},{"className":779},[],[781],{"type":32,"value":250},{"type":32,"value":783},"、trace 信息",{"type":27,"tag":44,"props":785,"children":786},{},[787],{"type":32,"value":788},"统一错误处理与日志",{"type":27,"tag":44,"props":790,"children":791},{},[792],{"type":32,"value":793},"基础安全 headers",{"type":27,"tag":28,"props":795,"children":796},{},[797],{"type":32,"value":798},"一个推荐的中间件职责边界：",{"type":27,"tag":40,"props":800,"children":801},{},[802,807],{"type":27,"tag":44,"props":803,"children":804},{},[805],{"type":32,"value":806},"中间件只做“横切关注点”",{"type":27,"tag":44,"props":808,"children":809},{},[810],{"type":32,"value":811},"不做具体业务（避免耦合与隐式依赖）",{"type":27,"tag":540,"props":813,"children":814},{},[],{"type":27,"tag":65,"props":816,"children":818},{"id":817},"_5-storage-抽象让缓存与数据存取可替换",[819],{"type":32,"value":820},"5. Storage 抽象：让缓存与数据存取可替换",{"type":27,"tag":28,"props":822,"children":823},{},[824,826,831],{"type":32,"value":825},"Nitro 的一个被低估的能力是 ",{"type":27,"tag":111,"props":827,"children":829},{"className":828},[],[830],{"type":32,"value":526},{"type":32,"value":832},"：",{"type":27,"tag":40,"props":834,"children":835},{},[836,841],{"type":27,"tag":44,"props":837,"children":838},{},[839],{"type":32,"value":840},"提供 KV 风格 API",{"type":27,"tag":44,"props":842,"children":843},{},[844],{"type":32,"value":845},"可接入内存、文件、Redis 等（取决于配置与环境）",{"type":27,"tag":28,"props":847,"children":848},{},[849],{"type":32,"value":850},"你可以用它做：",{"type":27,"tag":40,"props":852,"children":853},{},[854,859,864],{"type":27,"tag":44,"props":855,"children":856},{},[857],{"type":32,"value":858},"缓存（页面片段、API 结果）",{"type":27,"tag":44,"props":860,"children":861},{},[862],{"type":32,"value":863},"限流计数器",{"type":27,"tag":44,"props":865,"children":866},{},[867],{"type":32,"value":868},"临时会话信息",{"type":27,"tag":28,"props":870,"children":871},{},[872],{"type":32,"value":873},"设计原则：",{"type":27,"tag":40,"props":875,"children":876},{},[877,882],{"type":27,"tag":44,"props":878,"children":879},{},[880],{"type":32,"value":881},"把 storage 当成“可失效缓存”，不要当主数据库",{"type":27,"tag":44,"props":883,"children":884},{},[885],{"type":32,"value":886},"明确 TTL 与清理策略",{"type":27,"tag":540,"props":888,"children":889},{},[],{"type":27,"tag":65,"props":891,"children":893},{"id":892},"_6-缓存策略把快变成可控的工程能力",[894],{"type":32,"value":895},"6. 缓存策略：把“快”变成可控的工程能力",{"type":27,"tag":28,"props":897,"children":898},{},[899],{"type":32,"value":900},"Nitro 里的缓存往往涉及三层：",{"type":27,"tag":76,"props":902,"children":903},{},[904,909,914],{"type":27,"tag":44,"props":905,"children":906},{},[907],{"type":32,"value":908},"CDN 缓存（边缘）",{"type":27,"tag":44,"props":910,"children":911},{},[912],{"type":32,"value":913},"Nitro 运行时缓存（storage）",{"type":27,"tag":44,"props":915,"children":916},{},[917],{"type":32,"value":918},"上游服务缓存（数据库/服务端）",{"type":27,"tag":668,"props":920,"children":922},{"id":921},"_61-api-缓存的推荐做法",[923],{"type":32,"value":924},"6.1 API 缓存的推荐做法",{"type":27,"tag":40,"props":926,"children":927},{},[928,939],{"type":27,"tag":44,"props":929,"children":930},{},[931,933],{"type":32,"value":932},"对“读多写少”的接口做 ",{"type":27,"tag":111,"props":934,"children":936},{"className":935},[],[937],{"type":32,"value":938},"stale-while-revalidate",{"type":27,"tag":44,"props":940,"children":941},{},[942],{"type":32,"value":943},"缓存 key 必须包含：用户态/语言/地区/权限等关键维度",{"type":27,"tag":668,"props":945,"children":947},{"id":946},"_62-不要缓存带用户身份的响应除非你非常确定",[948],{"type":32,"value":949},"6.2 不要缓存“带用户身份”的响应（除非你非常确定）",{"type":27,"tag":28,"props":951,"children":952},{},[953],{"type":32,"value":954},"最容易出事故的是把 A 用户的数据缓存给 B 用户。",{"type":27,"tag":28,"props":956,"children":957},{},[958],{"type":32,"value":959},"建议：",{"type":27,"tag":40,"props":961,"children":962},{},[963,968],{"type":27,"tag":44,"props":964,"children":965},{},[966],{"type":32,"value":967},"默认对用户态接口不缓存",{"type":27,"tag":44,"props":969,"children":970},{},[971,973,979,981,987],{"type":32,"value":972},"必须缓存时，key 中加入 ",{"type":27,"tag":111,"props":974,"children":976},{"className":975},[],[977],{"type":32,"value":978},"userId",{"type":32,"value":980}," 或 ",{"type":27,"tag":111,"props":982,"children":984},{"className":983},[],[985],{"type":32,"value":986},"session",{"type":32,"value":988}," 维度",{"type":27,"tag":540,"props":990,"children":991},{},[],{"type":27,"tag":65,"props":993,"children":995},{"id":994},"_7-部署适配为什么同一套代码能跑在不同环境",[996],{"type":32,"value":997},"7. 部署适配：为什么同一套代码能跑在不同环境？",{"type":27,"tag":28,"props":999,"children":1000},{},[1001],{"type":32,"value":1002},"Nitro 的部署产物通常包含：",{"type":27,"tag":40,"props":1004,"children":1005},{},[1006,1011,1016],{"type":27,"tag":44,"props":1007,"children":1008},{},[1009],{"type":32,"value":1010},"编译后的 server bundle",{"type":27,"tag":44,"props":1012,"children":1013},{},[1014],{"type":32,"value":1015},"路由清单与运行时配置",{"type":27,"tag":44,"props":1017,"children":1018},{},[1019],{"type":32,"value":1020},"静态资源与预渲染结果（如果启用）",{"type":27,"tag":28,"props":1022,"children":1023},{},[1024],{"type":32,"value":1025},"在不同目标下的差异主要在：",{"type":27,"tag":40,"props":1027,"children":1028},{},[1029,1034,1039],{"type":27,"tag":44,"props":1030,"children":1031},{},[1032],{"type":32,"value":1033},"运行时能力（Node API 是否可用）",{"type":27,"tag":44,"props":1035,"children":1036},{},[1037],{"type":32,"value":1038},"冷启动与并发模型",{"type":27,"tag":44,"props":1040,"children":1041},{},[1042],{"type":32,"value":1043},"文件系统是否可写",{"type":27,"tag":668,"props":1045,"children":1047},{"id":1046},"_71-node-server",[1048],{"type":32,"value":1049},"7.1 Node Server",{"type":27,"tag":40,"props":1051,"children":1052},{},[1053,1058],{"type":27,"tag":44,"props":1054,"children":1055},{},[1056],{"type":32,"value":1057},"能力最完整",{"type":27,"tag":44,"props":1059,"children":1060},{},[1061],{"type":32,"value":1062},"适合长连接、websocket（需配合平台）",{"type":27,"tag":668,"props":1064,"children":1066},{"id":1065},"_72-serverless",[1067],{"type":32,"value":1068},"7.2 Serverless",{"type":27,"tag":40,"props":1070,"children":1071},{},[1072,1077],{"type":27,"tag":44,"props":1073,"children":1074},{},[1075],{"type":32,"value":1076},"冷启动成本、执行时长限制",{"type":27,"tag":44,"props":1078,"children":1079},{},[1080],{"type":32,"value":1081},"更适合 API 型工作负载",{"type":27,"tag":668,"props":1083,"children":1085},{"id":1084},"_73-edge",[1086],{"type":32,"value":1087},"7.3 Edge",{"type":27,"tag":40,"props":1089,"children":1090},{},[1091,1096],{"type":27,"tag":44,"props":1092,"children":1093},{},[1094],{"type":32,"value":1095},"延迟更低",{"type":27,"tag":44,"props":1097,"children":1098},{},[1099],{"type":32,"value":1100},"运行时限制更严格（例如 Node API 不可用）",{"type":27,"tag":28,"props":1102,"children":1103},{},[1104],{"type":32,"value":1105},"实践建议：",{"type":27,"tag":40,"props":1107,"children":1108},{},[1109,1114],{"type":27,"tag":44,"props":1110,"children":1111},{},[1112],{"type":32,"value":1113},"如果你依赖复杂 Node 能力（例如图像处理、原生模块），优先 Node/Serverless",{"type":27,"tag":44,"props":1115,"children":1116},{},[1117],{"type":32,"value":1118},"如果你追求极致延迟且逻辑简单，考虑 Edge",{"type":27,"tag":540,"props":1120,"children":1121},{},[],{"type":27,"tag":65,"props":1123,"children":1125},{"id":1124},"_8-性能调优nitro-侧你能做什么",[1126],{"type":32,"value":1127},"8. 性能调优：Nitro 侧你能做什么？",{"type":27,"tag":668,"props":1129,"children":1131},{"id":1130},"_81-减少阻塞-io",[1132],{"type":32,"value":1133},"8.1 减少阻塞 I/O",{"type":27,"tag":40,"props":1135,"children":1136},{},[1137,1142],{"type":27,"tag":44,"props":1138,"children":1139},{},[1140],{"type":32,"value":1141},"避免请求内做同步文件读写",{"type":27,"tag":44,"props":1143,"children":1144},{},[1145],{"type":32,"value":1146},"对“配置/规则”等可缓存数据做启动预热",{"type":27,"tag":668,"props":1148,"children":1150},{"id":1149},"_82-控制上游依赖",[1151],{"type":32,"value":1152},"8.2 控制上游依赖",{"type":27,"tag":40,"props":1154,"children":1155},{},[1156,1161],{"type":27,"tag":44,"props":1157,"children":1158},{},[1159],{"type":32,"value":1160},"给外部请求设超时（例如 2~3s）",{"type":27,"tag":44,"props":1162,"children":1163},{},[1164],{"type":32,"value":1165},"加重试要谨慎（避免雪崩）",{"type":27,"tag":668,"props":1167,"children":1169},{"id":1168},"_83-响应体积与压缩",[1170],{"type":32,"value":1171},"8.3 响应体积与压缩",{"type":27,"tag":40,"props":1173,"children":1174},{},[1175,1180],{"type":27,"tag":44,"props":1176,"children":1177},{},[1178],{"type":32,"value":1179},"JSON 输出控制字段",{"type":27,"tag":44,"props":1181,"children":1182},{},[1183],{"type":32,"value":1184},"开启 gzip/br",{"type":27,"tag":540,"props":1186,"children":1187},{},[],{"type":27,"tag":65,"props":1189,"children":1191},{"id":1190},"_9-可观测性没有观测就没有稳定",[1192],{"type":32,"value":1193},"9. 可观测性：没有观测就没有“稳定”",{"type":27,"tag":28,"props":1195,"children":1196},{},[1197],{"type":32,"value":1198},"建议 Nitro 侧最小可观测集合：",{"type":27,"tag":40,"props":1200,"children":1201},{},[1202,1207,1212,1217],{"type":27,"tag":44,"props":1203,"children":1204},{},[1205],{"type":32,"value":1206},"requestId/traceId",{"type":27,"tag":44,"props":1208,"children":1209},{},[1210],{"type":32,"value":1211},"关键路由耗时（p50/p95）",{"type":27,"tag":44,"props":1213,"children":1214},{},[1215],{"type":32,"value":1216},"错误率（按路由/按状态码）",{"type":27,"tag":44,"props":1218,"children":1219},{},[1220],{"type":32,"value":1221},"上游依赖耗时（DB/HTTP）",{"type":27,"tag":28,"props":1223,"children":1224},{},[1225],{"type":32,"value":1226},"落地方式：",{"type":27,"tag":40,"props":1228,"children":1229},{},[1230,1235],{"type":27,"tag":44,"props":1231,"children":1232},{},[1233],{"type":32,"value":1234},"在中间件注入 requestId",{"type":27,"tag":44,"props":1236,"children":1237},{},[1238],{"type":32,"value":1239},"在统一错误处理处记录结构化日志",{"type":27,"tag":540,"props":1241,"children":1242},{},[],{"type":27,"tag":65,"props":1244,"children":1246},{"id":1245},"_10-一个推荐的-nitro-工程结构",[1247],{"type":32,"value":1248},"10. 一个推荐的 Nitro 工程结构",{"type":27,"tag":28,"props":1250,"children":1251},{},[1252],{"type":32,"value":1253},"在 Nuxt 项目里，你可以这样组织服务端代码：",{"type":27,"tag":40,"props":1255,"children":1256},{},[1257,1268,1279,1290,1301],{"type":27,"tag":44,"props":1258,"children":1259},{},[1260,1266],{"type":27,"tag":111,"props":1261,"children":1263},{"className":1262},[],[1264],{"type":32,"value":1265},"server/middleware/",{"type":32,"value":1267},"：鉴权、日志、headers、rate limit",{"type":27,"tag":44,"props":1269,"children":1270},{},[1271,1277],{"type":27,"tag":111,"props":1272,"children":1274},{"className":1273},[],[1275],{"type":32,"value":1276},"server/api/",{"type":32,"value":1278},"：业务 API（薄控制器）",{"type":27,"tag":44,"props":1280,"children":1281},{},[1282,1288],{"type":27,"tag":111,"props":1283,"children":1285},{"className":1284},[],[1286],{"type":32,"value":1287},"server/services/",{"type":32,"value":1289},"：领域服务（可复用）",{"type":27,"tag":44,"props":1291,"children":1292},{},[1293,1299],{"type":27,"tag":111,"props":1294,"children":1296},{"className":1295},[],[1297],{"type":32,"value":1298},"server/repositories/",{"type":32,"value":1300},"：数据访问层",{"type":27,"tag":44,"props":1302,"children":1303},{},[1304,1310],{"type":27,"tag":111,"props":1305,"children":1307},{"className":1306},[],[1308],{"type":32,"value":1309},"server/utils/",{"type":32,"value":1311},"：纯工具",{"type":27,"tag":28,"props":1313,"children":1314},{},[1315],{"type":32,"value":1316},"目标是：",{"type":27,"tag":40,"props":1318,"children":1319},{},[1320,1325,1330],{"type":27,"tag":44,"props":1321,"children":1322},{},[1323],{"type":32,"value":1324},"handler 只做协议适配",{"type":27,"tag":44,"props":1326,"children":1327},{},[1328],{"type":32,"value":1329},"业务逻辑可复用、可测试",{"type":27,"tag":44,"props":1331,"children":1332},{},[1333],{"type":32,"value":1334},"横切能力集中化",{"type":27,"tag":540,"props":1336,"children":1337},{},[],{"type":27,"tag":65,"props":1339,"children":1340},{"id":369},[1341],{"type":32,"value":369},{"type":27,"tag":28,"props":1343,"children":1344},{},[1345,1347,1352],{"type":32,"value":1346},"Nitro 的本质是：把 Nuxt 的服务端能力变成一个",{"type":27,"tag":459,"props":1348,"children":1349},{},[1350],{"type":32,"value":1351},"可编译、可移植、可观测",{"type":32,"value":1353},"的运行时系统。",{"type":27,"tag":28,"props":1355,"children":1356},{},[1357],{"type":32,"value":1358},"你一旦理解了它的生命周期与边界，就可以更有信心地在 Nuxt 里做：",{"type":27,"tag":40,"props":1360,"children":1361},{},[1362,1367,1372,1377],{"type":27,"tag":44,"props":1363,"children":1364},{},[1365],{"type":32,"value":1366},"性能友好的 API",{"type":27,"tag":44,"props":1368,"children":1369},{},[1370],{"type":32,"value":1371},"可控的缓存",{"type":27,"tag":44,"props":1373,"children":1374},{},[1375],{"type":32,"value":1376},"稳定的鉴权与错误处理",{"type":27,"tag":44,"props":1378,"children":1379},{},[1380],{"type":32,"value":1381},"面向多环境部署的工程架构",{"title":7,"searchDepth":414,"depth":414,"links":1383},[1384,1385,1386,1387,1395,1396,1397,1401,1406,1411,1412,1413],{"id":450,"depth":417,"text":434},{"id":545,"depth":417,"text":548},{"id":605,"depth":417,"text":608},{"id":647,"depth":417,"text":1388,"children":1389},"3. 路由系统：server/api 与 server/routes 的区别",[1390,1392,1394],{"id":670,"depth":414,"text":1391},"3.1 server/api/*",{"id":699,"depth":414,"text":1393},"3.2 server/routes/*",{"id":723,"depth":414,"text":726},{"id":755,"depth":417,"text":758},{"id":817,"depth":417,"text":820},{"id":892,"depth":417,"text":895,"children":1398},[1399,1400],{"id":921,"depth":414,"text":924},{"id":946,"depth":414,"text":949},{"id":994,"depth":417,"text":997,"children":1402},[1403,1404,1405],{"id":1046,"depth":414,"text":1049},{"id":1065,"depth":414,"text":1068},{"id":1084,"depth":414,"text":1087},{"id":1124,"depth":417,"text":1127,"children":1407},[1408,1409,1410],{"id":1130,"depth":414,"text":1133},{"id":1149,"depth":414,"text":1152},{"id":1168,"depth":414,"text":1171},{"id":1190,"depth":417,"text":1193},{"id":1245,"depth":417,"text":1248},{"id":369,"depth":417,"text":369},"content:topics:nuxt:nitro-engine-deep-dive.md","topics/nuxt/nitro-engine-deep-dive.md","topics/nuxt/nitro-engine-deep-dive",{"_path":1418,"_dir":5,"_draft":6,"_partial":6,"_locale":7,"title":1419,"description":1420,"date":436,"topic":5,"author":11,"tags":1421,"image":1425,"featured":444,"readingTime":1426,"body":1427,"_type":425,"_id":2198,"_source":427,"_file":2199,"_stem":2200,"_extension":430},"/topics/nuxt/nuxt-rendering-modes-guide","Nuxt 渲染模式选择指南","从 SEO、性能、成本与一致性出发，系统对比 Nuxt 的 CSR/SSR/SSG/ISR（与预渲染）等模式，给出可执行的选型矩阵与落地架构建议。",[13,439,1422,1423,1424],"SSG","ISR","SEO","/images/topics/nuxt/rendering-modes.jpg",22,{"type":24,"children":1428,"toc":2181},[1429,1434,1439,1444,1472,1484,1487,1493,1498,1521,1526,1529,1535,1541,1546,1564,1569,1588,1594,1598,1611,1615,1628,1634,1638,1651,1655,1668,1674,1679,1692,1696,1709,1713,1726,1732,1736,1749,1753,1766,1769,1775,1780,1947,1950,1956,1961,1979,1984,1997,2000,2006,2011,2016,2039,2044,2062,2065,2071,2089,2092,2098,2151,2154,2158,2163],{"type":27,"tag":65,"props":1430,"children":1432},{"id":1431},"nuxt-渲染模式选择指南",[1433],{"type":32,"value":1419},{"type":27,"tag":28,"props":1435,"children":1436},{},[1437],{"type":32,"value":1438},"“到底要不要 SSR？”是 Nuxt 项目里最常见、也最容易吵起来的问题。",{"type":27,"tag":28,"props":1440,"children":1441},{},[1442],{"type":32,"value":1443},"原因是：渲染模式不是一个单点选择，它同时牵动：",{"type":27,"tag":40,"props":1445,"children":1446},{},[1447,1452,1457,1462,1467],{"type":27,"tag":44,"props":1448,"children":1449},{},[1450],{"type":32,"value":1451},"SEO（可索引内容是否直出）",{"type":27,"tag":44,"props":1453,"children":1454},{},[1455],{"type":32,"value":1456},"性能（TTFB/LCP/INP）",{"type":27,"tag":44,"props":1458,"children":1459},{},[1460],{"type":32,"value":1461},"成本（回源、算力、带宽）",{"type":27,"tag":44,"props":1463,"children":1464},{},[1465],{"type":32,"value":1466},"一致性（内容更新策略、缓存失效）",{"type":27,"tag":44,"props":1468,"children":1469},{},[1470],{"type":32,"value":1471},"工程复杂度（部署、观测、回滚）",{"type":27,"tag":28,"props":1473,"children":1474},{},[1475,1477,1482],{"type":32,"value":1476},"这篇文章给你一套",{"type":27,"tag":459,"props":1478,"children":1479},{},[1480],{"type":32,"value":1481},"可执行的选型方法",{"type":32,"value":1483},"：先定义目标，再选模式，最后给落地结构与检查清单。",{"type":27,"tag":540,"props":1485,"children":1486},{},[],{"type":27,"tag":65,"props":1488,"children":1490},{"id":1489},"_1-四个维度决定你的模式",[1491],{"type":32,"value":1492},"1. 四个维度，决定你的模式",{"type":27,"tag":28,"props":1494,"children":1495},{},[1496],{"type":32,"value":1497},"在做任何选择前，先回答四个问题：",{"type":27,"tag":76,"props":1499,"children":1500},{},[1501,1506,1511,1516],{"type":27,"tag":44,"props":1502,"children":1503},{},[1504],{"type":32,"value":1505},"页面是否需要 SEO？（搜索引擎是否必须看到正文）",{"type":27,"tag":44,"props":1507,"children":1508},{},[1509],{"type":32,"value":1510},"数据是否强一致？（用户态/支付/权限）",{"type":27,"tag":44,"props":1512,"children":1513},{},[1514],{"type":32,"value":1515},"更新频率如何？（发布频繁 vs 偶尔）",{"type":27,"tag":44,"props":1517,"children":1518},{},[1519],{"type":32,"value":1520},"流量模型是什么？（突发、平稳、长尾）",{"type":27,"tag":28,"props":1522,"children":1523},{},[1524],{"type":32,"value":1525},"这些问题比“SSR 快还是慢”更重要。",{"type":27,"tag":540,"props":1527,"children":1528},{},[],{"type":27,"tag":65,"props":1530,"children":1532},{"id":1531},"_2-主要模式概览csr-ssr-ssg-isr-预渲染",[1533],{"type":32,"value":1534},"2. 主要模式概览：CSR / SSR / SSG / ISR / 预渲染",{"type":27,"tag":668,"props":1536,"children":1538},{"id":1537},"_21-csr纯客户端渲染",[1539],{"type":32,"value":1540},"2.1 CSR（纯客户端渲染）",{"type":27,"tag":28,"props":1542,"children":1543},{},[1544],{"type":32,"value":1545},"特点：",{"type":27,"tag":40,"props":1547,"children":1548},{},[1549,1554,1559],{"type":27,"tag":44,"props":1550,"children":1551},{},[1552],{"type":32,"value":1553},"HTML 只有壳",{"type":27,"tag":44,"props":1555,"children":1556},{},[1557],{"type":32,"value":1558},"SEO 风险大（除非你不索引）",{"type":27,"tag":44,"props":1560,"children":1561},{},[1562],{"type":32,"value":1563},"首屏性能取决于 JS 与接口",{"type":27,"tag":28,"props":1565,"children":1566},{},[1567],{"type":32,"value":1568},"适用：",{"type":27,"tag":40,"props":1570,"children":1571},{},[1572,1577],{"type":27,"tag":44,"props":1573,"children":1574},{},[1575],{"type":32,"value":1576},"用户中心、后台、强交互工具",{"type":27,"tag":44,"props":1578,"children":1579},{},[1580,1582],{"type":32,"value":1581},"不需要索引或明确 ",{"type":27,"tag":111,"props":1583,"children":1585},{"className":1584},[],[1586],{"type":32,"value":1587},"noindex",{"type":27,"tag":668,"props":1589,"children":1591},{"id":1590},"_22-ssr服务端渲染",[1592],{"type":32,"value":1593},"2.2 SSR（服务端渲染）",{"type":27,"tag":28,"props":1595,"children":1596},{},[1597],{"type":32,"value":1545},{"type":27,"tag":40,"props":1599,"children":1600},{},[1601,1606],{"type":27,"tag":44,"props":1602,"children":1603},{},[1604],{"type":32,"value":1605},"首屏 HTML 直出，SEO 友好",{"type":27,"tag":44,"props":1607,"children":1608},{},[1609],{"type":32,"value":1610},"每次请求可能都需要回源（需要缓存）",{"type":27,"tag":28,"props":1612,"children":1613},{},[1614],{"type":32,"value":1568},{"type":27,"tag":40,"props":1616,"children":1617},{},[1618,1623],{"type":27,"tag":44,"props":1619,"children":1620},{},[1621],{"type":32,"value":1622},"内容需要 SEO，但数据强动态",{"type":27,"tag":44,"props":1624,"children":1625},{},[1626],{"type":32,"value":1627},"你有完善的缓存策略",{"type":27,"tag":668,"props":1629,"children":1631},{"id":1630},"_23-ssg静态生成",[1632],{"type":32,"value":1633},"2.3 SSG（静态生成）",{"type":27,"tag":28,"props":1635,"children":1636},{},[1637],{"type":32,"value":1545},{"type":27,"tag":40,"props":1639,"children":1640},{},[1641,1646],{"type":27,"tag":44,"props":1642,"children":1643},{},[1644],{"type":32,"value":1645},"性能与稳定性最好",{"type":27,"tag":44,"props":1647,"children":1648},{},[1649],{"type":32,"value":1650},"更新成本在“构建时”",{"type":27,"tag":28,"props":1652,"children":1653},{},[1654],{"type":32,"value":1568},{"type":27,"tag":40,"props":1656,"children":1657},{},[1658,1663],{"type":27,"tag":44,"props":1659,"children":1660},{},[1661],{"type":32,"value":1662},"内容站、文档站、营销页",{"type":27,"tag":44,"props":1664,"children":1665},{},[1666],{"type":32,"value":1667},"更新频率不高或可接受构建延迟",{"type":27,"tag":668,"props":1669,"children":1671},{"id":1670},"_24-isr增量静态再生按需生成",[1672],{"type":32,"value":1673},"2.4 ISR（增量静态再生/按需生成）",{"type":27,"tag":28,"props":1675,"children":1676},{},[1677],{"type":32,"value":1678},"在 Nuxt 体系里，ISR 的表达可能来自：",{"type":27,"tag":40,"props":1680,"children":1681},{},[1682,1687],{"type":27,"tag":44,"props":1683,"children":1684},{},[1685],{"type":32,"value":1686},"生成策略 + 缓存策略",{"type":27,"tag":44,"props":1688,"children":1689},{},[1690],{"type":32,"value":1691},"或配合边缘缓存与按需失效",{"type":27,"tag":28,"props":1693,"children":1694},{},[1695],{"type":32,"value":1545},{"type":27,"tag":40,"props":1697,"children":1698},{},[1699,1704],{"type":27,"tag":44,"props":1700,"children":1701},{},[1702],{"type":32,"value":1703},"静态化收益 + 可控更新",{"type":27,"tag":44,"props":1705,"children":1706},{},[1707],{"type":32,"value":1708},"需要你设计“失效与再生成”",{"type":27,"tag":28,"props":1710,"children":1711},{},[1712],{"type":32,"value":1568},{"type":27,"tag":40,"props":1714,"children":1715},{},[1716,1721],{"type":27,"tag":44,"props":1717,"children":1718},{},[1719],{"type":32,"value":1720},"内容更新频繁，但仍要 SEO",{"type":27,"tag":44,"props":1722,"children":1723},{},[1724],{"type":32,"value":1725},"你希望在高峰也保持稳定",{"type":27,"tag":668,"props":1727,"children":1729},{"id":1728},"_25-预渲染prerender",[1730],{"type":32,"value":1731},"2.5 预渲染（prerender）",{"type":27,"tag":28,"props":1733,"children":1734},{},[1735],{"type":32,"value":1545},{"type":27,"tag":40,"props":1737,"children":1738},{},[1739,1744],{"type":27,"tag":44,"props":1740,"children":1741},{},[1742],{"type":32,"value":1743},"对部分路由预先生成 HTML",{"type":27,"tag":44,"props":1745,"children":1746},{},[1747],{"type":32,"value":1748},"适合混合站点",{"type":27,"tag":28,"props":1750,"children":1751},{},[1752],{"type":32,"value":1568},{"type":27,"tag":40,"props":1754,"children":1755},{},[1756,1761],{"type":27,"tag":44,"props":1757,"children":1758},{},[1759],{"type":32,"value":1760},"首页/核心落地页需要 SEO",{"type":27,"tag":44,"props":1762,"children":1763},{},[1764],{"type":32,"value":1765},"工具页/用户页不需要 SEO",{"type":27,"tag":540,"props":1767,"children":1768},{},[],{"type":27,"tag":65,"props":1770,"children":1772},{"id":1771},"_3-选型矩阵可直接用",[1773],{"type":32,"value":1774},"3. 选型矩阵（可直接用）",{"type":27,"tag":28,"props":1776,"children":1777},{},[1778],{"type":32,"value":1779},"你可以按路由维度做选型，而不是全站一刀切。",{"type":27,"tag":1781,"props":1782,"children":1783},"table",{},[1784,1812],{"type":27,"tag":1785,"props":1786,"children":1787},"thead",{},[1788],{"type":27,"tag":1789,"props":1790,"children":1791},"tr",{},[1792,1798,1802,1807],{"type":27,"tag":1793,"props":1794,"children":1795},"th",{},[1796],{"type":32,"value":1797},"页面类型",{"type":27,"tag":1793,"props":1799,"children":1800},{},[1801],{"type":32,"value":1424},{"type":27,"tag":1793,"props":1803,"children":1804},{},[1805],{"type":32,"value":1806},"更新频率",{"type":27,"tag":1793,"props":1808,"children":1809},{},[1810],{"type":32,"value":1811},"推荐",{"type":27,"tag":1813,"props":1814,"children":1815},"tbody",{},[1816,1840,1861,1882,1903,1925],{"type":27,"tag":1789,"props":1817,"children":1818},{},[1819,1825,1830,1835],{"type":27,"tag":1820,"props":1821,"children":1822},"td",{},[1823],{"type":32,"value":1824},"文章详情",{"type":27,"tag":1820,"props":1826,"children":1827},{},[1828],{"type":32,"value":1829},"高",{"type":27,"tag":1820,"props":1831,"children":1832},{},[1833],{"type":32,"value":1834},"中",{"type":27,"tag":1820,"props":1836,"children":1837},{},[1838],{"type":32,"value":1839},"SSG/ISR",{"type":27,"tag":1789,"props":1841,"children":1842},{},[1843,1848,1852,1856],{"type":27,"tag":1820,"props":1844,"children":1845},{},[1846],{"type":32,"value":1847},"文章列表",{"type":27,"tag":1820,"props":1849,"children":1850},{},[1851],{"type":32,"value":1829},{"type":27,"tag":1820,"props":1853,"children":1854},{},[1855],{"type":32,"value":1834},{"type":27,"tag":1820,"props":1857,"children":1858},{},[1859],{"type":32,"value":1860},"SSG/ISR（注意聚合页）",{"type":27,"tag":1789,"props":1862,"children":1863},{},[1864,1869,1873,1877],{"type":27,"tag":1820,"props":1865,"children":1866},{},[1867],{"type":32,"value":1868},"产品详情",{"type":27,"tag":1820,"props":1870,"children":1871},{},[1872],{"type":32,"value":1829},{"type":27,"tag":1820,"props":1874,"children":1875},{},[1876],{"type":32,"value":1829},{"type":27,"tag":1820,"props":1878,"children":1879},{},[1880],{"type":32,"value":1881},"ISR/SSR（配缓存）",{"type":27,"tag":1789,"props":1883,"children":1884},{},[1885,1890,1894,1898],{"type":27,"tag":1820,"props":1886,"children":1887},{},[1888],{"type":32,"value":1889},"搜索结果",{"type":27,"tag":1820,"props":1891,"children":1892},{},[1893],{"type":32,"value":1834},{"type":27,"tag":1820,"props":1895,"children":1896},{},[1897],{"type":32,"value":1829},{"type":27,"tag":1820,"props":1899,"children":1900},{},[1901],{"type":32,"value":1902},"SSR/CSR（配 noindex）",{"type":27,"tag":1789,"props":1904,"children":1905},{},[1906,1911,1916,1920],{"type":27,"tag":1820,"props":1907,"children":1908},{},[1909],{"type":32,"value":1910},"用户中心",{"type":27,"tag":1820,"props":1912,"children":1913},{},[1914],{"type":32,"value":1915},"低",{"type":27,"tag":1820,"props":1917,"children":1918},{},[1919],{"type":32,"value":1829},{"type":27,"tag":1820,"props":1921,"children":1922},{},[1923],{"type":32,"value":1924},"CSR",{"type":27,"tag":1789,"props":1926,"children":1927},{},[1928,1933,1938,1942],{"type":27,"tag":1820,"props":1929,"children":1930},{},[1931],{"type":32,"value":1932},"工具页",{"type":27,"tag":1820,"props":1934,"children":1935},{},[1936],{"type":32,"value":1937},"低/中",{"type":27,"tag":1820,"props":1939,"children":1940},{},[1941],{"type":32,"value":1834},{"type":27,"tag":1820,"props":1943,"children":1944},{},[1945],{"type":32,"value":1946},"CSR + 预渲染核心路由",{"type":27,"tag":540,"props":1948,"children":1949},{},[],{"type":27,"tag":65,"props":1951,"children":1953},{"id":1952},"_4-混合渲染真正的生产最优解",[1954],{"type":32,"value":1955},"4. 混合渲染：真正的生产最优解",{"type":27,"tag":28,"props":1957,"children":1958},{},[1959],{"type":32,"value":1960},"生产上最常见的模式是混合：",{"type":27,"tag":40,"props":1962,"children":1963},{},[1964,1969,1974],{"type":27,"tag":44,"props":1965,"children":1966},{},[1967],{"type":32,"value":1968},"公共内容：静态化（SSG/ISR）+ CDN",{"type":27,"tag":44,"props":1970,"children":1971},{},[1972],{"type":32,"value":1973},"用户态内容：CSR 或 SSR（private/no-store）",{"type":27,"tag":44,"props":1975,"children":1976},{},[1977],{"type":32,"value":1978},"关键落地页：预渲染",{"type":27,"tag":28,"props":1980,"children":1981},{},[1982],{"type":32,"value":1983},"好处：",{"type":27,"tag":40,"props":1985,"children":1986},{},[1987,1992],{"type":27,"tag":44,"props":1988,"children":1989},{},[1990],{"type":32,"value":1991},"SEO 与性能兼得",{"type":27,"tag":44,"props":1993,"children":1994},{},[1995],{"type":32,"value":1996},"成本可控",{"type":27,"tag":540,"props":1998,"children":1999},{},[],{"type":27,"tag":65,"props":2001,"children":2003},{"id":2002},"_5-缓存与失效模式落地的关键",[2004],{"type":32,"value":2005},"5. 缓存与失效：模式落地的关键",{"type":27,"tag":28,"props":2007,"children":2008},{},[2009],{"type":32,"value":2010},"无论你选 SSR 还是 ISR，本质都离不开缓存。",{"type":27,"tag":28,"props":2012,"children":2013},{},[2014],{"type":32,"value":2015},"建议把缓存分层：",{"type":27,"tag":40,"props":2017,"children":2018},{},[2019,2024,2029,2034],{"type":27,"tag":44,"props":2020,"children":2021},{},[2022],{"type":32,"value":2023},"浏览器",{"type":27,"tag":44,"props":2025,"children":2026},{},[2027],{"type":32,"value":2028},"CDN",{"type":27,"tag":44,"props":2030,"children":2031},{},[2032],{"type":32,"value":2033},"应用侧（server runtime）",{"type":27,"tag":44,"props":2035,"children":2036},{},[2037],{"type":32,"value":2038},"数据侧（Redis/DB）",{"type":27,"tag":28,"props":2040,"children":2041},{},[2042],{"type":32,"value":2043},"并给每条路由明确：",{"type":27,"tag":40,"props":2045,"children":2046},{},[2047,2052,2057],{"type":27,"tag":44,"props":2048,"children":2049},{},[2050],{"type":32,"value":2051},"是否 public/private",{"type":27,"tag":44,"props":2053,"children":2054},{},[2055],{"type":32,"value":2056},"TTL 多久",{"type":27,"tag":44,"props":2058,"children":2059},{},[2060],{"type":32,"value":2061},"写操作后如何失效",{"type":27,"tag":540,"props":2063,"children":2064},{},[],{"type":27,"tag":65,"props":2066,"children":2068},{"id":2067},"_6-常见误区",[2069],{"type":32,"value":2070},"6. 常见误区",{"type":27,"tag":40,"props":2072,"children":2073},{},[2074,2079,2084],{"type":27,"tag":44,"props":2075,"children":2076},{},[2077],{"type":32,"value":2078},"“SSR 一定更快”：不一定，TTFB 可能更慢；LCP 受资源与主线程影响更大",{"type":27,"tag":44,"props":2080,"children":2081},{},[2082],{"type":32,"value":2083},"“SSG 一定更好”：构建成本与发布延迟可能无法接受",{"type":27,"tag":44,"props":2085,"children":2086},{},[2087],{"type":32,"value":2088},"“全站一个模式最省事”：短期省事，长期很难优化与扩展",{"type":27,"tag":540,"props":2090,"children":2091},{},[],{"type":27,"tag":65,"props":2093,"children":2095},{"id":2094},"_7-上线检查清单",[2096],{"type":32,"value":2097},"7. 上线检查清单",{"type":27,"tag":40,"props":2099,"children":2102},{"className":2100},[2101],"contains-task-list",[2103,2115,2124,2133,2142],{"type":27,"tag":44,"props":2104,"children":2107},{"className":2105},[2106],"task-list-item",[2108,2113],{"type":27,"tag":2109,"props":2110,"children":2112},"input",{"disabled":444,"type":2111},"checkbox",[],{"type":32,"value":2114}," 按路由明确 SEO 需求（哪些可索引）",{"type":27,"tag":44,"props":2116,"children":2118},{"className":2117},[2106],[2119,2122],{"type":27,"tag":2109,"props":2120,"children":2121},{"disabled":444,"type":2111},[],{"type":32,"value":2123}," 用户态页面是否 private/no-store",{"type":27,"tag":44,"props":2125,"children":2127},{"className":2126},[2106],[2128,2131],{"type":27,"tag":2109,"props":2129,"children":2130},{"disabled":444,"type":2111},[],{"type":32,"value":2132}," 公共内容是否走 CDN 并有合理 TTL",{"type":27,"tag":44,"props":2134,"children":2136},{"className":2135},[2106],[2137,2140],{"type":27,"tag":2109,"props":2138,"children":2139},{"disabled":444,"type":2111},[],{"type":32,"value":2141}," 更新路径是否有失效机制（发布事件）",{"type":27,"tag":44,"props":2143,"children":2145},{"className":2144},[2106],[2146,2149],{"type":27,"tag":2109,"props":2147,"children":2148},{"disabled":444,"type":2111},[],{"type":32,"value":2150}," 是否有 RUM/日志来验证效果",{"type":27,"tag":540,"props":2152,"children":2153},{},[],{"type":27,"tag":65,"props":2155,"children":2156},{"id":369},[2157],{"type":32,"value":369},{"type":27,"tag":28,"props":2159,"children":2160},{},[2161],{"type":32,"value":2162},"Nuxt 渲染模式选型的正确做法是：",{"type":27,"tag":40,"props":2164,"children":2165},{},[2166,2171,2176],{"type":27,"tag":44,"props":2167,"children":2168},{},[2169],{"type":32,"value":2170},"以“页面类型”而不是“站点整体”做选择",{"type":27,"tag":44,"props":2172,"children":2173},{},[2174],{"type":32,"value":2175},"把缓存与失效当成一等公民",{"type":27,"tag":44,"props":2177,"children":2178},{},[2179],{"type":32,"value":2180},"用观测验证，而不是凭感觉",{"title":7,"searchDepth":414,"depth":414,"links":2182},[2183,2184,2185,2192,2193,2194,2195,2196,2197],{"id":1431,"depth":417,"text":1419},{"id":1489,"depth":417,"text":1492},{"id":1531,"depth":417,"text":1534,"children":2186},[2187,2188,2189,2190,2191],{"id":1537,"depth":414,"text":1540},{"id":1590,"depth":414,"text":1593},{"id":1630,"depth":414,"text":1633},{"id":1670,"depth":414,"text":1673},{"id":1728,"depth":414,"text":1731},{"id":1771,"depth":417,"text":1774},{"id":1952,"depth":417,"text":1955},{"id":2002,"depth":417,"text":2005},{"id":2067,"depth":417,"text":2070},{"id":2094,"depth":417,"text":2097},{"id":369,"depth":417,"text":369},"content:topics:nuxt:nuxt-rendering-modes-guide.md","topics/nuxt/nuxt-rendering-modes-guide.md","topics/nuxt/nuxt-rendering-modes-guide",{"_path":2202,"_dir":5,"_draft":6,"_partial":6,"_locale":7,"title":2203,"description":2204,"date":2205,"topic":5,"author":11,"tags":2206,"image":2211,"featured":444,"readingTime":2212,"body":2213,"_type":425,"_id":2738,"_source":427,"_file":2739,"_stem":2740,"_extension":430},"/topics/nuxt/nuxt4-major-updates-overview","Nuxt 4 重大更新全面解读：架构升级与开发体验革新","深入解析 Nuxt 4 的重大更新，包括新目录结构、Nitro 2.0 引擎、兼容性层变化、性能优化等核心改进，帮助开发者全面了解新版本特性并做好升级准备。","2026-01-18",[2207,2208,439,2209,2210],"Nuxt 4","Vue","全栈框架","版本升级","/images/topics/nuxt/nuxt4-features-overview.jpg",16,{"type":24,"children":2214,"toc":2699},[2215,2221,2227,2232,2237,2243,2249,2254,2262,2270,2278,2284,2289,2300,2306,2315,2321,2327,2332,2341,2347,2356,2362,2371,2377,2383,2392,2398,2407,2413,2422,2428,2434,2443,2449,2458,2464,2475,2484,2490,2496,2505,2511,2520,2526,2535,2541,2547,2556,2562,2571,2577,2583,2593,2599,2608,2614,2619,2624,2629,2647,2650,2655],{"type":27,"tag":65,"props":2216,"children":2218},{"id":2217},"nuxt-4-重大更新全面解读",[2219],{"type":32,"value":2220},"Nuxt 4 重大更新全面解读",{"type":27,"tag":65,"props":2222,"children":2224},{"id":2223},"引言nuxt-的又一次进化",[2225],{"type":32,"value":2226},"引言：Nuxt 的又一次进化",{"type":27,"tag":28,"props":2228,"children":2229},{},[2230],{"type":32,"value":2231},"Nuxt 4 的发布标志着这个 Vue 生态中最受欢迎的全栈框架又迈入了新阶段。从 Nuxt 2 到 Nuxt 3 是一次彻底重写，而 Nuxt 3 到 Nuxt 4 则是在成熟架构上的精进打磨——更清晰的目录结构、更强大的引擎、更好的开发体验。",{"type":27,"tag":28,"props":2233,"children":2234},{},[2235],{"type":32,"value":2236},"这篇文章将全面解读 Nuxt 4 的核心变化，帮助你理解这些改动背后的设计理念，以及它们将如何影响你的日常开发。",{"type":27,"tag":65,"props":2238,"children":2240},{"id":2239},"第一部分新目录结构",[2241],{"type":32,"value":2242},"第一部分：新目录结构",{"type":27,"tag":668,"props":2244,"children":2246},{"id":2245},"_11-从扁平到分层",[2247],{"type":32,"value":2248},"1.1 从扁平到分层",{"type":27,"tag":28,"props":2250,"children":2251},{},[2252],{"type":32,"value":2253},"Nuxt 4 引入了新的目录结构，将应用代码与配置分离：",{"type":27,"tag":153,"props":2255,"children":2257},{"code":2256},"# Nuxt 3 目录结构\nproject/\n├── .nuxt/\n├── app.vue\n├── components/\n├── composables/\n├── layouts/\n├── middleware/\n├── pages/\n├── plugins/\n├── public/\n├── server/\n├── nuxt.config.ts\n└── package.json\n\n# Nuxt 4 新目录结构\nproject/\n├── .nuxt/\n├── app/                  # 应用代码集中在 app/ 目录\n│   ├── app.vue\n│   ├── components/\n│   ├── composables/\n│   ├── layouts/\n│   ├── middleware/\n│   ├── pages/\n│   └── plugins/\n├── public/\n├── server/\n├── nuxt.config.ts\n└── package.json\n",[2258],{"type":27,"tag":111,"props":2259,"children":2260},{"__ignoreMap":7},[2261],{"type":32,"value":2256},{"type":27,"tag":28,"props":2263,"children":2264},{},[2265],{"type":27,"tag":459,"props":2266,"children":2267},{},[2268],{"type":32,"value":2269},"为什么这样设计？",{"type":27,"tag":153,"props":2271,"children":2273},{"code":2272},"┌────────────────────────────────────────────────────────────┐\n│              新目录结构的设计理念                            │\n├────────────────────────────────────────────────────────────┤\n│                                                            │\n│  1. 关注点分离                                             │\n│     ├── app/ - 客户端/同构代码                             │\n│     ├── server/ - 服务端代码                               │\n│     └── 根目录 - 配置和公共资源                             │\n│                                                            │\n│  2. 更清晰的项目边界                                       │\n│     ├── Monorepo 友好                                      │\n│     ├── 多应用项目更清晰                                   │\n│     └── 与其他框架惯例对齐                                 │\n│                                                            │\n│  3. 未来扩展性                                             │\n│     ├── 为多前端支持做准备                                 │\n│     └── 便于工具链识别和处理                               │\n│                                                            │\n└────────────────────────────────────────────────────────────┘\n",[2274],{"type":27,"tag":111,"props":2275,"children":2276},{"__ignoreMap":7},[2277],{"type":32,"value":2272},{"type":27,"tag":668,"props":2279,"children":2281},{"id":2280},"_12-向后兼容",[2282],{"type":32,"value":2283},"1.2 向后兼容",{"type":27,"tag":28,"props":2285,"children":2286},{},[2287],{"type":32,"value":2288},"Nuxt 4 提供了兼容性选项，允许继续使用旧目录结构：",{"type":27,"tag":153,"props":2290,"children":2295},{"code":2291,"language":2292,"meta":7,"className":2293},"// nuxt.config.ts\nexport default defineNuxtConfig({\n  future: {\n    compatibilityVersion: 4  // 启用 Nuxt 4 特性\n  },\n  \n  // 如果需要继续使用旧目录结构\n  srcDir: './',  // 而不是 'app/'\n  \n  // 或者自定义目录\n  dir: {\n    app: 'src',\n    pages: 'src/pages',\n    layouts: 'src/layouts'\n  }\n});\n","typescript",[2294],"language-typescript",[2296],{"type":27,"tag":111,"props":2297,"children":2298},{"__ignoreMap":7},[2299],{"type":32,"value":2291},{"type":27,"tag":668,"props":2301,"children":2303},{"id":2302},"_13-appconfigts-变化",[2304],{"type":32,"value":2305},"1.3 app.config.ts 变化",{"type":27,"tag":153,"props":2307,"children":2310},{"code":2308,"language":2292,"meta":7,"className":2309},"// Nuxt 3: app.config.ts 在项目根目录\n// Nuxt 4: app.config.ts 移入 app/ 目录\n\n// app/app.config.ts\nexport default defineAppConfig({\n  ui: {\n    primary: 'green',\n    gray: 'slate'\n  },\n  \n  // 类型安全的应用配置\n  meta: {\n    name: 'My App',\n    description: 'A Nuxt 4 Application'\n  }\n});\n\n// 使用方式不变\nconst appConfig = useAppConfig();\nconsole.log(appConfig.ui.primary);  // 'green'\n",[2294],[2311],{"type":27,"tag":111,"props":2312,"children":2313},{"__ignoreMap":7},[2314],{"type":32,"value":2308},{"type":27,"tag":65,"props":2316,"children":2318},{"id":2317},"第二部分nitro-20-引擎升级",[2319],{"type":32,"value":2320},"第二部分：Nitro 2.0 引擎升级",{"type":27,"tag":668,"props":2322,"children":2324},{"id":2323},"_21-性能提升",[2325],{"type":32,"value":2326},"2.1 性能提升",{"type":27,"tag":28,"props":2328,"children":2329},{},[2330],{"type":32,"value":2331},"Nitro 2.0 带来了显著的性能改进：",{"type":27,"tag":153,"props":2333,"children":2336},{"code":2334,"language":2292,"meta":7,"className":2335},"// 冷启动时间优化\n// Nitro 1.x: ~150ms\n// Nitro 2.0: ~80ms (约 47% 提升)\n\n// 内存占用优化\n// 同样的应用，内存占用减少约 20%\n\n// 原因：\n// - 更高效的模块加载\n// - 优化的树摇（tree-shaking）\n// - 减少运行时开销\n",[2294],[2337],{"type":27,"tag":111,"props":2338,"children":2339},{"__ignoreMap":7},[2340],{"type":32,"value":2334},{"type":27,"tag":668,"props":2342,"children":2344},{"id":2343},"_22-新的路由系统",[2345],{"type":32,"value":2346},"2.2 新的路由系统",{"type":27,"tag":153,"props":2348,"children":2351},{"code":2349,"language":2292,"meta":7,"className":2350},"// server/routes/api/[...slug].ts\n\n// Nitro 2.0 新的路由定义方式\nexport default defineEventHandler({\n  // 路由级别配置\n  config: {\n    // 缓存配置\n    cache: {\n      maxAge: 60,\n      staleMaxAge: 3600,\n      swr: true\n    },\n    \n    // CORS 配置\n    cors: {\n      origin: ['https://example.com'],\n      methods: ['GET', 'POST']\n    }\n  },\n  \n  // 处理函数\n  handler: async (event) => {\n    const slug = event.context.params?.slug;\n    return { data: await fetchData(slug) };\n  }\n});\n\n// 支持中间件链\nexport default defineEventHandler({\n  onRequest: [authMiddleware, rateLimitMiddleware],\n  onBeforeResponse: [logMiddleware],\n  \n  handler: (event) => {\n    return { message: 'Hello' };\n  }\n});\n",[2294],[2352],{"type":27,"tag":111,"props":2353,"children":2354},{"__ignoreMap":7},[2355],{"type":32,"value":2349},{"type":27,"tag":668,"props":2357,"children":2359},{"id":2358},"_23-增强的数据获取",[2360],{"type":32,"value":2361},"2.3 增强的数据获取",{"type":27,"tag":153,"props":2363,"children":2366},{"code":2364,"language":2292,"meta":7,"className":2365},"// Nitro 2.0 改进的 $fetch\n\n// 自动请求去重\nconst [user, posts] = await Promise.all([\n  $fetch('/api/user/1'),\n  $fetch('/api/user/1')  // 相同请求自动去重\n]);\n\n// 请求拦截器\nexport default defineNuxtPlugin(() => {\n  const { $fetch } = useNuxtApp();\n  \n  // 全局请求配置\n  globalThis.$fetch = $fetch.create({\n    onRequest({ request, options }) {\n      options.headers = {\n        ...options.headers,\n        Authorization: `Bearer ${getToken()}`\n      };\n    },\n    \n    onResponseError({ response }) {\n      if (response.status === 401) {\n        navigateTo('/login');\n      }\n    }\n  });\n});\n",[2294],[2367],{"type":27,"tag":111,"props":2368,"children":2369},{"__ignoreMap":7},[2370],{"type":32,"value":2364},{"type":27,"tag":65,"props":2372,"children":2374},{"id":2373},"第三部分兼容性层变化",[2375],{"type":32,"value":2376},"第三部分：兼容性层变化",{"type":27,"tag":668,"props":2378,"children":2380},{"id":2379},"_31-移除的废弃-api",[2381],{"type":32,"value":2382},"3.1 移除的废弃 API",{"type":27,"tag":153,"props":2384,"children":2387},{"code":2385,"language":2292,"meta":7,"className":2386},"// Nuxt 4 移除了 Nuxt 3 中标记为废弃的 API\n\n// ❌ 已移除\nimport { defineNuxtRouteMiddleware } from '#app'\n\n// ✅ 使用新的 API\nimport { defineNuxtRouteMiddleware } from 'nuxt/app'\n\n// ❌ 已移除\nconst nuxtApp = useNuxtApp()\nnuxtApp.$router  // 不再有 $ 前缀\n\n// ✅ 使用 composables\nconst router = useRouter()\n\n// ❌ 已移除\nuseAsyncData('key', () => fetch(), { lazy: true })\n\n// ✅ 使用 useLazyAsyncData\nuseLazyAsyncData('key', () => fetch())\n",[2294],[2388],{"type":27,"tag":111,"props":2389,"children":2390},{"__ignoreMap":7},[2391],{"type":32,"value":2385},{"type":27,"tag":668,"props":2393,"children":2395},{"id":2394},"_32-类型系统改进",[2396],{"type":32,"value":2397},"3.2 类型系统改进",{"type":27,"tag":153,"props":2399,"children":2402},{"code":2400,"language":2292,"meta":7,"className":2401},"// Nuxt 4 增强的类型推导\n\n// 页面元数据类型\n// pages/dashboard.vue\n\u003Cscript setup lang=\"ts\">\ndefinePageMeta({\n  // 类型自动推导，IDE 自动补全\n  layout: 'admin',  // 只能填已定义的布局\n  middleware: ['auth'],  // 只能填已定义的中间件\n  \n  // 自定义元数据\n  title: '仪表盘',\n  requiresAuth: true\n});\n\u003C/script>\n\n// 路由参数类型\n// pages/users/[id].vue\n\u003Cscript setup lang=\"ts\">\nconst route = useRoute('users-id');\n//             ^? RouteLocationNormalized\u003C'users-id'>\n\nroute.params.id  // 类型: string\n\u003C/script>\n\n// 运行时配置类型\n// nuxt.config.ts\nexport default defineNuxtConfig({\n  runtimeConfig: {\n    // 私有配置（仅服务端）\n    apiSecret: '',\n    \n    // 公开配置\n    public: {\n      apiBase: ''\n    }\n  }\n});\n\n// 使用时自动推导类型\nconst config = useRuntimeConfig();\nconfig.apiSecret;  // 服务端可用\nconfig.public.apiBase;  // 客户端可用\n",[2294],[2403],{"type":27,"tag":111,"props":2404,"children":2405},{"__ignoreMap":7},[2406],{"type":32,"value":2400},{"type":27,"tag":668,"props":2408,"children":2410},{"id":2409},"_33-useasyncdata-改进",[2411],{"type":32,"value":2412},"3.3 useAsyncData 改进",{"type":27,"tag":153,"props":2414,"children":2417},{"code":2415,"language":2292,"meta":7,"className":2416},"// Nuxt 4 中 useAsyncData 的改进\n\n// 改进 1：更好的错误处理\nconst { data, error, status } = await useAsyncData('users', () => $fetch('/api/users'));\n\n// status 新增更多状态\n// 'idle' | 'pending' | 'success' | 'error'\n\n// 改进 2：简化的刷新机制\nconst { refresh, clear } = await useAsyncData('users', () => $fetch('/api/users'));\n\n// 带参数刷新\nawait refresh({ dedupe: true });\n\n// 清除缓存\nclear();\n\n// 改进 3：深度响应式默认关闭\nconst { data } = await useAsyncData('config', () => $fetch('/api/config'), {\n  deep: false  // 默认 false，提升性能\n});\n\n// 需要深度响应式时显式开启\nconst { data } = await useAsyncData('form', () => $fetch('/api/form'), {\n  deep: true\n});\n",[2294],[2418],{"type":27,"tag":111,"props":2419,"children":2420},{"__ignoreMap":7},[2421],{"type":32,"value":2415},{"type":27,"tag":65,"props":2423,"children":2425},{"id":2424},"第四部分开发体验改进",[2426],{"type":32,"value":2427},"第四部分：开发体验改进",{"type":27,"tag":668,"props":2429,"children":2431},{"id":2430},"_41-nuxt-devtools-增强",[2432],{"type":32,"value":2433},"4.1 Nuxt DevTools 增强",{"type":27,"tag":153,"props":2435,"children":2438},{"code":2436,"language":2292,"meta":7,"className":2437},"// Nuxt 4 内置增强版 DevTools\n\n// 新功能：\n// 1. 组件性能分析\n// - 渲染时间追踪\n// - 不必要渲染检测\n// - 内存使用监控\n\n// 2. 数据流可视化\n// - useAsyncData 调用时序图\n// - 数据缓存状态\n// - 请求去重可视化\n\n// 3. 路由调试\n// - 路由匹配过程\n// - 中间件执行顺序\n// - 导航守卫状态\n\n// 启用高级功能\nexport default defineNuxtConfig({\n  devtools: {\n    enabled: true,\n    \n    // 新选项\n    timeline: {\n      enabled: true  // 启用时间线\n    }\n  }\n});\n",[2294],[2439],{"type":27,"tag":111,"props":2440,"children":2441},{"__ignoreMap":7},[2442],{"type":32,"value":2436},{"type":27,"tag":668,"props":2444,"children":2446},{"id":2445},"_42-热更新优化",[2447],{"type":32,"value":2448},"4.2 热更新优化",{"type":27,"tag":153,"props":2450,"children":2453},{"code":2451,"language":2292,"meta":7,"className":2452},"// Nuxt 4 大幅改进了热更新体验\n\n// 1. 更快的 HMR\n// - 组件变更：\u003C 100ms\n// - 页面变更：\u003C 200ms\n// - 配置变更：\u003C 1s\n\n// 2. 保持状态的更新\n// composables 更新不再丢失组件状态\nconst count = ref(0);  // 更新文件后，值保持\n\n// 3. 错误恢复\n// 修复语法错误后自动恢复，无需重启\n",[2294],[2454],{"type":27,"tag":111,"props":2455,"children":2456},{"__ignoreMap":7},[2457],{"type":32,"value":2451},{"type":27,"tag":668,"props":2459,"children":2461},{"id":2460},"_43-错误处理增强",[2462],{"type":32,"value":2463},"4.3 错误处理增强",{"type":27,"tag":153,"props":2465,"children":2470},{"code":2466,"language":2467,"meta":7,"className":2468},"\u003C!-- app/error.vue - 增强的错误页面 -->\n\u003Ctemplate>\n  \u003Cdiv class=\"error-page\">\n    \u003Ch1>{{ error.statusCode }}\u003C/h1>\n    \u003Cp>{{ error.message }}\u003C/p>\n    \n    \u003C!-- Nuxt 4 新增：错误堆栈（开发环境） -->\n    \u003Cpre v-if=\"isDev && error.stack\">{{ error.stack }}\u003C/pre>\n    \n    \u003C!-- 新增：错误上下文 -->\n    \u003Cdetails v-if=\"error.data\">\n      \u003Csummary>详细信息\u003C/summary>\n      \u003Cpre>{{ error.data }}\u003C/pre>\n    \u003C/details>\n    \n    \u003Cbutton @click=\"handleError\">重试\u003C/button>\n  \u003C/div>\n\u003C/template>\n\n\u003Cscript setup lang=\"ts\">\nconst props = defineProps\u003C{\n  error: {\n    statusCode: number\n    message: string\n    stack?: string\n    data?: Record\u003Cstring, unknown>\n  }\n}>();\n\nconst isDev = process.dev;\n\nfunction handleError() {\n  clearError({ redirect: '/' });\n}\n\u003C/script>\n","vue",[2469],"language-vue",[2471],{"type":27,"tag":111,"props":2472,"children":2473},{"__ignoreMap":7},[2474],{"type":32,"value":2466},{"type":27,"tag":153,"props":2476,"children":2479},{"code":2477,"language":2292,"meta":7,"className":2478},"// server/api/users.ts - 增强的服务端错误\n\nexport default defineEventHandler((event) => {\n  const id = getRouterParam(event, 'id');\n  \n  if (!id) {\n    throw createError({\n      statusCode: 400,\n      message: '缺少用户 ID',\n      \n      // Nuxt 4 新增：结构化错误数据\n      data: {\n        field: 'id',\n        constraint: 'required'\n      }\n    });\n  }\n  \n  // 业务错误\n  throw createError({\n    statusCode: 404,\n    message: '用户不存在',\n    data: {\n      userId: id,\n      suggestion: '请检查用户 ID 是否正确'\n    }\n  });\n});\n",[2294],[2480],{"type":27,"tag":111,"props":2481,"children":2482},{"__ignoreMap":7},[2483],{"type":32,"value":2477},{"type":27,"tag":65,"props":2485,"children":2487},{"id":2486},"第五部分性能优化特性",[2488],{"type":32,"value":2489},"第五部分：性能优化特性",{"type":27,"tag":668,"props":2491,"children":2493},{"id":2492},"_51-更智能的代码分割",[2494],{"type":32,"value":2495},"5.1 更智能的代码分割",{"type":27,"tag":153,"props":2497,"children":2500},{"code":2498,"language":2292,"meta":7,"className":2499},"// Nuxt 4 的自动代码分割更加智能\n\n// 自动路由分割\n// pages/dashboard/\n//   index.vue      -> chunks/dashboard.js\n//   settings.vue   -> chunks/dashboard-settings.js\n//   analytics.vue  -> chunks/dashboard-analytics.js\n\n// 组件级分割\n// components/\n//   HeavyChart.vue -> chunks/heavy-chart.js (自动延迟加载)\n\n// 手动优化\nexport default defineNuxtConfig({\n  vite: {\n    build: {\n      rollupOptions: {\n        output: {\n          // 自定义分块策略\n          manualChunks: {\n            'vendor-vue': ['vue', 'vue-router', 'pinia'],\n            'vendor-ui': ['element-plus']\n          }\n        }\n      }\n    }\n  }\n});\n",[2294],[2501],{"type":27,"tag":111,"props":2502,"children":2503},{"__ignoreMap":7},[2504],{"type":32,"value":2498},{"type":27,"tag":668,"props":2506,"children":2508},{"id":2507},"_52-图片优化增强",[2509],{"type":32,"value":2510},"5.2 图片优化增强",{"type":27,"tag":153,"props":2512,"children":2515},{"code":2513,"language":2467,"meta":7,"className":2514},"\u003C!-- Nuxt 4 的 nuxt-img 增强 -->\n\u003Ctemplate>\n  \u003CNuxtImg\n    src=\"/images/hero.jpg\"\n    \n    \u003C!-- 新增：自动格式选择 -->\n    format=\"webp,avif\"\n    \n    \u003C!-- 新增：艺术指导响应式 -->\n    :sources=\"[\n      { media: '(max-width: 640px)', src: '/images/hero-mobile.jpg' },\n      { media: '(max-width: 1024px)', src: '/images/hero-tablet.jpg' }\n    ]\"\n    \n    \u003C!-- 新增：模糊占位符 -->\n    placeholder=\"/images/hero-blur.jpg\"\n    \n    \u003C!-- 新增：性能提示 -->\n    :priority=\"true\"\n    fetchpriority=\"high\"\n  />\n\u003C/template>\n\n\u003Cscript setup>\n// 编程式使用\nconst img = useImage();\n\n// 生成优化后的 URL\nconst optimizedUrl = img('/images/photo.jpg', {\n  width: 800,\n  height: 600,\n  format: 'webp',\n  quality: 80\n});\n\u003C/script>\n",[2469],[2516],{"type":27,"tag":111,"props":2517,"children":2518},{"__ignoreMap":7},[2519],{"type":32,"value":2513},{"type":27,"tag":668,"props":2521,"children":2523},{"id":2522},"_53-服务端渲染优化",[2524],{"type":32,"value":2525},"5.3 服务端渲染优化",{"type":27,"tag":153,"props":2527,"children":2530},{"code":2528,"language":2292,"meta":7,"className":2529},"// Nuxt 4 SSR 性能优化\n\n// 1. 流式 SSR\n// nuxt.config.ts\nexport default defineNuxtConfig({\n  nitro: {\n    // 启用流式 SSR\n    experimental: {\n      wasm: true\n    }\n  },\n  \n  // 组件流式渲染\n  experimental: {\n    componentIslands: true,  // 组件岛\n    payloadExtraction: true  // Payload 提取\n  }\n});\n\n// 2. 选择性 Hydration\n// pages/article/[id].vue\n\u003Ctemplate>\n  \u003Carticle>\n    \u003C!-- 静态内容，不需要 hydration -->\n    \u003CNuxtIsland name=\"ArticleContent\" :props=\"{ content }\" />\n    \n    \u003C!-- 需要交互的部分 -->\n    \u003CCommentSection :articleId=\"id\" />\n  \u003C/article>\n\u003C/template>\n\n// 3. 预加载优化\n\u003Cscript setup>\n// 智能预加载\nconst { data } = await useAsyncData('article', () => $fetch('/api/article/' + id), {\n  // 预加载相关数据\n  preload: [\n    () => $fetch('/api/comments/' + id),\n    () => $fetch('/api/related/' + id)\n  ]\n});\n\u003C/script>\n",[2294],[2531],{"type":27,"tag":111,"props":2532,"children":2533},{"__ignoreMap":7},[2534],{"type":32,"value":2528},{"type":27,"tag":65,"props":2536,"children":2538},{"id":2537},"第六部分模块生态更新",[2539],{"type":32,"value":2540},"第六部分：模块生态更新",{"type":27,"tag":668,"props":2542,"children":2544},{"id":2543},"_61-官方模块适配",[2545],{"type":32,"value":2546},"6.1 官方模块适配",{"type":27,"tag":153,"props":2548,"children":2551},{"code":2549,"language":2292,"meta":7,"className":2550},"// 主要官方模块的 Nuxt 4 兼容版本\n\n// @nuxtjs/i18n v9\nexport default defineNuxtConfig({\n  modules: ['@nuxtjs/i18n'],\n  \n  i18n: {\n    // 新增：编译时优化\n    bundle: {\n      optimizeTranslations: true\n    },\n    \n    // 新增：类型生成\n    types: 'composition'\n  }\n});\n\n// @nuxt/content v3\nexport default defineNuxtConfig({\n  modules: ['@nuxt/content'],\n  \n  content: {\n    // 新增：更强的查询 API\n    experimental: {\n      clientDB: true,\n      stripQueryParameters: true\n    }\n  }\n});\n\n// @pinia/nuxt v0.6\nexport default defineNuxtConfig({\n  modules: ['@pinia/nuxt'],\n  \n  pinia: {\n    // 新增：自动导入优化\n    storesDirs: ['./stores/**']\n  }\n});\n",[2294],[2552],{"type":27,"tag":111,"props":2553,"children":2554},{"__ignoreMap":7},[2555],{"type":32,"value":2549},{"type":27,"tag":668,"props":2557,"children":2559},{"id":2558},"_62-创建-nuxt-4-兼容模块",[2560],{"type":32,"value":2561},"6.2 创建 Nuxt 4 兼容模块",{"type":27,"tag":153,"props":2563,"children":2566},{"code":2564,"language":2292,"meta":7,"className":2565},"// 模块开发的新约定\n\n// my-module/src/module.ts\nimport { defineNuxtModule, createResolver } from '@nuxt/kit'\n\nexport default defineNuxtModule({\n  meta: {\n    name: 'my-module',\n    configKey: 'myModule',\n    \n    // Nuxt 4 要求\n    compatibility: {\n      nuxt: '^4.0.0'\n    }\n  },\n  \n  defaults: {\n    enabled: true\n  },\n  \n  setup(options, nuxt) {\n    const resolver = createResolver(import.meta.url);\n    \n    // 使用新的 hook API\n    nuxt.hook('app:resolve', (app) => {\n      // app 配置\n    });\n    \n    // 添加运行时插件\n    addPlugin(resolver.resolve('./runtime/plugin'));\n    \n    // 添加组件\n    addComponentsDir({\n      path: resolver.resolve('./runtime/components'),\n      prefix: 'MyModule'\n    });\n  }\n});\n",[2294],[2567],{"type":27,"tag":111,"props":2568,"children":2569},{"__ignoreMap":7},[2570],{"type":32,"value":2564},{"type":27,"tag":65,"props":2572,"children":2574},{"id":2573},"第七部分迁移准备",[2575],{"type":32,"value":2576},"第七部分：迁移准备",{"type":27,"tag":668,"props":2578,"children":2580},{"id":2579},"_71-兼容性检查清单",[2581],{"type":32,"value":2582},"7.1 兼容性检查清单",{"type":27,"tag":153,"props":2584,"children":2588},{"code":2585,"language":425,"meta":7,"className":2586},"## Nuxt 4 迁移检查清单\n\n### 依赖版本\n- [ ] Node.js >= 20\n- [ ] Vue >= 3.4\n- [ ] TypeScript >= 5.3（推荐）\n\n### 代码检查\n- [ ] 移除已废弃的 API 调用\n- [ ] 更新 composables 导入路径\n- [ ] 检查 useAsyncData 用法\n- [ ] 审查中间件语法\n\n### 目录结构\n- [ ] 决定是否采用新目录结构\n- [ ] 移动文件到 app/ 目录（如果采用）\n- [ ] 更新 nuxt.config.ts 配置\n\n### 模块更新\n- [ ] 更新官方模块到兼容版本\n- [ ] 检查第三方模块兼容性\n- [ ] 更新自定义模块\n\n### 测试\n- [ ] 运行全部测试套件\n- [ ] 验证 SSR/SSG 输出\n- [ ] 检查 hydration 错误\n- [ ] 性能基准测试\n",[2587],"language-markdown",[2589],{"type":27,"tag":111,"props":2590,"children":2591},{"__ignoreMap":7},[2592],{"type":32,"value":2585},{"type":27,"tag":668,"props":2594,"children":2596},{"id":2595},"_72-渐进式升级路径",[2597],{"type":32,"value":2598},"7.2 渐进式升级路径",{"type":27,"tag":153,"props":2600,"children":2603},{"code":2601,"language":2292,"meta":7,"className":2602},"// 使用 compatibilityVersion 实现渐进升级\n\n// 阶段 1：启用 Nuxt 4 特性（保持旧目录结构）\nexport default defineNuxtConfig({\n  future: {\n    compatibilityVersion: 4\n  },\n  srcDir: './'  // 保持旧目录结构\n});\n\n// 阶段 2：迁移到新目录结构\n// 1. 创建 app/ 目录\n// 2. 移动文件\n// 3. 更新导入路径\n\n// 阶段 3：完全升级\nexport default defineNuxtConfig({\n  // 移除 future 配置，默认使用 Nuxt 4 行为\n});\n",[2294],[2604],{"type":27,"tag":111,"props":2605,"children":2606},{"__ignoreMap":7},[2607],{"type":32,"value":2601},{"type":27,"tag":65,"props":2609,"children":2611},{"id":2610},"结语稳步前进的进化",[2612],{"type":32,"value":2613},"结语：稳步前进的进化",{"type":27,"tag":28,"props":2615,"children":2616},{},[2617],{"type":32,"value":2618},"Nuxt 4 不是一次颠覆性的重写，而是在 Nuxt 3 坚实基础上的持续改进。新的目录结构带来更好的组织性，Nitro 2.0 带来更好的性能，增强的类型系统带来更好的开发体验。",{"type":27,"tag":28,"props":2620,"children":2621},{},[2622],{"type":32,"value":2623},"对于 Nuxt 3 用户来说，升级路径相对平滑。核心概念没有变化，熟悉的 API 依然工作。Nuxt 团队显然吸取了 Nuxt 2 到 Nuxt 3 升级的经验，这次提供了更友好的迁移体验。",{"type":27,"tag":28,"props":2625,"children":2626},{},[2627],{"type":32,"value":2628},"如果你正在考虑是否升级，建议：",{"type":27,"tag":40,"props":2630,"children":2631},{},[2632,2637,2642],{"type":27,"tag":44,"props":2633,"children":2634},{},[2635],{"type":32,"value":2636},"新项目直接使用 Nuxt 4",{"type":27,"tag":44,"props":2638,"children":2639},{},[2640],{"type":32,"value":2641},"现有项目评估迁移成本后决定",{"type":27,"tag":44,"props":2643,"children":2644},{},[2645],{"type":32,"value":2646},"关注官方迁移指南的更新",{"type":27,"tag":540,"props":2648,"children":2649},{},[],{"type":27,"tag":65,"props":2651,"children":2653},{"id":2652},"参考资源",[2654],{"type":32,"value":2652},{"type":27,"tag":40,"props":2656,"children":2657},{},[2658,2669,2679,2689],{"type":27,"tag":44,"props":2659,"children":2660},{},[2661],{"type":27,"tag":389,"props":2662,"children":2666},{"href":2663,"rel":2664},"https://nuxt.com/blog/v4",[2665],"nofollow",[2667],{"type":32,"value":2668},"Nuxt 4 官方公告",{"type":27,"tag":44,"props":2670,"children":2671},{},[2672],{"type":27,"tag":389,"props":2673,"children":2676},{"href":2674,"rel":2675},"https://nuxt.com/docs/migration/upgrade",[2665],[2677],{"type":32,"value":2678},"Nuxt 4 迁移指南",{"type":27,"tag":44,"props":2680,"children":2681},{},[2682],{"type":27,"tag":389,"props":2683,"children":2686},{"href":2684,"rel":2685},"https://nitro.unjs.io/changelog",[2665],[2687],{"type":32,"value":2688},"Nitro 2.0 更新日志",{"type":27,"tag":44,"props":2690,"children":2691},{},[2692],{"type":27,"tag":389,"props":2693,"children":2696},{"href":2694,"rel":2695},"https://github.com/nuxt/nuxt/issues",[2665],[2697],{"type":32,"value":2698},"Nuxt 路线图",{"title":7,"searchDepth":414,"depth":414,"links":2700},[2701,2702,2703,2708,2713,2718,2723,2728,2732,2736,2737],{"id":2217,"depth":417,"text":2220},{"id":2223,"depth":417,"text":2226},{"id":2239,"depth":417,"text":2242,"children":2704},[2705,2706,2707],{"id":2245,"depth":414,"text":2248},{"id":2280,"depth":414,"text":2283},{"id":2302,"depth":414,"text":2305},{"id":2317,"depth":417,"text":2320,"children":2709},[2710,2711,2712],{"id":2323,"depth":414,"text":2326},{"id":2343,"depth":414,"text":2346},{"id":2358,"depth":414,"text":2361},{"id":2373,"depth":417,"text":2376,"children":2714},[2715,2716,2717],{"id":2379,"depth":414,"text":2382},{"id":2394,"depth":414,"text":2397},{"id":2409,"depth":414,"text":2412},{"id":2424,"depth":417,"text":2427,"children":2719},[2720,2721,2722],{"id":2430,"depth":414,"text":2433},{"id":2445,"depth":414,"text":2448},{"id":2460,"depth":414,"text":2463},{"id":2486,"depth":417,"text":2489,"children":2724},[2725,2726,2727],{"id":2492,"depth":414,"text":2495},{"id":2507,"depth":414,"text":2510},{"id":2522,"depth":414,"text":2525},{"id":2537,"depth":417,"text":2540,"children":2729},[2730,2731],{"id":2543,"depth":414,"text":2546},{"id":2558,"depth":414,"text":2561},{"id":2573,"depth":417,"text":2576,"children":2733},[2734,2735],{"id":2579,"depth":414,"text":2582},{"id":2595,"depth":414,"text":2598},{"id":2610,"depth":417,"text":2613},{"id":2652,"depth":417,"text":2652},"content:topics:nuxt:nuxt4-major-updates-overview.md","topics/nuxt/nuxt4-major-updates-overview.md","topics/nuxt/nuxt4-major-updates-overview",{"_path":4,"_dir":5,"_draft":6,"_partial":6,"_locale":7,"title":8,"description":9,"date":10,"topic":5,"author":11,"tags":2742,"image":18,"imageQuery":19,"pexelsPhotoId":20,"pexelsUrl":21,"featured":6,"readingTime":22,"body":2743,"_type":425,"_id":426,"_source":427,"_file":428,"_stem":429,"_extension":430},[13,14,15,16,17],{"type":24,"children":2744,"toc":3047},[2745,2749,2753,2768,2772,2776,2780,2795,2799,2803,2813,2817,2836,2840,2848,2852,2856,2860,2879,2883,2887,2891,2895,2918,2922,2926,2930,2949,2953,2957,2961,2984,2988,3011,3015,3019,3023],{"type":27,"tag":28,"props":2746,"children":2747},{},[2748],{"type":32,"value":33},{"type":27,"tag":28,"props":2750,"children":2751},{},[2752],{"type":32,"value":38},{"type":27,"tag":40,"props":2754,"children":2755},{},[2756,2760,2764],{"type":27,"tag":44,"props":2757,"children":2758},{},[2759],{"type":32,"value":48},{"type":27,"tag":44,"props":2761,"children":2762},{},[2763],{"type":32,"value":53},{"type":27,"tag":44,"props":2765,"children":2766},{},[2767],{"type":32,"value":58},{"type":27,"tag":28,"props":2769,"children":2770},{},[2771],{"type":32,"value":63},{"type":27,"tag":65,"props":2773,"children":2774},{"id":67},[2775],{"type":32,"value":67},{"type":27,"tag":28,"props":2777,"children":2778},{},[2779],{"type":32,"value":74},{"type":27,"tag":76,"props":2781,"children":2782},{},[2783,2787,2791],{"type":27,"tag":44,"props":2784,"children":2785},{},[2786],{"type":32,"value":83},{"type":27,"tag":44,"props":2788,"children":2789},{},[2790],{"type":32,"value":88},{"type":27,"tag":44,"props":2792,"children":2793},{},[2794],{"type":32,"value":93},{"type":27,"tag":28,"props":2796,"children":2797},{},[2798],{"type":32,"value":98},{"type":27,"tag":65,"props":2800,"children":2801},{"id":101},[2802],{"type":32,"value":104},{"type":27,"tag":28,"props":2804,"children":2805},{},[2806,2807,2812],{"type":32,"value":109},{"type":27,"tag":111,"props":2808,"children":2810},{"className":2809},[],[2811],{"type":32,"value":116},{"type":32,"value":118},{"type":27,"tag":28,"props":2814,"children":2815},{},[2816],{"type":32,"value":123},{"type":27,"tag":40,"props":2818,"children":2819},{},[2820,2824,2828,2832],{"type":27,"tag":44,"props":2821,"children":2822},{},[2823],{"type":32,"value":131},{"type":27,"tag":44,"props":2825,"children":2826},{},[2827],{"type":32,"value":136},{"type":27,"tag":44,"props":2829,"children":2830},{},[2831],{"type":32,"value":141},{"type":27,"tag":44,"props":2833,"children":2834},{},[2835],{"type":32,"value":146},{"type":27,"tag":28,"props":2837,"children":2838},{},[2839],{"type":32,"value":151},{"type":27,"tag":153,"props":2841,"children":2843},{"className":2842,"code":157,"language":158,"meta":7},[156],[2844],{"type":27,"tag":111,"props":2845,"children":2846},{"__ignoreMap":7},[2847],{"type":32,"value":157},{"type":27,"tag":65,"props":2849,"children":2850},{"id":166},[2851],{"type":32,"value":169},{"type":27,"tag":28,"props":2853,"children":2854},{},[2855],{"type":32,"value":174},{"type":27,"tag":28,"props":2857,"children":2858},{},[2859],{"type":32,"value":179},{"type":27,"tag":40,"props":2861,"children":2862},{},[2863,2867,2871,2875],{"type":27,"tag":44,"props":2864,"children":2865},{},[2866],{"type":32,"value":187},{"type":27,"tag":44,"props":2868,"children":2869},{},[2870],{"type":32,"value":192},{"type":27,"tag":44,"props":2872,"children":2873},{},[2874],{"type":32,"value":197},{"type":27,"tag":44,"props":2876,"children":2877},{},[2878],{"type":32,"value":202},{"type":27,"tag":28,"props":2880,"children":2881},{},[2882],{"type":32,"value":207},{"type":27,"tag":65,"props":2884,"children":2885},{"id":210},[2886],{"type":32,"value":210},{"type":27,"tag":28,"props":2888,"children":2889},{},[2890],{"type":32,"value":217},{"type":27,"tag":28,"props":2892,"children":2893},{},[2894],{"type":32,"value":222},{"type":27,"tag":40,"props":2896,"children":2897},{},[2898,2902,2906,2910,2914],{"type":27,"tag":44,"props":2899,"children":2900},{},[2901],{"type":32,"value":230},{"type":27,"tag":44,"props":2903,"children":2904},{},[2905],{"type":32,"value":235},{"type":27,"tag":44,"props":2907,"children":2908},{},[2909],{"type":32,"value":240},{"type":27,"tag":44,"props":2911,"children":2912},{},[2913],{"type":32,"value":245},{"type":27,"tag":44,"props":2915,"children":2916},{},[2917],{"type":32,"value":250},{"type":27,"tag":28,"props":2919,"children":2920},{},[2921],{"type":32,"value":255},{"type":27,"tag":65,"props":2923,"children":2924},{"id":258},[2925],{"type":32,"value":261},{"type":27,"tag":28,"props":2927,"children":2928},{},[2929],{"type":32,"value":266},{"type":27,"tag":40,"props":2931,"children":2932},{},[2933,2937,2941,2945],{"type":27,"tag":44,"props":2934,"children":2935},{},[2936],{"type":32,"value":274},{"type":27,"tag":44,"props":2938,"children":2939},{},[2940],{"type":32,"value":279},{"type":27,"tag":44,"props":2942,"children":2943},{},[2944],{"type":32,"value":284},{"type":27,"tag":44,"props":2946,"children":2947},{},[2948],{"type":32,"value":289},{"type":27,"tag":28,"props":2950,"children":2951},{},[2952],{"type":32,"value":294},{"type":27,"tag":65,"props":2954,"children":2955},{"id":297},[2956],{"type":32,"value":300},{"type":27,"tag":28,"props":2958,"children":2959},{},[2960],{"type":32,"value":305},{"type":27,"tag":76,"props":2962,"children":2963},{},[2964,2968,2972,2976,2980],{"type":27,"tag":44,"props":2965,"children":2966},{},[2967],{"type":32,"value":313},{"type":27,"tag":44,"props":2969,"children":2970},{},[2971],{"type":32,"value":318},{"type":27,"tag":44,"props":2973,"children":2974},{},[2975],{"type":32,"value":323},{"type":27,"tag":44,"props":2977,"children":2978},{},[2979],{"type":32,"value":328},{"type":27,"tag":44,"props":2981,"children":2982},{},[2983],{"type":32,"value":333},{"type":27,"tag":65,"props":2985,"children":2986},{"id":336},[2987],{"type":32,"value":336},{"type":27,"tag":40,"props":2989,"children":2990},{},[2991,2995,2999,3003,3007],{"type":27,"tag":44,"props":2992,"children":2993},{},[2994],{"type":32,"value":346},{"type":27,"tag":44,"props":2996,"children":2997},{},[2998],{"type":32,"value":351},{"type":27,"tag":44,"props":3000,"children":3001},{},[3002],{"type":32,"value":356},{"type":27,"tag":44,"props":3004,"children":3005},{},[3006],{"type":32,"value":361},{"type":27,"tag":44,"props":3008,"children":3009},{},[3010],{"type":32,"value":366},{"type":27,"tag":65,"props":3012,"children":3013},{"id":369},[3014],{"type":32,"value":369},{"type":27,"tag":28,"props":3016,"children":3017},{},[3018],{"type":32,"value":376},{"type":27,"tag":28,"props":3020,"children":3021},{},[3022],{"type":32,"value":381},{"type":27,"tag":40,"props":3024,"children":3025},{},[3026,3033,3040],{"type":27,"tag":44,"props":3027,"children":3028},{},[3029],{"type":27,"tag":389,"props":3030,"children":3031},{"href":391},[3032],{"type":32,"value":394},{"type":27,"tag":44,"props":3034,"children":3035},{},[3036],{"type":27,"tag":389,"props":3037,"children":3038},{"href":400},[3039],{"type":32,"value":403},{"type":27,"tag":44,"props":3041,"children":3042},{},[3043],{"type":27,"tag":389,"props":3044,"children":3045},{"href":409},[3046],{"type":32,"value":412},{"title":7,"searchDepth":414,"depth":414,"links":3048},[3049,3050,3051,3052,3053,3054,3055,3056],{"id":67,"depth":417,"text":67},{"id":101,"depth":417,"text":104},{"id":166,"depth":417,"text":169},{"id":210,"depth":417,"text":210},{"id":258,"depth":417,"text":261},{"id":297,"depth":417,"text":300},{"id":336,"depth":417,"text":336},{"id":369,"depth":417,"text":369},1777644597251]