Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: fs-router to use new_createPages & fix staticPaths #1003

Draft
wants to merge 17 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 16 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion e2e/fixtures/ssg-wildcard/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "waku-example",
"name": "ssg-wildcard",
"version": "0.1.0",
"type": "module",
"private": true,
Expand Down
2 changes: 1 addition & 1 deletion examples/11_fs-router/src/main.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { StrictMode } from 'react';
import { createRoot, hydrateRoot } from 'react-dom/client';
import { Router } from 'waku/router/client';
import { NewRouter as Router } from 'waku/router/client';

const rootElement = (
<StrictMode>
Expand Down
2 changes: 1 addition & 1 deletion packages/waku/src/lib/plugins/vite-plugin-rsc-managed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export default fsRouter(
const getManagedMain = () => `
import { StrictMode } from 'react';
import { createRoot, hydrateRoot } from 'react-dom/client';
import { Router } from 'waku/router/client';
import { NewRouter as Router } from 'waku/router/client';

const rootElement = (
<StrictMode>
Expand Down
2 changes: 1 addition & 1 deletion packages/waku/src/router/create-pages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -588,7 +588,7 @@ export const new_createPages = <
}
});
staticPathMap.set(
page.path,
'/' + pathItems.join('/'),
tylersayshi marked this conversation as resolved.
Show resolved Hide resolved
pathItems.map((name) => ({ type: 'literal', name })),
);
const id = joinPath(...pathItems, 'page');
Expand Down
2 changes: 1 addition & 1 deletion packages/waku/src/router/fs-router.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { unstable_getPlatformObject } from '../server.js';
import { createPages } from './create-pages.js';
import { new_createPages as createPages } from './create-pages.js';

import { EXTENSIONS } from '../lib/constants.js';

Expand Down
Loading