Skip to content

Commit

Permalink
fix: docs build
Browse files Browse the repository at this point in the history
  • Loading branch information
alvarosabu committed Nov 29, 2022
1 parent 5115353 commit 2e4397d
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 23 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ packages/.DS_Store
.pnpm-store/
# Local Netlify folder
.netlify
apps/lunchbox-demo
docs/.vitepress/dist
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
![repository-banner.png](/public/github-banner.png)

# Tres ▲ ■ ●
# Tres

> Declarative ThreeJS using Vue Components
Expand All @@ -13,9 +13,9 @@ Tres (Spanish word for "three", pronounced `/tres/` ) is a way of creating Three

## Packages

| Package | Version (click for changelogs) |
| --------------------- | :----------------------------------------------------------------------------------------------------- |
| [Tres](packages/tres) | [![tres version](https://img.shields.io/npm/v/@tresjs/core.svg?label=%20)](packages/tres/CHANGELOG.md) |
| Package | Version (click for changelogs) |
| --------------------------- | :----------------------------------------------------------------------------------------------------------- |
| [Tres](packages/tres) | [![tres version](https://img.shields.io/npm/v/@tresjs/core.svg?label=%20)](packages/tres/CHANGELOG.md) |
| [Cientos](packages/cientos) | [![tres version](https://img.shields.io/npm/v/@tresjs/cientos.svg?label=%20)](packages/cientos/CHANGELOG.md) |

## Docs
Expand Down
4 changes: 2 additions & 2 deletions docs/.vitepress/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { defineConfig } from 'vitepress'

export default defineConfig({
title: 'TresJS',
description: 'Autogenerated wrappers based on THREE instances',
description: 'Declarative ThreeJS using Vue Components',
head: [['link', { rel: 'icon', type: 'image/svg', href: '/favicon.svg' }]],
themeConfig: {
logo: '/logo.svg',
Expand All @@ -29,7 +29,7 @@ export default defineConfig({
},
],
socialLinks: [
{ icon: 'github', link: 'https://github.com/alvarosabu/tres' },
{ icon: 'github', link: 'https://github.com/tresjs/tres' },
{ icon: 'twitter', link: 'https://twitter.com/alvarosabu' },
],
},
Expand Down
13 changes: 3 additions & 10 deletions docs/.vitepress/theme/index.ts
Original file line number Diff line number Diff line change
@@ -1,21 +1,14 @@
import Tres from '@tresjs/core'
import { OrbitControls } from 'three/examples/jsm/controls/OrbitControls'
// .vitepress/theme/index.ts
import DefaultTheme from 'vitepress/theme'
import './config.css'
import FirstScene from './components/FirstScene.vue'
import FirstSceneLightToon from './components/FirstSceneLightToon.vue'
import ExtendExample from './components/ExtendExample.vue'

export default {
...DefaultTheme,
enhanceApp(ctx) {
ctx.app.component('FirstScene', FirstScene)
ctx.app.component('FirstSceneLightToon', FirstSceneLightToon)
ctx.app.component('ExtendExample', ExtendExample)
ctx.app.use(Tres, {
extends: {
OrbitControls,
},
})

ctx.app.use(Tres)
},
}
4 changes: 3 additions & 1 deletion docs/guide/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ React ecosystem has an impresive **custom render** solution called [React-three-

In my search for something similar in the VueJS ecosystem, I found this amazing library called [Lunchbox](https://github.com/breakfast-studio/lunchboxjs) which works with the same concept that R3F, it provides a [custom Vue3 Renderer](https://vuejs.org/api/custom-renderer.html). I'm also contrubuiting to improve this library so it gets as mature and feature-rich as R3F.

The only problem is, Mixing renderers in Vue 3 is something the Vue community is still working on - see [here](https://github.com/vuejs/vue-loader/pull/1645) for more information. Until there is a solution similar to [React Reconciliation](https://reactjs.org/docs/reconciliation.html) you will need to create 2 separate `Apps` which might be not ideal.
The only problem is, mixing different renderers in Vue 3 is something the Vue community is still working on - see [here](https://github.com/vuejs/vue-loader/pull/1645) for more information.

Until there is a solution similar to [React Reconciliation](https://reactjs.org/docs/reconciliation.html) you will need to create 2 separate `Apps` which might be not ideal.

```ts
// Example Vite setup
Expand Down
2 changes: 1 addition & 1 deletion docs/guide/your-first-scene.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ It's important that all components related to the scene live between the `<TresC
The `TresCanvas` component is going to do some setup work behind the scene:

- It creates a [**WebGLRenderer**](https://threejs.org/docs/index.html?q=webglrend#api/en/renderers/WebGLRenderer) that automatically updates every frame.
- It sets the rende rloop to be called on every frame based on the browser refresh rate.
- It sets the render loop to be called on every frame based on the browser refresh rate.

## Creating a scene

Expand Down
8 changes: 4 additions & 4 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,16 @@ hero:
text: Get Started
link: /guide/
- theme: alt
text: Why Vite?
link: /guide/why
text: Why Tres?
link: /guide/#motivation
- theme: alt
text: View on GitHub
link: https://github.com/alvarosabu/res
link: https://github.com/tresjs/tres

features:
- icon: 💡
title: Declarative
details: Build 3D scene as they were Vue components
details: Build 3D scene as they were Vue components.
- icon: ⚡️
title: Powered by Vite
details: Hot Module Replacement (HMR) that stays fast regardless of app size.
Expand Down

0 comments on commit 2e4397d

Please sign in to comment.