From 74a2c4786330286dcaf132f5382f656cd69651aa Mon Sep 17 00:00:00 2001 From: andretchen0 Date: Sat, 15 Jun 2024 11:24:06 +0200 Subject: [PATCH] refactor: playground housekeeping (#719) * refactor: playground housekeeping * move single-use components into folders with their parent components * add "Issues" category * chore: run linter --------- Co-authored-by: Alvaro Saburido --- playground/components.d.ts | 1 + playground/src/components/AkuAku.vue | 17 - .../components/AnimatedObjectUseUpdate.vue | 27 -- .../src/components/LocalOrbitControls.vue | 319 ------------------ .../{TestSphere.vue => PbrSphere.vue} | 0 .../advanced/fbo}/FBOCube.vue | 2 +- .../pages/advanced/{FBO.vue => fbo/index.vue} | 2 +- .../advanced/fbo}/useFBO.ts | 0 .../advanced/suspense/AsyncComponent.vue | 11 + .../pages/advanced/{ => suspense}/index.vue | 32 +- .../TakeOverRenderExperience.vue} | 0 .../index.vue} | 1 + playground/src/pages/cameras/NoCamera.vue | 3 +- .../multipleCameras}/TheCameraOperator.vue | 0 .../index.vue} | 6 +- .../events/propagation}/Box.vue | 0 .../index.vue} | 2 +- playground/src/pages/index.vue | 58 ++-- .../pages/{basic/vIf => issues/717}/MyBox.vue | 0 .../pages/{basic/vIf => issues/717}/index.vue | 3 +- .../directives}/DirectiveSubComponent.vue | 2 +- .../{Directives.vue => directives/index.vue} | 2 +- .../misc/text3D}/Text3D.vue | 0 .../misc/{Text3DDemo.vue => text3D/index.vue} | 1 + playground/src/router/index.ts | 116 +------ playground/src/router/routes/advanced.ts | 13 +- playground/src/router/routes/basic.ts | 5 - playground/src/router/routes/cameras.ts | 2 +- playground/src/router/routes/index.ts | 13 + playground/src/router/routes/issues.ts | 7 + playground/src/router/routes/misc.ts | 4 +- 31 files changed, 99 insertions(+), 550 deletions(-) delete mode 100644 playground/src/components/AkuAku.vue delete mode 100644 playground/src/components/LocalOrbitControls.vue rename playground/src/components/{TestSphere.vue => PbrSphere.vue} (100%) rename playground/src/{components => pages/advanced/fbo}/FBOCube.vue (90%) rename playground/src/pages/advanced/{FBO.vue => fbo/index.vue} (95%) rename playground/src/{composables => pages/advanced/fbo}/useFBO.ts (100%) create mode 100644 playground/src/pages/advanced/suspense/AsyncComponent.vue rename playground/src/pages/advanced/{ => suspense}/index.vue (68%) rename playground/src/{components/TakeOverLoopExperience.vue => pages/advanced/takeOverRender/TakeOverRenderExperience.vue} (100%) rename playground/src/pages/advanced/{TakeOverLoop.vue => takeOverRender/index.vue} (88%) rename playground/src/{components => pages/cameras/multipleCameras}/TheCameraOperator.vue (100%) rename playground/src/pages/cameras/{MultipleCameras.vue => multipleCameras/index.vue} (93%) rename playground/src/{components => pages/events/propagation}/Box.vue (100%) rename playground/src/pages/events/{Propagation.vue => propagation/index.vue} (98%) rename playground/src/pages/{basic/vIf => issues/717}/MyBox.vue (100%) rename playground/src/pages/{basic/vIf => issues/717}/index.vue (94%) rename playground/src/{components => pages/misc/directives}/DirectiveSubComponent.vue (56%) rename playground/src/pages/misc/{Directives.vue => directives/index.vue} (90%) rename playground/src/{components => pages/misc/text3D}/Text3D.vue (100%) rename playground/src/pages/misc/{Text3DDemo.vue => text3D/index.vue} (95%) create mode 100644 playground/src/router/routes/issues.ts diff --git a/playground/components.d.ts b/playground/components.d.ts index d8528055b..b344e1bd1 100644 --- a/playground/components.d.ts +++ b/playground/components.d.ts @@ -18,6 +18,7 @@ declare module 'vue' { LocalOrbitControls: typeof import('./src/components/LocalOrbitControls.vue')['default'] Overlay: typeof import('./src/components/Overlay.vue')['default'] OverlayInfo: typeof import('./src/components/OverlayInfo.vue')['default'] + PbrSphere: typeof import('./src/components/PbrSphere.vue')['default'] RouterLink: typeof import('vue-router')['RouterLink'] RouterView: typeof import('vue-router')['RouterView'] TakeOverLoopExperience: typeof import('./src/components/TakeOverLoopExperience.vue')['default'] diff --git a/playground/src/components/AkuAku.vue b/playground/src/components/AkuAku.vue deleted file mode 100644 index da35e1437..000000000 --- a/playground/src/components/AkuAku.vue +++ /dev/null @@ -1,17 +0,0 @@ - - - diff --git a/playground/src/components/AnimatedObjectUseUpdate.vue b/playground/src/components/AnimatedObjectUseUpdate.vue index c775616c1..dd28d0121 100644 --- a/playground/src/components/AnimatedObjectUseUpdate.vue +++ b/playground/src/components/AnimatedObjectUseUpdate.vue @@ -53,33 +53,6 @@ watchEffect(() => { off() } }) -/* const anotherLog = useThrottleFn(() => console.log('after render'), 3000) - */ -/* useUpdate(() => { - anotherLog() -}, 1) */ - -/* useUpdate(() => { - console.count('update loop 1') -}) - -useUpdate(() => { - console.count('update loop 2') -}) */ - -/* useUpdate(() => { - console.count('before renderer') -}, -1) - -useUpdate(() => { - console.log('this should be just before render') -}) - -useUpdate((state) => { - if (!sphereRef.value) { return } - console.count('after renderer') - sphereRef.value.position.y += Math.sin(state.elapsed) * 0.01 -}, 2) */