{"compiled":"\"use strict\";\nconst {Fragment: _Fragment, jsx: _jsx, jsxs: _jsxs} = arguments[0];\nfunction _createMdxContent(props) {\n  const _components = {\n    a: \"a\",\n    code: \"code\",\n    figure: \"figure\",\n    h2: \"h2\",\n    li: \"li\",\n    ol: \"ol\",\n    p: \"p\",\n    pre: \"pre\",\n    span: \"span\",\n    strong: \"strong\",\n    table: \"table\",\n    tbody: \"tbody\",\n    td: \"td\",\n    th: \"th\",\n    thead: \"thead\",\n    tr: \"tr\",\n    ...props.components\n  }, {Box} = _components;\n  if (!Box) _missingMdxReference(\"Box\", true);\n  return _jsxs(_Fragment, {\n    children: [_jsx(_components.p, {\n      children: \"v2 features may not work in v3. In order to upgrade an existing server to v3, you must apply the changes in v3.\"\n    }), \"\\n\", _jsx(_components.h2, {\n      children: \"Packages\"\n    }), \"\\n\", _jsxs(_components.p, {\n      children: [\"All actions were performed in the \", _jsx(_components.code, {\n        children: \"zely\"\n      }), \" module,\\nbut the method has changed to the \", _jsx(_components.code, {\n        children: \"@zely-js/~\"\n      }), \" module sharing the responsibility for actions.\"]\n    }), \"\\n\", _jsxs(_components.table, {\n      children: [_jsx(_components.thead, {\n        children: _jsxs(_components.tr, {\n          children: [_jsx(_components.th, {\n            children: _jsx(_components.strong, {\n              children: \"package\"\n            })\n          }), _jsx(_components.th, {\n            children: _jsx(_components.strong, {\n              children: \"description\"\n            })\n          })]\n        })\n      }), _jsxs(_components.tbody, {\n        children: [_jsxs(_components.tr, {\n          children: [_jsx(_components.td, {\n            children: _jsx(_components.code, {\n              children: \"zely\"\n            })\n          }), _jsxs(_components.td, {\n            children: [\"re-exports of \", _jsx(_components.code, {\n              children: \"@zely-js/zely\"\n            }), \" and \", _jsx(_components.code, {\n              children: \"zely-cli\"\n            })]\n          })]\n        }), _jsxs(_components.tr, {\n          children: [_jsx(_components.td, {\n            children: _jsx(_components.code, {\n              children: \"zely-cli\"\n            })\n          }), _jsx(_components.td, {\n            children: \"zely cli\"\n          })]\n        }), _jsxs(_components.tr, {\n          children: [_jsx(_components.td, {\n            children: _jsx(_components.code, {\n              children: \"@zely-js/zely\"\n            })\n          }), _jsx(_components.td, {\n            children: \"core module of zely\"\n          })]\n        }), _jsxs(_components.tr, {\n          children: [_jsx(_components.td, {\n            children: _jsx(_components.code, {\n              children: \"@zely-js/core\"\n            })\n          }), _jsx(_components.td, {\n            children: \"zely server\"\n          })]\n        }), _jsxs(_components.tr, {\n          children: [_jsx(_components.td, {\n            children: _jsx(_components.code, {\n              children: \"@zely-js/loader\"\n            })\n          }), _jsx(_components.td, {\n            children: \"javascript loader manager\"\n          })]\n        }), _jsxs(_components.tr, {\n          children: [_jsx(_components.td, {\n            children: _jsx(_components.code, {\n              children: \"@zely-js/loader-esbuild\"\n            })\n          }), _jsx(_components.td, {\n            children: \"esbuild loader (to load typescript)\"\n          })]\n        })]\n      })]\n    }), \"\\n\", _jsxs(_components.p, {\n      children: [\"To use zely and cli together, install \", _jsx(_components.code, {\n        children: \"zely\"\n      }), \".\\nIf you only want to use zely API, install \", _jsx(_components.code, {\n        children: \"@zely-js/zely\"\n      }), \".\"]\n    }), \"\\n\", _jsx(_components.h2, {\n      children: \"File Structure\"\n    }), \"\\n\", _jsxs(_components.p, {\n      children: [_jsx(_components.code, {\n        children: \"$routing\"\n      }), \" is deprecated.\"]\n    }), \"\\n\", _jsxs(_components.table, {\n      children: [_jsx(_components.thead, {\n        children: _jsxs(_components.tr, {\n          children: [_jsx(_components.th, {\n            children: _jsx(_components.strong, {\n              children: \"before\"\n            })\n          }), _jsx(_components.th, {\n            children: _jsx(_components.strong, {\n              children: \"after\"\n            })\n          })]\n        })\n      }), _jsxs(_components.tbody, {\n        children: [_jsxs(_components.tr, {\n          children: [_jsx(_components.td, {\n            children: _jsx(_components.code, {\n              children: \"/index.ts\"\n            })\n          }), _jsx(_components.td, {\n            children: _jsx(_components.code, {\n              children: \"/index.ts\"\n            })\n          })]\n        }), _jsxs(_components.tr, {\n          children: [_jsx(_components.td, {\n            children: _jsx(_components.code, {\n              children: \"/a/b.ts\"\n            })\n          }), _jsx(_components.td, {\n            children: _jsx(_components.code, {\n              children: \"/a/b.ts\"\n            })\n          })]\n        }), _jsxs(_components.tr, {\n          children: [_jsx(_components.td, {\n            children: _jsx(_components.code, {\n              children: \"/book/$id.ts\"\n            })\n          }), _jsx(_components.td, {\n            children: _jsx(_components.code, {\n              children: \"/book/[id].ts\"\n            })\n          })]\n        }), _jsxs(_components.tr, {\n          children: [_jsx(_components.td, {\n            children: _jsx(_components.code, {\n              children: \"/$id/about.ts\"\n            })\n          }), _jsx(_components.td, {\n            children: _jsx(_components.code, {\n              children: \"/[id]/about.ts\"\n            })\n          })]\n        }), _jsxs(_components.tr, {\n          children: [_jsx(_components.td, {\n            children: \"~\"\n          }), _jsx(_components.td, {\n            children: _jsx(_components.code, {\n              children: \"/[...params].ts\"\n            })\n          })]\n        })]\n      })]\n    }), \"\\n\", _jsxs(Box, {\n      type: \"info\",\n      children: [\"See \", _jsx(_components.a, {\n        href: \"/docs/routing\",\n        children: \"routing documentation\"\n      }), \".\"]\n    }), \"\\n\", _jsx(_components.h2, {\n      children: \"Migration\"\n    }), \"\\n\", _jsxs(_components.ol, {\n      children: [\"\\n\", _jsxs(_components.li, {\n        children: [\"change \", _jsx(_components.code, {\n          children: \"(req, res) => ...\"\n        }), \" to \", _jsx(_components.code, {\n          children: \"(ctx) => ...\"\n        }), \" in handlers.\"]\n      }), \"\\n\"]\n    }), \"\\n\", _jsxs(_components.p, {\n      children: [\"The \", _jsx(_components.code, {\n        children: \"export\"\n      }), \" handler can also use \", _jsx(_components.code, {\n        children: \"context\"\n      }), \".\"]\n    }), \"\\n\", _jsxs(Box, {\n      type: \"info\",\n      children: [\"Check the \", _jsx(_components.a, {\n        href: \"/docs/context\",\n        children: \"context document\"\n      })]\n    }), \"\\n\", _jsx(_components.figure, {\n      \"data-rehype-pretty-code-figure\": \"\",\n      children: _jsx(_components.pre, {\n        tabIndex: \"0\",\n        \"data-language\": \"ts\",\n        \"data-theme\": \"material-theme-palenight github-light\",\n        children: _jsxs(_components.code, {\n          \"data-language\": \"ts\",\n          \"data-theme\": \"material-theme-palenight github-light\",\n          style: {\n            display: \"grid\"\n          },\n          children: [_jsx(_components.span, {\n            \"data-line\": \"\",\n            children: _jsx(_components.span, {\n              style: {\n                \"--shiki-dark\": \"#676E95\",\n                \"--shiki-dark-font-style\": \"italic\",\n                \"--shiki-light\": \"#6A737D\",\n                \"--shiki-light-font-style\": \"inherit\"\n              },\n              children: \"// export function get(req, res) {}\"\n            })\n          }), \"\\n\", _jsxs(_components.span, {\n            \"data-line\": \"\",\n            children: [_jsx(_components.span, {\n              style: {\n                \"--shiki-dark\": \"#89DDFF\",\n                \"--shiki-dark-font-style\": \"italic\",\n                \"--shiki-light\": \"#D73A49\",\n                \"--shiki-light-font-style\": \"inherit\"\n              },\n              children: \"export\"\n            }), _jsx(_components.span, {\n              style: {\n                \"--shiki-dark\": \"#C792EA\",\n                \"--shiki-light\": \"#D73A49\"\n              },\n              children: \" function\"\n            }), _jsx(_components.span, {\n              style: {\n                \"--shiki-dark\": \"#82AAFF\",\n                \"--shiki-light\": \"#6F42C1\"\n              },\n              children: \" get\"\n            }), _jsx(_components.span, {\n              style: {\n                \"--shiki-dark\": \"#89DDFF\",\n                \"--shiki-light\": \"#24292E\"\n              },\n              children: \"(\"\n            }), _jsx(_components.span, {\n              style: {\n                \"--shiki-dark\": \"#BABED8\",\n                \"--shiki-dark-font-style\": \"italic\",\n                \"--shiki-light\": \"#E36209\",\n                \"--shiki-light-font-style\": \"inherit\"\n              },\n              children: \"ctx\"\n            }), _jsx(_components.span, {\n              style: {\n                \"--shiki-dark\": \"#89DDFF\",\n                \"--shiki-light\": \"#24292E\"\n              },\n              children: \")\"\n            }), _jsx(_components.span, {\n              style: {\n                \"--shiki-dark\": \"#89DDFF\",\n                \"--shiki-light\": \"#24292E\"\n              },\n              children: \" {\"\n            })]\n          }), \"\\n\", _jsxs(_components.span, {\n            \"data-line\": \"\",\n            children: [_jsx(_components.span, {\n              style: {\n                \"--shiki-dark\": \"#C792EA\",\n                \"--shiki-light\": \"#D73A49\"\n              },\n              children: \"  const\"\n            }), _jsx(_components.span, {\n              style: {\n                \"--shiki-dark\": \"#BABED8\",\n                \"--shiki-light\": \"#005CC5\"\n              },\n              children: \" req\"\n            }), _jsx(_components.span, {\n              style: {\n                \"--shiki-dark\": \"#89DDFF\",\n                \"--shiki-light\": \"#D73A49\"\n              },\n              children: \" =\"\n            }), _jsx(_components.span, {\n              style: {\n                \"--shiki-dark\": \"#BABED8\",\n                \"--shiki-light\": \"#24292E\"\n              },\n              children: \" ctx\"\n            }), _jsx(_components.span, {\n              style: {\n                \"--shiki-dark\": \"#89DDFF\",\n                \"--shiki-light\": \"#24292E\"\n              },\n              children: \".\"\n            }), _jsx(_components.span, {\n              style: {\n                \"--shiki-dark\": \"#BABED8\",\n                \"--shiki-light\": \"#24292E\"\n              },\n              children: \"request\"\n            }), _jsx(_components.span, {\n              style: {\n                \"--shiki-dark\": \"#89DDFF\",\n                \"--shiki-light\": \"#24292E\"\n              },\n              children: \";\"\n            })]\n          }), \"\\n\", _jsxs(_components.span, {\n            \"data-line\": \"\",\n            children: [_jsx(_components.span, {\n              style: {\n                \"--shiki-dark\": \"#C792EA\",\n                \"--shiki-light\": \"#D73A49\"\n              },\n              children: \"  const\"\n            }), _jsx(_components.span, {\n              style: {\n                \"--shiki-dark\": \"#BABED8\",\n                \"--shiki-light\": \"#005CC5\"\n              },\n              children: \" res\"\n            }), _jsx(_components.span, {\n              style: {\n                \"--shiki-dark\": \"#89DDFF\",\n                \"--shiki-light\": \"#D73A49\"\n              },\n              children: \" =\"\n            }), _jsx(_components.span, {\n              style: {\n                \"--shiki-dark\": \"#BABED8\",\n                \"--shiki-light\": \"#24292E\"\n              },\n              children: \" ctx\"\n            }), _jsx(_components.span, {\n              style: {\n                \"--shiki-dark\": \"#89DDFF\",\n                \"--shiki-light\": \"#24292E\"\n              },\n              children: \".\"\n            }), _jsx(_components.span, {\n              style: {\n                \"--shiki-dark\": \"#BABED8\",\n                \"--shiki-light\": \"#24292E\"\n              },\n              children: \"response\"\n            }), _jsx(_components.span, {\n              style: {\n                \"--shiki-dark\": \"#89DDFF\",\n                \"--shiki-light\": \"#24292E\"\n              },\n              children: \";\"\n            })]\n          }), \"\\n\", _jsx(_components.span, {\n            \"data-line\": \"\",\n            children: _jsx(_components.span, {\n              style: {\n                \"--shiki-dark\": \"#676E95\",\n                \"--shiki-dark-font-style\": \"italic\",\n                \"--shiki-light\": \"#6A737D\",\n                \"--shiki-light-font-style\": \"inherit\"\n              },\n              children: \"  // ...\"\n            })\n          }), \"\\n\", _jsx(_components.span, {\n            \"data-line\": \"\",\n            children: _jsx(_components.span, {\n              style: {\n                \"--shiki-dark\": \"#89DDFF\",\n                \"--shiki-light\": \"#24292E\"\n              },\n              children: \"}\"\n            })\n          })]\n        })\n      })\n    }), \"\\n\", _jsxs(_components.ol, {\n      start: \"2\",\n      children: [\"\\n\", _jsxs(_components.li, {\n        children: [\"remove \", _jsx(_components.a, {\n          href: \"https://zely2.netlify.app/docs/data-fetching\",\n          children: _jsx(_components.code, {\n            children: \"snatcher\"\n          })\n        }), \".\"]\n      }), \"\\n\"]\n    }), \"\\n\", _jsxs(_components.p, {\n      children: [_jsx(_components.code, {\n        children: \"snatcher\"\n      }), \" has been deprecated. Use \", _jsx(_components.code, {\n        children: \"fetch\"\n      }), \" instead.\"]\n    }), \"\\n\", _jsxs(_components.ol, {\n      start: \"3\",\n      children: [\"\\n\", _jsxs(_components.li, {\n        children: [\"remove \", _jsx(_components.a, {\n          href: \"https://zely2.netlify.app/docs/page-data\",\n          children: _jsx(_components.code, {\n            children: \"$page.path\"\n          })\n        })]\n      }), \"\\n\"]\n    }), \"\\n\", _jsxs(_components.p, {\n      children: [_jsx(_components.code, {\n        children: \"$page.path\"\n      }), \" is not supported in 3.0.\"]\n    }), \"\\n\", _jsxs(_components.ol, {\n      start: \"4\",\n      children: [\"\\n\", _jsxs(_components.li, {\n        children: [\"replace \", _jsx(_components.code, {\n          children: \"zely/~\"\n        }), \" with \", _jsx(_components.code, {\n          children: \"zely\"\n        }), \".\"]\n      }), \"\\n\"]\n    }), \"\\n\", _jsxs(_components.table, {\n      children: [_jsx(_components.thead, {\n        children: _jsxs(_components.tr, {\n          children: [_jsx(_components.th, {\n            children: _jsx(_components.strong, {\n              children: \"before\"\n            })\n          }), _jsx(_components.th, {\n            children: _jsx(_components.strong, {\n              children: \"after\"\n            })\n          })]\n        })\n      }), _jsxs(_components.tbody, {\n        children: [_jsxs(_components.tr, {\n          children: [_jsx(_components.td, {\n            children: _jsx(_components.code, {\n              children: \"zely/config\"\n            })\n          }), _jsx(_components.td, {\n            children: _jsx(_components.code, {\n              children: \"zely\"\n            })\n          })]\n        }), _jsxs(_components.tr, {\n          children: [_jsx(_components.td, {\n            children: _jsx(_components.code, {\n              children: \"zely/methods\"\n            })\n          }), _jsx(_components.td, {\n            children: _jsx(_components.code, {\n              children: \"zely\"\n            })\n          })]\n        })]\n      })]\n    })]\n  });\n}\nfunction MDXContent(props = {}) {\n  const {wrapper: MDXLayout} = props.components || ({});\n  return MDXLayout ? _jsx(MDXLayout, {\n    ...props,\n    children: _jsx(_createMdxContent, {\n      ...props\n    })\n  }) : _createMdxContent(props);\n}\nreturn {\n  default: MDXContent\n};\nfunction _missingMdxReference(id, component) {\n  throw new Error(\"Expected \" + (component ? \"component\" : \"object\") + \" `\" + id + \"` to be defined: you likely forgot to import, pass, or provide it.\");\n}\n","posts":[{"overview":"Overview"},{"why-zely":"Why Zely"},{"getting-started":"Getting Started"},{"config":"Config References"},{"benchmark":"Performance"},{"troubleshooting":"Troubleshooting"},{"migration-to-dobs":"Migration to dobs"},{"routing":"Routing"},{"handler":"Handler"},{"methods":"Methods"},{"send-data":"Sending Data"},{"context":"Context"},{"page-data":"Page Data"},{"customizing-response":"Customizing Response"},{"data-fetching":"Data Fetching"},{"middleware":"Middleware"},{"auto":"Auto Importing"},{"provided-middlewares":"Provided Middlewares"},{"caching":"Caching"},{"store":"Data Caching"},{"cache":"Data Access"},{"serpack":"Serpack"},{"asset":"Asset"},{"debugging":"Debugging"},{"server-data":"Server Data"},{"frontend":"Frontend"},{"html":"HTML"},{"migration":"Migration"},{"migration-3x":"Migration from 3.x"},{"migration-2x":"Migration from 2.x"},{"community":"Community"},{"contributing":"Contributing"},{"playground":"Playground"}],"target":{"migration-2x":"Migration from 2.x"},"targetcategory":"Migration","directory":"docs"}