Routes in a plugin should allow configuring the route configuration options. This would allow plugins to add pages without the app's layout or app wrapper to effect it. This would allow easier integration of plugins without need to do any changes to layout or app wrappers on the app.
An example of this is in the KV Insights plugin, additional configuration must be done on any layout wrappers. The plugin provides the following code as a work-around:
// routes/_app.tsx
import { AppProps } from '$fresh/server.ts';
export default function App(props: AppProps) {
if (context.url.pathname.startsWith('/kv-insights/')) {
return <props.Component />;
}
return (
<div class='wrapper'>
<props.Component />
</div>
);
}
Routes in a plugin should allow configuring the route configuration options. This would allow plugins to add pages without the app's layout or app wrapper to effect it. This would allow easier integration of plugins without need to do any changes to layout or app wrappers on the app.
An example of this is in the KV Insights plugin, additional configuration must be done on any layout wrappers. The plugin provides the following code as a work-around:
This is how this feature could be implemented: