Skip to content
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

chore: refactor components to sfc #323

Merged
merged 2 commits into from
Jun 28, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Merge branch 'main' into feature/refactor-canvas-scene-to-sfc
  • Loading branch information
alvarosabu committed Jun 28, 2023
commit c149aa8fc970e185ed85bce1e41335f988f25ac1
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@


## [2.4.0](https://github.com/Tresjs/tres/compare/2.3.0...2.4.0) (2023-06-28)


### Features

* export vue compiler options for Tres custom renderer ([#324](https://github.com/Tresjs/tres/issues/324)) ([66716d5](https://github.com/Tresjs/tres/commit/66716d523f1ee80b22bb5ee8da95eb1d8235714c))


### Bug Fixes

* temporaly cast the `disableRender` prop ([#322](https://github.com/Tresjs/tres/issues/322)) ([9cc63d2](https://github.com/Tresjs/tres/commit/9cc63d2af51f83dad7fe2af70ca8fdc4c0decebb))

## [2.3.0](https://github.com/Tresjs/tres/compare/2.2.0...2.3.0) (2023-06-22)


Expand Down
19 changes: 19 additions & 0 deletions docs/guide/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,25 @@ pnpm add @types/three -D
```
:::

## Vite

If you are using Vite, you have add the following to your `vite.config.ts`:

```ts
import { templateCompilerOptions } from '@tresjs/core'

export default defineConfig({
plugins: [
vue({
// Other config
...templateCompilerOptions
}),
],
}),
```

This is required to make the template compiler work with the custom renderer and not throw warnings on the console. For more info check [here](/guide/troubleshooting.html).

## Try it online

We have a brand new [StackBlitz](https://stackblitz.com/) starter to try TresJS online. Check it out:
Expand Down
8 changes: 3 additions & 5 deletions docs/guide/troubleshooting.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,15 +63,13 @@ Got to your `vite.config.ts` and add the following configuration to the `@vitejs
```ts
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import { templateCompilerOptions } from '@tresjs/core'

export default defineConfig({
plugins: [
vue({
template: {
compilerOptions: {
isCustomElement: tag => (tag.startsWith('Tres') && tag !== 'TresCanvas') || tag === 'primitive',
},
},
// Other config
...templateCompilerOptions,
}),
],
})
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@tresjs/core",
"description": "Declarative ThreeJS using Vue Components",
"version": "2.3.0",
"version": "2.4.0",
"type": "module",
"packageManager": "[email protected]",
"author": "Alvaro Saburido <[email protected]> (https://github.com/alvarosabu/)",
Expand Down Expand Up @@ -102,7 +102,7 @@
"vite-plugin-inspect": "^0.7.29",
"vite-plugin-require-transform": "^1.0.17",
"vite-svg-loader": "^4.0.0",
"vitepress": "1.0.0-beta.2",
"vitepress": "1.0.0-beta.3",
"vitest": "^0.32.2",
"vue": "^3.3.4",
"vue-demi": "^0.14.5"
Expand Down
7 changes: 1 addition & 6 deletions playground/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,7 @@ import { templateCompilerOptions } from '@tresjs/core'
export default defineConfig({
plugins: [
glsl(),
vue({
script: {
propsDestructure: true,
},
...templateCompilerOptions
}),
vue(templateCompilerOptions),
AutoImport({
dts: true,
eslintrc: {
Expand Down
Loading
You are viewing a condensed version of this merge commit. You can view the full changes here.