feat(server): plugins can create islands (#1472)
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import { MiddlewareHandlerContext, Plugin } from "$fresh/server.ts";
|
||||
import { handler as testMiddleware } from "./sample_routes/_middleware.ts";
|
||||
import { AppBuilder } from "./sample_routes/AppBuilder.tsx";
|
||||
import IslandPluginComponent from "./sample_routes/PluginRouteWithIsland.tsx";
|
||||
import { SimpleRoute } from "./sample_routes/simple-route.tsx";
|
||||
export type { Options };
|
||||
|
||||
@@ -43,9 +44,20 @@ export default function routePlugin(
|
||||
},
|
||||
path: "lots-of-middleware",
|
||||
}],
|
||||
routes: [{
|
||||
path: "/_app",
|
||||
component: AppBuilder(options),
|
||||
}, { path: "no-leading-slash-here", component: SimpleRoute }],
|
||||
routes: [
|
||||
{
|
||||
path: "/_app",
|
||||
component: AppBuilder(options),
|
||||
},
|
||||
{ path: "no-leading-slash-here", component: SimpleRoute },
|
||||
{
|
||||
path: "pluginroutewithisland",
|
||||
component: IslandPluginComponent,
|
||||
},
|
||||
],
|
||||
islands: {
|
||||
baseLocation: import.meta.url,
|
||||
paths: ["./sample_islands/IslandFromPlugin.tsx"],
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user