Skip to content

Commit c2f444b

Browse files
authored
Merge pull request #4 from XionWCFM/pages
[2024.08.11] Page Router and React Router Dom Supported | Release 0.0.3 version
2 parents b867406 + a50e3aa commit c2f444b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+3407
-115
lines changed

README.md

Lines changed: 34 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,16 +28,41 @@ Many frameworks provide routers to change paths. Supporting all of this would be
2828

2929
We aim for code that allows you to see at a glance how the funnel should behave.
3030

31+
# Supported
32+
33+
Currently officially supported are `next.js app router`, `next.js pages router`, `react-router-dom`.
34+
35+
# Installation
36+
37+
**nextjs app router**
38+
39+
```
40+
npm i qs @xionhub/funnel-core @xionhub/funnel-client @xionhub/funnel-app-router-adapter
41+
```
42+
43+
**nextjs pages router**
44+
45+
```
46+
npm i qs @xionhub/funnel-core @xionhub/funnel-client @xionhub/funnel-pages-router-adapter
47+
```
48+
49+
**react-router-dom**
50+
51+
```
52+
npm i qs @xionhub/funnel-core @xionhub/funnel-client @xionhub/funnel-react-router-dom-adapter
53+
```
54+
3155
# Quick Start
3256

3357
## next.js app router
3458

3559
### Requirements
3660

3761
```
38-
qs : ^6
39-
next : ^13
40-
react : ^16
62+
qs : >=6
63+
next : >=13
64+
react : >=16.8
65+
react-dom : >=16.8
4166
```
4267

4368
### Installation
@@ -250,6 +275,8 @@ Using createStep, you can create, delete, or update the query string for the nex
250275

251276
## Funnel Client
252277

278+
Funnel Client provides utility functions to help manage query string funnels.
279+
253280
### FunnelClient.createStep
254281

255282
```tsx
@@ -351,6 +378,10 @@ export const NestedFunnel = () => {
351378

352379
[App Router Example](https://github.com/XionWCFM/funnel/tree/main/apps/app-router-example)
353380

381+
[Pages Router Example](https://github.com/XionWCFM/funnel/tree/main/apps/pages-router-example)
382+
383+
[React Router Dom Example](https://github.com/XionWCFM/funnel/tree/main/apps/react-router-example)
384+
354385
# License
355386

356387
Licensed under the MIT license.

apps/pages-router-example/.gitignore

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2+
3+
# dependencies
4+
/node_modules
5+
/.pnp
6+
.pnp.js
7+
.yarn/install-state.gz
8+
9+
# testing
10+
/coverage
11+
12+
# next.js
13+
/.next/
14+
/out/
15+
16+
# production
17+
/build
18+
19+
# misc
20+
.DS_Store
21+
*.pem
22+
23+
# debug
24+
npm-debug.log*
25+
yarn-debug.log*
26+
yarn-error.log*
27+
28+
# local env files
29+
.env*.local
30+
31+
# vercel
32+
.vercel
33+
34+
# typescript
35+
*.tsbuildinfo
36+
next-env.d.ts

apps/pages-router-example/README.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
This is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app).
2+
3+
## Getting Started
4+
5+
First, run the development server:
6+
7+
```bash
8+
npm run dev
9+
# or
10+
yarn dev
11+
# or
12+
pnpm dev
13+
# or
14+
bun dev
15+
```
16+
17+
Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.
18+
19+
You can start editing the page by modifying `pages/index.tsx`. The page auto-updates as you edit the file.
20+
21+
[API routes](https://nextjs.org/docs/api-routes/introduction) can be accessed on [http://localhost:3000/api/hello](http://localhost:3000/api/hello). This endpoint can be edited in `pages/api/hello.ts`.
22+
23+
The `pages/api` directory is mapped to `/api/*`. Files in this directory are treated as [API routes](https://nextjs.org/docs/api-routes/introduction) instead of React pages.
24+
25+
This project uses [`next/font`](https://nextjs.org/docs/basic-features/font-optimization) to automatically optimize and load Inter, a custom Google Font.
26+
27+
## Learn More
28+
29+
To learn more about Next.js, take a look at the following resources:
30+
31+
- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
32+
- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.
33+
34+
You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome!
35+
36+
## Deploy on Vercel
37+
38+
The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js.
39+
40+
Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
/** @type {import('next').NextConfig} */
2+
const nextConfig = {
3+
reactStrictMode: true,
4+
};
5+
6+
export default nextConfig;

0 commit comments

Comments
 (0)