-
Notifications
You must be signed in to change notification settings - Fork 138
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Since Storybook is no longer used for development purposes and a new app for testing purposes has been added, we are updating the documentation.
- Loading branch information
Showing
9 changed files
with
70 additions
and
114 deletions.
There are no files selected for viewing
This file contains 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 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,30 +1,14 @@ | ||
# React + TypeScript + Vite | ||
## Development App | ||
|
||
This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules. | ||
This app is used for development purposes, and when a PR is created, the preview of this app is provided via Netlify. | ||
|
||
Currently, two official plugins are available: | ||
### Page Structure | ||
|
||
- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react/README.md) uses [Babel](https://babeljs.io/) for Fast Refresh | ||
- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh | ||
- `/`: This is the main page. Feel free to develop on the PlaygroundPage. | ||
- `/group_channel`: This is the group channel page. It's used for QA or testing purposes, so please modify only if necessary. | ||
- `/open_channel`: This is the open channel page. It's used for QA or testing purposes, so please modify only if necessary. | ||
- `/url-builder`: You can dynamically set the app ID or enable/disable specific features by extracting URL parameters. | ||
|
||
## Expanding the ESLint configuration | ||
|
||
If you are developing a production application, we recommend updating the configuration to enable type aware lint rules: | ||
|
||
- Configure the top-level `parserOptions` property like this: | ||
|
||
```js | ||
export default { | ||
// other rules... | ||
parserOptions: { | ||
ecmaVersion: 'latest', | ||
sourceType: 'module', | ||
project: ['./tsconfig.json', './tsconfig.node.json'], | ||
tsconfigRootDir: __dirname, | ||
}, | ||
} | ||
``` | ||
|
||
- Replace `plugin:@typescript-eslint/recommended` to `plugin:@typescript-eslint/recommended-type-checked` or `plugin:@typescript-eslint/strict-type-checked` | ||
- Optionally add `plugin:@typescript-eslint/stylistic-type-checked` | ||
- Install [eslint-plugin-react](https://github.com/jsx-eslint/eslint-plugin-react) and add `plugin:react/recommended` & `plugin:react/jsx-runtime` to the `extends` list | ||
### App settings | ||
- All app pages can change the app's settings through query params in the URL. (Easily extractable from the url-builder page) | ||
- To add specific features via query params, modify the `utils/paramsBuilder.ts` file. |
This file contains 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 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,7 @@ | ||
import { InitialParams } from '../utils/paramsBuilder.ts'; | ||
|
||
export const defaultProps: InitialParams = { | ||
appId: import.meta.env.VITE_APP_ID, | ||
userId: import.meta.env.VITE_USER_ID ?? 'test', | ||
accessToken: import.meta.env.VITE_ACCESS_TOKEN, | ||
}; |
This file contains 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,8 @@ | ||
import { useConfigParams } from '../utils/paramsBuilder.ts'; | ||
import GroupChannelApp from '../../../../src/modules/App'; | ||
import { defaultProps } from '../libs/const.ts'; | ||
|
||
export function GroupChannelPage() { | ||
const props = useConfigParams(defaultProps); | ||
return <GroupChannelApp {...props} breakpoint={/iPhone|iPad|iPod|Android/i.test(navigator.userAgent)} config={{ logLevel: 'all' }} />; | ||
} |
This file contains 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,8 @@ | ||
import { useConfigParams } from '../utils/paramsBuilder.ts'; | ||
import OpenChannelApp from '../../../../src/modules/OpenChannelApp'; | ||
import { defaultProps } from '../libs/const.ts'; | ||
|
||
export function OpenChannelPage() { | ||
const props = useConfigParams(defaultProps); | ||
return <OpenChannelApp {...props} />; | ||
} |
This file contains 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,8 @@ | ||
import { useConfigParams } from '../utils/paramsBuilder.ts'; | ||
import GroupChannelApp from '../../../../src/modules/App'; | ||
import { defaultProps } from '../libs/const.ts'; | ||
|
||
export function PlaygroundPage() { | ||
const props = useConfigParams(defaultProps); | ||
return <GroupChannelApp {...props} breakpoint={/iPhone|iPad|iPod|Android/i.test(navigator.userAgent)} config={{ logLevel: 'all' }} />; | ||
} |
4 changes: 2 additions & 2 deletions
4
apps/testing/src/URLBuilder.tsx → apps/testing/src/pages/URLBuilderPage.tsx
This file contains 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 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