From 18961995d55c57c20785d4120bb2744ed4d064de Mon Sep 17 00:00:00 2001 From: Mau Scheff Date: Tue, 16 Sep 2025 13:24:39 +0200 Subject: [PATCH] docs: Revise migration guide with new help sections (#3455) Revise migration guide with new help sections --- docs/latest/examples/migration-guide.md | 27 +++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/docs/latest/examples/migration-guide.md b/docs/latest/examples/migration-guide.md index be3fb262..4e9cb189 100644 --- a/docs/latest/examples/migration-guide.md +++ b/docs/latest/examples/migration-guide.md @@ -157,8 +157,10 @@ accordingly. ## Update deployment settings -Fresh 2 requires assets to be build during deployment instead of building them -on demand. Run the `deno task build` command as part of your deployment process. +Fresh 2 requires assets to be built during deployment instead of building them +on demand. Run the `deno task build` or `deno run build` command as part of your +deployment process. + If you have already set up Fresh's 1.x "Ahead-of-Time Builds", then no changes are necessary. @@ -236,9 +238,9 @@ re-use existing objects internally as a minor performance optimization. ### `ctx.render()` -The meaning of `ctx.render()` has changed. In Fresh 1.x this was used to pass +The _meaning_ of `ctx.render()` has changed. In Fresh 1.x this was used to pass data from a handler to a component. In Fresh 2.x this function has been -generalized to render JSX. +generalized to render JSX, so it's no longer needed. Fresh 1.x: @@ -255,7 +257,7 @@ export default function Page({ data }) { } ``` -Fresh 2: +Fresh 2 (removed): ```ts export const handlers = { @@ -290,6 +292,15 @@ to [update the command](/docs/deployment/deno-compile) to generate the binary. ## Getting help -If you run into problems with upgrading your app, reach out to us by creating an -issue here https://github.com/denoland/fresh/issues/new . That way we can -improve this migration guide for everyone. +### 1. Migrate by example + +If you run into problems with upgrading your app, first, try starting a new +Fresh 2 project and looking at the new structure. + +eg. `mkdir fresh2-demo && cd fresh2-demo && deno run -Ar jsr:@fresh/init` + +### 2. Document + +If you still can't solve the migration problems. Please reach out to us by +creating an issue here https://github.com/denoland/fresh/issues/new . That way +we can improve this migration guide for everyone.