mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-26 23:02:57 +08:00
feat: improve test & bundler (#14434)
#### PR Dependency Tree * **PR #14434** 👈 This tree was auto-generated by [Charcoal](https://github.com/danerwilliams/charcoal) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Introduced rspack bundler as an alternative to webpack for optimized builds. * **Tests & Quality** * Added comprehensive editor semantic tests covering markdown, hotkeys, and slash-menu operations. * Expanded CI cross-browser testing to Chromium, Firefox, and WebKit; improved shape-rendering tests to account for zoom. * **Bug Fixes** * Corrected CSS overlay styling for development servers. * Fixed TypeScript typings for build tooling. * **Other** * Document duplication now produces consistent "(n)" suffixes. * French i18n completeness increased to 100%. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
export const WORKSPACE_ROUTE_PATH = '/workspace/:workspaceId/*';
|
||||
export const SHARE_ROUTE_PATH = '/share/:workspaceId/:pageId';
|
||||
export const NOT_FOUND_ROUTE_PATH = '/404';
|
||||
export const CATCH_ALL_ROUTE_PATH = '*';
|
||||
|
||||
export function getWorkspaceDocPath(workspaceId: string, docId: string) {
|
||||
return `/workspace/${workspaceId}/${docId}`;
|
||||
}
|
||||
@@ -10,6 +10,13 @@ import {
|
||||
import { AffineErrorComponent } from '../components/affine/affine-error-boundary/affine-error-fallback';
|
||||
import { NavigateContext } from '../components/hooks/use-navigate-helper';
|
||||
import { RootWrapper } from './pages/root';
|
||||
import {
|
||||
CATCH_ALL_ROUTE_PATH,
|
||||
getWorkspaceDocPath,
|
||||
NOT_FOUND_ROUTE_PATH,
|
||||
SHARE_ROUTE_PATH,
|
||||
WORKSPACE_ROUTE_PATH,
|
||||
} from './route-paths';
|
||||
|
||||
export function RootRouter() {
|
||||
const navigate = useNavigate();
|
||||
@@ -38,17 +45,19 @@ export const topLevelRoutes = [
|
||||
lazy: () => import('./pages/index'),
|
||||
},
|
||||
{
|
||||
path: '/workspace/:workspaceId/*',
|
||||
path: WORKSPACE_ROUTE_PATH,
|
||||
lazy: () => import('./pages/workspace/index'),
|
||||
},
|
||||
{
|
||||
path: '/share/:workspaceId/:pageId',
|
||||
path: SHARE_ROUTE_PATH,
|
||||
loader: ({ params }) => {
|
||||
return redirect(`/workspace/${params.workspaceId}/${params.pageId}`);
|
||||
return redirect(
|
||||
getWorkspaceDocPath(params.workspaceId ?? '', params.pageId ?? '')
|
||||
);
|
||||
},
|
||||
},
|
||||
{
|
||||
path: '/404',
|
||||
path: NOT_FOUND_ROUTE_PATH,
|
||||
lazy: () => import('./pages/404'),
|
||||
},
|
||||
{
|
||||
@@ -175,7 +184,7 @@ export const topLevelRoutes = [
|
||||
lazy: () => import('./pages/open-app'),
|
||||
},
|
||||
{
|
||||
path: '*',
|
||||
path: CATCH_ALL_ROUTE_PATH,
|
||||
lazy: () => import('./pages/404'),
|
||||
},
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user