-
-
Notifications
You must be signed in to change notification settings - Fork 48
docs: Common code between examples #1995
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
Conversation
|
pkg.pr.new packages benchmark commit |
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.
Pull request overview
This PR introduces a common folder for shared code between documentation examples to reduce duplication. The primary change involves moving the setup-orbit-camera.ts utility from individual example directories to a centralized common location.
- Establishes infrastructure to handle common files across examples with proper type definitions
- Refactors
setup-orbit-camera.tsto be a shared utility with enhanced touch gesture support (pinch-to-zoom) - Updates build tooling to automatically include relevant common files in StackBlitz exports and code editor views
Reviewed changes
Copilot reviewed 10 out of 11 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| apps/typegpu-docs/src/utils/examples/types.ts | Adds ExampleCommonFile type to distinguish common files from example-specific files |
| apps/typegpu-docs/src/examples/simulation/gravity/setup-orbit-camera.ts | Removes local copy of orbit camera utility (moved to common folder) |
| apps/typegpu-docs/src/examples/simulation/gravity/schemas.ts | Updates import path to reference common folder |
| apps/typegpu-docs/src/examples/simulation/gravity/index.ts | Updates import path to reference common folder |
| apps/typegpu-docs/src/examples/rendering/phong-reflection/index.ts | Updates import path and removes export keywords from shader functions |
| apps/typegpu-docs/src/examples/exampleContent.ts | Adds common file loading logic with glob patterns and path extraction |
| apps/typegpu-docs/src/examples/common/setup-orbit-camera.ts | New centralized orbit camera utility with enhanced pinch-to-zoom support |
| apps/typegpu-docs/src/components/stackblitz/openInStackBlitz.ts | Updates to include common files in StackBlitz projects with proper path rewriting |
| apps/typegpu-docs/src/components/ExampleView.tsx | Adds filtering logic to include only relevant common files per example |
| apps/typegpu-docs/src/components/ExamplePage.tsx | Passes common files to ExampleView component |
| apps/typegpu-docs/src/components/CodeEditor.tsx | Updates path handling to support both example and common file paths |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.
📊 Bundle Size Comparison
👀 Notable resultsStatic test results:No major changes. Dynamic test results:No major changes. 📋 All resultsClick to reveal the results table (323 entries).
If you wish to run a comparison for other, slower bundlers, run the 'Tree-shake test' from the GitHub Actions menu. |
b9acc45 to
e8712fb
Compare
Changes:
commonfolder to examples,commonfiles when opening in StackBlitz,commonfiles in our examples,setup-orbit-camera.tsto be common (only where it was already used).