[{"data":1,"prerenderedAt":2145},["ShallowReactive",2],{"navigation_docs":3,"-devtools-aot-compilation":195,"-devtools-aot-compilation-surround":2140},[4,27,61,75,100,126,147,177],{"title":5,"icon":6,"redirect":7,"path":8,"stem":9,"children":10,"page":26},"Introduction","icon-park-outline:home","\u002Fintroduction\u002Fabout-mion","\u002Fintroduction","1.introduction",[11,14,18,22],{"title":12,"path":7,"stem":13},"About mion","1.introduction\u002F1.about-mion",{"title":15,"path":16,"stem":17},"Quick Start","\u002Fintroduction\u002Fquick-start","1.introduction\u002F2.quick-start",{"title":19,"path":20,"stem":21},"Manual Install","\u002Fintroduction\u002Fmanual-install","1.introduction\u002F3.manual-install",{"title":23,"path":24,"stem":25},"What's Next","\u002Fintroduction\u002Fwhat-is-next","1.introduction\u002F4.what-is-next",false,{"title":28,"icon":29,"path":30,"stem":31,"children":32,"page":26},"Server","icon-park-outline:server","\u002Fserver","20.server",[33,37,41,45,49,53,57],{"title":34,"path":35,"stem":36},"Router Overview","\u002Fserver\u002Foverview","20.server\u002F0.overview",{"title":38,"path":39,"stem":40},"Routes","\u002Fserver\u002Froutes","20.server\u002F1.routes",{"title":42,"path":43,"stem":44},"Middleware","\u002Fserver\u002Fmiddle-fns","20.server\u002F2.middle-fns",{"title":46,"path":47,"stem":48},"Request & Response","\u002Fserver\u002Frequest-and-response","20.server\u002F5.request-and-response",{"title":50,"path":51,"stem":52},"Error Handling","\u002Fserver\u002Ferror-handling","20.server\u002F6.error-handling",{"title":54,"path":55,"stem":56},"Validation","\u002Fserver\u002Fvalidation","20.server\u002F7.validation",{"title":58,"path":59,"stem":60},"Serialization","\u002Fserver\u002Fserialization","20.server\u002F8.serialization",{"title":62,"icon":63,"path":64,"stem":65,"children":66,"page":26},"Drizzle ORM","i-lineicons-drizzle","\u002Fdrizzle-orm","21.drizzle-orm",[67,71],{"title":68,"path":69,"stem":70},"Drizzle Overview","\u002Fdrizzle-orm\u002Fdrizzle-overview","21.drizzle-orm\u002F0.drizzle-overview",{"title":72,"path":73,"stem":74},"Column Mapping","\u002Fdrizzle-orm\u002Fcolumn-mapping","21.drizzle-orm\u002F1.column-mapping",{"title":76,"icon":77,"path":78,"stem":79,"children":80,"page":26},"Client","icon-park-outline:computer","\u002Fclient","3.client",[81,85,88,92,96],{"title":82,"path":83,"stem":84},"Client Overview","\u002Fclient\u002Fclient-overview","3.client\u002F0.client-overview",{"title":50,"path":86,"stem":87},"\u002Fclient\u002Ferror-handling","3.client\u002F1.error-handling",{"title":89,"path":90,"stem":91},"Validation Errors","\u002Fclient\u002Fvalidation-errors","3.client\u002F2.validation-errors",{"title":93,"path":94,"stem":95},"Routes Flow","\u002Fclient\u002Fclient-flow","3.client\u002F3.client-flow",{"title":97,"path":98,"stem":99},"Cancellation & Timeouts","\u002Fclient\u002Fcancellation-timeouts","3.client\u002F4.cancellation-timeouts",{"title":101,"icon":102,"redirect":103,"path":104,"stem":105,"children":106,"page":26},"RunTypes","i-lucide-scan-text","\u002Frun-types\u002Foverview","\u002Frun-types","4.run-types",[107,110,114,118,122],{"title":108,"path":103,"stem":109},"RunTypes Overview","4.run-types\u002F0.overview",{"title":111,"path":112,"stem":113},"Supported Types","\u002Frun-types\u002Ffeatures","4.run-types\u002F1.features",{"title":115,"path":116,"stem":117},"Type Formats","\u002Frun-types\u002Ftype-formats","4.run-types\u002F2.type-formats",{"title":119,"path":120,"stem":121},"Built-in Formats","\u002Frun-types\u002Fbuilt-in-formats","4.run-types\u002F3.built-in-formats",{"title":123,"path":124,"stem":125},"Caveats","\u002Frun-types\u002Fcaveats","4.run-types\u002F4.caveats",{"title":127,"path":128,"stem":129,"children":130,"page":26},"Devtools","\u002Fdevtools","5.devtools",[131,135,139,143],{"title":132,"path":133,"stem":134},"AOT Compilation","\u002Fdevtools\u002Faot-compilation","5.devtools\u002F0.aot-compilation",{"title":136,"path":137,"stem":138},"Pure Functions","\u002Fdevtools\u002Fpure-functions","5.devtools\u002F1.pure-functions",{"title":140,"path":141,"stem":142},"ESLint Rules","\u002Fdevtools\u002Feslint-rules","5.devtools\u002F2.eslint-rules",{"title":144,"path":145,"stem":146},"Vite Configuration","\u002Fdevtools\u002Fvite-config","5.devtools\u002F3.vite-config",{"title":148,"redirect":149,"icon":150,"path":151,"stem":152,"children":153,"page":26},"Platforms","\u002Fplatforms\u002Fnode-js","icon-park-outline:play","\u002Fplatforms","6.platforms",[154,157,161,165,169,173],{"title":155,"path":149,"stem":156},"Node.js","6.platforms\u002F1.node-js",{"title":158,"path":159,"stem":160},"Bun","\u002Fplatforms\u002Fbun","6.platforms\u002F2.bun",{"title":162,"path":163,"stem":164},"AWS Lambda","\u002Fplatforms\u002Faws-lambda","6.platforms\u002F3.aws-lambda",{"title":166,"path":167,"stem":168},"Google Cloud Functions","\u002Fplatforms\u002Fgoogle-cloud-functions","6.platforms\u002F4.google-cloud-functions",{"title":170,"path":171,"stem":172},"Cloudflare Workers","\u002Fplatforms\u002Fcloudflare","6.platforms\u002F5.cloudflare",{"title":174,"path":175,"stem":176},"Vercel","\u002Fplatforms\u002Fvercel","6.platforms\u002F6.vercel",{"title":178,"icon":179,"redirect":180,"path":181,"stem":182,"children":183,"page":26},"Benchmarks","icon-park-outline:chart-line","\u002Fbenchmarks\u002Fhello-world","\u002Fbenchmarks","7.benchmarks",[184,187,191],{"title":185,"path":180,"stem":186},"Hello World","7.benchmarks\u002F1.hello-world",{"title":188,"path":189,"stem":190},"Light Validation","\u002Fbenchmarks\u002Flight-validation","7.benchmarks\u002F2.light-validation",{"title":192,"path":193,"stem":194},"Heavy Validation","\u002Fbenchmarks\u002Fheavy-validation","7.benchmarks\u002F3.heavy-validation",{"id":196,"title":132,"body":197,"description":2134,"extension":2135,"links":2136,"meta":2137,"navigation":685,"path":133,"seo":2138,"stem":134,"__hash__":2139},"docs\u002F5.devtools\u002F0.aot-compilation.md",{"type":198,"value":199},"minimark",[200,213,218,286,290,293,308,311,316,323,373,380,405,413,417,420,490,497,572,576,586,593,597,603,606,617,1169,1184,1188,1192,1202,1371,1377,1381,1387,1413,1458,1467,1471,1993,1997,2006,2091,2102,2106,2109,2124,2130],[201,202,203,204,208,209,212],"p",{},"mion's Vite plugin provides ",[205,206,207],"strong",{},"Ahead-of-Time (AOT) compilation"," that pre-compiles critical runtime functions at build time. Instead of writing files to disk, AOT caches are generated as ",[205,210,211],{},"Vite virtual modules"," that get embedded directly into your server bundle.",[214,215,217],"h2",{"id":216},"benefits","Benefits",[219,220,222],"stylish-list",{"type":221},"check",[223,224,225,235,242,257,272,279],"ul",{},[226,227,228,234],"li",{},[229,230,233],"span",{"className":231},[232],"text-highlighted","Performance:"," Pre-compile JIT functions, pure functions, and router methods before deployment",[226,236,237,241],{},[229,238,240],{"className":239},[232],"Faster Startup:"," Eliminate runtime compilation overhead by loading pre-built caches",[226,243,244,248,249,253,254],{},[229,245,247],{"className":246},[232],"Secure Environments:"," Run in environments like Cloudflare Workers that do not allow ",[250,251,252],"code",{},"eval"," or ",[250,255,256],{},"new Function",[226,258,259,263,264,267,268,271],{},[229,260,262],{"className":261},[232],"Lazy Loading:"," When ",[250,265,266],{},"aot: true"," is set, the heavy ",[250,269,270],{},"@mionjs\u002Frun-types"," package is NOT loaded at all",[226,273,274,278],{},[229,275,277],{"className":276},[232],"Smaller Bundles:"," With proper tree-shaking, run-types is excluded from production bundles in AOT mode",[226,280,281,285],{},[229,282,284],{"className":283},[232],"Zero Disk Artifacts:"," Caches live as virtual modules — no generated files to commit or manage",[214,287,289],{"id":288},"how-it-works","How It Works",[201,291,292],{},"mion uses Just-In-Time (JIT) compilation to generate validation and serialization functions at runtime. While this provides great flexibility, it has two main drawbacks:",[294,295,296,302],"ol",{},[226,297,298,301],{},[205,299,300],{},"Startup overhead",": Functions are compiled when the application starts",[226,303,304,307],{},[205,305,306],{},"Security restrictions",": Some environments (like Cloudflare Workers) don't allow dynamic code generation",[201,309,310],{},"AOT compilation solves both issues by pre-compiling these functions during your Vite build process.",[312,313,315],"h3",{"id":314},"the-build-pipeline","The Build Pipeline",[201,317,318,319,322],{},"The mion Vite plugin generates AOT caches through this pipeline (using the ",[250,320,321],{},"server"," configuration):",[294,324,325,345,351,361,367],{},[226,326,327,332,333,336,337,340,341,344],{},[205,328,329],{},[250,330,331],{},"buildStart"," — The plugin spawns a ",[250,334,335],{},"vite-node"," child process that runs your server start script (or uses ",[250,338,339],{},"ssrLoadModule"," in ",[250,342,343],{},"middleware"," mode)",[226,346,347,350],{},[205,348,349],{},"Router initialization"," — Your server starts, registers all routes, and compiles JIT functions",[226,352,353,356,357,360],{},[205,354,355],{},"Cache capture"," — The router detects AOT compilation mode (",[250,358,359],{},"MION_COMPILE"," env) and emits all caches",[226,362,363,366],{},[205,364,365],{},"Virtual modules"," — The plugin stores the caches and serves them as Vite virtual modules",[226,368,369,372],{},[205,370,371],{},"Bundle embedding"," — When your app imports a virtual module, the cached code is embedded in the bundle",[201,374,375,376,379],{},"The ",[250,377,378],{},"server.runMode"," determines how the server process is managed:",[223,381,382,390,398],{},[226,383,384,389],{},[205,385,386],{},[250,387,388],{},"buildOnly",": Spawn child, generate caches, kill child (best for production builds)",[226,391,392,397],{},[205,393,394],{},[250,395,396],{},"childProcess",": Spawn child, generate caches, keep server running (best for development\u002Ftesting)",[226,399,400,404],{},[205,401,402],{},[250,403,343],{},": Load in same Vite process (for frameworks like Nuxt)",[201,406,407,408,412],{},"See ",[409,410,144],"a",{"href":411},".\u002Fvite-config#server-modes"," for details on each mode.",[312,414,416],{"id":415},"virtual-modules","Virtual Modules",[201,418,419],{},"The plugin generates these virtual modules that you can import in your application:",[421,422,423,436],"table",{},[424,425,426],"thead",{},[427,428,429,433],"tr",{},[430,431,432],"th",{},"Module",[430,434,435],{},"Description",[437,438,439,450,460,470,480],"tbody",{},[427,440,441,447],{},[442,443,444],"td",{},[250,445,446],{},"virtual:mion-aot\u002Fjit-fns",[442,448,449],{},"Pre-compiled JIT validation\u002Fserialization functions",[427,451,452,457],{},[442,453,454],{},[250,455,456],{},"virtual:mion-aot\u002Fpure-fns",[442,458,459],{},"Pre-compiled pure functions cache",[427,461,462,467],{},[442,463,464],{},[250,465,466],{},"virtual:mion-aot\u002Frouter-cache",[442,468,469],{},"Router methods metadata cache",[427,471,472,477],{},[442,473,474],{},[250,475,476],{},"virtual:mion-aot\u002Fcaches",[442,478,479],{},"Combined module — imports and registers all 3 caches",[427,481,482,487],{},[442,483,484],{},[250,485,486],{},"virtual:mion-server-pure-fns",[442,488,489],{},"Server pure functions extracted from client code",[201,491,492,493,496],{},"For TypeScript support, add the virtual module type definitions to your ",[250,494,495],{},"tsconfig.json",":",[498,499,504],"pre",{"className":500,"code":501,"filename":495,"language":502,"meta":503,"style":503},"language-json shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","{\n  \"compilerOptions\": {\n    \"types\": [\"@mionjs\u002Fdevtools\u002Fvirtual-modules\"]\n  }\n}\n","json","",[250,505,506,514,532,560,566],{"__ignoreMap":503},[229,507,510],{"class":508,"line":509},"line",1,[229,511,513],{"class":512},"sMK4o","{\n",[229,515,517,520,524,527,529],{"class":508,"line":516},2,[229,518,519],{"class":512},"  \"",[229,521,523],{"class":522},"spNyl","compilerOptions",[229,525,526],{"class":512},"\"",[229,528,496],{"class":512},[229,530,531],{"class":512}," {\n",[229,533,535,538,542,544,546,549,551,555,557],{"class":508,"line":534},3,[229,536,537],{"class":512},"    \"",[229,539,541],{"class":540},"sBMFI","types",[229,543,526],{"class":512},[229,545,496],{"class":512},[229,547,548],{"class":512}," [",[229,550,526],{"class":512},[229,552,554],{"class":553},"sfazB","@mionjs\u002Fdevtools\u002Fvirtual-modules",[229,556,526],{"class":512},[229,558,559],{"class":512},"]\n",[229,561,563],{"class":508,"line":562},4,[229,564,565],{"class":512},"  }\n",[229,567,569],{"class":508,"line":568},5,[229,570,571],{"class":512},"}\n",[312,573,575],{"id":574},"cache","Cache",[201,577,578,579,582,583,585],{},"The plugin caches AOT results on disk (in Vite's ",[250,580,581],{},"node_modules\u002F.vite\u002F"," by default) so subsequent builds skip the expensive ",[250,584,335],{}," step when your server source hasn't changed. The cache is invalidated automatically when source files change, the devtools version updates, or AOT options change.",[201,587,588,589,592],{},"Set ",[250,590,591],{},"MION_AOT_FORCE=true"," to force regeneration regardless of the cache.",[214,594,596],{"id":595},"important-what-gets-compiled","Important: What Gets Compiled",[598,599,600],"warning",{},[205,601,602],{},"AOT only compiles routes and types that are initialized when running your start script.",[201,604,605],{},"The AOT build process works by executing your start script and capturing all routes that get registered. This means:",[223,607,608,611,614],{},[226,609,610],{},"Routes not loaded by the start script will not be compiled",[226,612,613],{},"Types not exposed in route\u002FmiddleFn parameters or return types will not be compiled",[226,615,616],{},"Dynamically created types at runtime will not be compiled",[498,618,622],{"className":619,"code":620,"language":621,"meta":503,"style":503},"language-ts shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","import {Routes, route} from '@mionjs\u002Frouter';\nimport {runType} from '@mionjs\u002Frun-types';\n\ninterface User {\n    id: string;\n    name: string;\n}\n\ninterface AuditLog {\n    action: string;\n    timestamp: Date;\n}\n\ndeclare function findUser(id: string): User;\n\nconst routes = {\n    \u002F\u002F ✅ User type WILL be compiled (exposed in return type)\n    getUser: route((ctx, id: string): User => {\n        return findUser(id);\n    }),\n\n    \u002F\u002F ✅ string parameter WILL be compiled\n    saveUser: route((ctx, name: string): void => {\n        \u002F\u002F ...\n    }),\n} satisfies Routes;\n\n\u002F\u002F ❌ AuditLog type will NOT be compiled!\n\u002F\u002F It's not used in any route parameter or return type\nasync function logAction(log: AuditLog): Promise\u003Cvoid> {\n    const validate = await runType\u003CAuditLog>().createJitFunction('isType');\n    \u002F\u002F This will fail in secure environments (no JIT available)\n}\n\n\u002F\u002F ❌ This route won't be compiled if it's in a file\n\u002F\u002F that is not imported by the start script\n\u002F\u002F routes-admin.ts (not imported)\nconst adminRoutes = {\n    deleteUser: route((ctx, id: string): void => {\n        \u002F* ... *\u002F\n    }),\n};\n","ts",[250,623,624,660,681,687,697,710,722,727,732,742,754,767,772,777,808,813,827,834,869,886,897,902,908,942,948,957,970,975,981,987,1023,1070,1076,1081,1086,1092,1098,1104,1116,1148,1154,1163],{"__ignoreMap":503},[229,625,626,630,633,636,639,642,645,648,651,654,657],{"class":508,"line":509},[229,627,629],{"class":628},"s7zQu","import",[229,631,632],{"class":512}," {",[229,634,38],{"class":635},"sTEyZ",[229,637,638],{"class":512},",",[229,640,641],{"class":635}," route",[229,643,644],{"class":512},"}",[229,646,647],{"class":628}," from",[229,649,650],{"class":512}," '",[229,652,653],{"class":553},"@mionjs\u002Frouter",[229,655,656],{"class":512},"'",[229,658,659],{"class":512},";\n",[229,661,662,664,666,669,671,673,675,677,679],{"class":508,"line":516},[229,663,629],{"class":628},[229,665,632],{"class":512},[229,667,668],{"class":635},"runType",[229,670,644],{"class":512},[229,672,647],{"class":628},[229,674,650],{"class":512},[229,676,270],{"class":553},[229,678,656],{"class":512},[229,680,659],{"class":512},[229,682,683],{"class":508,"line":534},[229,684,686],{"emptyLinePlaceholder":685},true,"\n",[229,688,689,692,695],{"class":508,"line":562},[229,690,691],{"class":522},"interface",[229,693,694],{"class":540}," User",[229,696,531],{"class":512},[229,698,699,703,705,708],{"class":508,"line":568},[229,700,702],{"class":701},"swJcz","    id",[229,704,496],{"class":512},[229,706,707],{"class":540}," string",[229,709,659],{"class":512},[229,711,713,716,718,720],{"class":508,"line":712},6,[229,714,715],{"class":701},"    name",[229,717,496],{"class":512},[229,719,707],{"class":540},[229,721,659],{"class":512},[229,723,725],{"class":508,"line":724},7,[229,726,571],{"class":512},[229,728,730],{"class":508,"line":729},8,[229,731,686],{"emptyLinePlaceholder":685},[229,733,735,737,740],{"class":508,"line":734},9,[229,736,691],{"class":522},[229,738,739],{"class":540}," AuditLog",[229,741,531],{"class":512},[229,743,745,748,750,752],{"class":508,"line":744},10,[229,746,747],{"class":701},"    action",[229,749,496],{"class":512},[229,751,707],{"class":540},[229,753,659],{"class":512},[229,755,757,760,762,765],{"class":508,"line":756},11,[229,758,759],{"class":701},"    timestamp",[229,761,496],{"class":512},[229,763,764],{"class":540}," Date",[229,766,659],{"class":512},[229,768,770],{"class":508,"line":769},12,[229,771,571],{"class":512},[229,773,775],{"class":508,"line":774},13,[229,776,686],{"emptyLinePlaceholder":685},[229,778,780,783,786,790,793,797,799,801,804,806],{"class":508,"line":779},14,[229,781,782],{"class":522},"declare",[229,784,785],{"class":522}," function",[229,787,789],{"class":788},"s2Zo4"," findUser",[229,791,792],{"class":512},"(",[229,794,796],{"class":795},"sHdIc","id",[229,798,496],{"class":512},[229,800,707],{"class":540},[229,802,803],{"class":512},"):",[229,805,694],{"class":540},[229,807,659],{"class":512},[229,809,811],{"class":508,"line":810},15,[229,812,686],{"emptyLinePlaceholder":685},[229,814,816,819,822,825],{"class":508,"line":815},16,[229,817,818],{"class":522},"const",[229,820,821],{"class":635}," routes ",[229,823,824],{"class":512},"=",[229,826,531],{"class":512},[229,828,830],{"class":508,"line":829},17,[229,831,833],{"class":832},"sHwdD","    \u002F\u002F ✅ User type WILL be compiled (exposed in return type)\n",[229,835,837,840,842,844,846,848,851,853,856,858,860,862,864,867],{"class":508,"line":836},18,[229,838,839],{"class":701},"    getUser",[229,841,496],{"class":512},[229,843,641],{"class":788},[229,845,792],{"class":635},[229,847,792],{"class":512},[229,849,850],{"class":795},"ctx",[229,852,638],{"class":512},[229,854,855],{"class":795}," id",[229,857,496],{"class":512},[229,859,707],{"class":540},[229,861,803],{"class":512},[229,863,694],{"class":540},[229,865,866],{"class":522}," =>",[229,868,531],{"class":512},[229,870,872,875,877,879,881,884],{"class":508,"line":871},19,[229,873,874],{"class":628},"        return",[229,876,789],{"class":788},[229,878,792],{"class":701},[229,880,796],{"class":635},[229,882,883],{"class":701},")",[229,885,659],{"class":512},[229,887,889,892,894],{"class":508,"line":888},20,[229,890,891],{"class":512},"    }",[229,893,883],{"class":635},[229,895,896],{"class":512},",\n",[229,898,900],{"class":508,"line":899},21,[229,901,686],{"emptyLinePlaceholder":685},[229,903,905],{"class":508,"line":904},22,[229,906,907],{"class":832},"    \u002F\u002F ✅ string parameter WILL be compiled\n",[229,909,911,914,916,918,920,922,924,926,929,931,933,935,938,940],{"class":508,"line":910},23,[229,912,913],{"class":701},"    saveUser",[229,915,496],{"class":512},[229,917,641],{"class":788},[229,919,792],{"class":635},[229,921,792],{"class":512},[229,923,850],{"class":795},[229,925,638],{"class":512},[229,927,928],{"class":795}," name",[229,930,496],{"class":512},[229,932,707],{"class":540},[229,934,803],{"class":512},[229,936,937],{"class":540}," void",[229,939,866],{"class":522},[229,941,531],{"class":512},[229,943,945],{"class":508,"line":944},24,[229,946,947],{"class":832},"        \u002F\u002F ...\n",[229,949,951,953,955],{"class":508,"line":950},25,[229,952,891],{"class":512},[229,954,883],{"class":635},[229,956,896],{"class":512},[229,958,960,962,965,968],{"class":508,"line":959},26,[229,961,644],{"class":512},[229,963,964],{"class":628}," satisfies",[229,966,967],{"class":540}," Routes",[229,969,659],{"class":512},[229,971,973],{"class":508,"line":972},27,[229,974,686],{"emptyLinePlaceholder":685},[229,976,978],{"class":508,"line":977},28,[229,979,980],{"class":832},"\u002F\u002F ❌ AuditLog type will NOT be compiled!\n",[229,982,984],{"class":508,"line":983},29,[229,985,986],{"class":832},"\u002F\u002F It's not used in any route parameter or return type\n",[229,988,990,993,995,998,1000,1003,1005,1007,1009,1012,1015,1018,1021],{"class":508,"line":989},30,[229,991,992],{"class":522},"async",[229,994,785],{"class":522},[229,996,997],{"class":788}," logAction",[229,999,792],{"class":512},[229,1001,1002],{"class":795},"log",[229,1004,496],{"class":512},[229,1006,739],{"class":540},[229,1008,803],{"class":512},[229,1010,1011],{"class":540}," Promise",[229,1013,1014],{"class":512},"\u003C",[229,1016,1017],{"class":540},"void",[229,1019,1020],{"class":512},">",[229,1022,531],{"class":512},[229,1024,1026,1029,1032,1035,1038,1041,1043,1046,1048,1051,1054,1057,1059,1061,1064,1066,1068],{"class":508,"line":1025},31,[229,1027,1028],{"class":522},"    const",[229,1030,1031],{"class":635}," validate",[229,1033,1034],{"class":512}," =",[229,1036,1037],{"class":628}," await",[229,1039,1040],{"class":788}," runType",[229,1042,1014],{"class":512},[229,1044,1045],{"class":540},"AuditLog",[229,1047,1020],{"class":512},[229,1049,1050],{"class":701},"()",[229,1052,1053],{"class":512},".",[229,1055,1056],{"class":788},"createJitFunction",[229,1058,792],{"class":701},[229,1060,656],{"class":512},[229,1062,1063],{"class":553},"isType",[229,1065,656],{"class":512},[229,1067,883],{"class":701},[229,1069,659],{"class":512},[229,1071,1073],{"class":508,"line":1072},32,[229,1074,1075],{"class":832},"    \u002F\u002F This will fail in secure environments (no JIT available)\n",[229,1077,1079],{"class":508,"line":1078},33,[229,1080,571],{"class":512},[229,1082,1084],{"class":508,"line":1083},34,[229,1085,686],{"emptyLinePlaceholder":685},[229,1087,1089],{"class":508,"line":1088},35,[229,1090,1091],{"class":832},"\u002F\u002F ❌ This route won't be compiled if it's in a file\n",[229,1093,1095],{"class":508,"line":1094},36,[229,1096,1097],{"class":832},"\u002F\u002F that is not imported by the start script\n",[229,1099,1101],{"class":508,"line":1100},37,[229,1102,1103],{"class":832},"\u002F\u002F routes-admin.ts (not imported)\n",[229,1105,1107,1109,1112,1114],{"class":508,"line":1106},38,[229,1108,818],{"class":522},[229,1110,1111],{"class":635}," adminRoutes ",[229,1113,824],{"class":512},[229,1115,531],{"class":512},[229,1117,1119,1122,1124,1126,1128,1130,1132,1134,1136,1138,1140,1142,1144,1146],{"class":508,"line":1118},39,[229,1120,1121],{"class":701},"    deleteUser",[229,1123,496],{"class":512},[229,1125,641],{"class":788},[229,1127,792],{"class":635},[229,1129,792],{"class":512},[229,1131,850],{"class":795},[229,1133,638],{"class":512},[229,1135,855],{"class":795},[229,1137,496],{"class":512},[229,1139,707],{"class":540},[229,1141,803],{"class":512},[229,1143,937],{"class":540},[229,1145,866],{"class":522},[229,1147,531],{"class":512},[229,1149,1151],{"class":508,"line":1150},40,[229,1152,1153],{"class":832},"        \u002F* ... *\u002F\n",[229,1155,1157,1159,1161],{"class":508,"line":1156},41,[229,1158,891],{"class":512},[229,1160,883],{"class":635},[229,1162,896],{"class":512},[229,1164,1166],{"class":508,"line":1165},42,[229,1167,1168],{"class":512},"};\n",[1170,1171,1172,1175,1176,1179,1180,1183],"note",{},[205,1173,1174],{},"Solution:"," Ensure your start script imports and registers ALL routes you need. If you use ",[250,1177,1178],{},"runType\u003CT>()"," directly, make sure ",[250,1181,1182],{},"T"," is also used in at least one route parameter or return type.",[214,1185,1187],{"id":1186},"using-aot-caches","Using AOT Caches",[312,1189,1191],{"id":1190},"server-usage","Server Usage",[201,1193,1194,1195,1198,1199,1201],{},"Import the combined caches module ",[205,1196,1197],{},"before"," initializing the router. The ",[250,1200,476],{}," module automatically registers all caches:",[498,1203,1205],{"className":619,"code":1204,"language":621,"meta":503,"style":503},"\u002F\u002F Import cache exports from your AOT package\nimport {routerCache, jitFnsCache, pureFnsCache} from 'my-api-aot';\n\u002F\u002F Import the cache loading function from @mionjs\u002Fcore\nimport {addAOTCaches} from '@mionjs\u002Fcore';\n\u002F\u002F Now initialize your router - it will use the pre-compiled functions\nimport {initMionRouter} from '@mionjs\u002Frouter';\nimport {routes as myRoutes} from '.\u002Faot-routes-example.ts';\n\n\u002F\u002F Load the pre-compiled caches BEFORE initializing the router\naddAOTCaches(jitFnsCache, pureFnsCache);\nexport const myApi = await initMionRouter(myRoutes);\n",[250,1206,1207,1212,1244,1249,1271,1276,1297,1325,1329,1334,1348],{"__ignoreMap":503},[229,1208,1209],{"class":508,"line":509},[229,1210,1211],{"class":832},"\u002F\u002F Import cache exports from your AOT package\n",[229,1213,1214,1216,1218,1221,1223,1226,1228,1231,1233,1235,1237,1240,1242],{"class":508,"line":516},[229,1215,629],{"class":628},[229,1217,632],{"class":512},[229,1219,1220],{"class":635},"routerCache",[229,1222,638],{"class":512},[229,1224,1225],{"class":635}," jitFnsCache",[229,1227,638],{"class":512},[229,1229,1230],{"class":635}," pureFnsCache",[229,1232,644],{"class":512},[229,1234,647],{"class":628},[229,1236,650],{"class":512},[229,1238,1239],{"class":553},"my-api-aot",[229,1241,656],{"class":512},[229,1243,659],{"class":512},[229,1245,1246],{"class":508,"line":534},[229,1247,1248],{"class":832},"\u002F\u002F Import the cache loading function from @mionjs\u002Fcore\n",[229,1250,1251,1253,1255,1258,1260,1262,1264,1267,1269],{"class":508,"line":562},[229,1252,629],{"class":628},[229,1254,632],{"class":512},[229,1256,1257],{"class":635},"addAOTCaches",[229,1259,644],{"class":512},[229,1261,647],{"class":628},[229,1263,650],{"class":512},[229,1265,1266],{"class":553},"@mionjs\u002Fcore",[229,1268,656],{"class":512},[229,1270,659],{"class":512},[229,1272,1273],{"class":508,"line":568},[229,1274,1275],{"class":832},"\u002F\u002F Now initialize your router - it will use the pre-compiled functions\n",[229,1277,1278,1280,1282,1285,1287,1289,1291,1293,1295],{"class":508,"line":712},[229,1279,629],{"class":628},[229,1281,632],{"class":512},[229,1283,1284],{"class":635},"initMionRouter",[229,1286,644],{"class":512},[229,1288,647],{"class":628},[229,1290,650],{"class":512},[229,1292,653],{"class":553},[229,1294,656],{"class":512},[229,1296,659],{"class":512},[229,1298,1299,1301,1303,1306,1309,1312,1314,1316,1318,1321,1323],{"class":508,"line":724},[229,1300,629],{"class":628},[229,1302,632],{"class":512},[229,1304,1305],{"class":635},"routes",[229,1307,1308],{"class":628}," as",[229,1310,1311],{"class":635}," myRoutes",[229,1313,644],{"class":512},[229,1315,647],{"class":628},[229,1317,650],{"class":512},[229,1319,1320],{"class":553},".\u002Faot-routes-example.ts",[229,1322,656],{"class":512},[229,1324,659],{"class":512},[229,1326,1327],{"class":508,"line":729},[229,1328,686],{"emptyLinePlaceholder":685},[229,1330,1331],{"class":508,"line":734},[229,1332,1333],{"class":832},"\u002F\u002F Load the pre-compiled caches BEFORE initializing the router\n",[229,1335,1336,1338,1341,1343,1346],{"class":508,"line":744},[229,1337,1257],{"class":788},[229,1339,1340],{"class":635},"(jitFnsCache",[229,1342,638],{"class":512},[229,1344,1345],{"class":635}," pureFnsCache)",[229,1347,659],{"class":512},[229,1349,1350,1353,1356,1359,1361,1363,1366,1369],{"class":508,"line":756},[229,1351,1352],{"class":628},"export",[229,1354,1355],{"class":522}," const",[229,1357,1358],{"class":635}," myApi ",[229,1360,824],{"class":512},[229,1362,1037],{"class":628},[229,1364,1365],{"class":788}," initMionRouter",[229,1367,1368],{"class":635},"(myRoutes)",[229,1370,659],{"class":512},[1170,1372,1373,1376],{},[205,1374,1375],{},"Important:"," You must import the AOT caches before initializing the router. The router checks for pre-compiled functions during initialization and uses them instead of generating new ones.",[312,1378,1380],{"id":1379},"enabling-strict-aot-mode","Enabling Strict AOT Mode",[201,1382,1383,1384,1386],{},"When you set ",[250,1385,266],{}," in the router options, the router operates in strict AOT mode:",[223,1388,1389,1397,1407],{},[226,1390,1391,1394,1395,271],{},[205,1392,1393],{},"No run-types loading",": The heavy ",[250,1396,270],{},[226,1398,1399,1402,1403,1406],{},[205,1400,1401],{},"Fail-fast validation",": If any route\u002FmiddleFn is missing from the AOT cache, an ",[250,1404,1405],{},"AOTCacheError"," is thrown immediately",[226,1408,1409,1412],{},[205,1410,1411],{},"Smaller bundles",": With proper tree-shaking, run-types is excluded from production bundles",[498,1414,1418],{"className":1415,"code":1416,"language":1417,"meta":503,"style":503},"language-typescript shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","await initMionRouter(routes, {\n  aot: true,  \u002F\u002F Strict AOT mode - run-types will NOT be loaded\n});\n","typescript",[250,1419,1420,1434,1450],{"__ignoreMap":503},[229,1421,1422,1425,1427,1430,1432],{"class":508,"line":509},[229,1423,1424],{"class":628},"await",[229,1426,1365],{"class":788},[229,1428,1429],{"class":635},"(routes",[229,1431,638],{"class":512},[229,1433,531],{"class":512},[229,1435,1436,1439,1441,1445,1447],{"class":508,"line":516},[229,1437,1438],{"class":701},"  aot",[229,1440,496],{"class":512},[229,1442,1444],{"class":1443},"sfNiH"," true",[229,1446,638],{"class":512},[229,1448,1449],{"class":832},"  \u002F\u002F Strict AOT mode - run-types will NOT be loaded\n",[229,1451,1452,1454,1456],{"class":508,"line":534},[229,1453,644],{"class":512},[229,1455,883],{"class":635},[229,1457,659],{"class":512},[598,1459,1460,1461,1463,1464,1466],{},"When ",[250,1462,266],{}," is set, ALL routes and middleFns MUST be present in the AOT cache. If any are missing, the router will throw an ",[250,1465,1405],{}," instead of falling back to JIT compilation.",[312,1468,1470],{"id":1469},"complete-server-example","Complete Server Example",[1472,1473,1474,1689],"code-group",{},[498,1475,1478],{"className":619,"code":1476,"filename":1477,"language":621,"meta":503,"style":503},"\u002F\u002F Load AOT caches first\nimport {routerCache, jitFnsCache, pureFnsCache} from 'my-api-aot';\nimport {addAOTCaches} from '@mionjs\u002Fcore';\n\u002F\u002F Then initialize router and server\nimport {initMionRouter} from '@mionjs\u002Frouter';\nimport {initHttp} from '@mionjs\u002Fplatform-node';\nimport {routes} from '.\u002Faot-routes-example.ts';\n\n\u002F\u002F Load the pre-compiled caches BEFORE initializing the router\naddAOTCaches(jitFnsCache, pureFnsCache);\nexport const myApi = await initMionRouter(routes);\n\ninitHttp({port: 3000});\nconsole.log('Server running on port 3000');\n","server.ts",[250,1479,1480,1485,1513,1533,1538,1558,1580,1600,1604,1608,1620,1639,1643,1667],{"__ignoreMap":503},[229,1481,1482],{"class":508,"line":509},[229,1483,1484],{"class":832},"\u002F\u002F Load AOT caches first\n",[229,1486,1487,1489,1491,1493,1495,1497,1499,1501,1503,1505,1507,1509,1511],{"class":508,"line":516},[229,1488,629],{"class":628},[229,1490,632],{"class":512},[229,1492,1220],{"class":635},[229,1494,638],{"class":512},[229,1496,1225],{"class":635},[229,1498,638],{"class":512},[229,1500,1230],{"class":635},[229,1502,644],{"class":512},[229,1504,647],{"class":628},[229,1506,650],{"class":512},[229,1508,1239],{"class":553},[229,1510,656],{"class":512},[229,1512,659],{"class":512},[229,1514,1515,1517,1519,1521,1523,1525,1527,1529,1531],{"class":508,"line":534},[229,1516,629],{"class":628},[229,1518,632],{"class":512},[229,1520,1257],{"class":635},[229,1522,644],{"class":512},[229,1524,647],{"class":628},[229,1526,650],{"class":512},[229,1528,1266],{"class":553},[229,1530,656],{"class":512},[229,1532,659],{"class":512},[229,1534,1535],{"class":508,"line":562},[229,1536,1537],{"class":832},"\u002F\u002F Then initialize router and server\n",[229,1539,1540,1542,1544,1546,1548,1550,1552,1554,1556],{"class":508,"line":568},[229,1541,629],{"class":628},[229,1543,632],{"class":512},[229,1545,1284],{"class":635},[229,1547,644],{"class":512},[229,1549,647],{"class":628},[229,1551,650],{"class":512},[229,1553,653],{"class":553},[229,1555,656],{"class":512},[229,1557,659],{"class":512},[229,1559,1560,1562,1564,1567,1569,1571,1573,1576,1578],{"class":508,"line":712},[229,1561,629],{"class":628},[229,1563,632],{"class":512},[229,1565,1566],{"class":635},"initHttp",[229,1568,644],{"class":512},[229,1570,647],{"class":628},[229,1572,650],{"class":512},[229,1574,1575],{"class":553},"@mionjs\u002Fplatform-node",[229,1577,656],{"class":512},[229,1579,659],{"class":512},[229,1581,1582,1584,1586,1588,1590,1592,1594,1596,1598],{"class":508,"line":724},[229,1583,629],{"class":628},[229,1585,632],{"class":512},[229,1587,1305],{"class":635},[229,1589,644],{"class":512},[229,1591,647],{"class":628},[229,1593,650],{"class":512},[229,1595,1320],{"class":553},[229,1597,656],{"class":512},[229,1599,659],{"class":512},[229,1601,1602],{"class":508,"line":729},[229,1603,686],{"emptyLinePlaceholder":685},[229,1605,1606],{"class":508,"line":734},[229,1607,1333],{"class":832},[229,1609,1610,1612,1614,1616,1618],{"class":508,"line":744},[229,1611,1257],{"class":788},[229,1613,1340],{"class":635},[229,1615,638],{"class":512},[229,1617,1345],{"class":635},[229,1619,659],{"class":512},[229,1621,1622,1624,1626,1628,1630,1632,1634,1637],{"class":508,"line":756},[229,1623,1352],{"class":628},[229,1625,1355],{"class":522},[229,1627,1358],{"class":635},[229,1629,824],{"class":512},[229,1631,1037],{"class":628},[229,1633,1365],{"class":788},[229,1635,1636],{"class":635},"(routes)",[229,1638,659],{"class":512},[229,1640,1641],{"class":508,"line":769},[229,1642,686],{"emptyLinePlaceholder":685},[229,1644,1645,1647,1649,1652,1655,1657,1661,1663,1665],{"class":508,"line":774},[229,1646,1566],{"class":788},[229,1648,792],{"class":635},[229,1650,1651],{"class":512},"{",[229,1653,1654],{"class":701},"port",[229,1656,496],{"class":512},[229,1658,1660],{"class":1659},"sbssI"," 3000",[229,1662,644],{"class":512},[229,1664,883],{"class":635},[229,1666,659],{"class":512},[229,1668,1669,1672,1674,1676,1678,1680,1683,1685,1687],{"class":508,"line":779},[229,1670,1671],{"class":635},"console",[229,1673,1053],{"class":512},[229,1675,1002],{"class":788},[229,1677,792],{"class":635},[229,1679,656],{"class":512},[229,1681,1682],{"class":553},"Server running on port 3000",[229,1684,656],{"class":512},[229,1686,883],{"class":635},[229,1688,659],{"class":512},[498,1690,1693],{"className":619,"code":1691,"filename":1692,"language":621,"meta":503,"style":503},"import {Routes, route} from '@mionjs\u002Frouter';\n\nexport interface User {\n    id: string;\n    name: string;\n    email: string;\n}\n\nexport type MyApi = typeof routes;\n\nexport const routes = {\n    users: {\n        getById: route((ctx, id: string): User => {\n            return {id, name: 'John', email: 'john@example.com'};\n        }),\n        create: route((ctx, user: Omit\u003CUser, 'id'>): User => {\n            return {id: 'USER-123', ...user};\n        }),\n    },\n} satisfies Routes;\n","routes.ts",[250,1694,1695,1719,1723,1734,1744,1754,1765,1769,1773,1793,1797,1809,1818,1849,1887,1896,1943,1970,1978,1983],{"__ignoreMap":503},[229,1696,1697,1699,1701,1703,1705,1707,1709,1711,1713,1715,1717],{"class":508,"line":509},[229,1698,629],{"class":628},[229,1700,632],{"class":512},[229,1702,38],{"class":635},[229,1704,638],{"class":512},[229,1706,641],{"class":635},[229,1708,644],{"class":512},[229,1710,647],{"class":628},[229,1712,650],{"class":512},[229,1714,653],{"class":553},[229,1716,656],{"class":512},[229,1718,659],{"class":512},[229,1720,1721],{"class":508,"line":516},[229,1722,686],{"emptyLinePlaceholder":685},[229,1724,1725,1727,1730,1732],{"class":508,"line":534},[229,1726,1352],{"class":628},[229,1728,1729],{"class":522}," interface",[229,1731,694],{"class":540},[229,1733,531],{"class":512},[229,1735,1736,1738,1740,1742],{"class":508,"line":562},[229,1737,702],{"class":701},[229,1739,496],{"class":512},[229,1741,707],{"class":540},[229,1743,659],{"class":512},[229,1745,1746,1748,1750,1752],{"class":508,"line":568},[229,1747,715],{"class":701},[229,1749,496],{"class":512},[229,1751,707],{"class":540},[229,1753,659],{"class":512},[229,1755,1756,1759,1761,1763],{"class":508,"line":712},[229,1757,1758],{"class":701},"    email",[229,1760,496],{"class":512},[229,1762,707],{"class":540},[229,1764,659],{"class":512},[229,1766,1767],{"class":508,"line":724},[229,1768,571],{"class":512},[229,1770,1771],{"class":508,"line":729},[229,1772,686],{"emptyLinePlaceholder":685},[229,1774,1775,1777,1780,1783,1785,1788,1791],{"class":508,"line":734},[229,1776,1352],{"class":628},[229,1778,1779],{"class":522}," type",[229,1781,1782],{"class":540}," MyApi",[229,1784,1034],{"class":512},[229,1786,1787],{"class":512}," typeof",[229,1789,1790],{"class":635}," routes",[229,1792,659],{"class":512},[229,1794,1795],{"class":508,"line":744},[229,1796,686],{"emptyLinePlaceholder":685},[229,1798,1799,1801,1803,1805,1807],{"class":508,"line":756},[229,1800,1352],{"class":628},[229,1802,1355],{"class":522},[229,1804,821],{"class":635},[229,1806,824],{"class":512},[229,1808,531],{"class":512},[229,1810,1811,1814,1816],{"class":508,"line":769},[229,1812,1813],{"class":701},"    users",[229,1815,496],{"class":512},[229,1817,531],{"class":512},[229,1819,1820,1823,1825,1827,1829,1831,1833,1835,1837,1839,1841,1843,1845,1847],{"class":508,"line":774},[229,1821,1822],{"class":701},"        getById",[229,1824,496],{"class":512},[229,1826,641],{"class":788},[229,1828,792],{"class":635},[229,1830,792],{"class":512},[229,1832,850],{"class":795},[229,1834,638],{"class":512},[229,1836,855],{"class":795},[229,1838,496],{"class":512},[229,1840,707],{"class":540},[229,1842,803],{"class":512},[229,1844,694],{"class":540},[229,1846,866],{"class":522},[229,1848,531],{"class":512},[229,1850,1851,1854,1856,1858,1860,1862,1864,1866,1869,1871,1873,1876,1878,1880,1883,1885],{"class":508,"line":779},[229,1852,1853],{"class":628},"            return",[229,1855,632],{"class":512},[229,1857,796],{"class":635},[229,1859,638],{"class":512},[229,1861,928],{"class":701},[229,1863,496],{"class":512},[229,1865,650],{"class":512},[229,1867,1868],{"class":553},"John",[229,1870,656],{"class":512},[229,1872,638],{"class":512},[229,1874,1875],{"class":701}," email",[229,1877,496],{"class":512},[229,1879,650],{"class":512},[229,1881,1882],{"class":553},"john@example.com",[229,1884,656],{"class":512},[229,1886,1168],{"class":512},[229,1888,1889,1892,1894],{"class":508,"line":810},[229,1890,1891],{"class":512},"        }",[229,1893,883],{"class":635},[229,1895,896],{"class":512},[229,1897,1898,1901,1903,1905,1907,1909,1911,1913,1916,1918,1921,1923,1926,1928,1930,1932,1934,1937,1939,1941],{"class":508,"line":815},[229,1899,1900],{"class":701},"        create",[229,1902,496],{"class":512},[229,1904,641],{"class":788},[229,1906,792],{"class":635},[229,1908,792],{"class":512},[229,1910,850],{"class":795},[229,1912,638],{"class":512},[229,1914,1915],{"class":795}," user",[229,1917,496],{"class":512},[229,1919,1920],{"class":540}," Omit",[229,1922,1014],{"class":512},[229,1924,1925],{"class":540},"User",[229,1927,638],{"class":512},[229,1929,650],{"class":512},[229,1931,796],{"class":553},[229,1933,656],{"class":512},[229,1935,1936],{"class":512},">):",[229,1938,694],{"class":540},[229,1940,866],{"class":522},[229,1942,531],{"class":512},[229,1944,1945,1947,1949,1951,1953,1955,1958,1960,1962,1965,1968],{"class":508,"line":829},[229,1946,1853],{"class":628},[229,1948,632],{"class":512},[229,1950,796],{"class":701},[229,1952,496],{"class":512},[229,1954,650],{"class":512},[229,1956,1957],{"class":553},"USER-123",[229,1959,656],{"class":512},[229,1961,638],{"class":512},[229,1963,1964],{"class":512}," ...",[229,1966,1967],{"class":635},"user",[229,1969,1168],{"class":512},[229,1971,1972,1974,1976],{"class":508,"line":836},[229,1973,1891],{"class":512},[229,1975,883],{"class":635},[229,1977,896],{"class":512},[229,1979,1980],{"class":508,"line":871},[229,1981,1982],{"class":512},"    },\n",[229,1984,1985,1987,1989,1991],{"class":508,"line":888},[229,1986,644],{"class":512},[229,1988,964],{"class":628},[229,1990,967],{"class":540},[229,1992,659],{"class":512},[312,1994,1996],{"id":1995},"using-aot-caches-from-other-packages","Using AOT Caches from Other Packages",[201,1998,1999,2000,2002,2003,496],{},"The router handles AOT cache loading automatically when you set ",[250,2001,266],{}," in the router options. However, if you need to access AOT caches from your own packages or custom code, you can import them directly from ",[250,2004,2005],{},"@mionjs\u002Fcore\u002Faot-caches",[498,2007,2009],{"className":1415,"code":2008,"language":1417,"meta":503,"style":503},"import {loadAOTCaches, getRawAOTCaches} from '@mionjs\u002Fcore\u002Faot-caches';\n\n\u002F\u002F Load and register all AOT caches into the global cache\nloadAOTCaches();\n\n\u002F\u002F Or access the raw cache data directly\nconst {jitFnsCache, pureFnsCache, routerCache} = getRawAOTCaches();\n",[250,2010,2011,2037,2041,2046,2054,2058,2063],{"__ignoreMap":503},[229,2012,2013,2015,2017,2020,2022,2025,2027,2029,2031,2033,2035],{"class":508,"line":509},[229,2014,629],{"class":628},[229,2016,632],{"class":512},[229,2018,2019],{"class":635},"loadAOTCaches",[229,2021,638],{"class":512},[229,2023,2024],{"class":635}," getRawAOTCaches",[229,2026,644],{"class":512},[229,2028,647],{"class":628},[229,2030,650],{"class":512},[229,2032,2005],{"class":553},[229,2034,656],{"class":512},[229,2036,659],{"class":512},[229,2038,2039],{"class":508,"line":516},[229,2040,686],{"emptyLinePlaceholder":685},[229,2042,2043],{"class":508,"line":534},[229,2044,2045],{"class":832},"\u002F\u002F Load and register all AOT caches into the global cache\n",[229,2047,2048,2050,2052],{"class":508,"line":562},[229,2049,2019],{"class":788},[229,2051,1050],{"class":635},[229,2053,659],{"class":512},[229,2055,2056],{"class":508,"line":568},[229,2057,686],{"emptyLinePlaceholder":685},[229,2059,2060],{"class":508,"line":712},[229,2061,2062],{"class":832},"\u002F\u002F Or access the raw cache data directly\n",[229,2064,2065,2067,2069,2072,2074,2076,2078,2081,2083,2085,2087,2089],{"class":508,"line":724},[229,2066,818],{"class":522},[229,2068,632],{"class":512},[229,2070,2071],{"class":635},"jitFnsCache",[229,2073,638],{"class":512},[229,2075,1230],{"class":635},[229,2077,638],{"class":512},[229,2079,2080],{"class":635}," routerCache",[229,2082,644],{"class":512},[229,2084,1034],{"class":512},[229,2086,2024],{"class":788},[229,2088,1050],{"class":635},[229,2090,659],{"class":512},[201,2092,2093,2094,2097,2098,2101],{},"The mion Vite plugin automatically intercepts this import and replaces the underlying empty caches with the real AOT-generated data. This works both when importing from source (",[250,2095,2096],{},".ts",") and from pre-built output (",[250,2099,2100],{},".js","), so any package in your monorepo can consume AOT caches without extra configuration — as long as the Vite plugin is active.",[214,2103,2105],{"id":2104},"secure-environments-cloudflare-workers-etc","Secure Environments (Cloudflare Workers, etc.)",[201,2107,2108],{},"AOT compilation is essential for running mion in secure environments that restrict dynamic code execution.\nEnvironments like Cloudflare Workers, Deno Deploy, and some enterprise environments prohibit:",[223,2110,2111,2116,2121],{},[226,2112,2113],{},[250,2114,2115],{},"eval()",[226,2117,2118],{},[250,2119,2120],{},"new Function()",[226,2122,2123],{},"Other forms of dynamic code generation",[201,2125,2126,2127,2129],{},"mion's JIT compilation normally uses ",[250,2128,2120],{}," to generate validation and serialization functions. AOT compilation pre-generates these functions as static code, eliminating the need for runtime code generation.",[2131,2132,2133],"style",{},"html pre.shiki code .sMK4o, html code.shiki .sMK4o{--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF}html pre.shiki code .spNyl, html code.shiki .spNyl{--shiki-light:#9C3EDA;--shiki-default:#C792EA;--shiki-dark:#C792EA}html pre.shiki code .sBMFI, html code.shiki .sBMFI{--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B}html pre.shiki code .sfazB, html code.shiki .sfazB{--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D}html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html pre.shiki code .s7zQu, html code.shiki .s7zQu{--shiki-light:#39ADB5;--shiki-light-font-style:italic;--shiki-default:#89DDFF;--shiki-default-font-style:italic;--shiki-dark:#89DDFF;--shiki-dark-font-style:italic}html pre.shiki code .sTEyZ, html code.shiki .sTEyZ{--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8}html pre.shiki code .swJcz, html code.shiki .swJcz{--shiki-light:#E53935;--shiki-default:#F07178;--shiki-dark:#F07178}html pre.shiki code .s2Zo4, html code.shiki .s2Zo4{--shiki-light:#6182B8;--shiki-default:#82AAFF;--shiki-dark:#82AAFF}html pre.shiki code .sHdIc, html code.shiki .sHdIc{--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#EEFFFF;--shiki-default-font-style:italic;--shiki-dark:#BABED8;--shiki-dark-font-style:italic}html pre.shiki code .sHwdD, html code.shiki .sHwdD{--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#546E7A;--shiki-default-font-style:italic;--shiki-dark:#676E95;--shiki-dark-font-style:italic}html pre.shiki code .sfNiH, html code.shiki .sfNiH{--shiki-light:#FF5370;--shiki-default:#FF9CAC;--shiki-dark:#FF9CAC}html pre.shiki code .sbssI, html code.shiki .sbssI{--shiki-light:#F76D47;--shiki-default:#F78C6C;--shiki-dark:#F78C6C}","Learn how Ahead-of-Time (AOT) compilation works in mion using the Vite plugin and virtual modules.","md",null,{"toc":26},{"title":132,"description":2134},"OCBIzLXg2oXvoEYjsM_el3TWpE2MhrcZOTr4k6bchMI",[2141,2143],{"title":123,"path":124,"stem":125,"description":2142,"children":-1},"Common pitfalls when using RunTypes and how to avoid them with ESLint rules.",{"title":136,"path":137,"stem":138,"description":2144,"children":-1},"Learn about pure functions — registerPureFnFactory for server-to-client sharing, and pureServerFn\u002FserverMapFrom for client-to-server injection.",1778674529506]