-
-
Notifications
You must be signed in to change notification settings - Fork 108
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: 474 vue chrome devtools plugin (#526)
* feat: vue chrome devtools * feat: editable scenes from devtools * chore(lint): fix lint errors * feat: highlight material * chore(lint): fix * docs: debug section + devtools guide
- Loading branch information
1 parent
5268e9f
commit 0185bfa
Showing
18 changed files
with
1,203 additions
and
1,100 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 |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# Devtools | ||
|
||
|
||
|
||
One of the most difficult things a developer faces when creating 3D experiences on the browser is debugging. The browser `canvas` is a black box, and it's hard to know what's going on inside. The imperative nature of [ThreeJS](https://threejs.org/) makes it incredibly difficult to debug, having to depend on `console.log` to see what's going on, or third party to fine-tune and inspect the scene. | ||
|
||
Don't make me get started with checking the performance of your scene. 😱 | ||
|
||
![developer debugging 3D](/debug-3D.png) | ||
|
||
One of our goals with TresJS is to offer **the best DX (Developer Experience)** when dealing with 3D scenes on the browser. Thanks to the declarative nature of the ecosystem plus the variety of solutions the Vue ecosystem offers such as the Vue Devtools, Nuxt and Vite, we can offer a better tooling for devs to debug their scenes. | ||
|
||
## Introducing the Devtools | ||
|
||
From <Badge text="^3.7.0" /> we are introducing the TresJS Devtools, a customized inspector tab for the [Official Vue Chrome Devtools](https://devtools.vuejs.org/guide/installation.html) that allows you to inspect your TresJS scenes and components. | ||
|
||
![TresJS Devtools](/vue-chrome-devtools.png) | ||
|
||
### Features | ||
|
||
- **Scene Inspector**: Inspect the current scene and its components using a tree view similar to the Vue Devtools component inspector. | ||
- **Memory Allocation**: See how much memory is being by the components. | ||
- **Object Inspector**: Inspect the properties of the selected object in the scene, including its children. | ||
- **Editable Properties**: And yes, you can edit the properties of the selected object and see the changes in real-time. | ||
|
||
![](/devtools-scene-inspector.png) | ||
|
||
Enjoy the new Devtools and let us know what you think! 🎉 |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
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 |
---|---|---|
|
@@ -3,6 +3,7 @@ | |
<template> | ||
<TresMesh | ||
:position="[2, 2, 0]" | ||
name="sphere" | ||
cast-shadow | ||
> | ||
<TresSphereGeometry /> | ||
|
50 changes: 50 additions & 0 deletions
50
playground/vite.config.ts.timestamp-1706539768400-58c91108b32e6.mjs
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,50 @@ | ||
// vite.config.ts | ||
import { defineConfig } from "file:///Users/alvarosabu/Projects/tres/core/node_modules/.pnpm/[email protected]/node_modules/vite/dist/node/index.js"; | ||
import vue from "file:///Users/alvarosabu/Projects/tres/core/node_modules/.pnpm/@[email protected][email protected][email protected]/node_modules/@vitejs/plugin-vue/dist/index.mjs"; | ||
import { resolve } from "file:///Users/alvarosabu/Projects/tres/core/node_modules/.pnpm/[email protected]/node_modules/pathe/dist/index.mjs"; | ||
import AutoImport from "file:///Users/alvarosabu/Projects/tres/core/node_modules/.pnpm/[email protected]_@[email protected]/node_modules/unplugin-auto-import/dist/vite.js"; | ||
import Components from "file:///Users/alvarosabu/Projects/tres/core/node_modules/.pnpm/[email protected][email protected]/node_modules/unplugin-vue-components/dist/vite.js"; | ||
import glsl from "file:///Users/alvarosabu/Projects/tres/core/node_modules/.pnpm/[email protected][email protected]/node_modules/vite-plugin-glsl/src/index.js"; | ||
import UnoCSS from "file:///Users/alvarosabu/Projects/tres/core/node_modules/.pnpm/[email protected][email protected][email protected]/node_modules/unocss/dist/vite.mjs"; | ||
import { templateCompilerOptions } from "file:///Users/alvarosabu/Projects/tres/core/dist/tres.js"; | ||
import { qrcode } from "file:///Users/alvarosabu/Projects/tres/core/node_modules/.pnpm/[email protected][email protected]/node_modules/vite-plugin-qrcode/dist/index.js"; | ||
import VueDevTools from "file:///Users/alvarosabu/Projects/tres/core/node_modules/.pnpm/[email protected][email protected][email protected]/node_modules/vite-plugin-vue-devtools/dist/vite.mjs"; | ||
var __vite_injected_original_dirname = "/Users/alvarosabu/Projects/tres/core/playground"; | ||
var vite_config_default = defineConfig({ | ||
plugins: [ | ||
glsl(), | ||
VueDevTools(), | ||
vue({ | ||
script: { | ||
propsDestructure: true | ||
}, | ||
...templateCompilerOptions | ||
}), | ||
AutoImport({ | ||
dts: true, | ||
eslintrc: { | ||
enabled: true | ||
// <-- this | ||
}, | ||
imports: ["vue"] | ||
}), | ||
Components({ | ||
/* options */ | ||
}), | ||
UnoCSS({ | ||
/* options */ | ||
}), | ||
qrcode() | ||
// only applies in dev mode | ||
], | ||
resolve: { | ||
alias: { | ||
"@tresjs/core": resolve(__vite_injected_original_dirname, "../src/index.ts") | ||
}, | ||
dedupe: ["three"] | ||
} | ||
}); | ||
export { | ||
vite_config_default as default | ||
}; | ||
//# sourceMappingUR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