ui-next: refactor plugin loader (#1190)

This commit is contained in:
Baoshuo authored and GitHub committed 2026-07-22 03:07:33 +08:00
1 parent 0e688f77b7
commit f9cd5bcb40
12 files changed
+181 -17

No files matched your search

+4 -5
View File
@@ -1,9 +1,8 @@
import type { PluginAPI } from '@hydrooj/ui-next';
export function setup(api: PluginAPI) {
api.before('page:app', () => {
console.log('before app');
// throw new Error('test error boundary in before interceptor');
return <div>before app via @hydrooj/ui-next-plugin-sample</div>;
});
// (2) Page registration — slot names match the server route names / template stems
// registered in ../index.ts. Pages are lazy-loaded on demand.
api.registerPage('example_home', () => import('./pages/example_home'));
api.registerPage('example_css', () => import('./pages/example_css'));
}