-
Notifications
You must be signed in to change notification settings - Fork 2
feat: add vite-7/ folder #5
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
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
7690da9
feat: add vite-7/ folder
pzanella 4832e02
Merge remote-tracking branch 'origin/main' into feat/add-vite-7-folder
kixelated 656299f
Simplify the vite-7 integration.
kixelated 40b75b7
Update to 0.2.0
kixelated ed74a60
fix(vite-7): update README.md and vite.config.ts
pzanella b6d23b6
Remove cruft
kixelated 95e0cac
feat: add Vite template to App.tsx and update READMEs
pzanella 12887d9
fix: remove Vite template to App.tsx
pzanella 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,50 +1,50 @@ | ||
| # React + TypeScript + Vite | ||
| # MoQ Web Components + React | ||
|
|
||
| This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules. | ||
| React application demonstrating Media over QUIC (MoQ) web components for real-time media streaming. Uses `@moq/watch` and `@moq/publish` packages with React 18 and Vite 5. | ||
|
|
||
| Currently, two official plugins are available: | ||
| ## Features | ||
|
|
||
| - [@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 | ||
| - **Watch**: Subscribe to real-time media streams from a MoQ relay | ||
| - **Publish**: Publish camera/screen media to a MoQ relay | ||
| - Custom web components with Solid.js-based UI overlays | ||
| - Feature detection and browser support banners | ||
|
|
||
| ## Expanding the ESLint configuration | ||
| ## Prerequisites | ||
|
|
||
| If you are developing a production application, we recommend updating the configuration to enable type aware lint rules: | ||
| - Node.js 20.19.0 or >=22.12.0 | ||
|
|
||
| - Configure the top-level `parserOptions` property like this: | ||
| ## Quick Start | ||
|
|
||
| ```js | ||
| export default tseslint.config({ | ||
| languageOptions: { | ||
| // other options... | ||
| parserOptions: { | ||
| project: ['./tsconfig.node.json', './tsconfig.app.json'], | ||
| tsconfigRootDir: import.meta.dirname, | ||
| }, | ||
| }, | ||
| }) | ||
| ```bash | ||
| npm install | ||
| npm run dev | ||
| ``` | ||
|
|
||
| - Replace `tseslint.configs.recommended` to `tseslint.configs.recommendedTypeChecked` or `tseslint.configs.strictTypeChecked` | ||
| - Optionally add `...tseslint.configs.stylisticTypeChecked` | ||
| - Install [eslint-plugin-react](https://github.com/jsx-eslint/eslint-plugin-react) and update the config: | ||
|
|
||
| ```js | ||
| // eslint.config.js | ||
| import react from 'eslint-plugin-react' | ||
|
|
||
| export default tseslint.config({ | ||
| // Set the react version | ||
| settings: { react: { version: '18.3' } }, | ||
| plugins: { | ||
| // Add the react plugin | ||
| react, | ||
| }, | ||
| rules: { | ||
| // other rules... | ||
| // Enable its recommended rules | ||
| ...react.configs.recommended.rules, | ||
| ...react.configs['jsx-runtime'].rules, | ||
| }, | ||
| }) | ||
| The app opens at `http://localhost:5173`. | ||
|
|
||
| ## Build | ||
|
|
||
| ```bash | ||
| npm run build | ||
| ``` | ||
|
|
||
| Output is generated in the `dist/` directory. | ||
|
|
||
| ## Web Components | ||
|
|
||
| ### Watch (Subscribe) | ||
| - **`<moq-watch>`** - Core element for subscribing to MoQ streams. Accepts `url`, `path`, `muted`, `paused`, `volume`, `jitter` attributes. Contains a `<canvas>` or `<video>` element for rendering. | ||
| - **`<moq-watch-ui>`** - Solid.js UI overlay providing playback controls, stats panel, and buffering indicators. | ||
| - **`<moq-watch-support>`** - Feature detection banner that displays browser compatibility warnings. | ||
|
|
||
| ### Publish | ||
| - **`<moq-publish>`** - Core element for publishing media to MoQ streams. Accepts `url`, `path`, `source`, `muted`, `invisible` attributes. Contains a `<video>` element for preview. | ||
| - **`<moq-publish-ui>`** - Solid.js UI overlay providing publishing controls and configuration. | ||
| - **`<moq-publish-support>`** - Feature detection banner for publishing capabilities. | ||
|
|
||
| ## Resources | ||
|
|
||
| - [@moq/watch](https://www.npmjs.com/package/@moq/watch) - Watch/subscribe to MoQ streams | ||
| - [@moq/publish](https://www.npmjs.com/package/@moq/publish) - Publish to MoQ streams | ||
| - [Vite](https://vite.dev) | ||
| - [React](https://react.dev) | ||
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same copy-paste of the Vite 7 Node.js engine requirement.
Vite 7 and other modern tools require at least Node 20.19.0 or Node 22.12.0 due to upstream ESM loader changes — this doesn't apply to Vite 5. Documenting
20.19.0 or >=22.12.0here incorrectly excludes Node.js 18/20.x users who are on perfectly valid versions for Vite 5.📝 Proposed fix
📝 Committable suggestion
🤖 Prompt for AI Agents
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a valid point, but we need to keep the Node 20.19.0+ requirement. This is because some of our dependencies, such as
@svta/cml-iso-bmffandeslint-visitor-keys, require these versions to work.