-
Notifications
You must be signed in to change notification settings - Fork 25
♻️(front) WIP test Vite+Tanstack Router instead of Next.js #675
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
Open
sylvinus
wants to merge
3
commits into
main
Choose a base branch
from
vite
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| .env | ||
| bundle-stats.json |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,40 +1,28 @@ | ||
| This is a [Next.js](https://nextjs.org) project bootstrapped with [`create-next-app`](https://nextjs.org/docs/pages/api-reference/create-next-app). | ||
| # Messages frontend | ||
|
|
||
| This is the Messages frontend, built with [Vite](https://vite.dev/) and [TanStack Router](https://tanstack.com/router/). | ||
|
|
||
| ## Getting Started | ||
|
|
||
| First, run the development server: | ||
| Install dependencies and run the development server: | ||
|
|
||
| ```bash | ||
| npm install | ||
| npm run dev | ||
| # or | ||
| yarn dev | ||
| # or | ||
| pnpm dev | ||
| # or | ||
| bun dev | ||
| ``` | ||
|
|
||
| Open [http://localhost:8900](http://localhost:8900) with your browser to see the result. | ||
|
|
||
| You can start editing the page by modifying `pages/index.tsx`. The page auto-updates as you edit the file. | ||
|
|
||
| [API routes](https://nextjs.org/docs/pages/building-your-application/routing/api-routes) can be accessed on [http://localhost:3000/api/hello](http://localhost:3000/api/hello). This endpoint can be edited in `pages/api/hello.ts`. | ||
|
|
||
| The `pages/api` directory is mapped to `/api/*`. Files in this directory are treated as [API routes](https://nextjs.org/docs/pages/building-your-application/routing/api-routes) instead of React pages. | ||
|
|
||
| This project uses [`next/font`](https://nextjs.org/docs/pages/building-your-application/optimizing/fonts) to automatically optimize and load [Geist](https://vercel.com/font), a new font family for Vercel. | ||
|
|
||
| ## Learn More | ||
|
|
||
| To learn more about Next.js, take a look at the following resources: | ||
|
|
||
| - [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API. | ||
| - [Learn Next.js](https://nextjs.org/learn-pages-router) - an interactive Next.js tutorial. | ||
|
|
||
| You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js) - your feedback and contributions are welcome! | ||
| Open [http://localhost:8900](http://localhost:8900) when running through `make start`, | ||
| or [http://localhost:3000](http://localhost:3000) when running `npm run dev` directly. | ||
|
|
||
| ## Deploy on Vercel | ||
| Routes are file-based under `src/routes/`. Compatibility helpers for legacy | ||
| `next/router`, `next/navigation`, and `next/link` call sites live in | ||
| `src/lib/router-compat.ts`. | ||
|
|
||
| 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. | ||
| ## Useful scripts | ||
|
|
||
| Check out our [Next.js deployment documentation](https://nextjs.org/docs/pages/building-your-application/deploying) for more details. | ||
| - `npm run dev` — start the Vite dev server. | ||
| - `npm run build` — type-check and produce a production build in `dist/`. | ||
| - `npm run preview` — preview the production build locally. | ||
| - `npm run test` — run the Vitest test suite. | ||
| - `npm run lint` — run ESLint. | ||
| - `npm run ts:check` — run TypeScript in `--noEmit` mode. | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,23 +1,23 @@ | ||
| import { defineConfig, globalIgnores } from "eslint/config"; | ||
| import nextCoreWebVitals from "eslint-config-next/core-web-vitals"; | ||
| import nextTypescript from "eslint-config-next/typescript"; | ||
|
|
||
|
|
||
| import reactHooks from "eslint-plugin-react-hooks"; | ||
| import tseslint from "typescript-eslint"; | ||
|
|
||
| const eslintConfig = defineConfig([ | ||
| ...nextCoreWebVitals, | ||
| ...nextTypescript, | ||
| globalIgnores(["out/**", "next-env.d.ts", ".next/**"]), | ||
| globalIgnores(["dist/**", "src/routeTree.gen.ts", "scripts/**"]), | ||
| { ignores: ["src/features/api/gen/**/*.ts"] }, | ||
| ...tseslint.configs.recommended, | ||
| reactHooks.configs.flat.recommended, | ||
| { | ||
| rules: { | ||
| "react-hooks/exhaustive-deps": "off", | ||
| "react-hooks/refs": "off", | ||
| "no-console": ["error", { allow: ["error", "warn"] }], | ||
| "@typescript-eslint/no-unused-vars": "error", | ||
| "@typescript-eslint/no-explicit-any": "off", | ||
| "@typescript-eslint/no-empty-object-type": "off", | ||
| "react-hooks/exhaustive-deps": "off", | ||
| "react-hooks/refs": "off", | ||
|
sylvinus marked this conversation as resolved.
|
||
| "react-hooks/set-state-in-effect": "warn", | ||
| } | ||
| } | ||
| }, | ||
| }, | ||
| ]); | ||
|
|
||
| export default eslintConfig; | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,71 @@ | ||
| <!DOCTYPE html> | ||
| <html lang="en"> | ||
| <head> | ||
| <meta charset="UTF-8" /> | ||
| <meta name="theme-color" content="#FFFFFF" /> | ||
| <link rel="manifest" href="/manifest.json" /> | ||
| <link rel="icon" type="image/png" sizes="32x32" href="/images/pwa/icons/ios/32.png" /> | ||
| <link rel="icon" type="image/png" sizes="16x16" href="/images/pwa/icons/ios/16.png" /> | ||
| <link rel="shortcut icon" href="/images/pwa/icons/ios/32.png" /> | ||
| <link rel="apple-touch-icon" href="/images/pwa/icons/ios/180.png" /> | ||
| <link rel="apple-touch-icon" sizes="152x152" href="/images/pwa/icons/ios/152.png" /> | ||
| <link rel="apple-touch-icon" sizes="180x180" href="/images/pwa/icons/ios/180.png" /> | ||
| <link rel="apple-touch-icon" sizes="167x167" href="/images/pwa/icons/ios/167.png" /> | ||
| <meta name="apple-mobile-web-app-capable" content="yes" /> | ||
| <meta name="apple-mobile-web-app-status-bar-style" content="default" /> | ||
| <meta name="apple-mobile-web-app-title" content="Messaging" /> | ||
| <meta name="apple-touch-fullscreen" content="yes" /> | ||
| <meta name="msapplication-TileImage" content="/images/pwa/icons/ios/144.png" /> | ||
| <meta name="msapplication-TileColor" content="#FFFFFF" /> | ||
| <meta name="msapplication-config" content="/browserconfig.xml" /> | ||
| <meta name="application-name" content="Messaging" /> | ||
| <meta name="mobile-web-app-capable" content="yes" /> | ||
| <meta name="format-detection" content="telephone=no" /> | ||
| <meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover" /> | ||
| <meta name="description" content="Messaging" /> | ||
| <link rel="apple-touch-startup-image" href="/images/pwa/splash/apple-splash-2048-2732.jpg" media="(device-width: 1024px) and (device-height: 1366px) and (-webkit-device-pixel-ratio: 2) and (orientation: portrait)" /> | ||
| <link rel="apple-touch-startup-image" href="/images/pwa/splash/apple-splash-2732-2048.jpg" media="(device-width: 1024px) and (device-height: 1366px) and (-webkit-device-pixel-ratio: 2) and (orientation: landscape)" /> | ||
| <link rel="apple-touch-startup-image" href="/images/pwa/splash/apple-splash-1668-2388.jpg" media="(device-width: 834px) and (device-height: 1194px) and (-webkit-device-pixel-ratio: 2) and (orientation: portrait)" /> | ||
| <link rel="apple-touch-startup-image" href="/images/pwa/splash/apple-splash-2388-1668.jpg" media="(device-width: 834px) and (device-height: 1194px) and (-webkit-device-pixel-ratio: 2) and (orientation: landscape)" /> | ||
| <link rel="apple-touch-startup-image" href="/images/pwa/splash/apple-splash-1536-2048.jpg" media="(device-width: 768px) and (device-height: 1024px) and (-webkit-device-pixel-ratio: 2) and (orientation: portrait)" /> | ||
| <link rel="apple-touch-startup-image" href="/images/pwa/splash/apple-splash-2048-1536.jpg" media="(device-width: 768px) and (device-height: 1024px) and (-webkit-device-pixel-ratio: 2) and (orientation: landscape)" /> | ||
| <link rel="apple-touch-startup-image" href="/images/pwa/splash/apple-splash-1640-2360.jpg" media="(device-width: 820px) and (device-height: 1180px) and (-webkit-device-pixel-ratio: 2) and (orientation: portrait)" /> | ||
| <link rel="apple-touch-startup-image" href="/images/pwa/splash/apple-splash-2360-1640.jpg" media="(device-width: 820px) and (device-height: 1180px) and (-webkit-device-pixel-ratio: 2) and (orientation: landscape)" /> | ||
| <link rel="apple-touch-startup-image" href="/images/pwa/splash/apple-splash-1668-2224.jpg" media="(device-width: 834px) and (device-height: 1112px) and (-webkit-device-pixel-ratio: 2) and (orientation: portrait)" /> | ||
| <link rel="apple-touch-startup-image" href="/images/pwa/splash/apple-splash-2224-1668.jpg" media="(device-width: 834px) and (device-height: 1112px) and (-webkit-device-pixel-ratio: 2) and (orientation: landscape)" /> | ||
| <link rel="apple-touch-startup-image" href="/images/pwa/splash/apple-splash-1620-2160.jpg" media="(device-width: 810px) and (device-height: 1080px) and (-webkit-device-pixel-ratio: 2) and (orientation: portrait)" /> | ||
| <link rel="apple-touch-startup-image" href="/images/pwa/splash/apple-splash-2160-1620.jpg" media="(device-width: 810px) and (device-height: 1080px) and (-webkit-device-pixel-ratio: 2) and (orientation: landscape)" /> | ||
| <link rel="apple-touch-startup-image" href="/images/pwa/splash/apple-splash-1488-2266.jpg" media="(device-width: 744px) and (device-height: 1133px) and (-webkit-device-pixel-ratio: 2) and (orientation: portrait)" /> | ||
| <link rel="apple-touch-startup-image" href="/images/pwa/splash/apple-splash-2266-1488.jpg" media="(device-width: 744px) and (device-height: 1133px) and (-webkit-device-pixel-ratio: 2) and (orientation: landscape)" /> | ||
| <link rel="apple-touch-startup-image" href="/images/pwa/splash/apple-splash-1320-2868.jpg" media="(device-width: 440px) and (device-height: 956px) and (-webkit-device-pixel-ratio: 3) and (orientation: portrait)" /> | ||
| <link rel="apple-touch-startup-image" href="/images/pwa/splash/apple-splash-2868-1320.jpg" media="(device-width: 440px) and (device-height: 956px) and (-webkit-device-pixel-ratio: 3) and (orientation: landscape)" /> | ||
| <link rel="apple-touch-startup-image" href="/images/pwa/splash/apple-splash-1206-2622.jpg" media="(device-width: 402px) and (device-height: 874px) and (-webkit-device-pixel-ratio: 3) and (orientation: portrait)" /> | ||
| <link rel="apple-touch-startup-image" href="/images/pwa/splash/apple-splash-2622-1206.jpg" media="(device-width: 402px) and (device-height: 874px) and (-webkit-device-pixel-ratio: 3) and (orientation: landscape)" /> | ||
| <link rel="apple-touch-startup-image" href="/images/pwa/splash/apple-splash-1290-2796.jpg" media="(device-width: 430px) and (device-height: 932px) and (-webkit-device-pixel-ratio: 3) and (orientation: portrait)" /> | ||
| <link rel="apple-touch-startup-image" href="/images/pwa/splash/apple-splash-2796-1290.jpg" media="(device-width: 430px) and (device-height: 932px) and (-webkit-device-pixel-ratio: 3) and (orientation: landscape)" /> | ||
| <link rel="apple-touch-startup-image" href="/images/pwa/splash/apple-splash-1179-2556.jpg" media="(device-width: 393px) and (device-height: 852px) and (-webkit-device-pixel-ratio: 3) and (orientation: portrait)" /> | ||
| <link rel="apple-touch-startup-image" href="/images/pwa/splash/apple-splash-2556-1179.jpg" media="(device-width: 393px) and (device-height: 852px) and (-webkit-device-pixel-ratio: 3) and (orientation: landscape)" /> | ||
| <link rel="apple-touch-startup-image" href="/images/pwa/splash/apple-splash-1170-2532.jpg" media="(device-width: 390px) and (device-height: 844px) and (-webkit-device-pixel-ratio: 3) and (orientation: portrait)" /> | ||
| <link rel="apple-touch-startup-image" href="/images/pwa/splash/apple-splash-2532-1170.jpg" media="(device-width: 390px) and (device-height: 844px) and (-webkit-device-pixel-ratio: 3) and (orientation: landscape)" /> | ||
| <link rel="apple-touch-startup-image" href="/images/pwa/splash/apple-splash-1284-2778.jpg" media="(device-width: 428px) and (device-height: 926px) and (-webkit-device-pixel-ratio: 3) and (orientation: portrait)" /> | ||
| <link rel="apple-touch-startup-image" href="/images/pwa/splash/apple-splash-2778-1284.jpg" media="(device-width: 428px) and (device-height: 926px) and (-webkit-device-pixel-ratio: 3) and (orientation: landscape)" /> | ||
| <link rel="apple-touch-startup-image" href="/images/pwa/splash/apple-splash-1125-2436.jpg" media="(device-width: 375px) and (device-height: 812px) and (-webkit-device-pixel-ratio: 3) and (orientation: portrait)" /> | ||
| <link rel="apple-touch-startup-image" href="/images/pwa/splash/apple-splash-2436-1125.jpg" media="(device-width: 375px) and (device-height: 812px) and (-webkit-device-pixel-ratio: 3) and (orientation: landscape)" /> | ||
| <link rel="apple-touch-startup-image" href="/images/pwa/splash/apple-splash-1242-2688.jpg" media="(device-width: 414px) and (device-height: 896px) and (-webkit-device-pixel-ratio: 3) and (orientation: portrait)" /> | ||
| <link rel="apple-touch-startup-image" href="/images/pwa/splash/apple-splash-2688-1242.jpg" media="(device-width: 414px) and (device-height: 896px) and (-webkit-device-pixel-ratio: 3) and (orientation: landscape)" /> | ||
| <link rel="apple-touch-startup-image" href="/images/pwa/splash/apple-splash-828-1792.jpg" media="(device-width: 414px) and (device-height: 896px) and (-webkit-device-pixel-ratio: 2) and (orientation: portrait)" /> | ||
| <link rel="apple-touch-startup-image" href="/images/pwa/splash/apple-splash-1792-828.jpg" media="(device-width: 414px) and (device-height: 896px) and (-webkit-device-pixel-ratio: 2) and (orientation: landscape)" /> | ||
| <link rel="apple-touch-startup-image" href="/images/pwa/splash/apple-splash-1242-2208.jpg" media="(device-width: 414px) and (device-height: 736px) and (-webkit-device-pixel-ratio: 3) and (orientation: portrait)" /> | ||
| <link rel="apple-touch-startup-image" href="/images/pwa/splash/apple-splash-2208-1242.jpg" media="(device-width: 414px) and (device-height: 736px) and (-webkit-device-pixel-ratio: 3) and (orientation: landscape)" /> | ||
| <link rel="apple-touch-startup-image" href="/images/pwa/splash/apple-splash-750-1334.jpg" media="(device-width: 375px) and (device-height: 667px) and (-webkit-device-pixel-ratio: 2) and (orientation: portrait)" /> | ||
| <link rel="apple-touch-startup-image" href="/images/pwa/splash/apple-splash-1334-750.jpg" media="(device-width: 375px) and (device-height: 667px) and (-webkit-device-pixel-ratio: 2) and (orientation: landscape)" /> | ||
| <link rel="apple-touch-startup-image" href="/images/pwa/splash/apple-splash-640-1136.jpg" media="(device-width: 320px) and (device-height: 568px) and (-webkit-device-pixel-ratio: 2) and (orientation: portrait)" /> | ||
| <link rel="apple-touch-startup-image" href="/images/pwa/splash/apple-splash-1136-640.jpg" media="(device-width: 320px) and (device-height: 568px) and (-webkit-device-pixel-ratio: 2) and (orientation: landscape)" /> | ||
| <title>Messaging</title> | ||
| </head> | ||
| <body> | ||
| <div id="root"></div> | ||
| <div id="portal-drag-preview"></div> | ||
| <script type="module" src="/src/main.tsx"></script> | ||
| </body> | ||
| </html> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,15 +1,11 @@ | ||
| // Read more about this file in the documentation: | ||
| // https://nextjs.org/docs/app/api-reference/file-conventions/instrumentation-client | ||
| import * as Sentry from "@sentry/react"; | ||
|
|
||
|
|
||
| import * as Sentry from "@sentry/nextjs"; | ||
|
|
||
| const isSentryEnabled = process.env.NEXT_PUBLIC_SENTRY_DSN && process.env.NEXT_PUBLIC_SENTRY_ENVIRONMENT; | ||
| const isSentryEnabled = import.meta.env.NEXT_PUBLIC_SENTRY_DSN && import.meta.env.NEXT_PUBLIC_SENTRY_ENVIRONMENT; | ||
|
|
||
| if (isSentryEnabled) { | ||
| Sentry.init({ | ||
| dsn: process.env.NEXT_PUBLIC_SENTRY_DSN, | ||
| environment: process.env.NEXT_PUBLIC_SENTRY_ENVIRONMENT, | ||
| dsn: import.meta.env.NEXT_PUBLIC_SENTRY_DSN, | ||
| environment: import.meta.env.NEXT_PUBLIC_SENTRY_ENVIRONMENT, | ||
| }); | ||
| Sentry.setTag("application", "frontend"); | ||
| } |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.