Skip to content

Commit

Permalink
Fix vite PoC
Browse files Browse the repository at this point in the history
  • Loading branch information
sneridagh committed Dec 8, 2024
1 parent 364b9b6 commit f815e15
Show file tree
Hide file tree
Showing 6 changed files with 53 additions and 12 deletions.
4 changes: 2 additions & 2 deletions apps/vite-ssr/src/config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import config from '@plone/registry';
import { slate } from '@plone/blocks';
import { blocksConfig } from '@plone/blocks';
import { slate } from '@plone/blocks/config/slate';
import { blocksConfig } from '@plone/blocks/config';

const settings = {
apiPath: 'http://localhost:8080/Plone',
Expand Down
48 changes: 43 additions & 5 deletions apps/vite-ssr/src/routeTree.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,49 @@ declare module '@tanstack/react-router' {

// Create and export the route tree

export const routeTree = rootRoute.addChildren({
IndexRoute,
SplatRoute,
ErrorRoute,
})
export interface FileRoutesByFullPath {
'/': typeof IndexRoute
'/$': typeof SplatRoute
'/error': typeof ErrorRoute
}

export interface FileRoutesByTo {
'/': typeof IndexRoute
'/$': typeof SplatRoute
'/error': typeof ErrorRoute
}

export interface FileRoutesById {
__root__: typeof rootRoute
'/': typeof IndexRoute
'/$': typeof SplatRoute
'/error': typeof ErrorRoute
}

export interface FileRouteTypes {
fileRoutesByFullPath: FileRoutesByFullPath
fullPaths: '/' | '/$' | '/error'
fileRoutesByTo: FileRoutesByTo
to: '/' | '/$' | '/error'
id: '__root__' | '/' | '/$' | '/error'
fileRoutesById: FileRoutesById
}

export interface RootRouteChildren {
IndexRoute: typeof IndexRoute
SplatRoute: typeof SplatRoute
ErrorRoute: typeof ErrorRoute
}

const rootRouteChildren: RootRouteChildren = {
IndexRoute: IndexRoute,
SplatRoute: SplatRoute,
ErrorRoute: ErrorRoute,
}

export const routeTree = rootRoute
._addFileChildren(rootRouteChildren)
._addFileTypes<FileRouteTypes>()

/* prettier-ignore-end */

Expand Down
3 changes: 2 additions & 1 deletion apps/vite-ssr/src/routes/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ import * as React from 'react';
import { flattenToAppURL } from '../utils';
import { useSuspenseQuery } from '@tanstack/react-query';
import { usePloneClient } from '@plone/providers';
import { Breadcrumbs, RenderBlocks } from '@plone/components';
import { Breadcrumbs } from '@plone/components';
import RenderBlocks from '@plone/blocks/RenderBlocks/RenderBlocks';
import config from '@plone/registry';

const expand = ['breadcrumbs', 'navigation'];
Expand Down
4 changes: 2 additions & 2 deletions apps/vite/src/config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import config from '@plone/registry';
import { slate } from '@plone/blocks';
import { blocksConfig } from '@plone/blocks';
import { slate } from '@plone/blocks/config/slate';
import { blocksConfig } from '@plone/blocks/config';

const settings = {
apiPath: 'http://localhost:8080/Plone',
Expand Down
3 changes: 2 additions & 1 deletion apps/vite/src/routes/$.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ import * as React from 'react';
import { flattenToAppURL } from '../utils';
import { useSuspenseQuery } from '@tanstack/react-query';
import { usePloneClient } from '@plone/providers';
import { Breadcrumbs, RenderBlocks } from '@plone/components';
import { Breadcrumbs } from '@plone/components';
import RenderBlocks from '@plone/blocks/RenderBlocks/RenderBlocks';
import config from '@plone/registry';

const expand = ['breadcrumbs', 'navigation'];
Expand Down
3 changes: 2 additions & 1 deletion apps/vite/src/routes/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ import { createFileRoute } from '@tanstack/react-router';
import { flattenToAppURL } from '../utils';
import { useSuspenseQuery } from '@tanstack/react-query';
import { usePloneClient } from '@plone/providers';
import { Breadcrumbs, RenderBlocks } from '@plone/components';
import { Breadcrumbs } from '@plone/components';
import RenderBlocks from '@plone/blocks/RenderBlocks/RenderBlocks';
import config from '@plone/registry';

const expand = ['breadcrumbs', 'navigation'];
Expand Down

0 comments on commit f815e15

Please sign in to comment.